//
// sub_1004A9C84 from 0x1004a9c84 to 0x1004a9d4c (200 bytes)
//
// 0 xrefs:
//
// 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_1004A9C84(__int64 a1)
{
unsigned int v2; // w8
__int64 v3; // x20
__int64 v4; // x21
__int64 v5; // x8
void (__fastcall *v6)(_QWORD, __int64, _QWORD); // x8
if ( (*(_DWORD *)(a1 + 404) & 8) != 0 )
{
while ( atomic_load((unsigned int *)(a1 + 400)) )
sub_1004B586C(10);
}
v2 = *(_DWORD *)(a1 + 364);
v3 = v2 / *(_DWORD *)(a1 + 348) * *(_DWORD *)(a1 + 348);
*(_DWORD *)(a1 + 344) = v2 % *(_DWORD *)(a1 + 348);
*(_DWORD *)(a1 + 360) = 0;
*(_DWORD *)(a1 + 368) = v3;
*(_DWORD *)(a1 + 372) = v3;
*(_DWORD *)(a1 + 352) = 0;
*(_DWORD *)(a1 + 472) = 0;
*(_DWORD *)(a1 + 404) &= ~0x40u;
*(_DWORD *)(a1 + 404) &= ~0x80u;
v4 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 64LL))(a1, v3);
v5 = *(_QWORD *)(a1 + 408);
if ( v5 )
{
v6 = *(void (__fastcall **)(_QWORD, __int64, _QWORD))(v5 + 70192);
if ( v6 )
v6(*(_QWORD *)(a1 + 48), v3, *(_QWORD *)(a1 + 40));
}
return v4;
}