//
// sub_5FFFEA from 0x5fffea to 0x6000a2 (184 bytes)
//
// 2 xrefs:
// > sub_5FFFEA @ 0x60001c
// > sub_6049F4 @ 0x6053b6
//
// 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_5FFFEA(int a1, unsigned __int8 *a2, int a3, int a4)
{
int v7; // r0
int v8; // r3
int v9; // r3
int v10; // r0
unsigned __int8 *v11; // r1
unsigned __int8 *v12; // r3
int v13; // r2
int v14; // t1
unsigned __int8 *v15; // r1
int v16; // r2
int v17; // t1
unsigned __int8 *v19; // r1
int v20; // r2
int v21; // t1
while ( 2 )
{
++a2;
while ( 1 )
{
v7 = *a2;
if ( !*a2 )
{
if ( !a4 || a3 != 62 )
goto LABEL_29;
return a2;
}
if ( v7 != 60 )
break;
v8 = a2[1];
if ( v8 != 33 )
{
if ( v8 != 63 )
goto LABEL_29;
v19 = a2 + 2;
while ( 1 )
{
v12 = v19;
v21 = *v19++;
v20 = v21;
if ( !v21 )
goto LABEL_39;
if ( v20 == 63 && *v19 == 62 )
{
a2 = v12 + 2;
goto LABEL_23;
}
}
}
v9 = a2[2];
if ( v9 == 45 )
{
if ( a2[3] == 45 )
{
v15 = a2 + 4;
while ( 1 )
{
v12 = v15;
v17 = *v15++;
v16 = v17;
if ( !v17 )
goto LABEL_39;
if ( v16 == 45 && *v15 == 45 && v15[1] == 62 )
{
a2 = v12 + 4;
goto LABEL_23;
}
}
}
LABEL_29:
*(_DWORD *)(a1 + 8) = a2;
LABEL_30:
*(_DWORD *)(a1 + 12) = 9;
return nullptr;
}
if ( v9 == 91 )
{
a2 = (unsigned __int8 *)sub_5FFFA6(a1, a2);
LABEL_23:
if ( !a2 )
return nullptr;
}
else
{
v10 = sub_5FFFEA(a1, a2, a3, 0);
if ( !v10 )
return nullptr;
a2 = (unsigned __int8 *)(v10 + 1);
}
}
if ( v7 == 34 || v7 == 39 )
{
v11 = a2 + 1;
while ( 1 )
{
v12 = v11;
v14 = *v11++;
v13 = v14;
if ( !v14 )
break;
if ( v13 == v7 )
{
a2 = v12 + 1;
goto LABEL_23;
}
}
LABEL_39:
*(_DWORD *)(a1 + 8) = v12;
goto LABEL_30;
}
if ( v7 != 62 )
continue;
return a2;
}
}