//
// sub_1005A08A0 from 0x1005a08a0 to 0x1005a0b94 (756 bytes)
//
// 1 xrefs:
// > sub_10059F900 @ 0x10059fb44
//
// 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 11:09:01 +0000
//
__int64 __fastcall sub_1005A08A0(__int64 a1)
{
__int64 result; // x0
int v3; // w8
const char *v4; // x2
__int64 v5; // x4
_BYTE *v6; // x3
__int64 v7; // x0
int v8; // w9
__int64 v9; // x23
int v10; // w9
__int64 v11; // x9
_BYTE *v12; // x8
int v13; // w10
int v14; // w0
int v15; // [xsp+8h] [xbp-668h] BYREF
int v16; // [xsp+Ch] [xbp-664h] BYREF
_BYTE v17[5]; // [xsp+10h] [xbp-660h] BYREF
_BYTE v18[3]; // [xsp+15h] [xbp-65Bh] BYREF
_BYTE v19[512]; // [xsp+210h] [xbp-460h] BYREF
_BYTE v20[512]; // [xsp+410h] [xbp-260h] BYREF
v15 = 512;
v16 = 512;
result = sub_1005D0A20(*(_QWORD *)(a1 + 368), 0, 0);
if ( !(_DWORD)result )
{
result = sub_1005A0C7C(a1, v20, &v16, 0, 0);
if ( !(_DWORD)result )
{
if ( (unsigned int)sub_1005ED1C4("?XML VERSION", v20, 12) )
return 19;
if ( (unsigned int)sub_1005ED1C4("ENTRY PLAYSTRING=", v20, 16) )
{
while ( 1 )
{
v15 = 512;
v16 = 512;
if ( (unsigned int)sub_1005A0C7C(a1, v20, &v16, v19, &v15) )
return 19;
v20[v16] = 0;
v19[v15] = 0;
if ( !(unsigned int)sub_1005ED1C4("ENTRY PLAYSTRING=", v20, 16) )
{
v3 = v15;
goto LABEL_10;
}
}
}
v3 = 512;
LABEL_10:
if ( !v3 )
goto LABEL_15;
LABEL_11:
v4 = (const char *)sub_1005ED0C0(v20);
v5 = (unsigned int)(v15 + 1);
v6 = v19;
v7 = a1;
LABEL_12:
sub_100586064(v7, 8, (__int64)v4, (__int64)v6, v5, 3, 0);
while ( 1 )
{
v15 = 512;
v16 = 512;
if ( (unsigned int)sub_1005A0C7C(a1, v20, &v16, v19, &v15) )
return 0;
v20[v16] = 0;
v3 = v15;
v19[v15] = 0;
if ( v3 )
goto LABEL_11;
LABEL_15:
v8 = 0;
do
{
if ( v3 <= 511 )
v8 = (unsigned __int8)v20[v3++];
}
while ( v8 != 34 );
v9 = 0;
if ( v3 <= 510 )
v10 = 510;
else
v10 = v3;
v11 = (unsigned int)(v10 - v3 + 1);
v12 = &v20[v3];
while ( 1 )
{
v13 = (unsigned __int8)v12[v9];
if ( v13 == 34 )
break;
v17[v9++] = v13;
if ( v11 == v9 )
{
LODWORD(v9) = v11;
break;
}
}
v17[(int)v9] = 0;
if ( !(unsigned int)sub_1005ED1C4("ENTRY PLAYSTRING=", v20, 17) )
{
v14 = sub_1005ED1C4("FILE:", v17, 5);
v5 = (unsigned int)(v9 + 1);
if ( v14 )
{
v6 = v17;
v7 = a1;
v4 = "FILE";
}
else
{
v7 = a1;
v4 = "FILE";
v6 = v18;
}
goto LABEL_12;
}
if ( !(unsigned int)sub_1005ED1C4("NAME", v20, 13) )
{
v5 = (unsigned int)(v9 + 1);
v6 = v17;
v7 = a1;
v4 = "NAME";
goto LABEL_12;
}
if ( !(unsigned int)sub_1005ED1C4("LENGTH", v20, 14) )
{
v5 = (unsigned int)(v9 + 1);
v6 = v17;
v7 = a1;
v4 = "LENGTH";
goto LABEL_12;
}
}
}
}
return result;
}