//
// tinyxml2::XMLElement::ParseAttributes from 0x18009a370 to 0x18009a55d (493 bytes)
//
// 4 xrefs:
// > tinyxml2::XMLElement::ParseDeep @ 0x18009a875
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b6f24
// > ??> @ 0x1801b6f30
//
// 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
//
char *__fastcall tinyxml2::XMLElement::ParseAttributes(tinyxml2::XMLElement *this, char *a2)
{
char *v2; // rbx
char *(__fastcall ***v5)(char *, char); // rbp
char i; // al
char *(__fastcall ***v7)(char *, char); // rdi
__int64 v8; // rcx
const char *v9; // rax
const struct tinyxml2::XMLAttribute *Attribute; // rax
__int64 v12; // rax
char *(__fastcall **v13)(char *, char); // r14
char *(__fastcall *v14)(char *, char); // r8
__int64 v15; // rax
const char *Str; // rax
__int64 v17; // rcx
v2 = a2;
v5 = nullptr;
if ( !a2 )
return v2;
while ( 1 )
{
for ( i = *v2; i >= 0; i = *++v2 )
{
if ( !isspace((unsigned __int8)i) )
break;
}
if ( !*v2 )
{
Str = tinyxml2::StrPair::GetStr((tinyxml2::XMLElement *)((char *)this + 24));
v17 = *((_QWORD *)this + 1);
*(_QWORD *)(v17 + 112) = Str;
*(_DWORD *)(v17 + 92) = 7;
*(_QWORD *)(v17 + 104) = a2;
return nullptr;
}
if ( (unsigned __int8)*v2 < 0x80u && !isalpha((unsigned __int8)*v2) )
break;
v7 = (char *(__fastcall ***)(char *, char))(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*((_QWORD *)this + 1)
+ 256LL)
+ 16LL))(*((_QWORD *)this + 1) + 256LL);
*v7 = (char *(__fastcall **)(char *, char))&tinyxml2::XMLAttribute::`vftable';
*((_DWORD *)v7 + 2) = 0;
v7[2] = nullptr;
v7[3] = nullptr;
*((_DWORD *)v7 + 8) = 0;
v7[5] = nullptr;
v7[6] = nullptr;
v7[7] = nullptr;
v8 = *((_QWORD *)this + 1) + 256LL;
v7[8] = (char *(__fastcall **)(char *, char))v8;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 32LL))(v8);
v2 = tinyxml2::XMLAttribute::ParseDeep((tinyxml2::XMLAttribute *)v7, v2, *(_BYTE *)(*((_QWORD *)this + 1) + 89LL));
if ( !v2
|| (v9 = tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(v7 + 1)),
(Attribute = tinyxml2::XMLElement::FindAttribute(this, v9)) != nullptr)
&& tinyxml2::StrPair::GetStr((const struct tinyxml2::XMLAttribute *)((char *)Attribute + 32)) )
{
v13 = v7[8];
v14 = **v7;
if ( v14 == sub_180097D90 )
sub_180097D90((char *)v7, 0);
else
v14((char *)v7, 0);
(*((void (__fastcall **)(char *(__fastcall **)(char *, char), char *(__fastcall ***)(char *, char)))*v13 + 3))(
v13,
v7);
v15 = *((_QWORD *)this + 1);
*(_DWORD *)(v15 + 92) = 8;
*(_QWORD *)(v15 + 104) = a2;
*(_QWORD *)(v15 + 112) = v2;
return nullptr;
}
if ( v5 )
v5[7] = (char *(__fastcall **)(char *, char))v7;
else
*((_QWORD *)this + 12) = v7;
v5 = v7;
}
if ( *v2 == 47 )
{
if ( v2[1] == 62 )
{
*((_DWORD *)this + 22) = 1;
return v2 + 2;
}
}
else if ( *v2 == 62 )
{
return ++v2;
}
v12 = *((_QWORD *)this + 1);
*(_DWORD *)(v12 + 92) = 7;
*(_QWORD *)(v12 + 104) = a2;
*(_QWORD *)(v12 + 112) = v2;
return nullptr;
}