//
// cocos2d::CCUserDefault::getDoubleForKey from 0x1006b0690 to 0x1006b0818 (392 bytes)
//
// 1 xrefs:
// > cocos2d::CCUserDefault::getDoubleForKey_1 @ 0x1006b0688
//
// 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 12:35:24 +0000
//
double __fastcall cocos2d::CCUserDefault::getDoubleForKey(double result, __int64 a2, char *a3)
{
_QWORD *v4; // rax
_QWORD *v5; // r14
__int64 v6; // rdi
const char *v7; // rdi
NSUserDefaults *v8; // rax
__int64 v9; // rbx
__int64 v10; // rdi
const char *data; // rsi
__int64 v12; // r15
__int64 v13; // rdi
const char *v14; // rsi
NSUserDefaults *v15; // r14
NSString *v16; // rax
id v17; // rax
double v18; // [rsp+8h] [rbp-28h]
__int64 v19[4]; // [rsp+10h] [rbp-20h] BYREF
v18 = result;
v19[0] = 0;
v4 = (_QWORD *)sub_1006AFEB0(a3, v19);
if ( v4 )
{
v5 = v4;
v6 = v4[6];
if ( v6 )
{
v7 = (const char *)sub_10005AD20((int *)(v6 + 24));
v18 = atof(v7);
cocos2d::CCUserDefault::setDoubleForKey(v7, a3);
v8 = +[NSUserDefaults standardUserDefaults](&OBJC_CLASS___NSUserDefaults, "standardUserDefaults");
-[NSUserDefaults synchronize](v8, "synchronize");
v9 = v19[0];
v10 = v5[2];
sub_10005C340(v10, v5);
cocos2d::CCUserDefault::sharedUserDefault(v10);
if ( (*(_BYTE *)&stru_100BE8C08.__r_.__value_.__s.0 & 1) != 0 )
data = stru_100BE8C08.__r_.__value_.__l.__data_;
else
data = stru_100BE8C08.__r_.__value_.__s.__data_;
sub_10005FED0(v9, data, 0);
if ( v9 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 136LL))(v9);
return v18;
}
v12 = v19[0];
v13 = v4[2];
sub_10005C340(v13, v4);
cocos2d::CCUserDefault::sharedUserDefault(v13);
if ( (*(_BYTE *)&stru_100BE8C08.__r_.__value_.__s.0 & 1) != 0 )
v14 = stru_100BE8C08.__r_.__value_.__l.__data_;
else
v14 = stru_100BE8C08.__r_.__value_.__s.__data_;
sub_10005FED0(v12, v14, 0);
if ( v12 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 136LL))(v12);
}
v15 = +[NSUserDefaults standardUserDefaults](&OBJC_CLASS___NSUserDefaults, "standardUserDefaults");
v16 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", a3);
v17 = -[NSUserDefaults objectForKey:](v15, "objectForKey:", v16);
if ( v17 )
{
objc_msgSend(v17, "doubleValue");
return result;
}
return v18;
}