//
// sub_7247E4 from 0x7247e4 to 0x7248be (218 bytes)
//
// 2 xrefs:
// > sub_71E0C4 @ 0x71e0f4
// > sub_724DC4 @ 0x724e84
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_DWORD *__fastcall sub_7247E4(_DWORD *result, int a2)
{
unsigned int v2; // r3
int v3; // r3
int v4; // r3
int v5; // r3
_DWORD *v6; // r3
_DWORD *v7; // r3
signed int v8; // r3
unsigned int v9; // r2
signed int v10; // r3
unsigned int v11; // r2
if ( *(_BYTE *)a2 )
{
if ( *(_BYTE *)a2 == 1 )
{
++*(_DWORD *)(*result + 4 * (*(_DWORD *)(a2 + 4) + 280));
}
else
{
v2 = *(unsigned __int16 *)(a2 + 2);
if ( v2 >= 0x200 )
{
v10 = v2 - 1;
v11 = __clz(v10) ^ 0x1F;
v3 = ((v10 >> (v11 - 1)) & 1) + 2 * v11;
}
else
{
v3 = byte_A037B0[2 * v2];
}
++*(_DWORD *)(*result + 4 * (v3 + 256));
v4 = *(_DWORD *)(a2 + 4);
if ( v4 >= 512 )
{
v8 = v4 - 1;
v9 = __clz(v8) ^ 0x1F;
v5 = ((v8 >> (v9 - 1)) & 1) + 2 * v9;
}
else
{
v5 = byte_A037B0[2 * v4];
}
result += v5;
++result[769];
}
}
else
{
v6 = &result[*(unsigned __int8 *)(a2 + 7)];
++v6[513];
v7 = &result[*(unsigned __int8 *)(a2 + 6)];
++v7[1];
++*(_DWORD *)(*result + 4 * *(unsigned __int8 *)(a2 + 5));
result += *(unsigned __int8 *)(a2 + 4);
++result[257];
}
return result;
}