//
// sub_BAFDD0 from 0xbafdd0 to 0xbafe58 (136 bytes)
//
// 1 xrefs:
// > sub_B9C364 @ 0xb9ca78
//
// 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_BAFDD0(__int64 a1, __int64 a2)
{
__int64 *v2; // x19
__int64 v4; // x22
unsigned int v5; // w20
_QWORD *v7; // x0
v2 = *(__int64 **)(a2 + 1144);
v4 = *v2;
if ( (unsigned int)sub_B9941C(v2, v2[1], a1) )
v5 = 0;
else
v5 = 27;
if ( v2 != *(__int64 **)(a2 + 1144) || *v2 == v4 )
return v5;
v7 = *(_QWORD **)*v2;
*(_BYTE *)(a2 + 1137) = 0;
sub_B9B94C(v7, 0);
return v5;
}