//
// FileSaveManager::firstLoad from 0x100006da0 to 0x10000727e (1246 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008b00d8
//
// 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
//
void __fastcall FileSaveManager::firstLoad(FileSaveManager *a1)
{
double v1; // xmm0_8
__int64 v2; // r15
cocos2d::CCArray *v3; // rbx
cocos2d::CCString *v4; // rax
char *CString; // rax
cocos2d::CCDictionary *m_storeData; // rbx
size_t v7; // rax
size_t v8; // r14
char *v9; // r15
size_t v10; // r12
cocos2d::CCString *v11; // rax
const char *v12; // rbx
size_t v13; // rax
size_t v14; // r14
char *v15; // r15
size_t v16; // r12
char v17; // r14
void *v18; // rbx
size_t v19; // rdx
char *v20; // rdi
bool v21; // zf
bool v22; // r15
bool v23; // r12
cocos2d::CCArray *v24; // rbx
unsigned int v25; // r12d
cocos2d::CCString *v26; // rax
const char *v27; // r14
size_t v28; // rax
size_t v29; // r15
char *v30; // rbx
__int64 v31; // rax
size_t v32; // r13
const void *v33; // r13
cocos2d::CCDictionary *v34; // r15
size_t v35; // rax
size_t v36; // rbx
char *v37; // rax
__int64 v38; // rax
size_t v39; // r15
char *v40; // r15
cocos2d::CCDictionary *v41; // rbx
size_t v42; // rax
size_t v43; // r14
char *v44; // r15
size_t v45; // r12
char __s2[23]; // [rsp+1h] [rbp-8Fh] BYREF
cocos2d::CCArray *v47; // [rsp+18h] [rbp-78h]
cocos2d::CCDictionary *v48; // [rsp+20h] [rbp-70h]
__int64 v49; // [rsp+28h] [rbp-68h]
cocos2d::CCArray *v50; // [rsp+30h] [rbp-60h]
cocos2d::CCDictionary *v51; // [rsp+38h] [rbp-58h]
FileSaveManager *v52; // [rsp+40h] [rbp-50h]
void *__src; // [rsp+48h] [rbp-48h]
__int128 __dst; // [rsp+50h] [rbp-40h] BYREF
void *__p; // [rsp+60h] [rbp-30h]
v2 = 0;
cocos2d::CCObject::retain(nullptr);
v52 = a1;
a1->m_storeData = nullptr;
v3 = cocos2d::CCDictionary::allKeys(nullptr);
if ( (unsigned int)sub_100720070(v3) )
{
v50 = v3;
while ( 1 )
{
v4 = (cocos2d::CCString *)sub_1007200C0(v3, (unsigned int)v2);
CString = (char *)cocos2d::CCString::getCString(v4);
m_storeData = v52->m_storeData;
__src = CString;
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_68:
sub_100006BF0(v1);
v8 = v7;
v49 = v2;
if ( v7 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v7;
v9 = (char *)&__dst + 1;
if ( v7 )
goto LABEL_11;
LABEL_12:
v9[v8] = 0;
v51 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1(m_storeData, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 16;
strcpy((char *)&__dst + 1, "category");
v11 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v51, &__dst);
v12 = cocos2d::CCString::getCString(v11);
if ( (__dst & 1) != 0 )
operator delete(__p);
v13 = strlen(v12);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_68;
v14 = v13;
if ( v13 >= 0x17 )
{
v16 = (v13 | 7) + 1;
if ( (v13 | 7) == 0x17 )
v16 = 26;
v15 = (char *)operator new(v16);
__p = v15;
*(_QWORD *)&__dst = v16 + 1;
*((_QWORD *)&__dst + 1) = v14;
LABEL_23:
memmove(v15, v12, v14);
goto LABEL_24;
}
LOBYTE(__dst) = 2 * v13;
v15 = (char *)&__dst + 1;
if ( v13 )
goto LABEL_23;
LABEL_24:
v15[v14] = 0;
strcpy(__s2, "group");
v17 = __dst;
v18 = __p;
if ( (__dst & 1) != 0 )
{
v19 = *((_QWORD *)&__dst + 1);
v20 = (char *)__p;
}
else
{
v19 = (unsigned __int8)__dst >> 1;
v20 = (char *)&__dst + 1;
}
v21 = v19 == 5;
if ( v19 >= 5 )
v19 = 5;
v22 = v21;
v23 = memcmp(v20, __s2, v19) == 0;
if ( (v17 & 1) != 0 )
operator delete(v18);
if ( !v22 || !v23 )
goto LABEL_3;
v24 = cocos2d::CCDictionary::allKeys(v51);
if ( (unsigned int)sub_100720070(v24) )
{
v25 = 0;
v47 = v24;
while ( 1 )
{
v26 = (cocos2d::CCString *)sub_1007200C0(v24, v25);
v27 = cocos2d::CCString::getCString(v26);
v28 = strlen(v27);
if ( v28 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_68;
v29 = v28;
if ( v28 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v28;
v30 = (char *)&__dst + 1;
if ( v28 )
goto LABEL_42;
LABEL_43:
v30[v29] = 0;
v33 = (const void *)cocos2d::CCDictionary::objectForKey_1(v51, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( !v33
|| !__dynamic_cast(
v33,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,
0) )
{
goto LABEL_34;
}
v34 = v52->m_storeData;
v35 = strlen(v27);
if ( v35 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_68;
v36 = v35;
v48 = v52->m_storeData;
if ( v35 >= 0x17 )
{
v38 = v35 | 7;
v39 = 26;
if ( (v36 | 7) != 0x17 )
v39 = v38 + 1;
v37 = (char *)operator new(v39);
__p = v37;
*(_QWORD *)&__dst = v39 + 1;
*((_QWORD *)&__dst + 1) = v36;
LABEL_54:
v40 = v37;
memmove(v37, v27, v36);
v37 = v40;
v34 = v48;
goto LABEL_55;
}
LOBYTE(__dst) = 2 * v35;
v37 = (char *)&__dst + 1;
if ( v36 )
goto LABEL_54;
LABEL_55:
v37[v36] = 0;
cocos2d::CCDictionary::setObject_1(v34, v33, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
LABEL_34:
++v25;
v24 = v47;
if ( v25 >= (unsigned int)sub_100720070(v47) )
goto LABEL_57;
}
v31 = v28 | 7;
v32 = 26;
if ( (v29 | 7) != 0x17 )
v32 = v31 + 1;
v30 = (char *)operator new(v32);
__p = v30;
*(_QWORD *)&__dst = v32 + 1;
*((_QWORD *)&__dst + 1) = v29;
LABEL_42:
memmove(v30, v27, v29);
goto LABEL_43;
}
LABEL_57:
v41 = v52->m_storeData;
v42 = strlen((const char *)__src);
if ( v42 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_68;
v43 = v42;
if ( v42 >= 0x17 )
{
v45 = (v42 | 7) + 1;
if ( (v42 | 7) == 0x17 )
v45 = 26;
v44 = (char *)operator new(v45);
__p = v44;
*(_QWORD *)&__dst = v45 + 1;
*((_QWORD *)&__dst + 1) = v43;
LABEL_64:
memmove(v44, __src, v43);
goto LABEL_65;
}
LOBYTE(__dst) = 2 * v42;
v44 = (char *)&__dst + 1;
if ( v42 )
goto LABEL_64;
LABEL_65:
v44[v43] = 0;
cocos2d::CCDictionary::removeObjectForKey_1(v41, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
LABEL_3:
v2 = (unsigned int)(v49 + 1);
v3 = v50;
if ( (unsigned int)v2 >= (unsigned int)sub_100720070(v50) )
return;
}
v10 = (v7 | 7) + 1;
if ( (v7 | 7) == 0x17 )
v10 = 26;
v9 = (char *)operator new(v10);
__p = v9;
*(_QWORD *)&__dst = v10 + 1;
*((_QWORD *)&__dst + 1) = v8;
LABEL_11:
memmove(v9, __src, v8);
goto LABEL_12;
}
}