//
// sub_1002AAD60 from 0x1002aad60 to 0x1002aadfe (158 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008fb8a0
//
// 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_1002AAD60(__int64 a1, __int64 a2)
{
__int64 result; // rax
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1056LL))(a2, 0);
result = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 512LL))(a2, 1);
if ( *(_QWORD *)(a1 + 112) != a2 )
{
if ( *(_BYTE *)(a1 + 120) != 1 )
return result;
goto LABEL_3;
}
*(_QWORD *)(a1 + 112) = 0;
if ( *(_BYTE *)(a1 + 120) == 1 )
{
LABEL_3:
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 32) + 1144LL))(*(_QWORD *)(a1 + 32), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 40) + 1144LL))(*(_QWORD *)(a1 + 40), 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)(a1 - 648) + 1056LL))(a1 - 648, 0);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)(a1 - 648) + 512LL))(a1 - 648, 1);
}
return result;
}