//
// sub_1800D10B0 from 0x1800d10b0 to 0x1800d11ad (253 bytes)
//
// 2 xrefs:
// > sub_1800107D0 @ 0x180010957
// > ??> @ 0x1801feb44
//
// 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:09 +0000
//
__int64 __fastcall sub_1800D10B0(_QWORD *a1, __int64 a2, _DWORD *a3)
{
struct _RTL_CRITICAL_SECTION *v6; // rsi
__int64 v7; // r8
__int64 result; // rax
bool v9; // zf
_QWORD v10[3]; // [rsp+20h] [rbp-18h] BYREF
__int64 v11; // [rsp+58h] [rbp+20h] BYREF
v11 = 0;
if ( (unsigned int)FMOD::ChannelI::validate(a2, &v11, nullptr) )
{
result = sub_1800CCA80(a2, v10, nullptr);
if ( (_DWORD)result )
return result;
v6 = (struct _RTL_CRITICAL_SECTION *)a1[46];
FMOD_OS_CriticalSection_Enter(v6);
v7 = v10[0] + 520LL;
}
else
{
v6 = (struct _RTL_CRITICAL_SECTION *)a1[46];
FMOD_OS_CriticalSection_Enter(v6);
v7 = a1[42] + ((__int64)*(int *)(v11 + 464) << 6);
}
if ( *(_DWORD *)(v7 + 24) != 1 )
{
*(_DWORD *)(v7 + 24) = 0;
*(_QWORD *)(v7 + 32) = a2;
*(_DWORD *)(v7 + 40) = *a3;
*(_DWORD *)(v7 + 44) = a3[1];
v9 = *(_QWORD *)v7 == v7;
*(_DWORD *)(v7 + 48) = a3[2];
if ( v9 && *(_QWORD *)(v7 + 8) == v7 )
{
*(_QWORD *)(v7 + 8) = a1[44];
*(_QWORD *)v7 = a1 + 43;
a1[44] = v7;
**(_QWORD **)(v7 + 8) = v7;
}
}
return FMOD_OS_CriticalSection_Leave(v6);
}