//
// sub_100577708 from 0x100577708 to 0x1005778a8 (416 bytes)
//
// 2 xrefs:
// > sub_100574A1C @ 0x10057529c
// > sub_100575DC0 @ 0x1005763cc
//
// 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
//
__int64 __fastcall sub_100577708(_DWORD *a1)
{
_QWORD *v2; // x9
const char *v3; // x8
const char *v4; // x9
__int64 v5; // x20
const char *v6; // x20
__int64 v7; // x21
__int64 v8; // x22
_BYTE *i; // x8
__int64 v10; // x11
int v11; // w9
size_t v12; // x22
char *v13; // x0
char *v14; // x21
char *j; // x9
int v16; // w10
__int64 v17; // x0
v2 = *(_QWORD **)(*(_QWORD *)a1 + 536LL);
v3 = (const char *)v2[7];
if ( v3 )
{
v4 = (const char *)v2[8];
if ( !v4 )
v4 = "";
v5 = sub_10057723C((__int64)a1, "%s%s", v3, v4);
LABEL_28:
if ( !(_DWORD)v5 )
{
v5 = 0;
a1[362] = 7;
}
return v5;
}
v6 = (const char *)v2[1];
if ( !v6 )
{
v17 = ((__int64 (__fastcall *)(const char *))off_10085DEC8)("");
LABEL_26:
v14 = (char *)v17;
if ( !v17 )
return 27;
LABEL_27:
v5 = sub_10057723C((__int64)a1, "LIST \"%s\" *", v14);
off_10085DEB8(v14);
goto LABEL_28;
}
v7 = 0;
v8 = 0;
for ( i = (_BYTE *)v2[1]; ; ++i )
{
v11 = (unsigned __int8)*i;
if ( !*i )
break;
if ( v11 == 34 )
v10 = v8 + 1;
else
v10 = v8;
if ( v11 == 92 )
++v7;
else
v8 = v10;
}
if ( !(v8 | v7) )
{
v17 = ((__int64 (__fastcall *)(const char *))off_10085DEC8)(v6);
goto LABEL_26;
}
v12 = v8 + v7 + strlen(v6);
v13 = (char *)off_10085DEB0(v12 + 1);
v14 = v13;
if ( v13 )
{
for ( j = v13; ; ++j )
{
v16 = *(unsigned __int8 *)v6;
if ( v16 == 34 )
goto LABEL_22;
if ( !*v6 )
{
v13[v12] = 0;
goto LABEL_27;
}
if ( v16 == 92 )
{
LABEL_22:
*j++ = 92;
LOBYTE(v16) = *v6;
}
*j = v16;
++v6;
}
}
return 27;
}