//
// sub_1800D4520 from 0x1800d4520 to 0x1800d45ab (139 bytes)
//
// 2 xrefs:
// > sub_1800E69E0 @ 0x1800e6a5a
// > ??> @ 0x1801fed9c
//
// This function is hookable on this platform (idp: pc, 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 10:54:10 +0000
//
__int64 __fastcall sub_1800D4520(__int64 a1)
{
__int64 result; // rax
struct _RTL_CRITICAL_SECTION *v4; // rcx
struct _RTL_CRITICAL_SECTION *v5; // rcx
struct _RTL_CRITICAL_SECTION *v6; // rcx
if ( (*(_DWORD *)a1)-- != 1 )
return 0;
result = sub_1800C7170();
if ( !(_DWORD)result )
{
result = sub_1800B3C40();
if ( !(_DWORD)result )
{
result = sub_1800C13E0();
if ( !(_DWORD)result )
{
v4 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 296);
if ( v4 )
{
FMOD_OS_CriticalSection_Free(v4, 0);
*(_QWORD *)(a1 + 296) = 0;
}
v5 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 288);
if ( v5 )
{
FMOD_OS_CriticalSection_Free(v5, 0);
*(_QWORD *)(a1 + 288) = 0;
}
v6 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 280);
if ( v6 )
{
FMOD_OS_CriticalSection_Free(v6, 0);
*(_QWORD *)(a1 + 280) = 0;
}
return 0;
}
}
}
return result;
}