//
// tinyxml2::XMLDocument::Parse from 0x5eea8c to 0x5eeaf8 (108 bytes)
//
// 2 xrefs:
// > cocos2d::CCSAXParser::parse @ 0x5de49c
// > sub_5EB9B4 @ 0x5eba14
//
// 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
//
int __fastcall tinyxml2::XMLDocument::Parse(tinyxml2::XMLDocument *this, char *a2, size_t a3)
{
void *v6; // r0
const char *v7; // r1
unsigned __int8 *v8; // r0
bool *v9; // r2
unsigned __int8 *BOM; // r0
tinyxml2::XMLNode::DeleteChildren((int)this);
tinyxml2::XMLDocument::InitDocument(this);
if ( !a2 || !*a2 )
goto LABEL_7;
if ( a3 == -1 )
a3 = strlen(a2);
v6 = (void *)operator new[](a3 + 1);
*((_DWORD *)this + 16) = v6;
memcpy(v6, a2, a3);
*(_BYTE *)(*((_DWORD *)this + 16) + a3) = 0;
v8 = (unsigned __int8 *)tinyxml2::XMLUtil::SkipWhiteSpace((tinyxml2::XMLUtil *)a2, v7);
BOM = tinyxml2::XMLUtil::ReadBOM(v8, (char *)this + 44, v9);
if ( BOM && *BOM )
(*(void (__fastcall **)(tinyxml2::XMLDocument *, _DWORD, _DWORD))(*(_DWORD *)this + 60))(
this,
*((_DWORD *)this + 16),
0);
else
LABEL_7:
tinyxml2::XMLDocument::SetError(this, 15, 0, 0);
return *((_DWORD *)this + 12);
}