//
// tinyxml2::XMLNode::LastChildElement from 0x18009d700 to 0x18009d7af (175 bytes)
//
// 4 xrefs:
// > tinyxml2::XMLHandle::LastChildElement @ 0x1800d5474
// > tinyxml2::XMLNode::LastChildElement @ 0x1800d54a0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c1104
//
// This function is hookable on this platform (idp: pc, 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 11:22:12 +0000
//
const struct tinyxml2::XMLElement *__fastcall tinyxml2::XMLNode::LastChildElement(
tinyxml2::XMLNode *this,
const char *a2)
{
_QWORD *v2; // rdi
__int64 v4; // rax
__int64 v5; // rbp
const char *v6; // rbx
const char *Str; // rax
int v8; // edx
char v9; // cl
bool v10; // zf
v2 = *((_QWORD **)this + 7);
if ( !v2 )
return nullptr;
while ( 1 )
{
v4 = (*(__int64 (__fastcall **)(_QWORD *))(*v2 + 8LL))(v2);
v5 = v4;
if ( !v4 )
goto LABEL_14;
if ( !a2 )
return (const struct tinyxml2::XMLElement *)v5;
v6 = a2;
Str = tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(v4 + 24));
v8 = 0;
if ( Str == a2 )
return (const struct tinyxml2::XMLElement *)v5;
v9 = *Str;
if ( *Str )
break;
LABEL_13:
if ( !*v6 )
return (const struct tinyxml2::XMLElement *)v5;
LABEL_14:
v2 = (_QWORD *)v2[8];
if ( !v2 )
return nullptr;
}
do
{
if ( !*v6 || v9 != *v6 )
break;
v10 = v8 == 0x7FFFFFFF;
if ( v8 == 0x7FFFFFFF )
goto LABEL_11;
v9 = *++Str;
++v6;
++v8;
}
while ( v9 );
v10 = v8 == 0x7FFFFFFF;
LABEL_11:
if ( !v10 )
{
if ( *Str )
goto LABEL_14;
goto LABEL_13;
}
return (const struct tinyxml2::XMLElement *)v5;
}