//
// pugi::xml_node::first_element_by_path from 0x8134f8 to 0x8135ec (244 bytes)
//
// 2 xrefs:
// > pugi::xml_node::first_element_by_path @ 0x813586
// > pugi::xml_node::first_element_by_path @ 0x8135d2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:39 +0000
//
void (*__fastcall pugi::xml_node::first_element_by_path(pugi::xml_node *this, const char *a2, int a3))()
{
const char *v3; // r4
const char *v6; // r1
int v7; // r2
int v8; // r4
unsigned __int8 *v9; // r3
int v10; // r1
int v11; // r0
int v12; // t1
const char *v13; // r3
const char *v14; // r9
int *v15; // r0
int v16; // r8
int i; // r6
int v18; // r0
int v19; // [sp+0h] [bp-14h] BYREF
void (*element_by_path)(); // [sp+4h] [bp-10h] BYREF
int v21; // [sp+8h] [bp-Ch] BYREF
v3 = a2;
v19 = *(_DWORD *)this;
if ( !v19 || !a2 || !*a2 )
return (void (*)())v19;
if ( *(unsigned __int8 *)a2 == a3 )
{
v3 = a2 + 1;
v19 = pugi::xml_node::root((pugi::xml_node *)&v19, (int)a2);
}
v6 = v3;
do
{
v7 = *(unsigned __int8 *)v6;
v8 = (int)v6++;
}
while ( v7 == a3 );
v9 = (unsigned __int8 *)v8;
do
{
v10 = (int)v9;
v12 = *v9++;
v11 = v12;
}
while ( v12 && v11 != a3 );
if ( v8 == v10 )
return (void (*)())v19;
v13 = (const char *)v10;
do
v14 = v13++;
while ( *(unsigned __int8 *)v14 == a3 );
if ( v7 == 46 )
{
if ( v10 == v8 + 1 )
{
v15 = &v19;
return (void (*)())pugi::xml_node::first_element_by_path((pugi::xml_node *)v15, v14, a3);
}
if ( *(_BYTE *)(v8 + 1) == 46 && v10 == v8 + 2 )
{
v21 = pugi::xml_node::parent((pugi::xml_node *)&v19, v10);
v15 = &v21;
return (void (*)())pugi::xml_node::first_element_by_path((pugi::xml_node *)v15, v14, a3);
}
}
v16 = v10 - v8;
for ( i = *(_DWORD *)(v19 + 16); ; i = *(_DWORD *)(i + 24) )
{
if ( !i )
{
pugi::xml_node::xml_node(&v21);
return (void (*)())v21;
}
v18 = *(_DWORD *)(i + 8);
if ( v18 )
{
if ( sub_80F552(v18, v8, v16) )
{
pugi::xml_node::xml_node(&v21, i);
element_by_path = (void (*)())pugi::xml_node::first_element_by_path((pugi::xml_node *)&v21, v14, a3);
if ( pugi::xml_node::operator void (*)(pugi::xml_node***)(&element_by_path) )
break;
}
}
}
return element_by_path;
}