//
// sub_82A9E from 0x82a9e to 0x82ae6 (72 bytes)
//
// 2 xrefs:
// > sub_83348 @ 0x8347e
// > sub_83348 @ 0x83542
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:41:18 +0000
//
int __fastcall sub_82A9E(int a1)
{
int v1; // r1
int v2; // r2
int v3; // r3
int v4; // r0
v1 = *(_DWORD *)(a1 + 4);
v2 = *(_DWORD *)(a1 + 224);
v3 = *(_DWORD *)(v1 + 40);
if ( v3 < v2 )
{
v3 += 4 * *(unsigned __int8 *)(a1 + 228);
if ( v3 > v2 )
v3 = *(_DWORD *)(a1 + 224);
*(_DWORD *)(v1 + 40) = v3;
v2 = *(_DWORD *)(a1 + 224);
}
if ( v3 > v2 )
{
v4 = v3 - 4 * *(unsigned __int8 *)(a1 + 228);
if ( v4 < v2 )
v4 = v2;
*(_DWORD *)(v1 + 40) = v4;
}
*(_BYTE *)(v1 + 36) |= 1u;
return 0;
}