//
// tinyxml2::XMLDocument::Parse from 0x18009dec0 to 0x18009dfc9 (265 bytes)
//
// 4 xrefs:
// > cocos2d::CCSAXParser::parse @ 0x180074e46
// > sub_1800A2AE0 @ 0x1800a2be4
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c117c
//
// 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
//
__int64 __fastcall tinyxml2::XMLDocument::Parse(__int64 a1, __int64 a2, size_t a3)
{
void *v6; // rcx
void *v7; // rax
char i; // al
tinyxml2::XMLNode::DeleteChildren((tinyxml2::XMLNode *)a1);
v6 = *(void **)(a1 + 120);
*(_DWORD *)(a1 + 92) = 0;
*(_QWORD *)(a1 + 104) = 0;
*(_QWORD *)(a1 + 112) = 0;
j_j_free_0(v6);
*(_QWORD *)(a1 + 120) = 0;
if ( !a2 || !*(_BYTE *)a2 )
goto LABEL_15;
if ( a3 == -1 )
a3 = strlen((const char *)a2);
v7 = (void *)sub_1800E4C6C(a3 + 1);
*(_QWORD *)(a1 + 120) = v7;
memcpy(v7, (const void *)a2, a3);
*(_BYTE *)(a3 + *(_QWORD *)(a1 + 120)) = 0;
for ( i = *(_BYTE *)a2; i >= 0; i = *(_BYTE *)++a2 )
{
if ( !isspace((unsigned __int8)i) )
break;
}
*(_BYTE *)(a1 + 88) = 0;
if ( *(_BYTE *)a2 == 0xEF && *(_BYTE *)(a2 + 1) == 0xBB && *(_BYTE *)(a2 + 2) == 0xBF )
{
*(_BYTE *)(a1 + 88) = 1;
a2 += 3;
}
if ( a2 && *(_BYTE *)a2 )
{
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)a1 + 120LL))(a1, *(_QWORD *)(a1 + 120), 0);
return *(unsigned int *)(a1 + 92);
}
else
{
LABEL_15:
*(_QWORD *)(a1 + 112) = 0;
*(_DWORD *)(a1 + 92) = 15;
*(_QWORD *)(a1 + 104) = 0;
return 15;
}
}