//
// sub_6128C0 from 0x6128c0 to 0x612944 (132 bytes)
//
// 3 xrefs:
// > sub_612950 @ 0x612ace
// > sub_612950 @ 0x612fc8
// > sub_612950 @ 0x6130f6
//
// 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
//
char *__fastcall sub_6128C0(const char *a1)
{
const char *v1; // r0
char *v2; // r4
size_t v3; // r0
size_t v4; // r6
char *v5; // r1
int v6; // r2
char *result; // r0
v1 = off_ABAEB8(a1);
v2 = (char *)v1;
if ( !v1 )
return v2;
v3 = strlen(v1);
v4 = v3;
if ( *v2 != 34 )
{
if ( v3 )
goto LABEL_4;
LABEL_9:
if ( *v2 != 47 )
goto LABEL_14;
return v2;
}
v4 = v3 - 1;
memmove(v2, v2 + 1, v3);
if ( !v4 )
goto LABEL_9;
LABEL_4:
v5 = &v2[v4 - 1];
v6 = (unsigned __int8)*v5;
if ( v6 != 34 )
{
if ( *v2 == 47 )
goto LABEL_6;
LABEL_14:
off_ABAEB0(v2);
return off_ABAEB8((const char *)&word_9B1F2C);
}
v2[v4 - 1] = 0;
if ( *v2 != 47 )
goto LABEL_14;
if ( v4 == 1 )
return v2;
v5 = &v2[v4 - 2];
v6 = (unsigned __int8)*v5;
LABEL_6:
result = v2;
if ( v6 == 47 )
*v5 = 0;
return result;
}