//
// pugi::xml_document::save from 0x8153bc to 0x8154c2 (262 bytes)
//
// 5 xrefs:
// > pugi::xml_document::save @ 0x8154fa
// > pugi::xml_document::save @ 0x81553e
// > pugi::xml_document::save_file @ 0x8155a2
// > pugi::xml_document::save_file @ 0x815626
// > pugi::xml_document::save_string @ 0x81aa00
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:41 +0000
//
int __fastcall pugi::xml_document::save(pugi::xml_node *this, int a2, char *a3, int a4, int a5)
{
int v8; // r3
char *v9; // r0
int v10; // r1
void (*i)(); // [sp+Ch] [bp-2814h] BYREF
_DWORD v13[2564]; // [sp+10h] [bp-2810h] BYREF
v13[2560] = a2;
v13[2561] = 0;
switch ( a5 )
{
case 8:
goto LABEL_8;
case 4:
v8 = 2;
goto LABEL_9;
case 7:
LABEL_8:
v8 = 5;
goto LABEL_9;
}
if ( a5 )
v8 = a5;
else
v8 = 1;
LABEL_9:
v13[2562] = v8;
if ( (a4 & 2) != 0 && a5 != 9 )
sub_810F3E((int)v13, 239, 187, 191);
if ( (a4 & 8) == 0 )
{
for ( i = (void (*)())pugi::xml_node::first_child(this, a2);
pugi::xml_node::operator void (*)(pugi::xml_node***)(&i);
i = (void (*)())pugi::xml_node::next_sibling((pugi::xml_node *)&i, v10) )
{
v9 = (char *)pugi::xml_node::type((pugi::xml_node *)&i);
if ( v9 == &byte_7 )
goto LABEL_22;
if ( v9 == (_BYTE *)&dword_0 + 2 )
break;
}
sub_8113FE((int)v13, "