//
// sub_1005D2938 from 0x1005d2938 to 0x1005d2970 (56 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009aba50
//
// 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:32 +0000
//
__int64 __fastcall sub_1005D2938(__int64 a1, __int64 a2, int a3, _DWORD *a4)
{
int v4; // w8
unsigned int v5; // w9
unsigned int v6; // w10
int v7; // w8
bool v8; // cc
int v9; // w9
__int64 v10; // x8
v4 = *(_DWORD *)(a1 + 496);
v5 = v4 + a3;
v6 = *(_DWORD *)(a1 + 32);
v7 = v6 - v4;
v8 = v5 > v6;
if ( v5 <= v6 )
v9 = a3;
else
v9 = v7;
if ( v8 )
v10 = 31;
else
v10 = 0;
*a4 = v9;
*(_DWORD *)(a1 + 496) += v9;
return v10;
}