//
// tinyxml2::XMLPrinter::PrintString from 0x5ef060 to 0x5ef10c (172 bytes)
//
// 2 xrefs:
// > tinyxml2::XMLPrinter::PushAttribute @ 0x5ef134
// > tinyxml2::XMLPrinter::PushText @ 0x5ef414
//
// 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 tinyxml2::XMLPrinter::PrintString(int this, const char *a2, int a3)
{
const char *v3; // r3
tinyxml2::XMLPrinter *v4; // r5
int v5; // r6
const char *v6; // r4
int v7; // r2
const char *v8; // r7
int v9; // r3
int v10; // r3
v3 = a2;
v4 = (tinyxml2::XMLPrinter *)this;
if ( a3 )
v5 = this + 86;
else
v5 = this + 22;
v6 = a2;
if ( *(_BYTE *)(this + 20) )
{
while ( 1 )
{
v7 = *(unsigned __int8 *)v6;
if ( !*v6 )
goto LABEL_23;
if ( (unsigned int)(v7 - 1) <= 0x3E && *(_BYTE *)(v5 + v7) )
break;
LABEL_22:
++v6;
}
while ( 1 )
{
v8 = v3 + 1;
if ( v3 >= v6 )
break;
this = tinyxml2::XMLPrinter::Print(v4, "%c", *(unsigned __int8 *)v3);
v3 = v8;
}
v9 = *(unsigned __int8 *)v6;
switch ( v9 )
{
case '"':
v10 = 0;
break;
case '&':
v10 = 1;
break;
case '\'':
v10 = 2;
break;
case '<':
v10 = 3;
break;
case '>':
v10 = 4;
break;
default:
LABEL_21:
v3 = v8;
goto LABEL_22;
}
this = tinyxml2::XMLPrinter::Print(v4, "&%s;", (&off_A2CD80)[3 * v10]);
goto LABEL_21;
}
LABEL_23:
if ( !*((_BYTE *)v4 + 20) || v6 - v3 > 0 )
return tinyxml2::XMLPrinter::Print(v4, "%s", v3);
return this;
}