//
// sub_180111F40 from 0x180111f40 to 0x180111fb8 (120 bytes)
//
// 2 xrefs:
// > sub_1800DA550 @ 0x1800da994
// > ??> @ 0x180201ba4
//
// 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:35 +0000
//
__int64 __fastcall sub_180111F40(__int64 a1, int *a2)
{
int v2; // esi
__int64 v3; // rbx
struct _RTL_CRITICAL_SECTION *v4; // rdi
unsigned int v5; // ebx
v2 = *a2;
v3 = a1 + 1312;
v4 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 1344);
FMOD_OS_CriticalSection_Enter(v4);
if ( v2 )
{
*(_DWORD *)(v3 + 16) += v2;
if ( *(_DWORD *)(v3 + 16) == *(_DWORD *)(v3 + 12) )
*(_QWORD *)(v3 + 12) = 0;
}
v5 = sub_1801123F0(v3);
FMOD_OS_CriticalSection_Leave(v4);
if ( v5 )
return v5;
else
return 0;
}