#include "game_types.h"

/* Sub_08004830 @ 0x08004830 (real 28B) -- ladder table lookup (table 0x08027CF8). Mirrors src/matched/Sub_08004830.c. */
/* Ladder-table leaf: indexes table 0x08027CF8 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_08004830(int *p)
{
    int idx = *(short *)((char *)p + 136);
    int lv = p[15];
    int v = *(int *)((char *)(int *)0x08027CF8 + (idx << 3) + ((lv + lv * 2) << 5));
    return v;
}
