//
// FileSaveManager::firstLoad from 0x698c2c to 0x699064 (1080 bytes)
//
// 2 xrefs:
// > ??> @ 0x89230
// > ??> @ 0x1419988
//
// This function is hookable on this platform (idp: arm, 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:50:39 +0000
//
__int64 __fastcall FileSaveManager::firstLoad(FileSaveManager *this)
{
cocos2d::CCObject *StoreData; // x20
cocos2d::CCString *v3; // x0
const char *CString; // x0
char *v5; // x21
size_t v6; // x0
__int64 v7; // x20
cocos2d::CCDictionary *v8; // x24
cocos2d::CCString *v9; // x0
char *v10; // x20
size_t v11; // x0
int v12; // w25
size_t v13; // x21
int v14; // w23
size_t v15; // x20
char *v16; // x0
char *v17; // x1
size_t v18; // x2
int v19; // w22
unsigned int v21; // w20
cocos2d::CCArray *v22; // x23
cocos2d::CCString *v23; // x0
const char *v24; // x0
char *v25; // x22
size_t v26; // x0
void *v27; // x21
__int64 v28; // x28
size_t v29; // x0
__int64 v30; // x20
size_t v31; // x0
char *v32; // [xsp+70h] [xbp+70h]
cocos2d::CCArray *v33; // [xsp+78h] [xbp+78h]
unsigned int v34; // [xsp+8Ch] [xbp+8Ch]
__int64 v35; // [xsp+98h] [xbp+98h] BYREF
size_t v36; // [xsp+A0h] [xbp+A0h]
void *v37; // [xsp+A8h] [xbp+A8h]
__int64 v38; // [xsp+B0h] [xbp+B0h] BYREF
size_t v39; // [xsp+B8h] [xbp+B8h]
void *v40; // [xsp+C0h] [xbp+C0h]
v34 = 0;
StoreData = (cocos2d::CCObject *)FileSaveManager::getStoreData(this);
cocos2d::CCObject::retain(StoreData);
*((_QWORD *)this + 44) = StoreData;
v33 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(StoreData);
if ( (unsigned int)cocos2d::CCArray::count(v33) )
{
do
{
v3 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v33, v34);
CString = (const char *)cocos2d::CCString::getCString(v3);
v38 = 0;
v39 = 0;
v5 = (char *)CString;
v40 = nullptr;
v32 = (char *)CString;
v6 = strlen(CString);
v7 = *((_QWORD *)this + 44);
std::string::__init(&v38, v5, v6);
v8 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(v7, &v38);
if ( (v38 & 1) != 0 )
operator delete(v40);
v38 = 0;
v39 = 0;
v40 = nullptr;
std::string::__init(&v38, "category", 8u);
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v8, &v38);
v10 = (char *)cocos2d::CCString::getCString(v9);
if ( (v38 & 1) != 0 )
operator delete(v40);
v35 = 0;
v36 = 0;
v37 = nullptr;
v11 = strlen(v10);
std::string::__init(&v35, v10, v11);
v38 = 0;
v39 = 0;
v40 = nullptr;
std::string::__init(&v38, "group", 5u);
v12 = v35 & 1;
if ( (v35 & 1) != 0 )
{
v14 = v38 & 1;
v13 = v36;
if ( (v38 & 1) != 0 )
{
v15 = v39;
v16 = (char *)v37;
goto LABEL_11;
}
v15 = (unsigned __int8)v38 >> 1;
v17 = (char *)&v38 + 1;
v16 = (char *)v37;
}
else
{
v13 = (unsigned __int8)v35 >> 1;
v14 = v38 & 1;
if ( (v38 & 1) != 0 )
{
v15 = v39;
v16 = (char *)&v35 + 1;
LABEL_11:
v17 = (char *)v40;
v14 = 1;
goto LABEL_12;
}
v15 = (unsigned __int8)v38 >> 1;
v17 = (char *)&v38 + 1;
v16 = (char *)&v35 + 1;
}
LABEL_12:
if ( v15 > v13 )
v18 = v13;
else
v18 = v15;
if ( v18 && (v19 = memcmp(v16, v17, v18)) != 0 )
{
if ( !v14 )
goto LABEL_18;
}
else
{
v19 = v13 > v15;
if ( v13 < v15 )
v19 = -1;
if ( !v14 )
{
LABEL_18:
if ( !v12 )
goto LABEL_19;
goto LABEL_22;
}
}
operator delete(v40);
if ( (v35 & 1) == 0 )
{
LABEL_19:
if ( !v19 )
goto LABEL_23;
goto LABEL_20;
}
LABEL_22:
operator delete(v37);
if ( !v19 )
{
LABEL_23:
v21 = 0;
v22 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v8);
if ( (unsigned int)cocos2d::CCArray::count(v22) )
{
do
{
v23 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v22, v21);
v24 = (const char *)cocos2d::CCString::getCString(v23);
v38 = 0;
v39 = 0;
v25 = (char *)v24;
v40 = nullptr;
v26 = strlen(v24);
std::string::__init(&v38, v25, v26);
v27 = (void *)cocos2d::CCDictionary::objectForKey(v8, &v38);
if ( (v38 & 1) != 0 )
operator delete(v40);
if ( v27
&& _dynamic_cast(
v27,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,
0)
&& (v38 = 0,
v39 = 0,
v40 = nullptr,
v28 = *((_QWORD *)this + 44),
v29 = strlen(v25),
std::string::__init(&v38, v25, v29),
cocos2d::CCDictionary::setObject(v28, (cocos2d::CCObject *)v27),
(v38 & 1) != 0) )
{
++v21;
operator delete(v40);
}
else
{
++v21;
}
}
while ( v21 < (unsigned int)cocos2d::CCArray::count(v22) );
}
v38 = 0;
v39 = 0;
v40 = nullptr;
v30 = *((_QWORD *)this + 44);
v31 = strlen(v32);
std::string::__init(&v38, v32, v31);
cocos2d::CCDictionary::removeObjectForKey(v30, &v38);
if ( (v38 & 1) != 0 )
operator delete(v40);
}
LABEL_20:
++v34;
}
while ( v34 < (unsigned int)cocos2d::CCArray::count(v33) );
}
return _stack_chk_guard;
}