//
// sub_6B8F0 from 0x6b8f0 to 0x6ba4c (348 bytes)
//
// 5 xrefs:
// > sub_6BA70 @ 0x6bab4
// > sub_6C64C @ 0x6c8a0
// > sub_76B04 @ 0x76b84
// > sub_76FC8 @ 0x76fe4
// > FMOD::System::getDriverInfo @ 0xdaf98
//
// 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_6B8F0(
__int64 a1,
unsigned int a2,
__int64 a3,
unsigned int a4,
_QWORD *a5,
_DWORD *a6,
_DWORD *a7,
_DWORD *a8)
{
__int64 result; // x0
__int64 v17; // x0
__int64 (__fastcall *v18)(__int64, _QWORD, __int64, _QWORD, _QWORD *); // x9
int v19; // [xsp+Ch] [xbp-44h] BYREF
result = sub_6B868(a1, &v19);
if ( !(_DWORD)result )
{
result = 31;
if ( (a2 & 0x80000000) == 0 && v19 > (int)a2 )
{
if ( *(_BYTE *)(a1 + 8)
|| (result = sub_7676C(a1, *(unsigned int *)(a1 + 1656), *(unsigned int *)(a1 + 1660)), !(_DWORD)result) )
{
if ( !*(_QWORD *)(*(_QWORD *)(a1 + 1648) + 832LL) )
return 0;
if ( a3 )
result = sub_70450(a3);
if ( a5 )
{
*a5 = 0;
a5[1] = 0;
}
v17 = sub_701C8(result);
result = v18(v17, a2, a3, a4, a5);
if ( !(_DWORD)result )
{
if ( a7 )
*a7 = 3;
if ( a8 )
*a8 = 2;
if ( a6 )
*a6 = 48000;
return 0;
}
}
}
}
return result;
}