//
// sub_1005728A0 from 0x1005728a0 to 0x100572948 (168 bytes)
//
// 2 xrefs:
// > sub_1005735A8 @ 0x1005736dc
// > sub_1005736F8 @ 0x1005738d8
//
// 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:08:19 +0000
//
__int64 __fastcall sub_1005728A0(__int64 a1, int a2)
{
__int64 v4; // x19
__int64 v5; // x21
int v6; // w23
__int64 v7; // x0
__int64 v8; // x22
v4 = *(_QWORD *)(a1 + 32);
sub_1005DBDD8(v4);
if ( a2 )
*(_DWORD *)(a1 + 12) += a2;
v5 = *(_QWORD *)(a1 + 32);
sub_1005DBDD8(v5);
if ( *(int *)(a1 + 56) < 1 )
{
LABEL_7:
v8 = 0;
*(_DWORD *)(a1 + 56) = 0;
}
else
{
v6 = 0;
while ( 1 )
{
v7 = sub_1005DBF3C(*(_QWORD *)(a1 + 40));
if ( (_DWORD)v7 )
break;
if ( ++v6 >= *(_DWORD *)(a1 + 56) )
goto LABEL_7;
}
v8 = v7;
}
sub_1005DBE08(v5);
sub_1005DBE08(v4);
return v8;
}