//
// pugi::xml_node::first_element_by_path from 0xdc9d7c to 0xdc9f84 (520 bytes)
//
// 4 xrefs:
// > pugi::xml_node::first_element_by_path @ 0xdc9e84
// > pugi::xml_node::first_element_by_path @ 0xdc9f5c
// > pugi::xml_node::first_element_by_path @ 0xdc9f78
// > ??> @ 0xd15c0
//
// 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::first_element_by_path(pugi::xml_node *this, const char *a2, unsigned __int8 a3)
{
const char *v3; // x20
int v4; // w25
__int64 v5; // x0
int v6; // w21
const char *v7; // x19
int v8; // w0
int v9; // t1
const char *v10; // x26
int v11; // t1
signed __int64 v12; // x19
__int64 v13; // x21
unsigned __int8 *v14; // x3
__int64 v15; // x0
int v17; // w1
int v18; // t1
__int64 v19; // [xsp+50h] [xbp+50h] BYREF
__int64 element_by_path; // [xsp+58h] [xbp+58h] BYREF
__int64 v21; // [xsp+60h] [xbp+60h] BYREF
v3 = a2;
v4 = a3;
v5 = *(_QWORD *)this;
v19 = v5;
if ( !a2 )
return v19;
if ( !v5 )
return v19;
v6 = *(unsigned __int8 *)a2;
if ( !*a2 )
return v19;
if ( v6 == a3 )
{
v3 = a2 + 1;
v19 = pugi::xml_node::root((pugi::xml_node *)&v19);
v17 = *(unsigned __int8 *)v3;
if ( v6 == v17 )
{
do
{
v18 = *(unsigned __int8 *)++v3;
v17 = v18;
}
while ( v6 == v18 );
}
if ( !v17 || v4 == v17 )
return v19;
v6 = v17;
}
v7 = v3;
do
{
v9 = *(unsigned __int8 *)++v7;
v8 = v9;
}
while ( v4 != v9 && v8 );
v10 = v7;
if ( v3 == v7 )
return v19;
if ( v4 == v8 )
{
do
v11 = *(unsigned __int8 *)++v10;
while ( v11 == v4 );
}
if ( v6 != 46 )
{
LABEL_12:
v12 = v7 - v3;
v13 = *(_QWORD *)(v19 + 32);
if ( !v13 )
{
LABEL_22:
pugi::xml_node::xml_node(&v21);
return v21;
}
while ( 1 )
{
v14 = *(unsigned __int8 **)(v13 + 16);
if ( v14 )
{
if ( v12 )
{
if ( *v14 != *(unsigned __int8 *)v3 )
goto LABEL_21;
v15 = 0;
while ( v12 != ++v15 )
{
if ( v14[v15] != (unsigned __int8)v3[v15] )
goto LABEL_21;
}
}
if ( !v14[v12] )
{
pugi::xml_node::xml_node(&v21, v13);
element_by_path = pugi::xml_node::first_element_by_path((pugi::xml_node *)&v21, v10, v4);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)(&element_by_path) )
return element_by_path;
}
}
LABEL_21:
v13 = *(_QWORD *)(v13 + 48);
if ( !v13 )
goto LABEL_22;
}
}
if ( v7 != v3 + 1 )
{
if ( v3[1] == 46 && v7 == v3 + 2 )
{
v21 = pugi::xml_node::parent((pugi::xml_node *)&v19);
return pugi::xml_node::first_element_by_path((pugi::xml_node *)&v21, v10, v4);
}
goto LABEL_12;
}
return pugi::xml_node::first_element_by_path((pugi::xml_node *)&v19, v10, v4);
}