//
// cocos2d::CCUserDefault::setBoolForKey from 0x1800a2f10 to 0x1800a3112 (514 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c18f0
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCUserDefault::setBoolForKey(cocos2d::CCUserDefault *this, char *a2, char a3)
{
void *v5; // rcx
const struct tinyxml2::XMLElement *v6; // rax
struct tinyxml2::XMLElement *v7; // rbx
tinyxml2::XMLDocument *v8; // rdi
tinyxml2::XMLNode *v9; // rcx
struct tinyxml2::XMLNode *v10; // rax
const char *v11; // rdx
tinyxml2::XMLNode *v12; // [rsp+30h] [rbp-48h] BYREF
tinyxml2::XMLDocument *v13; // [rsp+38h] [rbp-40h] BYREF
void *Block[2]; // [rsp+40h] [rbp-38h] BYREF
__m128i si128; // [rsp+50h] [rbp-28h]
if ( a3 == 1 )
{
sub_180005A10(Block, "true");
cocos2d::CCUserDefault::setStringForKey(this, a2, Block);
if ( si128.m128i_i64[1] <= 0xFuLL )
return;
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
goto LABEL_21;
}
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_180106010);
LODWORD(Block[0]) = *(_DWORD *)"false";
WORD2(Block[0]) = (unsigned __int8)aFalse[4];
if ( a2 )
{
v6 = sub_1800A2AE0(a2, &v12, &v13);
v7 = v6;
v8 = v13;
if ( v6 )
{
v9 = *((tinyxml2::XMLNode **)v6 + 6);
if ( v9 )
{
tinyxml2::XMLNode::SetValue(v9, (char *)Block, 0);
goto LABEL_13;
}
}
else
{
if ( !v12 )
goto LABEL_13;
v7 = tinyxml2::XMLDocument::NewElement(v13, a2);
tinyxml2::XMLNode::InsertEndChild(v12, v7);
}
v10 = tinyxml2::XMLDocument::NewText(v8, (const char *)Block);
tinyxml2::XMLNode::InsertEndChild(v7, v10);
LABEL_13:
if ( v8 )
{
cocos2d::CCUserDefault::sharedUserDefault();
v11 = (const char *)&cocos2d::CCUserDefault::m_sFilePath;
if ( *((_QWORD *)&xmmword_1801B2AA0 + 1) > 0xFu )
v11 = cocos2d::CCUserDefault::m_sFilePath;
tinyxml2::XMLDocument::SaveFile((__int64)v8, v11, 0);
(*(void (__fastcall **)(tinyxml2::XMLDocument *, __int64))(*(_QWORD *)v8 + 128LL))(v8, 1);
}
}
if ( si128.m128i_i64[1] <= 0xFuLL )
return;
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
LABEL_21:
j_j_free_0(v5);
}