//
// sub_601446 from 0x601446 to 0x6014b8 (114 bytes)
//
// 3 xrefs:
// > sub_6049F4 @ 0x604a26
// > sub_605C00 @ 0x605c8e
// > pugi::xml_document::load @ 0x605f4c
//
// 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
//
int __fastcall sub_601446(int result, unsigned __int8 *a2, unsigned int a3)
{
int v3; // r3
int v4; // r2
int v5; // r0
int v6; // r1
bool v7; // zf
bool v8; // zf
switch ( result )
{
case 8:
return 5;
case 4:
return 2;
case 7:
return 5;
}
if ( result )
return result;
if ( a3 <= 3 )
return 1;
v3 = *a2;
v4 = a2[1];
v5 = a2[2];
v6 = a2[3];
switch ( v3 )
{
case 0:
if ( !v4 )
{
if ( v5 == 254 )
{
v7 = v6 == 255;
goto LABEL_15;
}
if ( !v5 )
{
v7 = v6 == 60;
LABEL_15:
if ( v7 )
return 6;
else
return 1;
}
return 1;
}
v8 = v4 == 60;
goto LABEL_25;
case 255:
if ( v4 != 254 )
return 1;
break;
case 254:
v8 = v4 == 255;
LABEL_25:
if ( v8 )
return 3;
else
return 1;
default:
if ( v3 != 60 || v4 )
return 1;
break;
}
if ( v5 )
return 2;
if ( v6 )
return 2;
else
return 5;
}