//
// sub_B9BEE4 from 0xb9bee4 to 0xb9bf74 (144 bytes)
//
// 1 xrefs:
// > sub_B83394 @ 0xb833b0
//
// 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_B9BEE4(_QWORD *result)
{
__int64 v1; // x2
_QWORD *v2; // x20
__int64 v3; // x21
__int64 v4; // x19
int v5; // w2
v1 = result[12];
if ( v1 )
{
v2 = result + 4096;
if ( result[4490] || result[4491] )
{
v3 = (__int64)result;
v4 = result[4498];
v5 = sub_BA3028(*(_QWORD *)(v1 + 128), result + 4492, v1 + 128);
if ( !v5 )
goto LABEL_7;
sub_B7B528(v3, "Internal error clearing splay node = %d\n", v5);
for ( result = *(_QWORD **)(v4 + 24); result; result = *(_QWORD **)(v4 + 24) )
{
sub_B994E4(v4, *(_QWORD **)(v4 + 8), 0);
LABEL_7:
;
}
v2[394] = 0;
v2[395] = 0;
}
}
return result;
}