//
// sub_B875D0 from 0xb875d0 to 0xb876d0 (256 bytes)
//
// 2 xrefs:
// > sub_B99F50 @ 0xb99fb4
// > sub_B9C0DC @ 0xb9c31c
//
// 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
//
_QWORD **__fastcall sub_B875D0(__int64 a1, __int64 a2)
{
int v4; // w22
int v5; // w21
_QWORD **v6; // x0
_QWORD *v7; // x1
_QWORD **result; // x0
_QWORD *v9; // x1
v4 = 0;
if ( *(_BYTE *)(a2 + 1136) )
v4 = (unsigned __int8)sub_BB0340();
v5 = 0;
if ( *(_BYTE *)(a2 + 1137) )
v5 = (unsigned __int8)sub_BB0368(a1, a2);
v6 = *(_QWORD ***)(a2 + 1152);
if ( v6 )
{
v7 = *v6;
if ( *v6 )
{
if ( a1 == *v7 )
{
LABEL_20:
sub_B994E4(v6, v7, 0);
if ( v4 )
sub_BB0418(a2);
}
else
{
while ( 1 )
{
v7 = (_QWORD *)v7[2];
if ( !v7 )
break;
if ( a1 == *v7 )
goto LABEL_20;
}
}
}
}
result = *(_QWORD ***)(a2 + 1144);
if ( result )
{
v9 = *result;
if ( *result )
{
if ( a1 == *v9 )
{
LABEL_18:
result = (_QWORD **)sub_B994E4(result, v9, 0);
if ( v5 )
return (_QWORD **)sub_BB0410(a2);
}
else
{
while ( 1 )
{
v9 = (_QWORD *)v9[2];
if ( !v9 )
break;
if ( a1 == *v9 )
goto LABEL_18;
}
}
}
}
return result;
}