//
// sub_1005FE7E8 from 0x1005fe7e8 to 0x1005fe868 (128 bytes)
//
// 2 xrefs:
// > sub_100568F94 @ 0x1005690d0
// > sub_100568F94 @ 0x1005690e8
//
// 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:56 +0000
//
__int64 __fastcall sub_1005FE7E8(__int64 a1, int a2)
{
char v2; // w19
int v4; // w8
int v5; // w8
unsigned int v6; // w8
unsigned int v7; // w9
bool v8; // cf
unsigned int v9; // w8
if ( *(_BYTE *)(a1 + 56) )
{
v2 = a2;
v4 = *(_DWORD *)(a1 + 52);
if ( a2 )
{
if ( !v4 )
{
sub_1005DB948((_DWORD *)(a1 + 12));
v4 = *(_DWORD *)(a1 + 52);
}
*(_DWORD *)(a1 + 52) = v4 + 1;
}
else
{
v5 = v4 - 1;
*(_DWORD *)(a1 + 52) = v5;
if ( !v5 )
{
sub_1005DB948((_DWORD *)(a1 + 16));
v7 = *(_DWORD *)(a1 + 12);
v6 = *(_DWORD *)(a1 + 16);
v8 = v6 >= v7;
v9 = v6 - v7;
if ( v9 != 0 && v8 )
*(_DWORD *)(a1 + 48) += v9;
}
}
*(_BYTE *)(a1 + 44) = v2;
}
return 0;
}