//
// tinyxml2::XMLElement::ParseAttributes from 0xd986ec to 0xd98a50 (868 bytes)
//
// 2 xrefs:
// > tinyxml2::XMLElement::ParseDeep @ 0xd98a98
// > ??> @ 0x8ae98
//
// This function is hookable on this platform (idp: arm, 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 13:08:22 +0000
//
char *__fastcall tinyxml2::XMLElement::ParseAttributes(tinyxml2::XMLElement *this, char *a2)
{
char *v4; // x20
_QWORD *i; // x24
int v6; // w19
__int64 v7; // x22
_QWORD *v8; // x19
int v9; // w1
int v10; // w0
int v11; // w1
__int64 v12; // x0
__int64 v13; // x1
__int64 v14; // x2
int *v15; // x3
const char *v16; // x0
int *v17; // x3
__int64 v18; // x21
int v20; // t1
__int64 v21; // x1
__int64 v22; // x2
int *v23; // x3
__int64 v24; // x19
__int64 Str; // x0
_QWORD *v26; // x27
int v27; // w0
int v28; // w19
_QWORD *v29; // x1
int v30; // w19
unsigned __int64 v31; // x0
void *v32; // x0
void *v33; // [xsp+68h] [xbp+68h]
if ( !a2 )
return nullptr;
v4 = a2;
for ( i = nullptr; ; i = v8 )
{
v6 = (unsigned __int8)*v4;
if ( (v6 & 0x80) == 0 )
{
while ( isspace(v6) )
{
v20 = (unsigned __int8)*++v4;
v6 = v20;
if ( (v20 & 0x80) != 0 )
goto LABEL_4;
}
if ( !v6 )
{
v24 = *((_QWORD *)this + 1);
Str = tinyxml2::StrPair::GetStr((tinyxml2::XMLElement *)((char *)this + 24), v21, v22, v23);
tinyxml2::XMLDocument::SetError(v24, 7, (__int64)a2, Str);
return nullptr;
}
}
LABEL_4:
if ( (v6 & 0x80) == 0 && !isalpha(v6) )
break;
v7 = *((_QWORD *)this + 1);
v8 = *(_QWORD **)(v7 + 360);
if ( !v8 )
{
v26 = (_QWORD *)operator new(0x3F0u);
memset(v26, 0, 0x3F0u);
v27 = *(_DWORD *)(v7 + 356);
v28 = v27 + 1;
if ( v27 + 1 > *(_DWORD *)(v7 + 352) )
{
v30 = 2 * v28;
v31 = 8LL * v30;
if ( (unsigned __int64)v30 > 0xFE0000000000000LL )
v31 = -1;
v33 = (void *)operator new[](v31);
memcpy(v33, *(const void **)(v7 + 264), 8LL * *(int *)(v7 + 356));
v32 = *(void **)(v7 + 264);
if ( v32 != (void *)(v7 + 272) && v32 )
operator delete[](v32);
*(_QWORD *)(v7 + 264) = v33;
v29 = v33;
*(_DWORD *)(v7 + 352) = v30;
v27 = *(_DWORD *)(v7 + 356);
v28 = v27 + 1;
}
else
{
v29 = *(_QWORD **)(v7 + 264);
}
*(_DWORD *)(v7 + 356) = v28;
v29[v27] = v26;
*v26 = v26 + 9;
v26[18] = v26 + 27;
v26[27] = v26 + 36;
v26[36] = v26 + 45;
v26[45] = v26 + 54;
v26[54] = v26 + 63;
v26[63] = v26 + 72;
v26[72] = v26 + 81;
v26[9] = v26 + 18;
v26[81] = v26 + 90;
v8 = v26;
v26[90] = v26 + 99;
v26[99] = v26 + 108;
v26[108] = v26 + 117;
v26[117] = 0;
*(_QWORD *)(v7 + 360) = v26;
}
v9 = *(_DWORD *)(v7 + 376);
v10 = *(_DWORD *)(v7 + 368) + 1;
*(_QWORD *)(v7 + 360) = *v8;
*(_DWORD *)(v7 + 368) = v10;
if ( v10 > v9 )
*(_DWORD *)(v7 + 376) = v10;
v11 = *(_DWORD *)(v7 + 380);
++*(_DWORD *)(v7 + 372);
*(_DWORD *)(v7 + 380) = v11 + 1;
*v8 = off_152F1B0;
*((_DWORD *)v8 + 2) = 0;
v8[2] = 0;
v8[3] = 0;
*((_DWORD *)v8 + 8) = 0;
v8[5] = 0;
v8[6] = 0;
v8[7] = 0;
v12 = *((_QWORD *)this + 1) + 256LL;
v8[8] = v12;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 40LL))(v12);
v4 = tinyxml2::XMLAttribute::ParseDeep((tinyxml2::XMLAttribute *)v8, v4, *(_BYTE *)(*((_QWORD *)this + 1) + 89LL));
if ( !v4
|| (v16 = (const char *)tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(v8 + 1), v13, v14, v15),
tinyxml2::XMLElement::Attribute(this, v16, nullptr, v17)) )
{
v18 = v8[8];
(*(void (__fastcall **)(_QWORD *))*v8)(v8);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v18 + 32LL))(v18, v8);
tinyxml2::XMLDocument::SetError(*((_QWORD *)this + 1), 8, (__int64)a2, (__int64)v4);
return nullptr;
}
if ( i )
i[7] = v8;
else
*((_QWORD *)this + 12) = v8;
}
if ( v6 != 47 )
{
if ( v6 == 62 )
return v4 + 1;
goto LABEL_35;
}
if ( v4[1] != 62 )
{
LABEL_35:
tinyxml2::XMLDocument::SetError(*((_QWORD *)this + 1), 7, (__int64)a2, (__int64)v4);
return nullptr;
}
*((_DWORD *)this + 22) = 1;
return v4 + 2;
}