#include "game_types.h"

/* Level_Veneer84F0 @ 0x080084F0 (real 62B) -- hash-slot increment with saturation to -1. Mirrors src/matched/Level_Veneer84F0.c. */
/* Hashes word k = [a+412] into table 0x08028518 (stride 60, tag at +32),
   and bumps the counter at a+0x2534 unless it reached 3 - tag (then -1).
   Returns the old counter. */
int Level_Veneer84F0(int *a)
{
    int k = *(int *)((char *)a + 412);
    int tag = *(int *)(0x08028518 + k * 60 + 32);
    int *cell = (int *)((char *)a + 0x2534);
    if (*cell >= 3 - tag)
        return -1;
    return (*cell)++;
}
