//
// tinyxml2::XMLDocument::NewDeclaration from 0x18009da50 to 0x18009db1d (205 bytes)
//
// 5 xrefs:
// > cocos2d::CCFileUtils::writeToFile @ 0x180074591
// > tinyxml2::XMLDeclaration::ShallowClone @ 0x1800a06b6
// > cocos2d::CCUserDefault::createXMLFile @ 0x1800a24f0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c1134
//
// 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
//
struct tinyxml2::XMLDeclaration *__fastcall tinyxml2::XMLDocument::NewDeclaration(
tinyxml2::XMLDocument *this,
const char *a2)
{
char *v2; // rdi
__int64 v5; // rax
const char *v6; // rsi
__int64 v7; // r14
size_t v8; // rdi
void *v9; // rax
__int64 v10; // rax
v2 = (char *)this + 512;
v5 = (*(__int64 (__fastcall **)(char *))(*((_QWORD *)this + 64) + 16LL))((char *)this + 512);
v6 = "xml version=\"1.0\" encoding=\"UTF-8\"";
v7 = v5;
*(_QWORD *)(v5 + 16) = 0;
if ( a2 )
v6 = a2;
*(_QWORD *)(v5 + 48) = 0;
*(_QWORD *)(v5 + 56) = 0;
*(_QWORD *)(v5 + 64) = 0;
*(_QWORD *)(v5 + 72) = 0;
*(_QWORD *)(v5 + 8) = this;
*(_QWORD *)v5 = &tinyxml2::XMLDeclaration::`vftable';
*(_QWORD *)(v5 + 80) = v2;
*(_DWORD *)(v5 + 24) = 0;
*(_QWORD *)(v5 + 32) = 0;
*(_QWORD *)(v5 + 40) = 0;
v8 = strlen(v6);
v9 = (void *)sub_1800E4C6C(v8 + 1);
*(_QWORD *)(v7 + 32) = v9;
memcpy(v9, v6, v8 + 1);
v10 = *(_QWORD *)(v7 + 32);
*(_DWORD *)(v7 + 24) = 512;
*(_QWORD *)(v7 + 40) = v8 + v10;
return (struct tinyxml2::XMLDeclaration *)v7;
}