//
// pugi::xml_node::print from 0xdca19c to 0xdca7dc (1600 bytes)
//
// 3 xrefs:
// > pugi::xml_node::print @ 0xdca834
// > pugi::xml_node::print @ 0xdca8b4
// > ??> @ 0x59068
//
// This function is hookable on this platform (idp: arm, 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 13:08:54 +0000
//
__int64 __fastcall pugi::xml_node::print(
pugi::xml_node *a1,
__int64 a2,
char *a3,
unsigned int a4,
int a5,
unsigned int a6)
{
int v6; // w6
unsigned __int64 v7; // x3
int v8; // w22
int *v10; // x1
unsigned __int8 *v11; // x0
int v12; // w2
bool v13; // zf
unsigned __int8 v14; // w2
unsigned __int8 v15; // w4
unsigned __int8 v16; // w4
unsigned __int8 v17; // w5
int v18; // w2
int *v19; // x2
unsigned __int8 *v20; // x0
int v21; // w1
__int16 v22; // w1
uint16x8_t *v23; // x4
unsigned __int64 v24; // x3
unsigned __int64 v25; // x0
unsigned __int64 v26; // x1
unsigned __int64 v27; // x5
unsigned __int64 v28; // x5
unsigned __int64 v29; // x1
unsigned __int8 v30; // w4
unsigned __int8 v31; // w4
unsigned __int8 v32; // w5
unsigned __int8 v33; // w4
unsigned __int8 v34; // w5
unsigned __int8 v35; // w6
int v36; // w4
int v37; // w2
signed __int64 v38; // x2
unsigned int *v39; // x1
__int64 v40; // x3
unsigned __int8 v41[2048]; // [xsp+40h] [xbp+40h] BYREF
int v42[8]; // [xsp+840h] [xbp+840h] BYREF
__int64 v43; // [xsp+2840h] [xbp+2840h]
unsigned __int64 v44; // [xsp+2848h] [xbp+2848h]
int v45; // [xsp+2850h] [xbp+2850h]
if ( !*(_QWORD *)a1 )
return _stack_chk_guard;
v43 = a2;
v44 = 0;
if ( a5 != 8 )
{
if ( a5 == 4 )
{
v6 = 2;
goto LABEL_8;
}
if ( a5 != 7 )
{
if ( a5 )
v6 = a5;
else
v6 = 1;
goto LABEL_8;
}
}
v6 = 5;
LABEL_8:
v45 = v6;
sub_DC5D74((__int64)v41, a1, a3, a4, a6);
v7 = v44;
if ( !v44 )
return _stack_chk_guard;
v8 = v45;
if ( v45 == 1 )
{
(*(void (__fastcall **)(__int64, unsigned __int8 *, unsigned __int64))(*(_QWORD *)v43 + 16LL))(v43, v41, v44);
return _stack_chk_guard;
}
if ( (unsigned int)(v45 - 2) > 1 )
{
if ( (unsigned int)(v45 - 5) <= 1 )
{
v38 = (char *)sub_DBE2E0(v41, v44, v42) - (char *)v42;
if ( v8 != 5 && v38 >> 2 )
{
v39 = (unsigned int *)v42;
v40 = 0;
do
{
++v40;
*v39 = bswap32(*v39);
++v39;
}
while ( v38 >> 2 != v40 );
}
goto LABEL_13;
}
if ( v45 != 9 )
goto LABEL_13;
v10 = v42;
v11 = v41;
while ( 1 )
{
LABEL_19:
while ( 1 )
{
v12 = *v11;
if ( (v12 & 0x80) == 0 )
break;
if ( (unsigned int)(v12 - 192) > 0x1F || v7 <= 1 )
{
if ( (unsigned int)(v12 - 224) > 0xF || v7 <= 2 )
{
if ( (unsigned int)(v12 - 240) <= 7
&& v7 > 3
&& (v11[1] & 0xC0) == 0x80
&& (v11[2] & 0xC0) == 0x80
&& (v11[3] & 0xC0) == 0x80 )
{
*(_BYTE *)v10 = 63;
v10 = (int *)((char *)v10 + 1);
v11 += 4;
v7 -= 4LL;
goto LABEL_26;
}
}
else
{
v16 = v11[1];
if ( (v16 & 0xC0) == 0x80 )
{
v17 = v11[2];
if ( (v17 & 0xC0) == 0x80 )
{
v18 = ((v12 & 0x1F) << 12) | ((v16 & 0x3F) << 6) | v17 & 0x3F;
v11 += 3;
v7 -= 3LL;
if ( v18 > 255 )
LOBYTE(v18) = 63;
*(_BYTE *)v10 = v18;
v10 = (int *)((char *)v10 + 1);
goto LABEL_26;
}
}
}
}
else
{
v15 = v11[1];
if ( (v15 & 0xC0) == 0x80 )
{
v37 = ((v12 & 0x3F) << 6) | v15 & 0x3F;
v11 += 2;
v7 -= 2LL;
if ( v37 > 255 )
LOBYTE(v37) = 63;
*(_BYTE *)v10 = v37;
v10 = (int *)((char *)v10 + 1);
goto LABEL_26;
}
}
++v11;
--v7;
LABEL_26:
if ( !v7 )
goto LABEL_13;
}
*(_BYTE *)v10 = v12;
v10 = (int *)((char *)v10 + 1);
--v7;
if ( ((unsigned __int64)(v11 + 1) & 3) != 0 || v7 <= 3 )
{
++v11;
goto LABEL_26;
}
v13 = (*(_DWORD *)++v11 & 0x80808080) == 0;
if ( v13 )
{
while ( 1 )
{
v14 = *v11;
v11 += 4;
*(_BYTE *)v10++ = v14;
v7 -= 4LL;
*((_BYTE *)v10 - 3) = *(v11 - 3);
*((_BYTE *)v10 - 2) = *(v11 - 2);
*((_BYTE *)v10 - 1) = *(v11 - 1);
if ( v7 <= 3 )
goto LABEL_26;
if ( (*(_DWORD *)v11 & 0x80808080) != 0 )
goto LABEL_19;
}
}
}
}
v19 = v42;
v20 = v41;
do
{
LABEL_47:
while ( 1 )
{
v21 = *v20;
if ( (v21 & 0x80) != 0 )
break;
*(_WORD *)v19 = v21;
v19 = (int *)((char *)v19 + 2);
--v7;
if ( ((unsigned __int64)(v20 + 1) & 3) != 0 || v7 <= 3 )
{
++v20;
goto LABEL_54;
}
v13 = (*(_DWORD *)++v20 & 0x80808080) == 0;
if ( v13 )
{
while ( 1 )
{
v22 = *v20;
v20 += 4;
*(_WORD *)v19 = v22;
v19 += 2;
v7 -= 4LL;
*((_WORD *)v19 - 3) = *(v20 - 3);
*((_WORD *)v19 - 2) = *(v20 - 2);
*((_WORD *)v19 - 1) = *(v20 - 1);
if ( v7 <= 3 )
goto LABEL_54;
if ( (*(_DWORD *)v20 & 0x80808080) != 0 )
goto LABEL_47;
}
}
}
if ( (unsigned int)(v21 - 192) > 0x1F || v7 <= 1 )
{
if ( (unsigned int)(v21 - 224) > 0xF || v7 <= 2 )
{
if ( (unsigned int)(v21 - 240) > 7
|| v7 <= 3
|| (v33 = v20[1], (v33 & 0xC0) != 0x80)
|| (v34 = v20[2], (v34 & 0xC0) != 0x80)
|| (v35 = v20[3], (v35 & 0xC0) != 0x80) )
{
LABEL_72:
++v20;
--v7;
continue;
}
v36 = ((v21 & 0xF) << 18) | ((v34 & 0x3F) << 6) | v35 & 0x3F | ((v33 & 0x3F) << 12);
*((_WORD *)++v19 - 1) = (v36 & 0x3FF) - 9216;
*((_WORD *)v19 - 2) = ((unsigned int)(v36 - 0x10000) >> 10) - 10240;
v20 += 4;
v7 -= 4LL;
}
else
{
v31 = v20[1];
if ( (v31 & 0xC0) != 0x80 )
goto LABEL_72;
v32 = v20[2];
if ( (v32 & 0xC0) != 0x80 )
goto LABEL_72;
v20 += 3;
*(_WORD *)v19 = ((v21 & 0x1F) << 12) | ((v31 & 0x3F) << 6) | v32 & 0x3F;
v19 = (int *)((char *)v19 + 2);
v7 -= 3LL;
}
}
else
{
v30 = v20[1];
if ( (v30 & 0xC0) != 0x80 )
goto LABEL_72;
v20 += 2;
*(_WORD *)v19 = ((v21 & 0x3F) << 6) | v30 & 0x3F;
v19 = (int *)((char *)v19 + 2);
v7 -= 2LL;
}
LABEL_54:
;
}
while ( v7 );
if ( v8 != 2 )
{
v23 = (uint16x8_t *)v42;
v24 = ((char *)v19 - (char *)v42) >> 1;
if ( v24 )
{
v25 = ((v24 - 8) >> 3) + 1;
v26 = 8 * v25;
if ( v24 - 1 <= 6 )
{
v26 = 0;
LABEL_61:
LOWORD(v42[v26 / 2]) = (unsigned __int8)HIBYTE(LOWORD(v42[v26 / 2]))
| (unsigned __int16)(LOWORD(v42[v26 / 2]) << 8);
if ( v24 > v26 + 1 )
{
HIWORD(v42[v26 / 2]) = (unsigned __int8)HIBYTE(HIWORD(v42[v26 / 2]))
| (unsigned __int16)(HIWORD(v42[v26 / 2]) << 8);
if ( v24 > v26 + 2 )
{
LOWORD(v42[v26 / 2 + 1]) = (unsigned __int8)HIBYTE(LOWORD(v42[v26 / 2 + 1]))
| (unsigned __int16)(LOWORD(v42[v26 / 2 + 1]) << 8);
if ( v24 > v26 + 3 )
{
HIWORD(v42[v26 / 2 + 1]) = (unsigned __int8)HIBYTE(HIWORD(v42[v26 / 2 + 1]))
| (unsigned __int16)(HIWORD(v42[v26 / 2 + 1]) << 8);
if ( v24 > v26 + 4 )
{
v28 = v26 + 5;
LOWORD(v42[v26 / 2 + 2]) = (unsigned __int8)HIBYTE(LOWORD(v42[v26 / 2 + 2]))
| (unsigned __int16)(LOWORD(v42[v26 / 2 + 2]) << 8);
if ( v24 > v26 + 5 )
{
v29 = v26 + 6;
*((_WORD *)v42 + v28) = (unsigned __int8)HIBYTE(*((_WORD *)v42 + v28))
| (unsigned __int16)(*((_WORD *)v42 + v28) << 8);
if ( v24 > v29 )
*((_WORD *)v42 + v29) = (unsigned __int8)HIBYTE(*((_WORD *)v42 + v29))
| (unsigned __int16)(*((_WORD *)v42 + v29) << 8);
}
}
}
}
}
}
else
{
v27 = 0;
do
{
++v27;
*v23 = vorrq_s8(vshlq_n_s16(*v23, 8u), vshrq_n_u16(*v23, 8u));
++v23;
}
while ( v25 > v27 );
if ( v24 != v26 )
goto LABEL_61;
}
}
}
LABEL_13:
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v43 + 16LL))(v43, v42);
return _stack_chk_guard;
}