#include "game_types.h"

/* Sub_08004964 @ 0x08004964 (real 32B) -- ladder table lookup (table 0x08027938). Mirrors src/matched/Sub_08004964.c. */
/* Ladder-table leaf: indexes table 0x08027938 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_08004964(int *p)
{
    int idx = *(short *)((char *)p + 136);
    int lv = p[15];
    int v = *(int *)((char *)(int *)0x08027938 + (idx << 2) + ((lv + lv * 2) << 4));
    return v;
}
