//
// sub_1005A0114 from 0x1005a0114 to 0x1005a0388 (628 bytes)
//
// 1 xrefs:
// > sub_10059F900 @ 0x10059fb14
//
// 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_1005A0114(__int64 a1)
{
__int64 result; // x0
__int64 v3; // x4
char *v4; // x3
__int64 v5; // x0
const char *v6; // x2
__int64 v7; // x5
int v8; // w8
int v9; // [xsp+8h] [xbp-268h] BYREF
int v10; // [xsp+Ch] [xbp-264h] BYREF
char v11[512]; // [xsp+10h] [xbp-260h] BYREF
result = sub_1005D0A20(*(_QWORD *)(a1 + 368), 0, 0);
if ( !(_DWORD)result )
{
if ( (unsigned int)sub_1005A0F7C(a1, v11, 512, 0) || (unsigned int)sub_1005ED1C4(v11, "[playlist]", 10) )
return 19;
if ( (unsigned int)sub_1005A0F7C(a1, v11, 512, 0) )
return 0;
while ( (unsigned int)sub_1005ED1C4("File", v11, 4) )
{
if ( !(unsigned int)sub_1005ED1C4("Title", v11, 5) )
{
if ( (unsigned int)sub_1005A0F7C(a1, v11, 512, &v10) )
return 0;
v3 = (unsigned int)(v10 + 1);
v4 = v11;
v5 = a1;
v6 = "TITLE";
LABEL_11:
v7 = 3;
LABEL_12:
sub_100586064(v5, 8, (__int64)v6, (__int64)v4, v3, v7, 0);
goto LABEL_13;
}
if ( !(unsigned int)sub_1005ED1C4("Length", v11, 6) )
{
v9 = 0;
if ( (unsigned int)sub_1005A0F7C(a1, v11, 512, &v10) )
return 0;
v11[v10] = 0;
v9 = atoi(v11);
v4 = (char *)&v9;
v5 = a1;
v6 = "LENGTH";
v3 = 4;
v7 = 1;
goto LABEL_12;
}
if ( (!(unsigned int)sub_1005ED1C4("NumberOfEntries", v11, 15) || !(unsigned int)sub_1005ED1C4("Version", v11, 7))
&& (unsigned int)sub_1005A0F7C(a1, v11, 512, 0) )
{
return 0;
}
LABEL_13:
v8 = sub_1005A0F7C(a1, v11, 512, 0);
result = 0;
if ( v8 )
return result;
}
if ( (unsigned int)sub_1005A0F7C(a1, v11, 512, &v10) )
return 0;
v3 = (unsigned int)(v10 + 1);
v4 = v11;
v5 = a1;
v6 = "FILE";
goto LABEL_11;
}
return result;
}