//
// sub_180108DB0 from 0x180108db0 to 0x180108ee0 (304 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801b07a0
// > ??> @ 0x180201670
//
// 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_180108DB0(int **a1, int a2, __int64 a3, __int64 a4, int a5, int a6)
{
struct _RTL_CRITICAL_SECTION *v6; // r14
int *v8; // rdi
unsigned int v11; // ebx
_DWORD *v12; // rcx
int v13; // ecx
int v14; // eax
int v15; // eax
__int64 v16; // rdx
__int64 v17; // rax
v6 = lpCriticalSection;
v8 = *a1;
FMOD_OS_CriticalSection_Enter(lpCriticalSection);
if ( a6 == 1 )
{
v11 = 0;
if ( a4 )
{
v12 = *(_DWORD **)(a4 + 8);
*(_DWORD *)(a4 + 32) = *(_DWORD *)(a3 + 32);
*v12 = **(_DWORD **)(a3 + 8);
v13 = **(_DWORD **)(a4 + 8);
v14 = 0;
if ( v13 != 1 )
{
LOBYTE(v14) = v13 != 2;
++v14;
}
v8[141] = v14;
if ( a5 )
{
v15 = v8[138];
if ( v15 )
{
if ( v15 == 1 )
v11 = 11;
}
else
{
v16 = qword_1801F24F0[v8[56]] + 112LL * v8[137];
v17 = 1 - *(_DWORD *)(v16 + 108);
if ( !*(_BYTE *)(v17 + v16 + 100) && !*(_BYTE *)(v17 + v16 + 102) && !*(_BYTE *)(v17 + v16 + 104) )
v11 = 11;
}
}
}
}
else
{
v11 = sub_180109990(
v8,
**(_QWORD **)(a3 + 24),
**(unsigned int **)(a3 + 8),
**(_QWORD **)(a4 + 24),
**(_DWORD **)(a4 + 8),
a2,
a5);
}
FMOD_OS_CriticalSection_Leave(v6);
return v11;
}