//
// sub_E4724 from 0xe4724 to 0xe47a4 (128 bytes)
//
// 2 xrefs:
// > sub_7BC78 @ 0x7bd60
// > sub_7BC78 @ 0x7bd78
//
// 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_E4724(__int64 a1, char a2)
{
int v2; // w8
char v4; // w20
int v5; // w8
unsigned int v6; // w8
unsigned int v7; // w9
bool v8; // cf
unsigned int v9; // w8
if ( *(_BYTE *)(a1 + 56) )
{
v2 = *(_DWORD *)(a1 + 52);
v4 = a2 & 1;
if ( (a2 & 1) != 0 )
{
if ( !v2 )
{
FMOD_OS_Time_GetUs(a1 + 12);
v2 = *(_DWORD *)(a1 + 52);
}
*(_DWORD *)(a1 + 52) = v2 + 1;
}
else
{
v5 = v2 - 1;
*(_DWORD *)(a1 + 52) = v5;
if ( !v5 )
{
FMOD_OS_Time_GetUs(a1 + 16);
v6 = *(_DWORD *)(a1 + 12);
v7 = *(_DWORD *)(a1 + 16);
v8 = v7 >= v6;
v9 = v7 - v6;
if ( v9 != 0 && v8 )
*(_DWORD *)(a1 + 48) += v9;
}
}
*(_BYTE *)(a1 + 44) = v4;
}
return 0;
}