//
// sub_10064A860 from 0x10064a860 to 0x10064a9d4 (372 bytes)
//
// 2 xrefs:
// > sub_100648250 @ 0x1006489b2
// > sub_10064A860 @ 0x10064a990
//
// 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
//
unsigned __int8 *__fastcall sub_10064A860(__int64 a1, _BYTE *a2, char a3, unsigned __int8 a4)
{
unsigned __int8 *result; // rax
unsigned __int8 v7; // cl
__int64 v8; // rdx
char v9; // dl
int v10; // ecx
int v11; // ecx
if ( *a2 != 60 && *a2 || a2[1] != 33 )
sub_1007CE3D0();
result = a2 + 1;
v7 = 33;
LABEL_7:
while ( 2 )
{
v8 = v7;
switch ( v7 )
{
case '"':
case '\'':
++result;
do
v9 = *result++;
while ( v9 && v9 != v7 );
if ( v9 )
goto LABEL_12;
--result;
goto LABEL_38;
case '#':
case '$':
case '%':
case '&':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
goto LABEL_6;
case '<':
v10 = result[1];
if ( v10 == 63 )
{
for ( result += 2; ; ++result )
{
if ( *result == 63 )
{
if ( result[1] == 62 )
{
result += 2;
v7 = *result;
goto LABEL_7;
}
}
else if ( !*result )
{
goto LABEL_38;
}
}
}
if ( v10 != 33 )
goto LABEL_38;
v11 = result[2];
if ( v11 == 45 )
{
if ( result[3] != 45 )
{
LABEL_38:
*(_QWORD *)(a1 + 16) = result;
*(_DWORD *)(a1 + 24) = 9;
return nullptr;
}
for ( result += 4; *result != 45; ++result )
{
if ( !*result )
goto LABEL_38;
LABEL_29:
;
}
if ( result[1] != 45 || result[2] != 62 )
goto LABEL_29;
result += 4;
LABEL_12:
v7 = *result;
continue;
}
if ( v11 == 91 )
{
result = (unsigned __int8 *)sub_10064AA50(a1, result, v8);
if ( result )
goto LABEL_12;
}
else
{
result = (unsigned __int8 *)sub_10064A860(a1, result, (unsigned int)a3, 0);
if ( result )
{
if ( *result != 62 )
sub_1007CE3A0();
LABEL_6:
v7 = *++result;
continue;
}
}
return nullptr;
case '>':
return result;
default:
if ( v7 )
goto LABEL_6;
if ( (a4 & (a3 == 62)) != 0 )
return result;
goto LABEL_38;
}
}
}