//
// sub_1005A716C from 0x1005a716c to 0x1005a7228 (188 bytes)
//
// 1 xrefs:
// > sub_1005A7050 @ 0x1005a70a8
//
// 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:05 +0000
//
__int64 __fastcall sub_1005A716C(__int64 a1, __int64 a2, unsigned int a3, int a4)
{
unsigned int v7; // w21
unsigned int v8; // w8
__int16 v9; // w20
if ( a4 == 2 )
{
v7 = *(_DWORD *)(a1 + 2136);
if ( v7 == a3 )
return 0;
v8 = *(_DWORD *)(a1 + 2136);
if ( v7 <= a3 )
goto LABEL_10;
sub_1005D8DAC(a1, 0);
while ( 1 )
{
v8 = *(_DWORD *)(a1 + 2136);
LABEL_10:
if ( v8 >= a3 )
break;
sub_1005A72AC(a1, 1);
}
if ( v7 <= a3 )
{
return 0;
}
else
{
v9 = *(_WORD *)(a1 + 3048);
sub_1005D8FD8(a1);
*(_WORD *)(a1 + 3048) = v9;
return 0;
}
}
else if ( a4 == 256 )
{
sub_1005D8DAC(a1, 0);
*(_DWORD *)(a1 + 3068) = a3;
*(_DWORD *)(a1 + 3084) = a3;
return 0;
}
else
{
return 19;
}
}