//
// sub_DD0D1C from 0xdd0d1c to 0xdd1320 (1540 bytes)
//
// 6 xrefs:
// > sub_DD0D1C @ 0xdd1144
// > sub_DD0D1C @ 0xdd1234
// > sub_DD1360 @ 0xdd139c
// > sub_DD1888 @ 0xdd19fc
// > sub_DD1888 @ 0xdd2e3c
// > sub_DD1888 @ 0xdd2f40
//
// 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:59 +0000
//
__int64 __fastcall sub_DD0D1C(__int64 *a1, __int64 *a2, __int64 a3, int a4, int a5, int a6, int a7, int a8)
{
__int64 v10; // x19
__int64 *v11; // x21
__int64 v12; // x0
__int64 *v13; // x19
__int64 v14; // x20
int v15; // w3
int v16; // w5
int v17; // w6
int v18; // w7
int v19; // w3
int v20; // w4
int v21; // w5
int v22; // w6
int v23; // w7
int v24; // w3
int v25; // w4
int v26; // w5
int v27; // w6
int v28; // w7
char *v29; // x23
__int64 *v30; // x20
__int64 *v31; // x21
char *v32; // x27
__int64 *v33; // x28
_BOOL4 v34; // w0
__int64 v35; // x5
__int64 v36; // x1
__int64 v37; // x0
__int64 v38; // x1
__int64 v39; // x0
__int64 v40; // x5
__int64 v41; // x2
__int64 v42; // x3
__int64 v43; // x1
__int64 v44; // x0
__int64 v45; // x4
__int64 v46; // x5
__int64 v47; // x1
__int64 v48; // x0
__int64 v49; // x1
__int64 v50; // x0
__int64 v51; // x5
__int64 v52; // x3
__int64 v53; // x1
__int64 v54; // x5
__int64 v55; // x7
__int64 v56; // x6
__int64 v57; // x2
__int64 v58; // x3
__int64 *v59; // x1
__int64 *v60; // x24
_QWORD *i; // x28
__int64 v62; // x3
__int64 *v63; // x21
_QWORD *v64; // x0
__int64 v65; // x3
__int64 v66; // x3
__int64 *v67; // x0
__int64 *v69; // x0
_BOOL4 v70; // w0
__int64 v71; // x1
__int64 *v72; // x19
__int64 v73; // x3
char v74; // [xsp+0h] [xbp+0h]
char v75; // [xsp+0h] [xbp+0h]
char v76; // [xsp+0h] [xbp+0h]
char v77; // [xsp+0h] [xbp+0h]
__int64 v79; // [xsp+70h] [xbp+70h] BYREF
__int64 v80; // [xsp+78h] [xbp+78h] BYREF
__int64 v81; // [xsp+80h] [xbp+80h] BYREF
__int64 v82; // [xsp+88h] [xbp+88h] BYREF
__int64 v83; // [xsp+90h] [xbp+90h]
while ( 1 )
{
v10 = (char *)a2 - (char *)a1;
if ( (char *)a2 - (char *)a1 <= 527 )
break;
LABEL_2:
v11 = a2 - 2;
v12 = (char *)(a2 - 2) - (char *)a1;
v13 = &a1[2 * (v10 >> 5)];
if ( v12 <= 655 )
{
sub_DCFD0C((pugi::xpath_node *)a1, (pugi::xpath_node *)v13, (pugi::xpath_node *)(a2 - 2), a4, a5, a6, a7, a8, v74);
}
else
{
v14 = ((v12 >> 4) + 1) >> 3;
sub_DCFD0C(
(pugi::xpath_node *)a1,
(pugi::xpath_node *)&a1[2 * v14],
(pugi::xpath_node *)&a1[2 * v14 + 2 * v14],
a4,
-16 * v14,
a6,
a7,
a8,
v74);
sub_DCFD0C(
(pugi::xpath_node *)&v13[-2 * v14],
(pugi::xpath_node *)v13,
(pugi::xpath_node *)&v13[2 * v14],
v15,
-16 * v14,
v16,
v17,
v18,
v75);
sub_DCFD0C(
(pugi::xpath_node *)&v11[-4 * v14],
(pugi::xpath_node *)&v11[-2 * v14],
(pugi::xpath_node *)(a2 - 2),
v19,
v20,
v21,
v22,
v23,
v76);
sub_DCFD0C(
(pugi::xpath_node *)&a1[2 * v14],
(pugi::xpath_node *)v13,
(pugi::xpath_node *)&v11[-2 * v14],
v24,
v25,
v26,
v27,
v28,
v77);
}
v29 = (char *)(v13 + 2);
if ( a1 != v13 )
{
while ( 1 )
{
v30 = v13 - 2;
if ( !pugi::xpath_node::operator==(v13 - 2, v13) )
break;
v13 -= 2;
if ( a1 == v30 )
{
v13 = a1;
break;
}
}
}
while ( a2 != (__int64 *)v29 && pugi::xpath_node::operator==(v29, v13) )
v29 += 16;
v31 = v13;
v32 = v29;
while ( 2 )
{
while ( 2 )
{
if ( a2 == (__int64 *)v29 )
{
LABEL_17:
if ( a1 != v31 )
break;
goto LABEL_47;
}
while ( 1 )
{
v82 = pugi::xpath_node::attribute((pugi::xpath_node *)v13);
if ( !pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v82) )
break;
v82 = pugi::xpath_node::attribute((pugi::xpath_node *)v29);
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v82) )
{
v81 = pugi::xpath_node::attribute((pugi::xpath_node *)v13);
v80 = pugi::xpath_node::attribute((pugi::xpath_node *)v29);
if ( !pugi::xml_attribute::operator<(&v81, &v80) )
goto LABEL_29;
}
LABEL_15:
v29 += 16;
LABEL_16:
if ( a2 == (__int64 *)v29 )
goto LABEL_17;
}
v82 = pugi::xpath_node::attribute((pugi::xpath_node *)v29);
if ( !pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v82) )
{
v81 = pugi::xpath_node::node((pugi::xpath_node *)v13);
v80 = pugi::xpath_node::node((pugi::xpath_node *)v29);
if ( pugi::xml_node::operator<(&v81, &v80) )
goto LABEL_15;
}
LABEL_29:
if ( pugi::xpath_node::operator==(v29, v13) )
{
v41 = *(_QWORD *)v32;
v42 = *((_QWORD *)v32 + 1);
v32 += 16;
v43 = *(_QWORD *)v29;
v44 = *((_QWORD *)v29 + 1);
v29 += 16;
*((_QWORD *)v29 - 2) = v41;
*((_QWORD *)v29 - 1) = v42;
*((_QWORD *)v32 - 2) = v43;
*((_QWORD *)v32 - 1) = v44;
goto LABEL_16;
}
v33 = a1;
if ( a1 == v31 )
{
LABEL_25:
if ( v29 != v32 )
{
v35 = *((_QWORD *)v32 + 1);
v36 = *v13;
v37 = v13[1];
*v13 = *(_QWORD *)v32;
v13[1] = v35;
*(_QWORD *)v32 = v36;
*((_QWORD *)v32 + 1) = v37;
}
v38 = *(_QWORD *)v29;
v29 += 16;
v39 = *((_QWORD *)v29 - 1);
v13 += 2;
v40 = *(v13 - 1);
*((_QWORD *)v29 - 2) = *(v13 - 2);
*((_QWORD *)v29 - 1) = v40;
v32 += 16;
v31 = v33;
*(v13 - 2) = v38;
*(v13 - 1) = v39;
continue;
}
break;
}
while ( 2 )
{
v33 = v31 - 2;
v82 = pugi::xpath_node::attribute((pugi::xpath_node *)(v31 - 2));
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v82) )
{
v82 = pugi::xpath_node::attribute((pugi::xpath_node *)v13);
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v82) )
{
v81 = pugi::xpath_node::attribute((pugi::xpath_node *)(v31 - 2));
v80 = pugi::xpath_node::attribute((pugi::xpath_node *)v13);
v34 = pugi::xml_attribute::operator<(&v81, &v80);
goto LABEL_21;
}
goto LABEL_22;
}
v82 = pugi::xpath_node::attribute((pugi::xpath_node *)v13);
if ( !pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v82) )
{
v81 = pugi::xpath_node::node((pugi::xpath_node *)(v31 - 2));
v80 = pugi::xpath_node::node((pugi::xpath_node *)v13);
v34 = pugi::xml_node::operator<(&v81, &v80);
LABEL_21:
if ( v34 )
{
LABEL_22:
v31 -= 2;
if ( a1 == v33 )
goto LABEL_23;
continue;
}
}
break;
}
if ( pugi::xpath_node::operator==(v13, v31 - 2) )
{
v45 = *(v13 - 2);
v46 = *(v13 - 1);
v13 -= 2;
v47 = *v33;
v48 = *(v31 - 1);
*v33 = v45;
*(v31 - 1) = v46;
*v13 = v47;
v13[1] = v48;
goto LABEL_22;
}
v33 = v31;
LABEL_23:
if ( a1 != v33 )
{
if ( a2 == (__int64 *)v29 )
{
v31 = v33 - 2;
if ( v33 - 2 == v13 - 2 )
{
v55 = *(v13 - 2);
v56 = *(v13 - 1);
}
else
{
v52 = *(v33 - 2);
v53 = *(v33 - 1);
v54 = *(v13 - 1);
*(v33 - 2) = *(v13 - 2);
*(v33 - 1) = v54;
v55 = v52;
v56 = v53;
*(v13 - 2) = v52;
*(v13 - 1) = v53;
}
v57 = *((_QWORD *)v32 - 2);
v58 = *((_QWORD *)v32 - 1);
v32 -= 16;
*(v13 - 2) = v57;
*(v13 - 1) = v58;
v13 -= 2;
*(_QWORD *)v32 = v55;
*((_QWORD *)v32 + 1) = v56;
}
else
{
v49 = *(_QWORD *)v29;
v29 += 16;
v50 = *((_QWORD *)v29 - 1);
v31 = v33 - 2;
v51 = *(v33 - 1);
*((_QWORD *)v29 - 2) = *(v33 - 2);
*((_QWORD *)v29 - 1) = v51;
*(v33 - 2) = v49;
*(v33 - 1) = v50;
}
continue;
}
break;
}
if ( a2 != (__int64 *)v29 )
goto LABEL_25;
LABEL_47:
if ( ((char *)a2 - v32) >> 4 < ((char *)v13 - (char *)a1) >> 4 )
{
v59 = a2;
a2 = v13;
v10 = (char *)v13 - (char *)a1;
sub_DD0D1C(v32, v59, a3);
if ( v10 <= 527 )
break;
goto LABEL_2;
}
v69 = a1;
a1 = (__int64 *)v32;
sub_DD0D1C(v69, v13, a3);
}
if ( a2 != a1 )
{
v60 = a1 + 2;
if ( a1 + 2 != a2 )
{
for ( i = a1 + 4; ; i += 2 )
{
v62 = v60[1];
v82 = *v60;
v83 = v62;
v63 = v60;
if ( !(unsigned __int8)sub_DCFC10((pugi::xpath_node *)&v82, (pugi::xpath_node *)a1) )
break;
if ( v60 != a1 )
{
v64 = i;
do
{
v64 -= 2;
v65 = *(v64 - 1);
*v64 = *(v64 - 2);
v64[1] = v65;
}
while ( v64 != (__int64 *)((char *)v60 - (((unsigned __int64)v60 - 16 - (_QWORD)a1) & 0xFFFFFFFFFFFFFFF0LL)) );
}
v66 = v83;
v67 = i;
*a1 = v82;
a1[1] = v66;
LABEL_57:
v60 += 2;
if ( v67 == a2 )
return _stack_chk_guard;
}
while ( 2 )
{
v72 = v63 - 2;
v81 = pugi::xpath_node::attribute((pugi::xpath_node *)&v82);
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v81) )
{
v81 = pugi::xpath_node::attribute((pugi::xpath_node *)(v63 - 2));
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v81) )
{
v80 = pugi::xpath_node::attribute((pugi::xpath_node *)&v82);
v79 = pugi::xpath_node::attribute((pugi::xpath_node *)(v63 - 2));
v70 = pugi::xml_attribute::operator<(&v80, &v79);
goto LABEL_63;
}
}
else
{
v81 = pugi::xpath_node::attribute((pugi::xpath_node *)(v63 - 2));
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v81) )
{
LABEL_69:
v73 = v83;
v67 = i;
*v63 = v82;
v63[1] = v73;
goto LABEL_57;
}
v80 = pugi::xpath_node::node((pugi::xpath_node *)&v82);
v79 = pugi::xpath_node::node((pugi::xpath_node *)(v63 - 2));
v70 = pugi::xml_node::operator<(&v80, &v79);
LABEL_63:
if ( !v70 )
goto LABEL_69;
}
v71 = *(v63 - 1);
v63 -= 2;
v72[2] = *v72;
v72[3] = v71;
continue;
}
}
}
return _stack_chk_guard;
}