//
// sub_1005831E8 from 0x1005831e8 to 0x100583258 (112 bytes)
//
// 1 xrefs:
// > sub_10058776C @ 0x10058776c
//
// 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_1005831E8(__int64 a1, int a2)
{
__int64 v3; // x20
__int64 v4; // x8
__int64 v5; // x0
__int64 *v6; // x21
__int64 v7; // x8
__int64 result; // x0
_QWORD *v9; // x19
v3 = a2;
v4 = a1 + 40LL * a2;
v5 = *(_QWORD *)(v4 + 544);
if ( v5 )
{
v6 = (__int64 *)(v4 + 544);
sub_10053ECAC(v5);
sub_10053EB14(*v6);
sub_10053E3A4(*v6);
*v6 = 0;
}
v7 = a1 + 40 * v3;
result = *(_QWORD *)(v7 + 536);
if ( result )
{
v9 = (_QWORD *)(v7 + 536);
result = sub_10053E6A0(result);
*v9 = 0;
}
return result;
}