//
// sub_816440 from 0x816440 to 0x816546 (262 bytes)
//
// 2 xrefs:
// > sub_8183A0 @ 0x8184bc
// > sub_8183A0 @ 0x8184ea
//
// 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:42 +0000
//
void *__fastcall sub_816440(pugi::xpath_node *a1)
{
int v2; // r1
int v3; // r2
void (*v4)(); // r7
int v5; // r4
char *v6; // r0
bool v7; // zf
int v8; // r3
int v10; // r1
int v11; // r4
char *v12; // r0
bool v13; // zf
int v14; // r3
int v15; // r1
void (*v16)(); // [sp+4h] [bp-20h] BYREF
void (*v17)(); // [sp+8h] [bp-1Ch] BYREF
void (*i)(); // [sp+Ch] [bp-18h] BYREF
void (*v19)(); // [sp+10h] [bp-14h] BYREF
int v20; // [sp+14h] [bp-10h]
char *v21; // [sp+18h] [bp-Ch]
v16 = (void (*)())pugi::xpath_node::attribute(a1);
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v16) )
{
v17 = (void (*)())pugi::xpath_node::attribute(a1);
v4 = (void (*)())pugi::xpath_node::parent((void (**)())a1);
v5 = (int)pugi::xml_attribute::name((pugi::xml_attribute *)&v17);
v6 = strchr((const char *)v5, 58);
v7 = v6 == nullptr;
if ( v6 )
v6 -= v5;
v21 = v6;
if ( v7 )
v8 = 0;
else
v8 = v5;
v20 = v8;
if ( v8 )
{
for ( i = v4;
pugi::xml_node::operator void (*)(pugi::xml_node***)(&i);
i = (void (*)())pugi::xml_node::parent((pugi::xml_node *)&i, v10) )
{
v19 = sub_8123E4((pugi::xml_node *)&i, v20, (int)v21);
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v19) )
return pugi::xml_attribute::value((pugi::xml_attribute *)&v19);
}
}
return &unk_B6B226;
}
else
{
v17 = pugi::xpath_node::node((void (**)())a1, v2, v3);
v11 = (int)pugi::xml_node::name((pugi::xml_node *)&v17);
v12 = strchr((const char *)v11, 58);
v13 = v12 == nullptr;
if ( v12 )
v12 -= v11;
v21 = v12;
if ( v13 )
v14 = 0;
else
v14 = v11;
v20 = v14;
for ( i = v17;
pugi::xml_node::operator void (*)(pugi::xml_node***)(&i);
i = (void (*)())pugi::xml_node::parent((pugi::xml_node *)&i, v15) )
{
v19 = sub_8123E4((pugi::xml_node *)&i, v20, (int)v21);
if ( pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)(&v19) )
return pugi::xml_attribute::value((pugi::xml_attribute *)&v19);
}
return &unk_B6B226;
}
}