//
// sub_BB097C from 0xbb097c to 0xbb0ad8 (348 bytes)
//
// 2 xrefs:
// > ??> @ 0x111cee8
// > ??> @ 0x111cf68
//
// 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_BB097C(__int64 *a1)
{
__int64 v2; // x20
void *v3; // x0
unsigned int v4; // w1
__int64 v5; // x6
__int64 v6; // x0
__int64 v7; // x19
int v8; // w2
const char *v9; // x0
const char *v10; // x0
const char *v11; // x20
char *v12; // x0
_BYTE *v13; // x1
int v14; // w0
int v15; // t1
int v16; // t1
char *v18; // [xsp+28h] [xbp+28h] BYREF
v2 = *a1;
v3 = off_1231020(1u, 0x20u);
*(_QWORD *)(v2 + 536) = v3;
v4 = 27;
if ( v3 )
{
v5 = *a1 + 0x8000;
v6 = *a1;
v7 = *(_QWORD *)(*a1 + 536);
v4 = sub_B8B660(v6, *(char **)(v5 + 3264), 0, &v18, nullptr, 1u);
if ( !v4 )
{
v8 = (unsigned __int8)*v18;
if ( v8 == 92 || (v9 = v18, v8 == 47) )
v9 = v18 + 1;
v10 = off_1231018(v9);
*(_QWORD *)(v7 + 8) = v10;
v11 = v10;
if ( v10 )
{
v12 = strchr(v10, 47);
if ( v12 || (v12 = strchr(v11, 92)) != nullptr )
{
*v12 = 0;
v13 = v12 + 1;
*(_QWORD *)(v7 + 16) = v12 + 1;
v14 = (unsigned __int8)v12[1];
if ( v14 )
{
do
{
while ( v14 != 47 )
{
v15 = (unsigned __int8)*++v13;
v14 = v15;
if ( !v15 )
goto LABEL_12;
}
*v13 = 92;
v16 = (unsigned __int8)*++v13;
v14 = v16;
}
while ( v16 );
}
LABEL_12:
off_1231008(v18);
return 0;
}
else
{
off_1231008(v18);
return 3;
}
}
else
{
off_1231008(v18);
return 27;
}
}
}
return v4;
}