//
// sub_10047E2E8 from 0x10047e2e8 to 0x10047e584 (668 bytes)
//
// 1 xrefs:
// > sub_10047E254 @ 0x10047e288
//
// 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_10047E2E8(__int64 a1)
{
__int64 result; // x0
__int64 v3; // x22
int v4; // w8
__int64 v5; // x0
int v6; // w23
__int64 v7; // x22
int v8; // [xsp+0h] [xbp-50h] BYREF
unsigned int v9; // [xsp+4h] [xbp-4Ch] BYREF
_BYTE v10[16]; // [xsp+8h] [xbp-48h] BYREF
if ( (unsigned int)sub_1004AA8B8(*(_QWORD *)(a1 + 368), 4294967168LL, 2) )
{
LABEL_2:
result = sub_1004AA8B8(*(_QWORD *)(a1 + 368), 0, 0);
if ( !(_DWORD)result )
{
result = sub_1004AA0BC(*(_QWORD *)(a1 + 368), v10, 1, 16, &v8);
if ( !(_DWORD)result )
{
v3 = 0;
while ( v8 == 16 )
{
if ( (unsigned int)sub_1004C6FE8(v10, "TAG", 3) )
{
v4 = sub_1004C6FE8(v10, "ID3", 3);
v5 = *(_QWORD *)(a1 + 368);
if ( v4 )
return sub_1004AA8B8(v5, v3, 0);
result = sub_1004AA8B8(v5, 4294967283LL, 1);
if ( (_DWORD)result )
return result;
result = sub_10047E9E8(a1);
if ( (_DWORD)result )
return result;
}
else
{
result = sub_1004AA8B8(*(_QWORD *)(a1 + 368), 4294967283LL, 1);
if ( (_DWORD)result )
return result;
result = sub_10047E584(a1);
if ( (_DWORD)result )
return result;
}
result = sub_1004AAA30(*(_QWORD *)(a1 + 368), &v9);
if ( !(_DWORD)result )
{
v3 = v9;
result = sub_1004AA0BC(*(_QWORD *)(a1 + 368), v10, 1, 16, &v8);
if ( !(_DWORD)result )
continue;
}
return result;
}
return 13;
}
}
}
else
{
v6 = 0;
LODWORD(v7) = -128;
while ( 1 )
{
result = sub_1004AA0BC(*(_QWORD *)(a1 + 368), v10, 1, 3, &v8);
if ( (_DWORD)result )
break;
if ( v8 != 3 )
return 13;
if ( (unsigned int)sub_1004C6FE8(v10, "TAG", 3) )
{
result = sub_1004AA8B8(*(_QWORD *)(a1 + 368), (unsigned int)(v6 - 10), 2);
if ( (_DWORD)result )
{
if ( (_DWORD)result == 14 )
goto LABEL_2;
return result;
}
result = sub_1004AA0BC(*(_QWORD *)(a1 + 368), v10, 1, 3, &v8);
if ( (_DWORD)result )
return result;
if ( v8 != 3 )
return 13;
if ( (unsigned int)sub_1004C6FE8(v10, "3DI", 3) )
goto LABEL_2;
result = sub_10047E8CC(a1);
if ( (_DWORD)result )
return result;
result = sub_1004AAA30(*(_QWORD *)(a1 + 368), &v9);
if ( (_DWORD)result )
return result;
LODWORD(v7) = v9;
}
else
{
result = sub_10047E584(a1);
if ( (_DWORD)result )
return result;
result = sub_1004AAA30(*(_QWORD *)(a1 + 368), &v9);
if ( (_DWORD)result )
return result;
if ( v9 < 0x81 )
goto LABEL_2;
}
v6 = v7;
v7 = (unsigned int)(v7 - 128);
if ( (unsigned int)sub_1004AA8B8(*(_QWORD *)(a1 + 368), v7, 2) )
goto LABEL_2;
}
}
return result;
}