//
// sub_BBA990 from 0xbba990 to 0xbbaa80 (240 bytes)
//
// 1 xrefs:
// > sub_BB5664 @ 0xbb56cc
//
// 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_BBA990(__int64 a1, int a2)
{
__int64 v2; // x20
int v4; // w0
void *v5; // x0
__int64 v7; // x19
int v8; // w21
int v9; // w0
v2 = a1 + 0x8000;
v4 = *(_DWORD *)(a1 + 36416);
if ( v4 )
{
v7 = 0;
v8 = 0;
if ( v4 > 0 )
{
do
{
++v8;
sub_BA4C54(*(_QWORD *)(*(_QWORD *)(v2 + 3656) + v7));
v9 = *(_DWORD *)(v2 + 3648);
*(_QWORD *)(*(_QWORD *)(v2 + 3656) + v7) = 0;
v7 += 8;
}
while ( v8 < v9 );
}
off_1231008(*(void **)(v2 + 3656));
*(_QWORD *)(v2 + 3656) = 0;
*(_DWORD *)(v2 + 3648) = 0;
v5 = off_1231020(a2, 8u);
if ( v5 )
goto LABEL_3;
}
else
{
v5 = off_1231020(a2, 8u);
if ( v5 )
{
LABEL_3:
*(_DWORD *)(v2 + 3648) = a2;
*(_QWORD *)(v2 + 3656) = v5;
return 0;
}
}
return 27;
}