//
// sub_AFF00 from 0xaff00 to 0xaffc4 (196 bytes)
//
// 1 xrefs:
// > sub_B02EC @ 0xb04d0
//
// 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_AFF00(__int64 a1)
{
unsigned __int64 v2; // x10
int v3; // w11
_QWORD *v4; // x9
_QWORD *v5; // x8
int v6; // w10
__int64 i; // x11
__int64 v8; // x12
_BYTE v10[16]; // [xsp+0h] [xbp-20h] BYREF
sub_B0EE0(v10);
v2 = *(_QWORD *)(a1 + 656);
v3 = *(_DWORD *)(a1 + 664);
v4 = *(_QWORD **)(a1 + 576);
v5 = (_QWORD *)(a1 + 576);
*(_QWORD *)(a1 + 608) = v2;
*(_DWORD *)(a1 + 616) = v3;
while ( v5 != v4 && v4[3] <= v2 )
v4 = (_QWORD *)*v4;
v6 = 1;
for ( i = 624; i != 672; i += 16 )
{
if ( v4 == v5 )
{
v8 = 0;
*(_DWORD *)(a1 + i + 8) = 0;
v4 = (_QWORD *)(a1 + 576);
}
else
{
v8 = v4[3];
++v6;
*(_DWORD *)(a1 + i + 8) = v4[2];
v4 = (_QWORD *)*v4;
}
*(_QWORD *)(a1 + i) = v8;
}
*(_DWORD *)(a1 + 676) = v6;
*(_DWORD *)(a1 + 672) = 1;
sub_51F94((__int64)v10);
return 0;
}