//
// tinyxml2::XMLNode::InsertEndChild from 0xb2499c to 0xb249fc (96 bytes)
//
// 12 xrefs:
// > sub_B0449C @ 0xb0450c
// > sub_B0449C @ 0xb045a4
// > sub_B0460C @ 0xb0466c
// > sub_B0460C @ 0xb04684
// > sub_B0460C @ 0xb046a8
// > cocos2d::CCFileUtils::writeToFile @ 0xb0471c
// > cocos2d::CCFileUtils::writeToFile @ 0xb04738
// > cocos2d::CCFileUtils::writeToFile @ 0xb04774
// > cocos2d::CCFileUtils::writeToFile @ 0xb04790
// > tinyxml2::XMLNode::InsertAfterChild @ 0xb24ad8
// > tinyxml2::XMLNode::ParseDeep @ 0xb27a44
// > ??> @ 0xb2350
//
// 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
//
tinyxml2::XMLNode *__fastcall tinyxml2::XMLNode::InsertEndChild(tinyxml2::XMLNode *this, tinyxml2::XMLNode *a2)
{
__int64 v2; // x2
__int64 v3; // x2
v2 = *((_QWORD *)this + 7);
if ( v2 )
{
*(_QWORD *)(v2 + 72) = a2;
*((_QWORD *)a2 + 8) = v2;
*((_QWORD *)this + 7) = a2;
}
else
{
*((_QWORD *)this + 7) = a2;
*((_QWORD *)this + 6) = a2;
*((_QWORD *)a2 + 8) = 0;
}
*((_QWORD *)a2 + 9) = 0;
v3 = *((_QWORD *)a2 + 10);
*((_QWORD *)a2 + 2) = this;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 40LL))(v3);
return a2;
}