//
// sub_180085B00 from 0x180085b00 to 0x180085c90 (400 bytes)
//
// 3 xrefs:
// > sub_180085B00 @ 0x180085b69
// > sub_180085EC0 @ 0x18008630a
// > ??> @ 0x1801bf6d0
//
// This function is hookable on this platform (idp: pc, 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:22:04 +0000
//
char *__fastcall sub_180085B00(__int64 a1, __int64 a2, unsigned __int8 a3, char a4)
{
char *result; // rax
char v6; // dl
char v9; // cl
__int64 v10; // rax
char v11; // dl
char v12; // cl
char v13; // cl
char v14; // dl
char *v15; // rcx
char v16; // cl
result = (char *)(a2 + 1);
v6 = *(_BYTE *)(a2 + 1);
if ( v6 )
{
do
{
if ( v6 == 60 && result[1] == 33 && (v9 = result[2], v9 != 45) )
{
if ( v9 == 91 )
{
result = (char *)sub_180085C90(a1, result);
if ( !result )
return nullptr;
}
else
{
v10 = sub_180085B00(a1, result, a3, 0);
if ( !v10 )
return nullptr;
result = (char *)(v10 + 1);
}
}
else
{
v11 = *result;
if ( *result == 60 )
{
v13 = result[1];
if ( v13 == 63 )
{
v14 = result[2];
result += 2;
if ( !v14 )
goto LABEL_44;
while ( 1 )
{
v15 = result + 1;
if ( v14 == 63 && *v15 == 62 )
break;
v14 = *v15;
++result;
if ( !*v15 )
goto LABEL_44;
}
if ( !*result )
goto LABEL_44;
result += 2;
}
else
{
if ( v13 != 33 )
goto LABEL_44;
if ( result[2] != 45 )
goto LABEL_44;
if ( result[3] != 45 )
goto LABEL_44;
v16 = result[4];
result += 4;
if ( !v16 )
goto LABEL_44;
while ( v16 != 45 || result[1] != 45 || result[2] != 62 )
{
v16 = *++result;
if ( !v16 )
goto LABEL_44;
}
if ( !*result )
goto LABEL_44;
result += 4;
}
goto LABEL_40;
}
if ( v11 == 34 || v11 == 39 )
{
v12 = *++result;
if ( !v12 )
goto LABEL_44;
while ( v12 != v11 )
{
v12 = *++result;
if ( !v12 )
goto LABEL_44;
}
if ( !*result )
goto LABEL_44;
++result;
LABEL_40:
if ( !result )
return result;
goto LABEL_41;
}
if ( v11 == 62 )
return result;
++result;
}
LABEL_41:
v6 = *result;
}
while ( *result );
}
if ( !a4 || a3 != 62 )
{
LABEL_44:
*(_DWORD *)(a1 + 24) = 9;
*(_QWORD *)(a1 + 16) = result;
return nullptr;
}
return result;
}