//
// sub_8B300 from 0x8b300 to 0x8b4ac (428 bytes)
//
// 1 xrefs:
// > sub_8A6F4 @ 0x8a6f4
//
// 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_8B300(__int64 a1, int a2, __int64 a3)
{
__int64 v3; // x9
__int64 v4; // x24
__int64 v7; // x8
_BYTE *v8; // x8
unsigned int *v9; // x8
unsigned __int64 v10; // x25
char v11; // t1
unsigned int *v12; // x28
unsigned __int64 v13; // x26
unsigned __int64 v14; // x22
unsigned int *v15; // x3
__int64 v16; // x27
__int64 v17; // x0
__int64 v18; // x3
unsigned int *v19; // x23
__int64 (__fastcall *v20)(__int64); // x8
unsigned int v21; // w0
unsigned int *v22; // x27
unsigned __int64 i; // x23
unsigned int v24; // t1
__int64 v25; // x0
__int64 (__fastcall *v26)(__int64); // x8
__int64 v27; // x0
unsigned int v28; // w0
_BOOL4 v29; // w9
unsigned int v31; // [xsp+Ch] [xbp-54h]
v3 = *(_QWORD *)(a1 + 384);
v4 = a2;
v7 = a2;
if ( v3 )
v7 = *(int *)(v3 + 4LL * a2);
v8 = (_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 376) + 64LL) + *(int *)(*(_QWORD *)(*(_QWORD *)(a1 + 376) + 56LL) + 4 * v7));
v11 = *v8;
v9 = (unsigned int *)(v8 + 8);
LOBYTE(v10) = v11;
while ( 1 )
{
if ( (v10 & 1) == 0 )
return 0;
v12 = v9 + 1;
v10 = *v9;
v13 = (v10 >> 1) & 0xFFFFFF;
if ( (unsigned int)v10 >> 25 == 5 )
{
v14 = v13 >> 2;
v22 = v9 + 1;
for ( i = v13 >> 2; i; --i )
{
v24 = *v22++;
v25 = sub_8B538(a3, v24, 2, 0);
v21 = v26(v25);
if ( v21 )
return v21;
}
}
else
{
if ( (unsigned int)v10 >> 25 != 4 )
goto LABEL_22;
v14 = (unsigned int)v13 / 0x104;
v15 = v9 + 2;
v16 = -1;
while ( ++v16 < v14 )
{
v17 = sub_8B538(a3, *(v15 - 1), 2, v15);
v19 = (unsigned int *)(v18 + 260);
v21 = v20(v17);
v15 = v19;
if ( v21 )
return v21;
}
}
if ( !(_DWORD)v14 )
{
LABEL_22:
v29 = 0;
v12 = (unsigned int *)((char *)v12 + v13);
goto LABEL_23;
}
if ( *(_QWORD *)(a3 + 168) )
break;
LABEL_20:
v28 = sub_696E0(a3);
v29 = v28 != 0;
if ( !v28 )
goto LABEL_22;
v31 = v28;
LABEL_23:
v9 = v12;
if ( v29 )
return v31;
}
v27 = *(_QWORD *)(a3 + 232);
if ( v27
|| (v27 = sub_E2AC4(
*(__int64 *)((char *)&qword_1B0 + (_QWORD)off_114000),
(unsigned int)(4 * *(_DWORD *)(a1 + 24)),
"../../src/fmod_codec_fsb5.cpp",
908,
0),
(*(_QWORD *)(a3 + 232) = v27) != 0) )
{
*(_DWORD *)(v27 + 4 * v4) = v14;
goto LABEL_20;
}
return 38;
}