//
// tinyxml2::XMLDocument::NewUnknown from 0x18009a050 to 0x18009a105 (181 bytes)
//
// 3 xrefs:
// > tinyxml2::XMLUnknown::ShallowClone @ 0x18009cb26
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b6f00
//
// 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
//
struct tinyxml2::XMLUnknown *__fastcall tinyxml2::XMLDocument::NewUnknown(tinyxml2::XMLDocument *this, const char *a2)
{
char *v2; // rdi
__int64 v5; // rsi
__int64 v6; // rbx
void *v7; // rax
__int64 v8; // rcx
v2 = (char *)this + 512;
v5 = (*(__int64 (__fastcall **)(char *))(*((_QWORD *)this + 64) + 16LL))((char *)this + 512);
*(_QWORD *)(v5 + 8) = this;
v6 = -1;
*(_QWORD *)(v5 + 16) = 0;
*(_QWORD *)(v5 + 48) = 0;
*(_QWORD *)(v5 + 56) = 0;
*(_QWORD *)(v5 + 64) = 0;
*(_QWORD *)(v5 + 72) = 0;
*(_QWORD *)v5 = &tinyxml2::XMLUnknown::`vftable';
*(_QWORD *)(v5 + 80) = v2;
*(_DWORD *)(v5 + 24) = 0;
*(_QWORD *)(v5 + 32) = 0;
*(_QWORD *)(v5 + 40) = 0;
do
++v6;
while ( a2[v6] );
v7 = operator new(v6 + 1);
*(_QWORD *)(v5 + 32) = v7;
memcpy(v7, a2, v6 + 1);
v8 = *(_QWORD *)(v5 + 32);
*(_DWORD *)(v5 + 24) = 512;
*(_QWORD *)(v5 + 40) = v6 + v8;
return (struct tinyxml2::XMLUnknown *)v5;
}