//
// sub_6AF3E from 0x6af3e to 0x6af7c (62 bytes)
//
// 3 xrefs:
// > sub_6B2EC @ 0x6b344
// > sub_6B36C @ 0x6b372
// > sub_6B614 @ 0x6b68a
//
// 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
//
int __fastcall sub_6AF3E(int a1, int a2, int a3, int a4)
{
__int64 v6; // r0
int v7; // r4
int v9; // [sp+0h] [bp-10h] BYREF
int v10; // [sp+4h] [bp-Ch]
v9 = a3;
v10 = a4;
v9 = *(_DWORD *)(a1 + 24);
j_FMOD_OS_CriticalSection_Enter(v9);
LOBYTE(v10) = 1;
if ( a2 )
{
v6 = *(_QWORD *)(a1 + 8);
HIDWORD(v6) += a2;
*(_DWORD *)(a1 + 12) = HIDWORD(v6);
if ( HIDWORD(v6) == (_DWORD)v6 )
{
*(_DWORD *)(a1 + 8) = 0;
*(_DWORD *)(a1 + 12) = 0;
}
}
v7 = sub_6AEEE((_DWORD *)a1);
sub_44984((int)&v9);
return v7;
}