//
// sub_B4E1BC from 0xb4e1bc to 0xb4e2d0 (276 bytes)
//
// 2 xrefs:
// > sub_B4E1BC @ 0xb4e2a8
// > sub_B4EA4C @ 0xb4ecfc
//
// 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
//
unsigned __int8 *__fastcall sub_B4E1BC(__int64 a1, __int64 a2)
{
unsigned __int8 *v3; // x0
int i; // w1
unsigned __int8 *v6; // x1
int v7; // w0
bool v8; // zf
unsigned __int8 *v9; // x0
v3 = (unsigned __int8 *)(a2 + 1);
for ( i = *(unsigned __int8 *)(a2 + 1); i; i = v6[3] )
{
while ( i != 60 )
{
v8 = i == 93;
i = v3[1];
if ( v8 && i == 93 && v3[2] == 62 )
return v3 + 3;
LABEL_5:
++v3;
if ( !i )
goto LABEL_6;
}
i = v3[1];
if ( i != 33 || v3[2] != 91 )
goto LABEL_5;
v6 = v3 + 1;
LABEL_15:
v7 = v6[1];
do
{
LABEL_16:
++v6;
v8 = v7 == 60;
if ( !v7 )
{
LABEL_27:
*(_QWORD *)(a1 + 16) = v6;
*(_DWORD *)(a1 + 24) = 9;
return nullptr;
}
while ( v8 )
{
v7 = v6[1];
if ( v7 != 33 || v6[2] != 91 )
goto LABEL_16;
v9 = (unsigned __int8 *)sub_B4E1BC(a1);
v6 = v9;
if ( !v9 )
return nullptr;
v7 = *v9;
v8 = v7 == 60;
if ( !v7 )
goto LABEL_27;
}
if ( v7 != 93 )
goto LABEL_15;
v7 = v6[1];
}
while ( v7 != 93 || v6[2] != 62 );
v3 = v6 + 3;
if ( v6 == (unsigned __int8 *)-3LL )
return nullptr;
}
LABEL_6:
*(_QWORD *)(a1 + 16) = v3;
*(_DWORD *)(a1 + 24) = 9;
return nullptr;
}