//
// GameManager::recountUserStats from 0x140184bc0 to 0x140185cef (4399 bytes)
//
// 3 xrefs:
// > GameManager::dataLoaded @ 0x140188602
// > GJAccountManager::onSyncAccountCompleted @ 0x1402035f2
// > ??> @ 0x1406cb61c
//
// 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
//
// Hidden C++ exception states: #wind=34
void __fastcall GameManager::recountUserStats(GameManager *a1, __int64 *a2)
{
__int64 v3; // rax
__int64 v4; // rax
const char *v5; // rcx
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // r8
__int128 *v9; // rcx
__int128 *v10; // rax
__int64 v11; // rdx
char *v12; // rdi
size_t v13; // r8
void **v14; // rcx
unsigned __int64 v15; // rsi
size_t v16; // r8
int v17; // ebx
int v18; // r12d
int v19; // r15d
int v20; // r13d
std::_List_val>::_Nodeptr Myhead; // rdi
__int64 *v22; // rbx
int v23; // esi
GameLevelManager *v24; // rcx
GJGameLevel *MainLevel; // r14
int v26; // esi
GameStatsManager *v27; // rcx
unsigned int v28; // edi
int v29; // r15d
_QWORD *v30; // rcx
__int64 v31; // rbx
__int64 v32; // rbx
__int64 i; // rsi
GJGameLevel *v34; // rbx
GameStatsManager *v35; // rcx
bool hasCompletedLevel; // r14
unsigned int v37; // edx
__int64 v38; // rcx
int v39; // edi
float v40; // xmm0_4
float v41; // xmm0_4
GameStatsManager *v42; // rcx
int random; // ecx
int seed; // edx
int v45; // eax
cocos2d::CCDictionary *v46; // r15
_BYTE *v47; // r9
_BYTE *v48; // rcx
const char *v49; // rdx
__int64 v50; // r8
cocos2d::CCArray *v51; // rsi
void *v52; // rcx
unsigned int v53; // edi
cocos2d::CCString *v54; // rax
__int64 v55; // rbx
struct cocos2d::CCString *v56; // rax
cocos2d::CCArray *v57; // r14
__int64 v58; // rsi
cocos2d::CCString *v59; // rax
int v60; // eax
int v61; // ebx
GameStatsManager *v62; // rcx
GameStatsManager *v63; // rcx
cocos2d::CCArray *CompletedMapPacks; // r14
unsigned int j; // ebx
cocos2d::CCString *v66; // rax
int v67; // esi
__int64 v68; // rdi
cocos2d::CCString *v69; // rax
const char *v70; // rax
size_t v71; // r8
cocos2d::CCString *v72; // rax
int v73; // edi
void *v74; // rcx
GameStatsManager *v75; // rcx
int v76; // edi
int k; // ebx
cocos2d::CCString *v78; // rax
const char *v79; // rax
size_t v80; // r8
__int64 v81; // rcx
GameStatsManager *v82; // rcx
int m; // ebx
cocos2d::CCString *v84; // rax
const char *v85; // rax
size_t v86; // r8
__int64 v87; // rcx
GameStatsManager *v88; // rcx
int n; // ebx
cocos2d::CCString *v90; // rax
const char *v91; // rax
size_t v92; // r8
__int64 v93; // rcx
GameStatsManager *v94; // rcx
cocos2d::CCString *v95; // rax
const char *v96; // rax
size_t v97; // r8
__int64 v98; // rcx
GameStatsManager *v99; // rcx
GameStatsManager *v100; // rcx
GameStatsManager *v101; // rcx
GameStatsManager *v102; // rcx
GameStatsManager *v103; // rcx
__int64 v104; // rax
void *v105; // [rsp+28h] [rbp-E0h]
void *v106; // [rsp+28h] [rbp-E0h]
void *v107; // [rsp+28h] [rbp-E0h]
void *v108; // [rsp+28h] [rbp-E0h]
void *v109; // [rsp+28h] [rbp-E0h]
void *v110; // [rsp+28h] [rbp-E0h]
void *v111; // [rsp+28h] [rbp-E0h]
void *v112; // [rsp+28h] [rbp-E0h]
void *v113; // [rsp+28h] [rbp-E0h]
void *v114; // [rsp+28h] [rbp-E0h]
void *v115; // [rsp+28h] [rbp-E0h]
void *v116; // [rsp+28h] [rbp-E0h]
void *v117; // [rsp+28h] [rbp-E0h]
void *v118; // [rsp+28h] [rbp-E0h]
char v119; // [rsp+30h] [rbp-D8h]
bool m_dontNotify; // [rsp+31h] [rbp-D7h]
int v121; // [rsp+34h] [rbp-D4h]
int v122; // [rsp+38h] [rbp-D0h]
int v123; // [rsp+3Ch] [rbp-CCh]
int v124; // [rsp+40h] [rbp-C8h]
void *v125; // [rsp+40h] [rbp-C8h]
void *v126; // [rsp+48h] [rbp-C0h]
void *v127; // [rsp+48h] [rbp-C0h]
void *v128; // [rsp+48h] [rbp-C0h]
void *v129; // [rsp+48h] [rbp-C0h]
void *v130; // [rsp+48h] [rbp-C0h]
void *v131; // [rsp+50h] [rbp-B8h] BYREF
GameManager *v132; // [rsp+58h] [rbp-B0h]
__int64 *v133; // [rsp+60h] [rbp-A8h]
__int64 v134; // [rsp+68h] [rbp-A0h] BYREF
void *v135; // [rsp+70h] [rbp-98h] BYREF
_QWORD v136[3]; // [rsp+80h] [rbp-88h] BYREF
__int64 v137; // [rsp+98h] [rbp-70h]
void *v138; // [rsp+A8h] [rbp-60h]
void *v139; // [rsp+B0h] [rbp-58h]
void *v140; // [rsp+B8h] [rbp-50h]
std::unordered_set v141; // [rsp+C8h] [rbp-40h] BYREF
__int64 *v142; // [rsp+108h] [rbp+0h]
void *Buf1[2]; // [rsp+110h] [rbp+8h] BYREF
unsigned __int64 v144; // [rsp+120h] [rbp+18h]
unsigned __int64 v145; // [rsp+128h] [rbp+20h]
__int128 v146; // [rsp+130h] [rbp+28h] BYREF
__int64 v147; // [rsp+140h] [rbp+38h]
unsigned __int64 v148; // [rsp+148h] [rbp+40h]
_QWORD v149[4]; // [rsp+150h] [rbp+48h] BYREF
__int128 v150; // [rsp+170h] [rbp+68h]
__int64 v151; // [rsp+180h] [rbp+78h]
__int64 v152; // [rsp+188h] [rbp+80h]
_BYTE v153[48]; // [rsp+190h] [rbp+88h] BYREF
v133 = a2;
v132 = a1;
v142 = a2;
m_dontNotify = AchievementManager::sharedState()->m_dontNotify;
AchievementManager::sharedState()->m_dontNotify = 1;
v3 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v131 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v131);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v3 = qword_1406C2EE8;
}
v119 = *(_BYTE *)(v3 + 904);
*(_BYTE *)(v3 + 904) = 1;
sub_14005D660((__int64)&v134);
v4 = cocos2d::CCFileUtils::sharedFileUtils();
(*(void (__fastcall **)(__int64, _QWORD *, const char *, _QWORD))(*(_QWORD *)v4 + 40LL))(
v4,
v149,
"LevelStats.dat",
0);
v5 = (const char *)v149;
if ( v149[3] > 0xFu )
v5 = (const char *)v149[0];
v6 = cocos2d::CCString::createWithContentsOfFile(v5);
CString = cocos2d::CCString::getCString(v6);
v146 = 0;
v147 = 0;
v148 = 0;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003A930(&v146, CString, v8);
if ( v147 )
{
v9 = &v146;
if ( v148 <= 0xF )
{
v10 = &v146;
}
else
{
v9 = (__int128 *)v146;
v10 = (__int128 *)v146;
}
v11 = -1;
do
++v11;
while ( *((_BYTE *)v10 + v11) );
sub_140070860((__int64)v9, v11, Buf1);
sub_140070B30((unsigned __int8 *)Buf1, v153);
v150 = 0;
v12 = (char *)sub_14003AA10(0x30u);
*(_QWORD *)&v150 = v12;
v151 = 40;
v152 = 47;
strcpy(v12, "2dc0e75c5070651ccb072bd2fe938607ea7e4ab9");
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 0;
v13 = -1;
do
++v13;
while ( v153[v13] );
sub_14003A930(Buf1, v153, v13);
v14 = Buf1;
if ( v145 > 0xF )
v14 = (void **)Buf1[0];
v15 = v144;
v16 = v144;
if ( v144 > 0x28 )
v16 = 40;
v17 = memcmp(v14, v12, v16);
if ( !v17 )
{
if ( v15 >= 0x28 )
v17 = v15 > 0x28;
else
v17 = -1;
}
sub_14003A830((__int64)Buf1);
j_j_free(v12);
if ( !v17 )
sub_140184A80((float *)&v134, (__int64 *)&v146);
}
if ( a2[2] )
sub_140184A80((float *)&v134, a2);
v18 = 0;
v121 = 0;
v19 = 0;
v122 = 0;
v20 = 0;
v124 = 0;
v123 = 0;
LevelTools::getLevelList(&v141);
Myhead = v141._List._Mypair._Myval2._Myhead;
v22 = *(__int64 **)v141._List._Mypair._Myval2._Myhead;
if ( *(std::_List_val>::_Nodeptr *)v141._List._Mypair._Myval2._Myhead != v141._List._Mypair._Myval2._Myhead )
{
do
{
v23 = *((_DWORD *)v22 + 4);
v24 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v131 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v131);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v24 = (GameLevelManager *)qword_1406C2EC0;
}
MainLevel = GameLevelManager::getMainLevel(v24, v23, 1);
v26 = MainLevel->m_stars.random - MainLevel->m_stars.seed;
if ( v26 >= 20 )
{
v26 = 20;
}
else if ( v26 < 0 )
{
v26 = 0;
}
v27 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v125 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v125);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v27 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::hasCompletedLevel(v27, MainLevel) )
{
if ( MainLevel->m_levelLength == 5 )
v121 += v26;
else
v18 += v26;
if ( MainLevel->m_demon.random - MainLevel->m_demon.seed == 1 )
++v19;
if ( MainLevel->m_difficulty == Insane )
++v20;
}
v22 = (__int64 *)*v22;
}
while ( v22 != (__int64 *)Myhead );
v122 = v19;
v124 = v20;
}
v28 = 0;
v29 = 0;
v30 = (_QWORD *)qword_1406C2EC0;
do
{
if ( v29 )
{
if ( v29 == 1 )
{
if ( !v30 )
{
v139 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v139);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v30 = (_QWORD *)qword_1406C2EC0;
}
v31 = v30[55];
}
else
{
if ( v29 != 2 )
goto LABEL_101;
if ( !v30 )
{
v138 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v138);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v30 = (_QWORD *)qword_1406C2EC0;
}
v31 = v30[61];
}
}
else
{
if ( !v30 )
{
v140 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v140);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v30 = (_QWORD *)qword_1406C2EC0;
}
v31 = v30[44];
}
if ( v31 )
{
v32 = *(_QWORD *)(v31 + 56);
if ( v32 )
{
for ( i = *(_QWORD *)(v32 + 288); ; i = *(_QWORD *)(i + 288) )
{
v34 = *(GJGameLevel **)(v32 + 264);
v35 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v126 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v126);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v35 = (GameStatsManager *)qword_1406C2EE8;
}
hasCompletedLevel = GameStatsManager::hasCompletedLevel(v35, v34);
if ( v34->m_stars.random - v34->m_stars.seed <= 0 )
break;
LABEL_77:
if ( hasCompletedLevel && v34->m_stars.random - v34->m_stars.seed > 0 )
{
v42 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v105 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v105);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v42 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::markLevelAsCompletedAndClaimed(v42, v34);
random = v34->m_stars.random;
seed = v34->m_stars.seed;
v45 = random - seed;
if ( random - seed >= 10 )
{
v45 = 10;
}
else if ( v45 < 0 )
{
v45 = 0;
}
if ( v34->m_levelLength == 5 )
v121 += v45;
else
v18 += v45;
if ( v34->m_demon.random - v34->m_demon.seed == 1 )
++v122;
if ( random - seed == 8 || random - seed == 9 )
++v20;
if ( v29 == 1
&& v34->m_dailyID.random - v34->m_dailyID.seed > 0
&& v34->m_dailyID.random - v34->m_dailyID.seed <= 100000 )
{
++v123;
}
}
v32 = i;
if ( !i )
{
v124 = v20;
v30 = (_QWORD *)qword_1406C2EC0;
goto LABEL_101;
}
}
v37 = v34->m_levelID.random - v34->m_levelID.seed;
v38 = *(_QWORD *)(v136[0]
+ 16
* (v137
& (0x100000001B3LL
* (((unsigned __int64)v37 >> 24)
^ (0x100000001B3LL
* (BYTE2(v37)
^ (0x100000001B3LL
* ((0x100000001B3LL
* ((unsigned __int8)(LOBYTE(v34->m_levelID.random) - LOBYTE(v34->m_levelID.seed))
^ 0xCBF29CE484222325uLL))
^ (unsigned __int8)((unsigned __int16)(LOWORD(v34->m_levelID.random)
- LOWORD(v34->m_levelID.seed)) >> 8))))))))
+ 8);
if ( (void *)v38 != v135 )
{
if ( v37 == *(_DWORD *)(v38 + 16) )
goto LABEL_72;
while ( v38 != *(_QWORD *)(v136[0]
+ 16
* (v137
& (0x100000001B3LL
* (((unsigned __int64)(unsigned int)(v34->m_levelID.random - v34->m_levelID.seed) >> 24)
^ (0x100000001B3LL
* ((unsigned __int8)((unsigned int)(v34->m_levelID.random - v34->m_levelID.seed) >> 16)
^ (0x100000001B3LL
* ((0x100000001B3LL
* ((unsigned __int8)(LOBYTE(v34->m_levelID.random)
- LOBYTE(v34->m_levelID.seed))
^ 0xCBF29CE484222325uLL))
^ (unsigned __int8)((unsigned __int16)(LOWORD(v34->m_levelID.random)
- LOWORD(v34->m_levelID.seed)) >> 8))))))))) )
{
v38 = *(_QWORD *)(v38 + 8);
if ( v37 == *(_DWORD *)(v38 + 16) )
goto LABEL_72;
}
}
v38 = 0;
LABEL_72:
if ( v38 )
{
LODWORD(v131) = v34->m_levelID.random - v34->m_levelID.seed;
v39 = *(_DWORD *)(*(_QWORD *)sub_1401795B0((float *)&v134, (__int64)Buf1, (unsigned __int8 *)&v131) + 20LL);
if ( (unsigned int)(v39 - 1) <= 9 )
{
v34->m_stars.value = v39;
v40 = (float)((float)rand() / 32767.0) * 1000.0;
v34->m_stars.seed = (int)v40;
v34->m_stars.random = v39 + (int)v40;
if ( v39 == 10 )
{
v34->m_demon.value = 1;
v41 = (float)((float)rand() / 32767.0) * 1000.0;
v34->m_demon.seed = (int)v41;
v34->m_demon.random = (int)v41 + 1;
}
}
v28 = 0;
}
goto LABEL_77;
}
}
LABEL_101:
++v29;
}
while ( v29 < 3 );
v46 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v30);
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 15;
v47 = sub_14003AA10(0x120u);
Buf1[0] = v47;
v144 = 279;
v145 = 287;
v48 = v47;
v49 = "1,3,2,4,3,4,5,5,6,6,7,6,8,7,9,8,10,8,11,9,19,10,20,10,21,10,22,10,26,10,27,10,28,10,29,10,30,10,31,10,32,4,33,5,"
"34,6,35,8,36,8,37,5,38,5,39,6,40,7,41,8,42,8,43,8,44,9,45,6,46,10,47,10,48,10,49,10,50,10,52,4,53,3,54,4,55,4,56"
",5,57,6,58,7,59,8,60,8,61,8,62,9,63,9,64,10,65,10,66,10";
v50 = 2;
do
{
*(_OWORD *)v48 = *(_OWORD *)v49;
*((_OWORD *)v48 + 1) = *((_OWORD *)v49 + 1);
*((_OWORD *)v48 + 2) = *((_OWORD *)v49 + 2);
*((_OWORD *)v48 + 3) = *((_OWORD *)v49 + 3);
*((_OWORD *)v48 + 4) = *((_OWORD *)v49 + 4);
*((_OWORD *)v48 + 5) = *((_OWORD *)v49 + 5);
*((_OWORD *)v48 + 6) = *((_OWORD *)v49 + 6);
v48 += 128;
*((_OWORD *)v48 - 1) = *((_OWORD *)v49 + 7);
v49 += 128;
--v50;
}
while ( v50 );
*(_OWORD *)v48 = *(_OWORD *)v49;
*((_DWORD *)v48 + 4) = *((_DWORD *)v49 + 4);
*((_WORD *)v48 + 10) = *((_WORD *)v49 + 10);
v48[22] = v49[22];
v47[279] = 0;
v51 = sub_140063EF0((__int64 *)Buf1);
if ( v145 > 0xF )
{
v52 = Buf1[0];
if ( v145 + 1 >= 0x1000 )
{
v52 = *((void **)Buf1[0] - 1);
if ( (unsigned __int64)((char *)Buf1[0] - (char *)v52 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v52);
}
v144 = 0;
v145 = 15;
LOBYTE(Buf1[0]) = 0;
if ( cocos2d::CCArray::count(v51) > 1 )
{
v53 = 1;
do
{
v54 = cocos2d::CCArray::stringAtIndex(v51, v53 - 1);
v55 = (int)cocos2d::CCString::intValue(v54);
v56 = cocos2d::CCArray::stringAtIndex(v51, v53);
cocos2d::CCDictionary::setObject(v46, v56, v55);
v53 += 2;
}
while ( v53 < cocos2d::CCArray::count(v51) );
v28 = 0;
}
v57 = cocos2d::CCDictionary::allKeys(v46);
if ( cocos2d::CCArray::count(v57) )
{
do
{
v58 = SLODWORD(cocos2d::CCArray::objectAtIndex(v57, v28)[1].__vftable);
v59 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v46, v58);
v60 = cocos2d::CCString::intValue(v59);
v61 = 10;
if ( v60 < 10 )
v61 = v60;
if ( v61 < 0 )
v61 = 0;
v62 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v106 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v106);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v62 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStarsForMapPack(v62, v58, v61);
++v28;
}
while ( v28 < cocos2d::CCArray::count(v57) );
v20 = v124;
}
v63 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v107 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v107);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v63 = (GameStatsManager *)qword_1406C2EE8;
}
CompletedMapPacks = GameStatsManager::getCompletedMapPacks(v63);
for ( j = 0; j < cocos2d::CCArray::count(CompletedMapPacks); ++j )
{
v66 = cocos2d::CCArray::stringAtIndex(CompletedMapPacks, j);
v67 = cocos2d::CCString::intValue(v66);
v68 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v108 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v108);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v68 = qword_1406C2EE8;
}
v69 = cocos2d::CCString::createWithFormat("pack_%i", v67);
v70 = cocos2d::CCString::getCString(v69);
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 0;
v71 = -1;
do
++v71;
while ( v70[v71] );
sub_14003A930(Buf1, v70, v71);
v72 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v68 + 824), Buf1);
v73 = cocos2d::CCString::intValue(v72);
if ( v145 > 0xF )
{
v74 = Buf1[0];
if ( v145 + 1 >= 0x1000 )
{
v74 = *((void **)Buf1[0] - 1);
if ( (unsigned __int64)((char *)Buf1[0] - (char *)v74 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v74);
}
v18 += v73;
}
v75 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v109 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v109);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v75 = (GameStatsManager *)qword_1406C2EE8;
}
v76 = 1;
if ( v18 < GameStatsManager::getStat(v75, "6") )
{
for ( k = 1; k <= 33; ++k )
{
v78 = cocos2d::CCString::createWithFormat("geometry.ach.stars%02d", k);
v79 = cocos2d::CCString::getCString(v78);
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 0;
v80 = -1;
do
++v80;
while ( v79[v80] );
sub_14003A930(Buf1, v79, v80);
v81 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v127 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v127);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v81 = qword_1406C2ED8;
}
GameManager::resetAchievement(v81, (const char *)Buf1);
}
}
v82 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v110 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v110);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v82 = (GameStatsManager *)qword_1406C2EE8;
}
if ( v122 < GameStatsManager::getStat(v82, (const char *)&word_140531E90) )
{
for ( m = 1; m <= 27; ++m )
{
v84 = cocos2d::CCString::createWithFormat("geometry.ach.demon%02d", m);
v85 = cocos2d::CCString::getCString(v84);
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 0;
v86 = -1;
do
++v86;
while ( v85[v86] );
sub_14003A930(Buf1, v85, v86);
v87 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v128 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v128);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v87 = qword_1406C2ED8;
}
GameManager::resetAchievement(v87, (const char *)Buf1);
}
}
v88 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v111 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v111);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v88 = (GameStatsManager *)qword_1406C2EE8;
}
if ( v20 < GameStatsManager::getStat(v88, "42") )
{
for ( n = 1; n <= 10; ++n )
{
v90 = cocos2d::CCString::createWithFormat("geometry.ach.insane%02d", n);
v91 = cocos2d::CCString::getCString(v90);
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 0;
v92 = -1;
do
++v92;
while ( v91[v92] );
sub_14003A930(Buf1, v91, v92);
v93 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v129 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v129);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v93 = qword_1406C2ED8;
}
GameManager::resetAchievement(v93, (const char *)Buf1);
}
}
v94 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v112 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v112);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v94 = (GameStatsManager *)qword_1406C2EE8;
}
if ( v123 < GameStatsManager::getStat(v94, "15") )
{
do
{
v95 = cocos2d::CCString::createWithFormat("geometry.ach.daily%02d", v76);
v96 = cocos2d::CCString::getCString(v95);
*(_OWORD *)Buf1 = 0;
v144 = 0;
v145 = 0;
v97 = -1;
do
++v97;
while ( v96[v97] );
sub_14003A930(Buf1, v96, v97);
v98 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v130 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v130);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v98 = qword_1406C2ED8;
}
GameManager::resetAchievement(v98, (const char *)Buf1);
++v76;
}
while ( v76 <= 7 );
}
v99 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v113 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v113);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v99 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v99, "6", v18);
v100 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v114 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v114);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v100 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v100, "28", v121);
v101 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v115 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v115);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v101 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v101, (const char *)&word_140531E90, v122);
v102 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v116 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v116);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v102 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v102, "42", v20);
v103 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v117 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v117);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v103 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v103, "15", v123);
GameManager::checkUsedIcons(v132);
v104 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v118 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v118);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v104 = qword_1406C2EE8;
}
*(_BYTE *)(v104 + 904) = v119;
AchievementManager::sharedState()->m_dontNotify = m_dontNotify;
sub_14005D100((__int64)&v141._Vec);
sub_14005D870((void **)&v141._List._Mypair._Myval2._Myhead);
sub_14003A830((__int64)&v146);
sub_14003A830((__int64)v149);
sub_14005D100((__int64)v136);
sub_14005D870(&v135);
sub_14003A830((__int64)v133);
}