//
// sub_180097A00 from 0x180097a00 to 0x180097b46 (326 bytes)
//
// 4 xrefs:
// > FMOD::DSP::getOutput @ 0x1800a256c
// > sub_1800E1F40 @ 0x1800e2270
// > sub_1800E3A10 @ 0x1800e3b81
// > ??> @ 0x1801faa1c
//
// 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:47 +0000
//
__int64 __fastcall sub_180097A00(__int64 a1, __int64 a2, _QWORD *a3, _QWORD *a4, char a5, char a6)
{
char v6; // r11
__int64 v7; // r15
__int64 v8; // rsi
char v9; // r12
_QWORD *v11; // r10
int v12; // r14d
__int64 v14; // rdi
unsigned int v15; // ebx
__int16 v16; // ax
_QWORD *v17; // r8
int v18; // edx
int v19; // r9d
int v20; // ecx
int v21; // eax
v6 = a6;
v7 = 0;
v8 = *(_QWORD *)(a1 + 168);
v9 = 0;
v11 = a3;
v12 = a2;
v14 = 0;
v15 = 0;
if ( a6 )
{
LOBYTE(a2) = 1;
sub_1800FC980(*(_QWORD *)(a1 + 168), a2);
if ( v8 )
{
sub_1801021C0(v8, 1);
v9 = 1;
}
v6 = a6;
v11 = a3;
}
if ( a5 )
v16 = *(_WORD *)(a1 + 430);
else
v16 = *(_WORD *)(a1 + 426);
if ( v12 < v16 )
{
v17 = *(_QWORD **)(a1 + 400);
if ( v17 == (_QWORD *)(a1 + 400) )
{
v15 = 28;
}
else
{
v14 = v17[2];
v18 = 0;
v19 = a5 != 0 ? 5 : 0;
v20 = *(_DWORD *)(v14 + 124) & v19;
while ( v18 < v12 || v20 )
{
v17 = (_QWORD *)*v17;
v21 = v18 + 1;
v14 = v17[2];
v20 = *(_DWORD *)(v14 + 124) & v19;
if ( v20 )
v21 = v18;
v18 = v21;
}
}
}
else
{
v15 = 9;
}
if ( a4 )
*a4 = v14;
if ( v11 )
{
if ( v14 )
v7 = *(_QWORD *)(v14 + 96);
*v11 = v7;
}
if ( v6 && v8 )
{
if ( !v9 )
return v15;
goto LABEL_30;
}
if ( v9 && v8 )
LABEL_30:
sub_180102300(v8, 1);
return v15;
}