//
// sub_C28F24 from 0xc28f24 to 0xc28fa8 (132 bytes)
//
// 1 xrefs:
// > sub_C29334 @ 0xc29364
//
// 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
//
unsigned __int64 __fastcall sub_C28F24(unsigned __int64 result, __int64 a2, __int64 a3, int a4)
{
int v4; // w10
__int64 v5; // x7
__int64 v6; // x8
unsigned __int8 *v7; // x4
unsigned __int8 *v8; // x6
unsigned int v9; // w5
__int64 v10; // x5
v4 = *(_DWORD *)(result + 136);
v5 = *(_QWORD *)(*(_QWORD *)(result + 656) + 48LL);
if ( a4 > 0 )
{
v6 = 0;
do
{
v7 = *(unsigned __int8 **)(a2 + 8 * v6);
v8 = &v7[3 * (v4 - 1) + 3];
if ( v4 )
{
do
{
v9 = *v7;
v7 += 3;
v10 = *(_QWORD *)(v5 + 8LL * (v9 >> 3));
result = ((unsigned __int64)(*(v7 - 2) >> 2) << 6) + 2LL * (*(v7 - 1) >> 3);
if ( *(_WORD *)(v10 + result) != 0xFFFF )
++*(_WORD *)(v10 + result);
}
while ( v7 != v8 );
}
++v6;
}
while ( a4 > (int)v6 );
}
return result;
}