//
// sub_10047A220 from 0x10047a220 to 0x10047a4ec (716 bytes)
//
// 1 xrefs:
// > sub_100479798 @ 0x1004799bc
//
// 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_10047A220(__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; // w8
int v15; // [xsp+8h] [xbp-668h] BYREF
int v16; // [xsp+Ch] [xbp-664h] BYREF
_BYTE v17[512]; // [xsp+10h] [xbp-660h] BYREF
_BYTE v18[512]; // [xsp+210h] [xbp-460h] BYREF
_BYTE v19[512]; // [xsp+410h] [xbp-260h] BYREF
v16 = 512;
result = sub_1004AA8B8(*(_QWORD *)(a1 + 368), 0, 0);
if ( !(_DWORD)result )
{
result = sub_10047AB14(a1, v19, &v16, 0, 0);
if ( !(_DWORD)result )
{
if ( (unsigned int)sub_1004C705C("ASX VERSION", v19, 11) )
return 19;
v15 = 512;
v16 = 512;
if ( (unsigned int)sub_10047AB14(a1, v19, &v16, v18, &v15) )
return 0;
while ( 1 )
{
v19[v16] = 0;
v18[v15] = 0;
if ( !(unsigned int)sub_1004C705C("ENTRY", v19, 5) )
break;
v3 = v15;
if ( v15 )
{
v4 = (const char *)sub_1004C6F58(v19);
v5 = (unsigned int)(v15 + 1);
v6 = v18;
goto LABEL_33;
}
v8 = 0;
do
{
if ( v3 <= 511 )
v8 = (unsigned __int8)v19[v3++];
}
while ( v8 != 34 );
v9 = 0;
if ( v3 <= 510 )
v10 = 510;
else
v10 = v3;
v11 = (unsigned int)(v10 - v3 + 1);
v12 = &v19[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_1004C705C("REF HREF", v19, 8) )
{
v4 = "FILE";
goto LABEL_32;
}
if ( !(unsigned int)sub_1004C705C("MOREINFO HREF", v19, 13) )
{
v4 = "MOREINFO";
goto LABEL_32;
}
if ( !(unsigned int)sub_1004C705C("DURATION VALUE", v19, 14) )
{
v4 = "DURATION";
goto LABEL_32;
}
if ( !(unsigned int)sub_1004C705C("LOGO HREF", v19, 9) )
{
v4 = "LOGO";
LABEL_32:
v5 = (unsigned int)(v9 + 1);
v6 = v17;
LABEL_33:
v7 = a1;
LABEL_34:
sub_10045FEFC(v7, 8, (__int64)v4, (__int64)v6, v5, 6, 0);
goto LABEL_35;
}
if ( !(unsigned int)sub_1004C705C("BANNER HREF", v19, 11) )
{
v4 = "BANNER";
goto LABEL_32;
}
LABEL_35:
v15 = 512;
v16 = 512;
v14 = sub_10047AB14(a1, v19, &v16, v18, &v15);
result = 0;
if ( v14 )
return result;
}
v7 = a1;
v4 = "ENTRY";
v6 = nullptr;
v5 = 0;
goto LABEL_34;
}
}
return result;
}