//
// tinyxml2::XMLNode::FirstChildElement from 0xb24adc to 0xb24bd4 (248 bytes)
//
// 3 xrefs:
// > sub_B1F9A4 @ 0xb1fa58
// > sub_B1F9A4 @ 0xb1fa64
// > ??> @ 0x32a30
//
// 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
//
__int64 __fastcall tinyxml2::XMLNode::FirstChildElement(tinyxml2::XMLNode *this, const char *a2)
{
__int64 v2; // x20
__int64 v4; // x0
__int64 v5; // x1
__int64 v6; // x2
int *v7; // x3
__int64 v8; // x23
const char *Str; // x0
const char *v10; // x5
const char *v11; // x2
int v12; // w3
int v13; // t1
int v14; // w1
v2 = *((_QWORD *)this + 6);
if ( !v2 )
return 0;
while ( 1 )
{
v4 = (**(__int64 (__fastcall ***)(__int64))v2)(v2);
v8 = v4;
if ( !v4 )
goto LABEL_15;
if ( !a2 )
return v8;
Str = (const char *)tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(v4 + 24), v5, v6, v7);
if ( a2 == Str )
return v8;
if ( *Str )
break;
v11 = a2;
LABEL_14:
if ( !*v11 )
return v8;
LABEL_15:
v2 = *(_QWORD *)(v2 + 72);
if ( !v2 )
return 0;
}
if ( *(unsigned __int8 *)Str != *(unsigned __int8 *)a2 || !*a2 )
goto LABEL_15;
v10 = Str + 0x7FFFFFFF;
v11 = a2;
while ( 1 )
{
v13 = *(unsigned __int8 *)++Str;
v12 = v13;
v14 = (_DWORD)++v11 - (_DWORD)a2;
if ( !v13 )
{
if ( v14 == 0x7FFFFFFF )
return v8;
goto LABEL_14;
}
if ( !*v11 || v12 != *(unsigned __int8 *)v11 )
break;
if ( Str == v10 )
return v8;
}
if ( v14 != 0x7FFFFFFF )
goto LABEL_15;
return v8;
}