//
// tinyxml2::XMLNode::ParseDeep from 0x18009a8b0 to 0x18009ab5a (682 bytes)
//
// 5 xrefs:
// > tinyxml2::XMLElement::ParseDeep @ 0x18009a893
// > ??> @ 0x1801046f0
// > ??> @ 0x180104b20
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b6f90
//
// 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
//
// Hidden C++ exception states: #wind=1
char *__fastcall tinyxml2::XMLNode::ParseDeep(tinyxml2::XMLDocument **this, char *a2, struct tinyxml2::StrPair *a3)
{
char *v4; // rbp
char *v6; // rax
struct tinyxml2::XMLNode *v7; // rbx
__int64 v8; // rax
__int64 v9; // rax
unsigned __int64 v10; // rdx
int v11; // eax
__int64 v12; // rax
const char *Str; // rdi
const char *v14; // rax
char v15; // cl
bool v16; // zf
const char *v17; // rax
__int64 v18; // rcx
__int64 v19; // rdi
__int64 v20; // rdi
__int64 v22; // rdi
__int64 v23; // rax
int v24; // [rsp+20h] [rbp-48h] BYREF
void *Block[2]; // [rsp+28h] [rbp-40h]
struct tinyxml2::XMLNode *v26; // [rsp+78h] [rbp+10h] BYREF
v4 = a2;
if ( a2 )
{
while ( 1 )
{
if ( !*v4 )
return nullptr;
v26 = nullptr;
v6 = tinyxml2::XMLDocument::Identify(*(this + 1), v4, &v26);
if ( !v6 )
return nullptr;
v7 = v26;
if ( !v26 )
return nullptr;
v24 = 0;
*(_OWORD *)Block = 0;
v4 = (char *)(*(__int64 (__fastcall **)(struct tinyxml2::XMLNode *, char *, int *))(*(_QWORD *)v26 + 120LL))(
v26,
v6,
&v24);
v8 = *(_QWORD *)v7;
if ( !v4 )
{
v22 = *((_QWORD *)v7 + 10);
(*(void (__fastcall **)(struct tinyxml2::XMLNode *, _QWORD))(v8 + 128))(v7, 0);
(*(void (__fastcall **)(__int64, struct tinyxml2::XMLNode *))(*(_QWORD *)v22 + 24LL))(v22, v7);
v23 = (__int64)*(this + 1);
if ( !*(_DWORD *)(v23 + 92) )
{
*(_DWORD *)(v23 + 92) = 17;
*(_QWORD *)(v23 + 104) = 0;
*(_QWORD *)(v23 + 112) = 0;
}
if ( (v24 & 0x200) != 0 )
j_j_free_0(Block[0]);
return nullptr;
}
if ( (*(__int64 (__fastcall **)(struct tinyxml2::XMLNode *))(v8 + 8))(v7)
&& *(_DWORD *)((*(__int64 (__fastcall **)(struct tinyxml2::XMLNode *))(*(_QWORD *)v7 + 8LL))(v7) + 88) == 2 )
{
if ( a3 )
{
*(_OWORD *)a3 = *(_OWORD *)((char *)v7 + 24);
*((_QWORD *)a3 + 2) = *((_QWORD *)v7 + 5);
}
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)v7 + 10) + 32LL))(*((_QWORD *)v7 + 10));
v20 = *((_QWORD *)v7 + 10);
(*(void (__fastcall **)(struct tinyxml2::XMLNode *, _QWORD))(*(_QWORD *)v7 + 128LL))(v7, 0);
(*(void (__fastcall **)(__int64, struct tinyxml2::XMLNode *))(*(_QWORD *)v20 + 24LL))(v20, v7);
if ( (v24 & 0x200) != 0 )
j_j_free_0(Block[0]);
return v4;
}
v9 = (*(__int64 (__fastcall **)(struct tinyxml2::XMLNode *))(*(_QWORD *)v7 + 8LL))(v7);
if ( !v9 )
break;
v11 = *(_DWORD *)(v9 + 88);
v10 = (unsigned __int64)Block[1];
if ( Block[0] == Block[1] )
{
if ( v11 )
break;
}
else if ( !v11 )
{
if ( Block[0] == Block[1] )
break;
Str = tinyxml2::StrPair::GetStr((struct tinyxml2::XMLNode *)((char *)v7 + 24));
v14 = tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)&v24);
v10 = 0;
if ( v14 == Str )
break;
v15 = *v14;
if ( *v14 )
{
do
{
if ( !*Str || v15 != *Str )
break;
v16 = (_DWORD)v10 == 0x7FFFFFFF;
if ( (_DWORD)v10 == 0x7FFFFFFF )
goto LABEL_22;
++v14;
++Str;
v10 = (unsigned int)(v10 + 1);
v15 = *v14;
}
while ( *v14 );
v16 = (_DWORD)v10 == 0x7FFFFFFF;
LABEL_22:
if ( v16 )
break;
}
if ( !*v14 && !*Str )
break;
}
v17 = tinyxml2::StrPair::GetStr((struct tinyxml2::XMLNode *)((char *)v7 + 24));
v18 = (__int64)*(this + 1);
*(_QWORD *)(v18 + 112) = 0;
*(_QWORD *)(v18 + 104) = v17;
*(_DWORD *)(v18 + 92) = 16;
v4 = nullptr;
v19 = *((_QWORD *)v7 + 10);
(*(void (__fastcall **)(struct tinyxml2::XMLNode *, _QWORD))(*(_QWORD *)v7 + 128LL))(v7, 0);
(*(void (__fastcall **)(__int64, struct tinyxml2::XMLNode *))(*(_QWORD *)v19 + 24LL))(v19, v7);
LABEL_28:
if ( (v24 & 0x200) != 0 )
j_j_free_0(Block[0]);
if ( !v4 )
return nullptr;
}
v12 = (__int64)*(this + 7);
if ( v12 )
{
*(_QWORD *)(v12 + 72) = v7;
*((_QWORD *)v7 + 8) = *(this + 7);
*(this + 7) = v7;
}
else
{
*(this + 7) = v7;
*(this + 6) = v7;
*((_QWORD *)v7 + 8) = 0;
}
*((_QWORD *)v7 + 9) = 0;
*((_QWORD *)v7 + 2) = this;
(*(void (__fastcall **)(_QWORD, unsigned __int64))(**((_QWORD **)v7 + 10) + 32LL))(*((_QWORD *)v7 + 10), v10);
goto LABEL_28;
}
return nullptr;
}