//
// sub_1801123F0 from 0x1801123f0 to 0x18011245a (106 bytes)
//
// 5 xrefs:
// > sub_180111EE0 @ 0x180111f18
// > sub_180111F40 @ 0x180111f7c
// > sub_1801122A0 @ 0x180112371
// > sub_1801122A0 @ 0x1801123ae
// > ??> @ 0x180201c10
//
// 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_1801123F0(__int64 a1)
{
struct _RTL_CRITICAL_SECTION *v1; // rbp
int v3; // ebx
unsigned int v4; // esi
v1 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 32);
FMOD_OS_CriticalSection_Enter(v1);
if ( *(int *)(a1 + 60) <= 0 )
{
LABEL_6:
v4 = 0;
}
else
{
v3 = 0;
while ( 1 )
{
v4 = sub_1800C14F0(*(void **)(a1 + 48));
if ( v4 )
break;
if ( ++v3 >= *(_DWORD *)(a1 + 60) )
{
*(_DWORD *)(a1 + 60) = 0;
goto LABEL_6;
}
}
}
FMOD_OS_CriticalSection_Leave(v1);
return v4;
}