//
// pugi::xml_node::first_element_by_path from 0x603e80 to 0x603f74 (244 bytes)
//
// 2 xrefs:
// > pugi::xml_node::first_element_by_path @ 0x603f0e
// > pugi::xml_node::first_element_by_path @ 0x603f5a
//
// 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_node_struct *__fastcall pugi::xml_node::first_element_by_path(
pugi::xml_node *this,
pugi::xml_node_struct *a2,
int a3)
{
const char *v3; // r4
const char *v6; // r1
int v7; // r2
int v8; // r4
pugi::xml_node_struct *v9; // r3
pugi::xml_node_struct *v10; // r1
int v11; // r0
int v12; // t1
const char *v13; // r3
const char *v14; // r9
pugi::xml_node *v15; // r0
int v16; // r8
int i; // r6
int v18; // r0
pugi::xml_node v19; // [sp+0h] [bp-14h] BYREF
void (*v20)(); // [sp+4h] [bp-10h] BYREF
pugi::xml_node v21; // [sp+8h] [bp-Ch] BYREF
v3 = (const char *)a2;
v19._root = this->_root;
if ( !v19._root || !a2 || !*(_BYTE *)a2 )
return v19._root;
if ( *(unsigned __int8 *)a2 == a3 )
{
v3 = (char *)a2 + 1;
v19._root = pugi::xml_node::root(&v19, a2);
}
v6 = v3;
do
{
v7 = *(unsigned __int8 *)v6;
v8 = (int)v6++;
}
while ( v7 == a3 );
v9 = (pugi::xml_node_struct *)v8;
do
{
v10 = v9;
v12 = *(unsigned __int8 *)v9;
v9 = (pugi::xml_node_struct *)((char *)v9 + 1);
v11 = v12;
}
while ( v12 && v11 != a3 );
if ( (pugi::xml_node_struct *)v8 == v10 )
return v19._root;
v13 = (const char *)v10;
do
v14 = v13++;
while ( *(unsigned __int8 *)v14 == a3 );
if ( v7 == 46 )
{
if ( v10 == (pugi::xml_node_struct *)(v8 + 1) )
{
v15 = &v19;
return (pugi::xml_node_struct *)pugi::xml_node::first_element_by_path(v15, v14, a3);
}
if ( *(_BYTE *)(v8 + 1) == 46 && v10 == (pugi::xml_node_struct *)(v8 + 2) )
{
v21._root = pugi::xml_node::parent(&v19, v10);
v15 = &v21;
return (pugi::xml_node_struct *)pugi::xml_node::first_element_by_path(v15, v14, a3);
}
}
v16 = (int)v10 - v8;
for ( i = *((_DWORD *)v19._root + 4); ; i = *(_DWORD *)(i + 24) )
{
if ( !i )
{
pugi::xml_node::xml_node(&v21);
return v21._root;
}
v18 = *(_DWORD *)(i + 8);
if ( v18 )
{
if ( sub_5FFF2A(v18, v8, v16) )
{
pugi::xml_node::xml_node(&v21, i);
v20 = (void (*)())pugi::xml_node::first_element_by_path(&v21, v14, a3);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)(&v20) )
break;
}
}
}
return (pugi::xml_node_struct *)v20;
}