//
// sub_6BC04 from 0x6bc04 to 0x6bdbc (440 bytes)
//
// 1 xrefs:
// > FMOD::System::setAdvancedSettings @ 0xdba28
//
// 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_6BC04(_DWORD *a1, int *a2)
{
size_t v2; // x2
unsigned int v3; // w8
float v5; // s0
float v6; // s1
bool v7; // cc
unsigned int v8; // w11
unsigned int v9; // w8
unsigned int v10; // w10
if ( !a2 )
return 31;
v2 = *a2;
v3 = 31;
if ( (unsigned int)(v2 - 85) > 0x13 || (v2 & 3) != 0 )
return v3;
if ( *((_WORD *)a2 + 5)
|| *((_WORD *)a2 + 3)
|| *((_WORD *)a2 + 7)
|| *((_WORD *)a2 + 9)
|| *((_WORD *)a2 + 11)
|| *((_WORD *)a2 + 13)
|| (int)v2 >= 97 && (a2[24] < 0 || (int)v2 >= 101 && (unsigned int)(a2[25] + 1) > 0x10000) )
{
return 31;
}
v5 = *((float *)a2 + 14);
if ( (~LODWORD(v5) & 0x7F800000) == 0 )
return 29;
v6 = *((float *)a2 + 18);
if ( v6 < 0.0001 )
{
a2[18] = a1[17428];
goto LABEL_22;
}
v3 = 31;
if ( v6 >= 10.0 && v6 <= 22050.0 )
{
LABEL_22:
if ( v5 == -1.0 || (v5 >= 0.0 ? (v7 = v5 <= 1.0) : (v7 = 0), v7) )
{
if ( (unsigned int)a2[8] <= 0x20 )
{
v8 = a2[20];
if ( !HIWORD(v8) )
{
v9 = a2[21];
if ( v9 <= 4 && (unsigned int)a2[19] <= 3 )
{
v10 = a2[23];
if ( v10 <= 3 )
{
if ( (unsigned int)(a2[15] - 1) >> 4 >= 0x753 )
{
a2[15] = a1[17425];
if ( v8 )
{
LABEL_35:
if ( v9 )
goto LABEL_36;
goto LABEL_40;
}
}
else if ( v8 )
{
goto LABEL_35;
}
a2[20] = a1[17430];
if ( v9 )
{
LABEL_36:
if ( v10 )
{
LABEL_37:
memcpy(a1 + 17410, a2, v2);
return 0;
}
LABEL_41:
a2[23] = a1[17433];
goto LABEL_37;
}
LABEL_40:
a2[21] = a1[17431];
if ( v10 )
goto LABEL_37;
goto LABEL_41;
}
}
}
}
}
return 31;
}
return v3;
}