//
// sub_C2A200 from 0xc2a200 to 0xc2a300 (256 bytes)
//
// 1 xrefs:
// > sub_C29334 @ 0xc293b8
//
// 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
//
__int64 __fastcall sub_C2A200(__int64 result, __int64 a2, __int64 a3, int a4)
{
int v4; // w26
__int64 v5; // x24
__int64 v6; // x21
__int64 v8; // x20
_BYTE *v9; // x23
unsigned __int8 *v10; // x19
unsigned __int8 *v11; // x22
unsigned int v12; // w1
unsigned int v13; // w1
__int64 v14; // x28
int v15; // w2
unsigned int v16; // w3
unsigned __int64 v17; // x27
__int16 v18; // w4
__int64 v20; // [xsp+78h] [xbp+78h]
v4 = *(_DWORD *)(result + 136);
v5 = *(_QWORD *)(*(_QWORD *)(result + 656) + 48LL);
if ( a4 > 0 )
{
v6 = result;
v20 = (unsigned int)(a4 - 1) + 1LL;
v8 = 0;
do
{
v9 = *(_BYTE **)(a3 + 8 * v8);
v10 = *(unsigned __int8 **)(a2 + 8 * v8);
v11 = &v10[3 * (v4 - 1) + 3];
if ( v4 )
{
do
{
while ( 1 )
{
v12 = *v10;
v10 += 3;
v13 = v12 >> 3;
v14 = *(_QWORD *)(v5 + 8LL * v13);
v15 = *(v10 - 2) >> 2;
v16 = *(v10 - 1) >> 3;
v17 = ((unsigned __int64)(v15 & 0x3F) << 6) + 2LL * v16;
v18 = *(_WORD *)(v14 + v17);
if ( !v18 )
break;
*v9++ = v18 - 1;
if ( v10 == v11 )
goto LABEL_8;
}
sub_C29910(v6, v13, v15, v16);
*v9++ = *(_WORD *)(v14 + v17) - 1;
}
while ( v10 != v11 );
}
LABEL_8:
result = v20;
++v8;
}
while ( v8 != v20 );
}
return result;
}