//
// sub_607BBC from 0x607bbc to 0x608878 (3260 bytes)
//
// 39 xrefs:
// > sub_607BBC @ 0x607c2a
// > sub_607BBC @ 0x607c36
// > sub_607BBC @ 0x607c68
// > sub_607BBC @ 0x607cfa
// > sub_607BBC @ 0x607e6a
// > sub_607BBC @ 0x607f26
// > sub_607BBC @ 0x608044
// > sub_607BBC @ 0x60811c
// > sub_607BBC @ 0x6081be
// > sub_607BBC @ 0x6082b0
// > sub_607BBC @ 0x608386
// > sub_607BBC @ 0x60845c
// > sub_607BBC @ 0x60856a
// > sub_607BBC @ 0x608624
// > sub_607BBC @ 0x6086fc
// > sub_608878 @ 0x6089c2
// > sub_608878 @ 0x6089ce
// > sub_608878 @ 0x608a7a
// > sub_608878 @ 0x608ae4
// > sub_608878 @ 0x608bcc
// > sub_608878 @ 0x608bdc
// > sub_608878 @ 0x608c80
// > sub_608878 @ 0x608ce0
// > sub_608878 @ 0x608e9e
// > sub_608F28 @ 0x60907c
// > sub_608F28 @ 0x609128
// > sub_609260 @ 0x609306
// > sub_609260 @ 0x609356
// > sub_609260 @ 0x609398
// > sub_609260 @ 0x60981e
// > sub_609AD8 @ 0x609b48
// > sub_609AD8 @ 0x609b58
// > sub_609AD8 @ 0x609bfe
// > sub_609AD8 @ 0x609c4a
// > sub_609CC0 @ 0x609d30
// > sub_609CC0 @ 0x609d40
// > sub_609CC0 @ 0x609de6
// > sub_609CC0 @ 0x609e32
// > pugi::xpath_query::evaluate_node_set @ 0x60b6b6
//
// 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
//
pugi::xml_attribute_struct **__fastcall sub_607BBC(
pugi::xml_attribute_struct **a1,
pugi::xpath_variable **a2,
void (**a3)(),
int a4)
{
unsigned int v6; // r7
pugi::xpath_variable *v9; // r1
int v10; // r1
int v11; // r2
pugi::xpath_node *v12; // r1
int *v13; // r2
pugi::xml_attribute_struct *v14; // r3
int *v15; // r0
int *v16; // r8
int *v17; // r9
pugi::xml_node_struct *v18; // r2
pugi::xpath_variable *v19; // r1
pugi::xml_node_struct *v20; // r1
pugi::xml_node_struct *v21; // r2
void (**j)(); // r7
pugi::xml_node_struct *v23; // r2
int v24; // r9
pugi::xml_node_struct *v25; // r1
pugi::xml_node_struct *v26; // r2
pugi::xml_node_struct *v27; // r0
pugi::xml_node_struct *v28; // r1
pugi::xml_attribute_struct *v29; // r11
pugi::xml_node *k; // r0
pugi::xml_attribute_struct *v31; // r0
pugi::xml_attribute_struct *v32; // r11
pugi::xml_node_struct *v33; // r1
pugi::xml_node_struct *v34; // r1
pugi::xml_node_struct *v35; // r2
pugi::xml_attribute_struct *v36; // r0
pugi::xml_node_struct *v37; // r1
pugi::xml_attribute_struct *v38; // r8
pugi::xml_attribute *i; // r0
pugi::xml_attribute_struct *v40; // r0
pugi::xml_attribute_struct *v41; // r8
pugi::xml_node_struct *v42; // r1
pugi::xml_node_struct *v43; // r1
pugi::xml_node_struct *v44; // r2
pugi::xml_attribute_struct *v45; // r0
pugi::xml_attribute_struct *v46; // r3
pugi::xpath_variable *v47; // r1
void (**m)(); // r7
pugi::xml_node_struct *v49; // r2
int v50; // r8
pugi::xml_node_struct *v51; // r1
pugi::xml_node_struct *v52; // r2
pugi::xml_attribute_struct *v53; // r0
pugi::xml_attribute_struct *v54; // r3
pugi::xml_attribute_struct *v55; // r0
pugi::xml_attribute_struct *v56; // r0
pugi::xpath_variable *v57; // r1
pugi::xml_node_struct *v58; // r1
pugi::xml_node_struct *v59; // r2
void (**n)(); // r8
int v61; // r7
pugi::xml_node_struct *v62; // r1
pugi::xml_node_struct *v63; // r2
pugi::xml_node_struct *v64; // r0
pugi::xml_attribute_struct *v65; // r1
pugi::xml_attribute_struct *ii; // r0
pugi::xml_attribute_struct *v67; // r1
pugi::xml_node_struct *v68; // r1
pugi::xml_node_struct *v69; // r2
pugi::xml_attribute_struct *v70; // r0
int v71; // r9
pugi::xml_attribute_struct *v72; // r1
pugi::xml_attribute_struct *jj; // r0
pugi::xml_attribute_struct *v74; // r1
pugi::xml_node_struct *v75; // r1
pugi::xml_node_struct *v76; // r2
pugi::xml_attribute_struct *v77; // r0
pugi::xml_attribute_struct *v78; // r3
pugi::xpath_variable *v79; // r1
pugi::xml_node_struct *v80; // r1
pugi::xml_node_struct *v81; // r2
void (**kk)(); // r8
int v83; // r7
pugi::xml_node_struct *v84; // r1
pugi::xml_node_struct *v85; // r2
pugi::xml_node_struct *v86; // r0
pugi::xml_attribute_struct *v87; // r11
pugi::xml_node_struct *v88; // r1
pugi::xml_attribute_struct *mm; // r0
pugi::xml_node_struct *v90; // r1
pugi::xml_node_struct *v91; // r1
pugi::xml_node_struct *v92; // r2
pugi::xml_attribute_struct *v93; // r0
pugi::xml_attribute_struct *v94; // r8
pugi::xml_node_struct *v95; // r1
pugi::xml_attribute_struct *nn; // r0
pugi::xml_node_struct *v97; // r1
pugi::xpath_variable *v98; // r1
void (**i1)(); // r8
int v100; // r7
pugi::xml_node_struct *v101; // r1
pugi::xml_node_struct *v102; // r2
pugi::xml_attribute_struct *v103; // r0
void (*v104)(); // r3
pugi::xml_node_struct *v105; // r1
pugi::xml_node_struct *v106; // r2
pugi::xml_attribute_struct *v107; // r0
void (*v108)(); // r3
pugi::xpath_variable *v109; // r1
void (**i2)(); // r7
pugi::xml_node_struct *v111; // r2
int v112; // r8
pugi::xml_node_struct *v113; // r1
pugi::xml_node_struct *v114; // r2
pugi::xml_attribute_struct *v115; // r0
void (*v116)(); // r3
pugi::xml_attribute_struct *v117; // r0
int v118; // r2
int v119; // r3
pugi::xml_node_struct *v120; // r1
pugi::xml_node_struct *v121; // r2
pugi::xml_attribute_struct *v122; // r0
void (*v123)(); // r3
pugi::xml_attribute_struct *v124; // r0
int v125; // r2
int v126; // r3
pugi::xpath_variable *v127; // r1
void (**i3)(); // r7
pugi::xml_node_struct *v129; // r2
int v130; // r8
pugi::xml_node_struct *v131; // r1
pugi::xml_node_struct *v132; // r2
pugi::xml_attribute_struct *v133; // r0
pugi::xml_attribute_struct *v134; // r3
pugi::xml_attribute_struct *v135; // r0
pugi::xml_attribute_struct *v136; // r3
pugi::xml_node_struct *v137; // r1
pugi::xml_node_struct *v138; // r2
pugi::xml_attribute_struct *v139; // r0
pugi::xml_attribute_struct *v140; // r3
pugi::xml_attribute_struct *v141; // r0
pugi::xml_attribute_struct *v142; // r3
pugi::xpath_variable *v143; // r1
void (**i4)(); // r8
int v145; // r7
pugi::xml_node_struct *v146; // r1
pugi::xml_node_struct *v147; // r2
pugi::xml_node_struct *v148; // r0
pugi::xml_node_struct *v149; // r1
pugi::xml_attribute_struct *v150; // r11
pugi::xml_node *i5; // r0
pugi::xml_node_struct *v152; // r1
pugi::xml_node_struct *v153; // r2
pugi::xml_attribute_struct *v154; // r0
pugi::xml_node_struct *v155; // r1
pugi::xml_attribute_struct *v156; // r8
pugi::xml_attribute *i6; // r0
pugi::xpath_variable *v158; // r1
int *i7; // r7
pugi::xml_node_struct *v160; // r2
int v161; // r8
pugi::xml_node_struct *v162; // r1
pugi::xml_node_struct *v163; // r2
pugi::xml_node_struct *v164; // r0
int v165; // r11
pugi::xml_node_struct *v166; // r1
pugi::xml_node_struct *v167; // r1
pugi::xml_attribute_struct *v168; // r0
pugi::xml_attribute_struct *v169; // r1
pugi::xml_attribute_struct *v170; // r3
int v171; // r0
pugi::xml_attribute_struct *v172; // r0
pugi::xml_node_struct *v173; // r1
pugi::xml_node_struct *v174; // r2
pugi::xml_attribute_struct *v175; // r0
int v176; // r9
pugi::xml_node_struct *v177; // r1
pugi::xml_node_struct *v178; // r1
pugi::xml_attribute_struct *v179; // r0
pugi::xml_attribute_struct *v180; // r1
pugi::xml_attribute_struct *v181; // r3
int v182; // r0
pugi::xml_attribute_struct *v183; // r0
pugi::xpath_variable *v184; // r1
void (**i8)(); // r7
pugi::xml_node_struct *v186; // r2
int v187; // r8
pugi::xml_node_struct *v188; // r1
pugi::xml_node_struct *v189; // r2
pugi::xml_attribute_struct *v190; // r0
pugi::xml_node_struct *v191; // r1
pugi::xml_node_struct *v192; // r2
pugi::xml_attribute_struct *v193; // r0
pugi::xpath_variable *v194; // r1
void (**i9)(); // r8
int v196; // r7
pugi::xml_node_struct *v197; // r1
pugi::xml_node_struct *v198; // r2
pugi::xml_node_struct *v199; // r0
pugi::xml_node_struct *v200; // r1
pugi::xml_attribute_struct *v201; // r11
pugi::xml_node *i10; // r0
pugi::xml_node_struct *v203; // r1
pugi::xml_node_struct *v204; // r2
pugi::xml_attribute_struct *v205; // r0
pugi::xml_node_struct *v206; // r1
pugi::xml_attribute_struct *v207; // r8
pugi::xml_attribute *i11; // r0
pugi::xpath_variable *v209; // r1
pugi::xml_node_struct *v210; // r1
void (**v211)(); // r7
pugi::xml_node_struct *v212; // r2
int v213; // r8
pugi::xml_node_struct *v214; // r1
pugi::xml_node_struct *v215; // r2
pugi::xml_attribute_struct *v216; // r0
pugi::xml_attribute_struct *v217; // r3
pugi::xml_attribute_struct *v218; // r0
int v219; // r2
int v220; // r3
pugi::xml_attribute_struct *v221; // r0
int v222; // r2
int v223; // r3
pugi::xml_node_struct *v224; // r1
pugi::xml_node_struct *v225; // r2
pugi::xml_node_struct *v226; // r0
pugi::xml_node_struct *v227; // r1
pugi::xml_attribute_struct *attr; // r0
pugi::xpath_node *v229; // r1
int *v230; // r2
pugi::xml_attribute_struct *v231; // r3
char *node_set; // r0
pugi::xpath_node_set *v233; // r7
void *v234; // r8
int v235; // r0
pugi::xml_attribute_struct *v237; // [sp+0h] [bp-54h]
pugi::xml_attribute_struct *v238; // [sp+0h] [bp-54h]
int v239; // [sp+8h] [bp-4Ch]
pugi::xml_node v240[2]; // [sp+14h] [bp-40h] BYREF
pugi::xml_node v241[4]; // [sp+1Ch] [bp-38h] BYREF
pugi::xml_attribute v242[4]; // [sp+2Ch] [bp-28h] BYREF
pugi::xml_attribute v243; // [sp+3Ch] [bp-18h] BYREF
pugi::xpath_node *v244; // [sp+40h] [bp-14h]
int *v245; // [sp+44h] [bp-10h]
pugi::xml_attribute_struct *v246; // [sp+48h] [bp-Ch]
v6 = *(unsigned __int8 *)a2;
if ( v6 == 21 )
{
if ( *((_BYTE *)a2 + 1) == 1 )
{
node_set = pugi::xpath_variable::get_node_set(a2[4]);
v244 = nullptr;
v245 = nullptr;
v246 = nullptr;
v233 = (pugi::xpath_node_set *)node_set;
v243._attr = (pugi::xml_attribute_struct *)pugi::xpath_node_set::type((pugi::xpath_node_set *)node_set);
v234 = (void *)pugi::xpath_node_set::begin(v233);
v235 = pugi::xpath_node_set::end(v233);
sub_601BE6((int)&v243, v234, v235, *(_DWORD *)a4);
attr = v243._attr;
v229 = v244;
v230 = v245;
v231 = v246;
goto LABEL_197;
}
LABEL_198:
*a1 = nullptr;
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
return a1;
}
if ( v6 > 0x15 )
{
if ( v6 != 57 )
{
if ( v6 != 58 )
goto LABEL_198;
v244 = nullptr;
v245 = nullptr;
v246 = nullptr;
v243._attr = (pugi::xml_attribute_struct *)(&dword_0 + 1);
v242[0]._attr = pugi::xpath_node::node(
a3,
(pugi::xml_node_struct *)&_stack_chk_guard,
(pugi::xml_node_struct *)a3);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v226 = pugi::xpath_node::node(a3, v224, v225);
}
else
{
v242[0]._attr = (pugi::xml_attribute_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)a3);
if ( !pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)((void (**)())v242) )
{
LABEL_194:
attr = v243._attr;
v229 = v244;
v230 = v245;
v231 = v246;
LABEL_197:
*a1 = attr;
a1[1] = v229;
a1[2] = (pugi::xml_attribute_struct *)v230;
a1[3] = v231;
return a1;
}
v226 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
}
v240[0]._root = v226;
v241[0]._root = pugi::xml_node::root(v240, v227);
pugi::xpath_node::xpath_node(v242, v241);
sub_601BA4(&v243, (int *)v242, *(_DWORD *)a4);
goto LABEL_194;
}
v18 = (pugi::xml_node_struct *)*((unsigned __int8 *)a2 + 2);
switch ( *((_BYTE *)a2 + 2) )
{
case 0:
v19 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 2);
if ( !v19 )
{
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v36 = pugi::xpath_node::node(a3, v34, v35);
v38 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v36;
for ( i = v242; ; i = &v243 )
{
v243._attr = pugi::xml_node::parent((pugi::xml_node *)i, v37);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)&v243, v38);
}
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v40 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
v41 = *(pugi::xml_attribute_struct **)a4;
while ( 1 )
{
v243._attr = v40;
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)&v243, v41);
v40 = pugi::xml_node::parent((pugi::xml_node *)&v243, v42);
}
}
goto LABEL_42;
}
sub_607BBC(&v243, v19, a3, a4);
for ( j = (void (**)())v244; j != (void (**)())v245; j += 2 )
{
v23 = a1[1];
v24 = (a1[2] - v23) >> 3;
if ( v24 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(j, v20, v23);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v27 = pugi::xpath_node::node(j, v25, v26);
v29 = *(pugi::xml_attribute_struct **)a4;
v241[0]._root = v27;
for ( k = v241; ; k = (pugi::xml_node *)v242 )
{
v242[0]._attr = pugi::xml_node::parent(k, v28);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)v242, v29);
}
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)j);
v31 = pugi::xpath_node::parent((pugi::xpath_node *)j);
v32 = *(pugi::xml_attribute_struct **)a4;
while ( 1 )
{
v242[0]._attr = v31;
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)v242, v32);
v31 = pugi::xml_node::parent((pugi::xml_node *)v242, v33);
}
}
sub_609F50(a2 + 2, a1, v24, a4);
}
goto LABEL_43;
case 1:
v47 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 2);
if ( !v47 )
{
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v45 = pugi::xpath_node::node(a3, v43, v44);
v46 = *(pugi::xml_attribute_struct **)a4;
v243._attr = v45;
sub_6066CC((int)a2, (pugi::xml_node_struct *)a1, (pugi::xml_attribute_struct *)&v243, v46);
}
else
{
v242[0]._attr = (pugi::xml_attribute_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v56 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
v238 = *(pugi::xml_attribute_struct **)a4;
v243._attr = v56;
sub_606C20(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v242,
(pugi::xml_node_struct *)&v243,
v238);
}
goto LABEL_42;
}
sub_607BBC(&v243, v47, a3, a4);
for ( m = (void (**)())v244; m != (void (**)())v245; m += 2 )
{
v49 = a1[1];
v50 = (a1[2] - v49) >> 3;
if ( v50 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(m, v20, v49);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v53 = pugi::xpath_node::node(m, v51, v52);
v54 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v53;
sub_6066CC((int)a2, (pugi::xml_node_struct *)a1, (pugi::xml_attribute_struct *)v242, v54);
}
else
{
v241[0]._root = (pugi::xml_node_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)m);
v55 = pugi::xpath_node::parent((pugi::xpath_node *)m);
v237 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v55;
sub_606C20(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v241,
(pugi::xml_node_struct *)v242,
v237);
}
sub_609F50(a2 + 2, a1, v50, a4);
}
goto LABEL_43;
case 2:
v57 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v57 )
{
sub_607BBC(&v243, v57, a3, a4);
for ( n = (void (**)())v244; n != (void (**)())v245; n += 2 )
{
v61 = (a1[2] - a1[1]) >> 3;
if ( v61 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(n, v58, v59);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v64 = pugi::xpath_node::node(n, v62, v63);
v239 = *(_DWORD *)a4;
v241[0]._root = v64;
for ( ii = pugi::xml_node::first_attribute(v241, v65); ; ii = pugi::xml_attribute::next_attribute(
v242,
v67) )
{
v242[0]._attr = ii;
if ( !pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)((void (**)())v242) )
break;
sub_606B80(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v242,
(pugi::xml_node_struct *)v241,
v239);
}
}
sub_609F50(a2 + 2, a1, v61, a4);
}
return a1;
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v70 = pugi::xpath_node::node(a3, v68, v69);
v71 = *(_DWORD *)a4;
v242[0]._attr = v70;
for ( jj = pugi::xml_node::first_attribute((pugi::xml_node *)v242, v72);
;
jj = pugi::xml_attribute::next_attribute(&v243, v74) )
{
v243._attr = jj;
if ( !pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)((void (**)())&v243) )
break;
sub_606B80(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)&v243,
(pugi::xml_node_struct *)v242,
v71);
}
}
goto LABEL_71;
case 3:
v79 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v79 )
{
sub_607BBC(&v243, v79, a3, a4);
for ( kk = (void (**)())v244; kk != (void (**)())v245; kk += 2 )
{
v83 = (a1[2] - a1[1]) >> 3;
if ( v83 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(kk, v80, v81);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v86 = pugi::xpath_node::node(kk, v84, v85);
v87 = *(pugi::xml_attribute_struct **)a4;
v241[0]._root = v86;
for ( mm = pugi::xml_node::first_child(v241, v88);
;
mm = pugi::xml_node::next_sibling((pugi::xml_node *)v242, v90) )
{
v242[0]._attr = mm;
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)v242, v87);
}
}
sub_609F50(a2 + 2, a1, v83, a4);
}
return a1;
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v93 = pugi::xpath_node::node(a3, v91, v92);
v94 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v93;
for ( nn = pugi::xml_node::first_child((pugi::xml_node *)v242, v95);
;
nn = pugi::xml_node::next_sibling((pugi::xml_node *)&v243, v97) )
{
v243._attr = nn;
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)&v243, v94);
}
}
goto LABEL_71;
case 4:
v98 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v98 )
{
sub_607BBC(&v243, v98, a3, a4);
for ( i1 = (void (**)())v244; i1 != (void (**)())v245; i1 += 2 )
{
v100 = (a1[2] - a1[1]) >> 3;
if ( v100 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(i1, v20, v21);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v103 = pugi::xpath_node::node(i1, v101, v102);
v104 = *(void (**)())a4;
v242[0]._attr = v103;
sub_60672C((int)a2, (pugi::xml_node_struct *)a1, (pugi::xml_node *)v242, v104);
}
sub_609F50(a2 + 2, a1, v100, a4);
}
goto LABEL_43;
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v107 = pugi::xpath_node::node(a3, v105, v106);
v108 = *(void (**)())a4;
v243._attr = v107;
sub_60672C((int)a2, (pugi::xml_node_struct *)a1, (pugi::xml_node *)&v243, v108);
}
goto LABEL_42;
case 5:
v109 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v109 )
{
sub_607BBC(&v243, v109, a3, a4);
for ( i2 = (void (**)())v244; i2 != (void (**)())v245; i2 += 2 )
{
v111 = a1[1];
v112 = (a1[2] - v111) >> 3;
if ( v112 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(i2, v20, v111);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v115 = pugi::xpath_node::node(i2, v113, v114);
v116 = *(void (**)())a4;
v242[0]._attr = v115;
sub_6067EC((int)a2, (pugi::xml_attribute_struct *)a1, (void (*)())v242, v116);
}
else
{
v241[0]._root = (pugi::xml_node_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)i2);
v117 = pugi::xpath_node::parent((pugi::xpath_node *)i2);
v118 = *((unsigned __int8 *)a2 + 3);
v119 = *(_DWORD *)a4;
v242[0]._attr = v117;
if ( v118 == 2 )
sub_606B80(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v241,
(pugi::xml_node_struct *)v242,
v119);
}
sub_609F50(a2 + 2, a1, v112, a4);
}
goto LABEL_43;
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v122 = pugi::xpath_node::node(a3, v120, v121);
v123 = *(void (**)())a4;
v243._attr = v122;
sub_6067EC((int)a2, (pugi::xml_attribute_struct *)a1, (void (*)())&v243, v123);
}
else
{
v242[0]._attr = (pugi::xml_attribute_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v124 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
v125 = *((unsigned __int8 *)a2 + 3);
v126 = *(_DWORD *)a4;
v243._attr = v124;
if ( v125 == 2 )
sub_606B80(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v242,
(pugi::xml_node_struct *)&v243,
v126);
}
goto LABEL_42;
case 6:
v127 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( !v127 )
{
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v139 = pugi::xpath_node::node(a3, v137, v138);
v140 = *(pugi::xml_attribute_struct **)a4;
v243._attr = v139;
sub_6068B0((int)a2, (pugi::xml_attribute_struct *)a1, &v243._attr, v140);
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v141 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
v142 = *(pugi::xml_attribute_struct **)a4;
v243._attr = v141;
sub_60697C((int)a2, (pugi::xml_attribute_struct *)a1, &v243._attr, v142);
}
goto LABEL_42;
}
sub_607BBC(&v243, v127, a3, a4);
for ( i3 = (void (**)())v244; i3 != (void (**)())v245; i3 += 2 )
{
v129 = a1[1];
v130 = (a1[2] - v129) >> 3;
if ( v130 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(i3, v20, v129);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v133 = pugi::xpath_node::node(i3, v131, v132);
v134 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v133;
sub_6068B0((int)a2, (pugi::xml_attribute_struct *)a1, &v242[0]._attr, v134);
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)i3);
v135 = pugi::xpath_node::parent((pugi::xpath_node *)i3);
v136 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v135;
sub_60697C((int)a2, (pugi::xml_attribute_struct *)a1, &v242[0]._attr, v136);
}
sub_609F50(a2 + 2, a1, v130, a4);
}
goto LABEL_43;
case 7:
v143 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v143 )
{
sub_607BBC(&v243, v143, a3, a4);
for ( i4 = (void (**)())v244; i4 != (void (**)())v245; i4 += 2 )
{
v145 = (a1[2] - a1[1]) >> 3;
if ( v145 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(i4, v20, v21);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v148 = pugi::xpath_node::node(i4, v146, v147);
v150 = *(pugi::xml_attribute_struct **)a4;
v241[0]._root = v148;
for ( i5 = v241; ; i5 = (pugi::xml_node *)v242 )
{
v242[0]._attr = pugi::xml_node::next_sibling(i5, v149);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)v242, v150);
}
}
sub_609F50(a2 + 2, a1, v145, a4);
}
goto LABEL_43;
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v154 = pugi::xpath_node::node(a3, v152, v153);
v156 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v154;
for ( i6 = v242; ; i6 = &v243 )
{
v243._attr = pugi::xml_node::next_sibling((pugi::xml_node *)i6, v155);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)&v243, v156);
}
}
goto LABEL_42;
case 9:
v158 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v158 )
{
sub_607BBC(&v243, v158, a3, a4);
for ( i7 = (int *)v244; ; i7 += 2 )
{
if ( i7 == v245 )
goto LABEL_43;
v160 = a1[1];
v161 = (a1[2] - v160) >> 3;
if ( v161 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node((void (**)())i7, v20, v160);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v164 = pugi::xpath_node::node((void (**)())i7, v162, v163);
v165 = *(_DWORD *)a4;
v241[0]._root = v164;
v242[0]._attr = pugi::xml_node::parent(v241, v166);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
goto LABEL_146;
v168 = pugi::xml_node::parent(v241, v167);
v169 = (pugi::xml_attribute_struct *)a1;
v170 = (pugi::xml_attribute_struct *)v165;
v242[0]._attr = v168;
v171 = (int)a2;
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)i7);
v172 = pugi::xpath_node::parent((pugi::xpath_node *)i7);
v170 = *(pugi::xml_attribute_struct **)a4;
v169 = (pugi::xml_attribute_struct *)a1;
v242[0]._attr = v172;
v171 = (int)a2;
}
sub_6065F8(v171, v169, (pugi::xml_attribute_struct *)v242, v170);
LABEL_146:
sub_609F50(a2 + 2, a1, v161, a4);
}
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v175 = pugi::xpath_node::node(a3, v173, v174);
v176 = *(_DWORD *)a4;
v242[0]._attr = v175;
v243._attr = pugi::xml_node::parent((pugi::xml_node *)v242, v177);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
goto LABEL_42;
v179 = pugi::xml_node::parent((pugi::xml_node *)v242, v178);
v180 = (pugi::xml_attribute_struct *)a1;
v181 = (pugi::xml_attribute_struct *)v176;
v243._attr = v179;
v182 = (int)a2;
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v183 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
v181 = *(pugi::xml_attribute_struct **)a4;
v180 = (pugi::xml_attribute_struct *)a1;
v243._attr = v183;
v182 = (int)a2;
}
sub_6065F8(v182, v180, (pugi::xml_attribute_struct *)&v243, v181);
LABEL_42:
sub_609F50(a2 + 2, a1, 0, a4);
LABEL_43:
if ( !*a1 )
sub_6078F4((int)a1, (int)v20, (int)v21);
return a1;
case 0xA:
v184 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 2);
if ( !v184 )
{
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v193 = pugi::xpath_node::node(a3, v191, v192);
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v193 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
}
v243._attr = v193;
sub_606A28((int)a2, (pugi::xml_attribute_struct *)a1, &v243._attr, *(pugi::xml_attribute_struct **)a4);
goto LABEL_42;
}
sub_607BBC(&v243, v184, a3, a4);
for ( i8 = (void (**)())v244; i8 != (void (**)())v245; i8 += 2 )
{
v186 = a1[1];
v187 = (a1[2] - v186) >> 3;
if ( v187 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(i8, v20, v186);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v190 = pugi::xpath_node::node(i8, v188, v189);
}
else
{
pugi::xpath_node::attribute((pugi::xpath_node *)i8);
v190 = pugi::xpath_node::parent((pugi::xpath_node *)i8);
}
v242[0]._attr = v190;
sub_606A28((int)a2, (pugi::xml_attribute_struct *)a1, &v242[0]._attr, *(pugi::xml_attribute_struct **)a4);
sub_609F50(a2 + 2, a1, v187, a4);
}
goto LABEL_43;
case 0xB:
v194 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 2);
if ( v194 )
{
sub_607BBC(&v243, v194, a3, a4);
for ( i9 = (void (**)())v244; i9 != (void (**)())v245; i9 += 2 )
{
v196 = (a1[2] - a1[1]) >> 3;
if ( v196 )
*a1 = nullptr;
v242[0]._attr = pugi::xpath_node::node(i9, v20, v21);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v199 = pugi::xpath_node::node(i9, v197, v198);
v201 = *(pugi::xml_attribute_struct **)a4;
v241[0]._root = v199;
for ( i10 = v241; ; i10 = (pugi::xml_node *)v242 )
{
v242[0]._attr = pugi::xml_node::previous_sibling(i10, v200);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)v242, v201);
}
}
sub_609F50(a2 + 2, a1, v196, a4);
}
goto LABEL_43;
}
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v205 = pugi::xpath_node::node(a3, v203, v204);
v207 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v205;
for ( i11 = v242; ; i11 = &v243 )
{
v243._attr = pugi::xml_node::previous_sibling((pugi::xml_node *)i11, v206);
if ( !pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
break;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)&v243, v207);
}
}
goto LABEL_42;
case 0xC:
v209 = a2[1];
a1[1] = nullptr;
a1[2] = nullptr;
a1[3] = nullptr;
*a1 = (pugi::xml_attribute_struct *)(&dword_0 + 1);
if ( v209 )
{
sub_607BBC(&v243, v209, a3, a4);
v211 = (void (**)())v244;
*a1 = v243._attr;
while ( v211 != (void (**)())v245 )
{
v212 = a1[1];
v213 = (a1[2] - v212) >> 3;
v242[0]._attr = pugi::xpath_node::node(v211, v210, v212);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())v242) )
{
v216 = pugi::xpath_node::node(v211, v214, v215);
v217 = *(pugi::xml_attribute_struct **)a4;
v242[0]._attr = v216;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)v242, v217);
}
else
{
v241[0]._root = (pugi::xml_node_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)v211);
v218 = pugi::xpath_node::parent((pugi::xpath_node *)v211);
v219 = *((unsigned __int8 *)a2 + 3);
v220 = *(_DWORD *)a4;
v242[0]._attr = v218;
if ( v219 == 2 )
sub_606B80(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v241,
(pugi::xml_node_struct *)v242,
v220);
}
sub_609F50(a2 + 2, a1, v213, a4);
v211 += 2;
}
}
else
{
v243._attr = pugi::xpath_node::node(a3, nullptr, v18);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)((void (**)())&v243) )
{
v77 = pugi::xpath_node::node(a3, v75, v76);
v78 = *(pugi::xml_attribute_struct **)a4;
v243._attr = v77;
sub_6065F8((int)a2, (pugi::xml_attribute_struct *)a1, (pugi::xml_attribute_struct *)&v243, v78);
}
else
{
v242[0]._attr = (pugi::xml_attribute_struct *)pugi::xpath_node::attribute((pugi::xpath_node *)a3);
v221 = pugi::xpath_node::parent((pugi::xpath_node *)a3);
v222 = *((unsigned __int8 *)a2 + 3);
v223 = *(_DWORD *)a4;
v243._attr = v221;
if ( v222 == 2 )
sub_606B80(
(int)a2,
(pugi::xml_node_struct *)a1,
(pugi::xml_node_struct *)v242,
(pugi::xml_node_struct *)&v243,
v223);
}
LABEL_71:
sub_609F50(a2 + 2, a1, 0, a4);
}
return a1;
default:
goto LABEL_198;
}
}
if ( v6 != 15 )
{
if ( v6 < 0xF || v6 - 17 > 1 )
goto LABEL_198;
sub_607BBC(&v243, a2[1], a3, a4);
if ( *(_BYTE *)a2 == 17 )
{
v15 = (int *)v244;
v16 = v245;
if ( v243._attr )
{
if ( v243._attr != (pugi::xml_attribute_struct *)((char *)&dword_0 + 1) )
{
while ( (char *)v16 - (char *)v15 > 15 )
{
v16 -= 2;
v17 = v15 + 2;
sub_600614(v15, v16);
v15 = v17;
}
}
}
else
{
sub_607480((void (*)())v244, v245, (pugi::xml_node_struct *)v242);
}
v243._attr = (pugi::xml_attribute_struct *)(&dword_0 + 1);
}
sub_609EA8(&v243, 0, a2[2], a4);
goto LABEL_194;
}
sub_600130((int **)v241, *(int **)(a4 + 4));
v9 = a2[1];
v240[0] = *(pugi::xml_node *)(a4 + 4);
v240[1] = *(pugi::xml_node *)a4;
sub_607BBC(v242, v9, a3, v240);
sub_607BBC(&v243, a2[2], a3, a4);
v243._attr = nullptr;
sub_601BE6((int)&v243, v242[1]._attr, (int)v242[2]._attr, *(_DWORD *)a4);
sub_6078F4((int)&v243, v10, v11);
v12 = v244;
v13 = v245;
v14 = v246;
*a1 = v243._attr;
a1[1] = v12;
a1[2] = (pugi::xml_attribute_struct *)v13;
a1[3] = v14;
sub_600144((int)v241);
return a1;
}