#include "game_types.h"

/* Physics_BounceReflect @ 0x08019D58 (real 70B) -- 3-way bounce lookup with x-32 fallback. Mirrors src/matched/Physics_BounceReflect.c. */
/* Looks x up across the three entry halfwords (+14 of each table row);
   hits return the mapped words at 0x0200150C/10/14, else x - 32. */
int Physics_BounceReflect(int x)
{
    int *t = *(int **)0x02000938;
    int *e = (int *)*t;
    if (x == *(short *)((char *)(int *)e[1] + 14))
        return *(int *)0x0200150C;
    if (x == *(short *)((char *)(int *)e[2] + 14))
        return *(int *)0x02001510;
    if (x == *(short *)((char *)(int *)e[3] + 14))
        return *(int *)0x02001514;
    return x - 32;
}
