//
// sub_623518 from 0x623518 to 0x6235ba (162 bytes)
//
// 3 xrefs:
// > sub_6235C4 @ 0x623674
// > sub_6235C4 @ 0x6236ca
// > sub_6235C4 @ 0x62378a
//
// 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
//
_BYTE *__fastcall sub_623518(int a1, char *a2)
{
_BOOL4 v2; // r4
_BYTE *result; // r0
_BYTE *v4; // r5
_BYTE *v5; // r2
unsigned int v6; // r3
int v7; // r1
bool v8; // zf
int v9; // r0
int v10; // r4
unsigned int v11; // t1
bool v12; // cc
int v13; // r4
unsigned int v14; // t1
_BYTE *v15; // [sp+8h] [bp-8h] BYREF
int v16; // [sp+Ch] [bp-4h] BYREF
if ( sub_623DF4(a1, a2, 0, (int)&v15, (int)&v16, 0) )
v2 = 1;
else
v2 = v15 == nullptr;
result = nullptr;
if ( !v2 )
{
v4 = off_ABAEAC(2 * v16 + 1);
if ( v4 )
{
v5 = v15;
v6 = (unsigned __int8)*v15;
if ( *v15 )
{
v7 = 0;
do
{
while ( 1 )
{
v12 = v6 > 0x7F;
if ( v6 != 127 )
v12 = v6 > 0x20;
v13 = v7 + 1;
if ( !v12 )
break;
v8 = v6 == 34;
if ( v6 != 34 )
v8 = v6 == 39;
v9 = v8;
if ( v6 == 92 )
v9 |= 1u;
if ( v9 )
break;
v10 = v7++;
v4[v10] = v6;
v11 = (unsigned __int8)*++v5;
v6 = v11;
if ( !v11 )
goto LABEL_21;
}
v4[v7] = 92;
v7 += 2;
v4[v13] = v6;
v14 = (unsigned __int8)*++v5;
v6 = v14;
}
while ( v14 );
}
else
{
v7 = (unsigned __int8)*v15;
}
LABEL_21:
v4[v7] = 0;
}
off_ABAEB0(v15);
return v4;
}
return result;
}