//
// sub_1004567C8 from 0x1004567c8 to 0x1004569c4 (508 bytes)
//
// 3 xrefs:
// > sub_1004535C8 @ 0x10045373c
// > sub_1004535C8 @ 0x100453888
// > sub_100456668 @ 0x100456708
//
// 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:05:23 +0000
//
__int64 __fastcall sub_1004567C8(__int64 result, const char *__src, int a3, char a4)
{
char *v4; // x19
__int64 v5; // x20
__int64 v7; // x24
int v8; // w8
unsigned int v9; // w8
__int64 v10; // x0
__int64 v11; // x2
__int64 v12; // x3
__int64 v13; // x4
__int64 v14; // x0
char v15; // w2
__int64 v16; // x2
unsigned int v17; // w9
size_t v18; // x2
v4 = (char *)__src;
v5 = result;
if ( (a4 & 0x10) != 0 )
{
v18 = sub_100453DD4(__src, (__int64)__src);
return sub_100457130(v5, v4, v18);
}
else if ( *__src )
{
while ( 1 )
{
v7 = 0;
do
v8 = byte_10076EEBD[(unsigned __int8)v4[v7++]];
while ( (v8 & a3) == 0 );
result = sub_100457130(v5, v4, v7 - 1);
v4 += v7;
v9 = (unsigned __int8)*(v4 - 1);
if ( v9 <= 0x3B )
break;
if ( v9 == 60 )
{
v14 = v5;
v15 = 108;
}
else
{
if ( v9 != 62 )
goto LABEL_18;
v14 = v5;
v15 = 103;
}
result = sub_100456734(v14, 38, v15, 116, 59);
LABEL_21:
if ( !*v4 )
return result;
}
if ( v9 == 34 )
{
v16 = *(_QWORD *)(v5 + 10248);
if ( (unsigned __int64)(v16 - 2043) <= 0xFFFFFFFFFFFFF7FELL )
{
result = sub_100456B3C(v5, v5, v16);
v16 = 0;
*(_QWORD *)(v5 + 10248) = 0;
}
*(_BYTE *)(v5 + v16) = 38;
*(_BYTE *)(*(_QWORD *)(v5 + 10248) + v5 + 1) = 113;
*(_BYTE *)(*(_QWORD *)(v5 + 10248) + v5 + 2) = 117;
*(_BYTE *)(*(_QWORD *)(v5 + 10248) + v5 + 3) = 111;
*(_BYTE *)(*(_QWORD *)(v5 + 10248) + v5 + 4) = 116;
*(_BYTE *)(*(_QWORD *)(v5 + 10248) + v5 + 5) = 59;
*(_QWORD *)(v5 + 10248) += 6LL;
goto LABEL_21;
}
if ( v9 == 38 )
{
v10 = v5;
v11 = 97;
v12 = 109;
v13 = 112;
}
else
{
if ( !*(v4 - 1) )
return result;
LABEL_18:
if ( v9 >= 0x20 )
sub_100755B08(result);
v17 = (unsigned __int8)*(v4 - 1) / 0xAu;
v13 = (unsigned int)(char)((v9 - 10 * v17) | 0x30);
v12 = v17 | 0x30;
v10 = v5;
v11 = 35;
}
result = sub_100456A98(v10, 38, v11, v12, v13, 59);
goto LABEL_21;
}
return result;
}