//
// cocos2d::CCUserDefault::setDoubleForKey from 0x1800a3120 to 0x1800a324b (299 bytes)
//
// 6 xrefs:
// > cocos2d::CCUserDefault::setFloatForKey @ 0x1800a3254
// > ??> @ 0x1801483cc
// > ??> @ 0x1801483e0
// > ??> @ 0x1801483f0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c18fc
//
// 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:14 +0000
//
void __fastcall cocos2d::CCUserDefault::setDoubleForKey(cocos2d::CCUserDefault *this, char *a2, double a3)
{
const struct tinyxml2::XMLElement *v4; // rax
tinyxml2::XMLDocument *v5; // rdi
struct tinyxml2::XMLElement *v6; // rbx
tinyxml2::XMLNode *v7; // rcx
struct tinyxml2::XMLNode *v8; // rax
const char *v9; // rdx
tinyxml2::XMLNode *v10; // [rsp+20h] [rbp-58h] BYREF
tinyxml2::XMLDocument *v11; // [rsp+28h] [rbp-50h] BYREF
char v12[16]; // [rsp+30h] [rbp-48h] BYREF
__int128 v13; // [rsp+40h] [rbp-38h]
__int128 v14; // [rsp+50h] [rbp-28h]
__int16 v15; // [rsp+60h] [rbp-18h]
if ( !a2 )
return;
v15 = 0;
*(_OWORD *)v12 = 0;
v13 = 0;
v14 = 0;
sub_1800095F0(v12, "%f", a3);
v4 = sub_1800A2AE0(a2, &v10, &v11);
v5 = v11;
v6 = v4;
if ( v4 )
{
v7 = *((tinyxml2::XMLNode **)v4 + 6);
if ( v7 )
{
tinyxml2::XMLNode::SetValue(v7, v12, 0);
goto LABEL_8;
}
}
else
{
if ( !v10 )
goto LABEL_8;
v6 = tinyxml2::XMLDocument::NewElement(v11, a2);
tinyxml2::XMLNode::InsertEndChild(v10, v6);
}
v8 = tinyxml2::XMLDocument::NewText(v5, v12);
tinyxml2::XMLNode::InsertEndChild(v6, v8);
LABEL_8:
if ( v5 )
{
cocos2d::CCUserDefault::sharedUserDefault();
v9 = (const char *)&cocos2d::CCUserDefault::m_sFilePath;
if ( *((_QWORD *)&xmmword_1801B2AA0 + 1) > 0xFu )
v9 = cocos2d::CCUserDefault::m_sFilePath;
tinyxml2::XMLDocument::SaveFile((__int64)v5, v9, 0);
(*(void (__fastcall **)(tinyxml2::XMLDocument *, __int64))(*(_QWORD *)v5 + 128LL))(v5, 1);
}
}