//
// sub_1800992C0 from 0x1800992c0 to 0x180099415 (341 bytes)
//
// 8 xrefs:
// > sub_18000E700 @ 0x18000e7e4
// > sub_18001CAB0 @ 0x18001cb1f
// > sub_18007A680 @ 0x18007aa30
// > FMOD::DSP::reset @ 0x1800a3545
// > ??> @ 0x180185640
// > ??> @ 0x180185654
// > ??> @ 0x180185664
// > ??> @ 0x1801faac4
//
// 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:53:48 +0000
//
__int64 __fastcall sub_1800992C0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v5; // rsi
char v6; // r14
__int64 v7; // rax
unsigned int v8; // edi
__int64 v9; // rcx
__int64 v10; // rbp
__int64 v11; // rax
__int64 result; // rax
__int64 v13; // r8
__int64 v14; // [rsp+40h] [rbp+8h] BYREF
v5 = *(_QWORD *)(a1 + 168);
if ( (*(_DWORD *)(a1 + 100) & 0x100) != 0 )
{
v6 = 0;
if ( v5 )
{
sub_1801021C0(v5, 7);
v6 = 1;
}
v7 = *(_QWORD *)(a1 + 536);
v8 = 0;
if ( v7 && *(_BYTE *)(v7 + 530) )
{
v9 = *(_QWORD *)(a1 + 536);
}
else
{
v9 = 0;
if ( !v7 )
goto LABEL_9;
}
v10 = v7 + 532;
if ( *(_BYTE *)(v7 + 1062) )
{
LABEL_10:
if ( v9 )
{
*(_DWORD *)(v9 + 524) = 0;
*(_WORD *)(v9 + 528) = 0;
memset((void *)v9, 0, 0x208u);
}
if ( v10 )
{
*(_DWORD *)(v10 + 524) = 0;
*(_WORD *)(v10 + 528) = 0;
memset((void *)v10, 0, 0x208u);
}
if ( v6 && v5 )
sub_180102300(v5, 7);
v11 = *(_QWORD *)(a1 + 232);
if ( v11 )
{
if ( *(_QWORD *)(v11 + 64) )
{
*(_QWORD *)(a1 + 176) = a1;
return (*(unsigned int (**)(void))(v11 + 64))();
}
}
return v8;
}
LABEL_9:
v10 = 0;
goto LABEL_10;
}
LOBYTE(a4) = 1;
result = sub_1800FCF40(*(_QWORD *)(a1 + 168), &v14, 16, a4);
if ( !(_DWORD)result )
{
LOBYTE(v13) = 1;
*(_BYTE *)v14 = 17;
*(_QWORD *)(v14 + 8) = a1;
return sub_1800FD370(*(_QWORD *)(a1 + 168), v14, v13);
}
return result;
}