//
// cocos2d::CCUserDefault::getIntegerForKey from 0x1005de870 to 0x1005de9fa (394 bytes)
//
// 1 xrefs:
// > cocos2d::CCUserDefault::getIntegerForKey_1 @ 0x1005de867
//
// 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
//
int __fastcall cocos2d::CCUserDefault::getIntegerForKey(cocos2d::CCUserDefault *a1, const char *a2, int a3)
{
_QWORD *v5; // rax
_QWORD *v6; // r15
__int64 v7; // rdi
char *v8; // rdi
NSUserDefaults *v9; // rax
__int64 v10; // r14
const char *data; // rsi
__int64 v12; // r12
const char *v13; // rsi
NSUserDefaults *v14; // r15
NSString *v15; // rax
id v16; // rax
__int64 v18[5]; // [rsp+8h] [rbp-28h] BYREF
v18[0] = 0;
v5 = (_QWORD *)sub_1005DE5A0((char *)a2, v18);
if ( v5 )
{
v6 = v5;
v7 = v5[6];
if ( v7 )
{
v8 = (char *)sub_100093910((int *)(v7 + 24));
a3 = atoi(v8);
cocos2d::CCUserDefault::setIntegerForKey((cocos2d::CCUserDefault *)v8, a2, a3);
v9 = +[NSUserDefaults standardUserDefaults](&OBJC_CLASS___NSUserDefaults, "standardUserDefaults");
-[NSUserDefaults synchronize](v9, "synchronize");
v10 = v18[0];
sub_100094F30(v6[2], v6);
cocos2d::CCUserDefault::sharedUserDefault();
if ( (*(_BYTE *)&stru_1009A4FD0.__r_.__value_.__s.0 & 1) != 0 )
data = stru_1009A4FD0.__r_.__value_.__l.__data_;
else
data = stru_1009A4FD0.__r_.__value_.__s.__data_;
sub_100098AC0(v10, data, 0);
if ( v10 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v10 + 136LL))(v10);
return a3;
}
v12 = v18[0];
sub_100094F30(v5[2], v5);
cocos2d::CCUserDefault::sharedUserDefault();
if ( (*(_BYTE *)&stru_1009A4FD0.__r_.__value_.__s.0 & 1) != 0 )
v13 = stru_1009A4FD0.__r_.__value_.__l.__data_;
else
v13 = stru_1009A4FD0.__r_.__value_.__s.__data_;
sub_100098AC0(v12, v13, 0);
if ( v12 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 136LL))(v12);
}
v14 = +[NSUserDefaults standardUserDefaults](&OBJC_CLASS___NSUserDefaults, "standardUserDefaults");
v15 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", a2);
v16 = -[NSUserDefaults objectForKey:](v14, "objectForKey:", v15);
if ( v16 )
return (unsigned int)objc_msgSend(v16, "intValue");
return a3;
}