//
// sub_E4BAC from 0xe4bac to 0xe4c58 (172 bytes)
//
// 2 xrefs:
// > sub_E498C @ 0xe49a4
// > sub_E498C @ 0xe49c0
//
// 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 12:14:58 +0000
//
__int64 __fastcall sub_E4BAC(__int64 *a1)
{
__int64 v1; // x20
__int64 result; // x0
int v4; // w8
int v5; // w9
int v6; // w11
int v7; // w10
int v8; // w9
int v9; // w2
int v10; // w8
int v11; // [xsp+Ch] [xbp-14h] BYREF
v1 = *a1;
v11 = 0;
result = sub_E694C(&v11);
if ( !(_DWORD)result )
{
v4 = v11;
v5 = *(_DWORD *)(v1 + 12);
v6 = *(_DWORD *)(v1 + 16);
v7 = *(_DWORD *)(v1 + 20);
*(_DWORD *)(v1 + 12) = v11;
v8 = v4 - v5;
v9 = *(_DWORD *)(v1 + 4);
if ( v8 > 1000 )
v8 = 0;
v10 = v8 * *(_DWORD *)v1 / 1000 + v7;
*(_DWORD *)(v1 + 20) = v10;
if ( v10 - v6 >= v9 )
{
result = ((__int64 (__fastcall *)(__int64 *, _QWORD))a1[1])(a1, *(_QWORD *)(v1 + 24));
if ( !(_DWORD)result )
*(_DWORD *)(v1 + 16) += *(_DWORD *)(v1 + 4);
}
else
{
FMOD_OS_Time_Sleep(*(unsigned int *)(v1 + 8));
return 0;
}
}
return result;
}