//
// sub_B8B854 from 0xb8b854 to 0xb8b8e4 (144 bytes)
//
// 2 xrefs:
// > sub_B828FC @ 0xb82a60
// > sub_B828FC @ 0xb82d98
//
// 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
//
void *__fastcall sub_B8B854(int a1, char *a2, int a3, _DWORD *a4)
{
void *v4; // x19
int v6; // w0
void *p; // [xsp+20h] [xbp+20h] BYREF
unsigned __int64 v9; // [xsp+28h] [xbp+28h] BYREF
v4 = nullptr;
p = nullptr;
if ( a3 < 0 || (unsigned int)sub_B8B660(a1, a2, a3, &p, &v9, 0) )
return v4;
if ( !a4 )
return p;
if ( v9 <= 0x7FFFFFFF )
{
v6 = sub_BABA88();
v4 = p;
*a4 = v6;
return v4;
}
off_1231008(p);
return nullptr;
}