//
// sub_1005D9240 from 0x1005d9240 to 0x1005d92dc (156 bytes)
//
// 1 xrefs:
// > sub_10058A138 @ 0x10058bce4
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:09:36 +0000
//
__int64 __fastcall sub_1005D9240(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x0
__int64 v4; // x8
_QWORD *v5; // x9
char v7; // [xsp+Fh] [xbp-11h] BYREF
v7 = 0;
v2 = *(_QWORD *)(a1 + 32);
if ( !v2 )
{
LABEL_6:
*(_BYTE *)(a1 + 60) = 0;
v5 = *(_QWORD **)(a1 + 8);
*v5 = *(_QWORD *)a1;
*(_QWORD *)(*(_QWORD *)a1 + 8LL) = v5;
*(_QWORD *)a1 = a1;
*(_QWORD *)(a1 + 8) = a1;
*(_BYTE *)(a1 + 28) = 0;
return 0;
}
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v2 + 168LL))(v2, &v7);
if ( !v7 )
{
v3 = *(_QWORD *)(a1 + 32);
if ( v3 )
{
sub_1005823CC(v3, 128);
v4 = *(_QWORD *)(*(_QWORD *)(a1 + 48) + 1520LL);
if ( v4 )
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 32) + 280LL))(
*(_QWORD *)(a1 + 32),
*(_QWORD *)(v4 + 8LL * *(int *)(*(_QWORD *)(a1 + 32) + 464LL)));
}
goto LABEL_6;
}
return 0;
}