#include "game_types.h"

/* Sub_080048FC @ 0x080048FC (real 34B) -- ladder table lookup (table 0x08027B18, halved). Mirrors src/matched/Sub_080048FC.c. */
/* Ladder-table leaf: indexes table 0x08027B18 by the halfword at +136 and the
   level word at +60. (Leading .hword islands in the ROM span are jumped-over
   data, not code.) */
int Sub_080048FC(int *p)
{
    int idx = *(short *)((char *)p + 136);
    int lv = p[15];
    int v = *(int *)((char *)(int *)0x08027B18 + (idx << 2) + ((lv + lv * 2) << 4));
    return v >> 1;
}
