//
// sub_1004563E0 from 0x1004563e0 to 0x100456590 (432 bytes)
//
// 2 xrefs:
// > sub_1004544E4 @ 0x100454b10
// > sub_1004563E0 @ 0x10045652c
//
// 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
//
unsigned __int8 *__fastcall sub_1004563E0(__int64 a1, unsigned __int8 *a2, __int64 a3, char a4)
{
int v4; // w8
bool v5; // zf
int v6; // w8
int v7; // t1
int v11; // w8
int v12; // w8
int v13; // w9
int v14; // t1
bool v15; // zf
_BYTE *v16; // x0
v4 = *a2;
v5 = v4 == 60 || v4 == 0;
if ( !v5 || (v7 = a2[1], ++a2, v6 = v7, v7 != 33) )
sub_100755AB8(a1, a2);
while ( v6 > 38 )
{
if ( v6 == 39 )
goto LABEL_17;
if ( v6 != 60 )
{
if ( v6 == 62 )
return a2;
goto LABEL_28;
}
v11 = a2[1];
if ( v11 == 63 )
{
for ( a2 += 2; ; ++a2 )
{
if ( *a2 == 63 )
{
if ( a2[1] == 62 )
{
a2 += 2;
goto LABEL_29;
}
}
else if ( !*a2 )
{
goto LABEL_49;
}
}
}
if ( v11 != 33 )
goto LABEL_49;
v12 = a2[2];
if ( v12 == 45 )
{
if ( a2[3] == 45 )
{
for ( a2 += 4; ; ++a2 )
{
if ( *a2 == 45 )
{
if ( a2[1] == 45 && a2[2] == 62 )
{
a2 += 4;
goto LABEL_29;
}
}
else if ( !*a2 )
{
goto LABEL_49;
}
}
}
goto LABEL_49;
}
if ( v12 == 91 )
{
a2 = (unsigned __int8 *)sub_100456590(a1);
if ( a2 )
goto LABEL_29;
return a2;
}
v16 = (_BYTE *)sub_1004563E0(a1, a2, a3, 0);
if ( !v16 )
return nullptr;
if ( *v16 != 62 )
sub_100755A90();
a2 = v16 + 1;
LABEL_29:
v6 = *a2;
}
if ( v6 != 34 )
{
if ( !v6 )
{
if ( (_DWORD)a3 == 62 && (a4 & 1) != 0 )
return a2;
goto LABEL_49;
}
LABEL_28:
++a2;
goto LABEL_29;
}
LABEL_17:
++a2;
do
{
v14 = *a2++;
v13 = v14;
if ( v14 )
v15 = v13 == v6;
else
v15 = 1;
}
while ( !v15 );
if ( v13 )
goto LABEL_29;
--a2;
LABEL_49:
*(_QWORD *)(a1 + 16) = a2;
*(_DWORD *)(a1 + 24) = 9;
return nullptr;
}