//
// sub_E1B0FC from 0xe1b0fc to 0xe1b2d4 (472 bytes)
//
// 6 xrefs:
// > sub_E1B530 @ 0xe1b54c
// > sub_E1B530 @ 0xe1b55c
// > sub_E1BB10 @ 0xe1bfd8
// > sub_E1BB10 @ 0xe1c150
// > sub_E1C978 @ 0xe1cd20
// > sub_E1C978 @ 0xe1cd30
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:09:43 +0000
//
char *__fastcall sub_E1B0FC(char *a1, char a2)
{
const char *v2; // x20
int v3; // w3
__int64 v4; // x21
int v5; // w19
__int64 v6; // x22
int v7; // w2
__int64 *v8; // x4
bool v9; // zf
int v10; // t1
int v11; // t1
size_t v12; // x21
char *result; // x0
char *v14; // x2
int v15; // w1
int v16; // t1
char *v17; // x2
int v18; // t1
int v19; // t1
int v20; // t1
size_t v21; // x19
__int64 v22; // [xsp+40h] [xbp+40h] BYREF
v2 = a1;
strcpy((char *)&v22, "(){ %*]");
if ( !a1 )
return nullptr;
v3 = (unsigned __int8)*a1;
if ( !*a1 )
return off_154A3D8(v2);
v4 = 0;
v5 = 0;
v6 = 0;
do
{
while ( 1 )
{
while ( v3 == 92 )
{
v19 = (unsigned __int8)*++a1;
v3 = v19;
++v6;
if ( !v19 )
goto LABEL_16;
}
if ( v3 != 34 )
break;
v20 = (unsigned __int8)*++a1;
v3 = v20;
++v4;
if ( !v20 )
goto LABEL_16;
}
if ( !a2 && (_BYTE)v22 && !v5 )
{
v7 = (unsigned __int8)v22;
v8 = &v22;
do
{
v9 = v3 == v7;
v10 = *((unsigned __int8 *)v8 + 1);
v8 = (__int64 *)((char *)v8 + 1);
v7 = v10;
v5 = v9;
}
while ( v7 && !v5 );
}
v11 = (unsigned __int8)*++a1;
v3 = v11;
}
while ( v11 );
LABEL_16:
if ( !(v6 | v4) )
{
if ( v5 )
{
v21 = strlen(v2);
goto LABEL_32;
}
return off_154A3D8(v2);
}
v12 = v6 + v4 + strlen(v2);
if ( v5 )
{
v21 = v12;
LABEL_32:
v12 = v21 + 2;
result = (char *)off_154A3C0(v21 + 3);
if ( result )
{
*result = 34;
v14 = result + 1;
result[v21 + 1] = 34;
goto LABEL_19;
}
return nullptr;
}
result = (char *)off_154A3C0(v12 + 1);
v14 = result;
if ( !result )
return nullptr;
LABEL_19:
v15 = *(unsigned __int8 *)v2;
if ( *v2 )
{
do
{
while ( v15 != 34 && v15 != 92 )
{
*v14++ = *v2;
v16 = *(unsigned __int8 *)++v2;
v15 = v16;
if ( !v16 )
goto LABEL_25;
}
*v14 = 92;
v17 = v14 + 1;
*v17 = *v2;
v14 = v17 + 1;
v18 = *(unsigned __int8 *)++v2;
v15 = v18;
}
while ( v18 );
}
LABEL_25:
result[v12] = 0;
return result;
}