//
// sub_1800B8AE0 from 0x1800b8ae0 to 0x1800b8b5c (124 bytes)
//
// 5 xrefs:
// > sub_180102CA0 @ 0x180103160
// > sub_180102CA0 @ 0x180103182
// > ??> @ 0x180189ab8
// > ??> @ 0x180189ac8
// > ??> @ 0x1801fd32c
//
// 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_1800B8AE0(__int64 a1, char a2)
{
int v4; // eax
unsigned int v7; // eax
unsigned int v8; // ecx
if ( !*(_BYTE *)(a1 + 56) )
return 0;
if ( !a2 )
{
if ( (*(_DWORD *)(a1 + 52))-- == 1 )
{
FMOD_OS_Time_GetUs(a1 + 16);
v7 = *(_DWORD *)(a1 + 16);
v8 = *(_DWORD *)(a1 + 12);
if ( v7 > v8 )
*(_DWORD *)(a1 + 48) += v7 - v8;
}
*(_BYTE *)(a1 + 44) = a2;
return 0;
}
v4 = *(_DWORD *)(a1 + 52);
if ( !v4 )
{
FMOD_OS_Time_GetUs(a1 + 12);
v4 = *(_DWORD *)(a1 + 52);
}
*(_BYTE *)(a1 + 44) = a2;
*(_DWORD *)(a1 + 52) = v4 + 1;
return 0;
}