//
// sub_100572B94 from 0x100572b94 to 0x100572c50 (188 bytes)
//
// 3 xrefs:
// > sub_1005734B8 @ 0x100573568
// > sub_10057359C @ 0x1005735a4
// > sub_10057394C @ 0x100573a8c
//
// 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_100572B94(__int64 a1, int a2)
{
__int64 v4; // x19
int v5; // w9
int v6; // w8
__int64 v7; // x21
int v8; // w23
__int64 v9; // x0
__int64 v10; // x22
v4 = *(_QWORD *)(a1 + 32);
sub_1005DBDD8(v4);
if ( a2 )
{
v5 = *(_DWORD *)(a1 + 12);
v6 = *(_DWORD *)(a1 + 16) + a2;
*(_DWORD *)(a1 + 16) = v6;
if ( v6 == v5 )
{
*(_DWORD *)(a1 + 12) = 0;
*(_DWORD *)(a1 + 16) = 0;
}
}
v7 = *(_QWORD *)(a1 + 32);
sub_1005DBDD8(v7);
if ( *(int *)(a1 + 60) < 1 )
{
v10 = 0;
}
else
{
v8 = 0;
while ( 1 )
{
v9 = sub_1005DBF3C(*(_QWORD *)(a1 + 48));
if ( (_DWORD)v9 )
break;
if ( ++v8 >= *(_DWORD *)(a1 + 60) )
{
v10 = 0;
*(_DWORD *)(a1 + 60) = 0;
goto LABEL_11;
}
}
v10 = v9;
}
LABEL_11:
sub_1005DBE08(v7);
sub_1005DBE08(v4);
return v10;
}