//
// sub_A39EC from 0xa39ec to 0xa3a40 (84 bytes)
//
// 2 xrefs:
// > sub_A495C @ 0xa4c08
// > sub_A6470 @ 0xa647c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_A39EC(__int64 a1)
{
__int64 v1; // x8
int v2; // w9
int v3; // w10
int v4; // w10
int v5; // w10
v1 = *(_QWORD *)(a1 + 8);
v2 = *(_DWORD *)(a1 + 256);
v3 = *(_DWORD *)(v1 + 64);
if ( v3 < v2 )
{
v4 = v3 + 4 * *(unsigned __int8 *)(a1 + 260);
if ( v4 <= v2 )
v2 = v4;
LABEL_7:
*(_DWORD *)(v1 + 64) = v2;
goto LABEL_8;
}
if ( v3 > v2 )
{
v5 = v3 - 4 * *(unsigned __int8 *)(a1 + 260);
if ( v5 >= v2 )
v2 = v5;
goto LABEL_7;
}
LABEL_8:
*(_BYTE *)(v1 + 60) |= 1u;
return 0;
}