//
// tinyxml2::XMLDocument::SaveFile from 0x18009c280 to 0x18009c314 (148 bytes)
//
// 8 xrefs:
// > cocos2d::CCFileUtils::writeToFile @ 0x180072318
// > cocos2d::CCUserDefault::createXMLFile @ 0x18009e891
// > cocos2d::CCUserDefault::setBoolForKey @ 0x18009f37b
// > cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f4fa
// > cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f635
// > cocos2d::CCUserDefault::setStringForKey @ 0x18009f73c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b720c
//
// 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
//
__int64 __fastcall tinyxml2::XMLDocument::SaveFile(__int64 a1, const char *a2, char a3)
{
errno_t v6; // eax
FILE *Stream; // [rsp+48h] [rbp+20h] BYREF
Stream = nullptr;
v6 = fopen_s(&Stream, a2, "w");
if ( !Stream || v6 )
{
*(_DWORD *)(a1 + 92) = 4;
*(_QWORD *)(a1 + 104) = a2;
*(_QWORD *)(a1 + 112) = 0;
return 4;
}
else
{
tinyxml2::XMLDocument::SaveFile((_DWORD *)a1, Stream, a3);
fclose(Stream);
return *(unsigned int *)(a1 + 92);
}
}