//
// GameManager::recountUserStats from 0x1402803a0 to 0x140281671 (4817 bytes)
//
// 3 xrefs:
// > GameManager::dataLoaded @ 0x1402849a2
// > GJAccountManager::onSyncAccountCompleted @ 0x14030926d
// > ??> @ 0x14091d06c
//
// 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 11:29:00 +0000
//
// Hidden C++ exception states: #wind=36
void __fastcall GameManager::recountUserStats(__int64 a1, _QWORD *a2, __int64 a3)
{
__int64 v4; // rdx
__int64 v5; // rcx
__int64 v6; // r8
__int64 v7; // rax
_QWORD *v8; // rax
__int64 v9; // rcx
__int64 v10; // rax
const char *v11; // rcx
cocos2d::CCString *v12; // rax
const char *CString; // rax
size_t v14; // r8
__int128 *v15; // r9
__int128 *v16; // r8
__int64 v17; // rdx
char *v18; // rdi
size_t v19; // r8
void **v20; // rcx
unsigned __int64 v21; // rsi
size_t v22; // r8
int v23; // ebx
int v24; // r12d
int v25; // r15d
int v26; // r13d
_QWORD *v27; // rdi
_DWORD *v28; // rbx
unsigned int v29; // esi
__int64 v30; // rcx
_DWORD *MainLevel; // r14
int v32; // esi
__int64 v33; // rcx
unsigned int v34; // edi
int v35; // r15d
_QWORD *v36; // rcx
__int64 v37; // rbx
__int64 v38; // rbx
__int64 i; // rsi
_DWORD *v40; // rbx
__int64 v41; // rcx
char hasCompletedLevel; // r14
int v43; // edx
__int64 v44; // rcx
int v45; // edi
float v46; // xmm0_4
float v47; // xmm0_4
__int64 v48; // rcx
int v49; // ecx
int v50; // eax
cocos2d::CCDictionary *v51; // r15
_BYTE *v52; // r9
_BYTE *v53; // rcx
const char *v54; // rdx
__int64 v55; // r8
cocos2d::CCArray *v56; // rsi
void *v57; // rcx
unsigned int v58; // edi
cocos2d::CCString *v59; // rax
__int64 v60; // rbx
struct cocos2d::CCObject *v61; // rax
cocos2d::CCArray *v62; // r14
__int64 v63; // rsi
cocos2d::CCString *v64; // rax
int v65; // eax
int v66; // ebx
__int64 v67; // rcx
cocos2d::CCArray *CompletedMapPacks; // r14
unsigned int j; // ebx
cocos2d::CCString *v70; // rax
int v71; // esi
__int64 v72; // rdi
cocos2d::CCString *v73; // rax
const char *v74; // rax
size_t v75; // r8
cocos2d::CCString *v76; // rax
int v77; // edi
void *v78; // rcx
__int64 v79; // rcx
int v80; // edi
int k; // ebx
cocos2d::CCString *v82; // rax
const char *v83; // rax
size_t v84; // r8
__int64 v85; // rcx
__int64 v86; // rcx
int m; // ebx
cocos2d::CCString *v88; // rax
const char *v89; // rax
size_t v90; // r8
__int64 v91; // rcx
__int64 v92; // rcx
int n; // ebx
cocos2d::CCString *v94; // rax
const char *v95; // rax
size_t v96; // r8
__int64 v97; // rcx
__int64 v98; // rcx
cocos2d::CCString *v99; // rax
const char *v100; // rax
size_t v101; // r8
__int64 v102; // rcx
__int64 v103; // rcx
__int64 v104; // rcx
__int64 v105; // rcx
__int64 v106; // rcx
__int64 v107; // rcx
__int64 v108; // rdx
__int64 v109; // r8
__int64 v110; // rax
unsigned __int8 v111; // [rsp+38h] [rbp-D0h]
char v112; // [rsp+39h] [rbp-CFh]
unsigned int v113; // [rsp+3Ch] [rbp-CCh]
int v114; // [rsp+40h] [rbp-C8h]
int v115; // [rsp+44h] [rbp-C4h]
int v116; // [rsp+48h] [rbp-C0h]
void *v117; // [rsp+48h] [rbp-C0h]
void *v118; // [rsp+50h] [rbp-B8h] BYREF
void *v119; // [rsp+58h] [rbp-B0h]
__int64 v120; // [rsp+68h] [rbp-A0h] BYREF
void *v121[2]; // [rsp+70h] [rbp-98h] BYREF
__int64 v122; // [rsp+80h] [rbp-88h] BYREF
__int128 v123; // [rsp+88h] [rbp-80h]
__int64 v124; // [rsp+98h] [rbp-70h]
__int64 v125; // [rsp+A0h] [rbp-68h]
__int64 v126; // [rsp+A8h] [rbp-60h]
_QWORD *v127; // [rsp+B0h] [rbp-58h]
void *v128; // [rsp+B8h] [rbp-50h]
void *v129; // [rsp+C0h] [rbp-48h]
void *v130; // [rsp+C8h] [rbp-40h]
_BYTE v131[8]; // [rsp+D8h] [rbp-30h] BYREF
_QWORD *v132; // [rsp+E0h] [rbp-28h] BYREF
void *v133[6]; // [rsp+F0h] [rbp-18h] BYREF
void *Buf1[2]; // [rsp+120h] [rbp+18h] BYREF
unsigned __int64 v135; // [rsp+130h] [rbp+28h]
unsigned __int64 v136; // [rsp+138h] [rbp+30h]
__int128 v137; // [rsp+148h] [rbp+40h] BYREF
__int64 v138; // [rsp+158h] [rbp+50h]
__int64 v139; // [rsp+160h] [rbp+58h]
__int128 v140; // [rsp+168h] [rbp+60h] BYREF
__int64 v141; // [rsp+178h] [rbp+70h]
unsigned __int64 v142; // [rsp+180h] [rbp+78h]
_QWORD v143[4]; // [rsp+188h] [rbp+80h] BYREF
_OWORD v144[10]; // [rsp+1A8h] [rbp+A0h] BYREF
int v145; // [rsp+248h] [rbp+140h]
int v146; // [rsp+24Ch] [rbp+144h]
int v147; // [rsp+250h] [rbp+148h]
char v148; // [rsp+254h] [rbp+14Ch] BYREF
_BYTE v149[48]; // [rsp+258h] [rbp+150h] BYREF
v127 = a2;
v126 = a1;
v133[5] = a2;
v112 = *(_BYTE *)(AchievementManager::sharedState(a1, a2, a3) + 360);
*(_BYTE *)(AchievementManager::sharedState(v5, v4, v6) + 360) = 1;
v7 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v118 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v118);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v7 = qword_14090BFE0;
}
v111 = *(_BYTE *)(v7 + 912);
*(_BYTE *)(v7 + 912) = 1;
v121[1] = nullptr;
v8 = operator new(0x18u);
*v8 = v8;
v8[1] = v8;
v121[0] = v8;
v122 = 0;
v123 = 0;
v124 = 7;
v125 = 8;
LODWORD(v120) = 1065353216;
sub_14003F200((__int64)&v122, 0x10u, (unsigned __int64)v8);
v10 = cocos2d::CCFileUtils::sharedFileUtils(v9);
(*(void (__fastcall **)(__int64, _QWORD *, const char *, _QWORD))(*(_QWORD *)v10 + 40LL))(
v10,
v143,
"LevelStats.dat",
0);
v11 = (const char *)v143;
if ( v143[3] > 0xFu )
v11 = (const char *)v143[0];
v12 = cocos2d::CCString::createWithContentsOfFile(v11);
CString = cocos2d::CCString::getCString(v12);
v140 = 0;
v141 = 0;
v142 = 0;
v14 = -1;
do
++v14;
while ( CString[v14] );
sub_14003D230(&v140, CString, v14);
if ( v141 )
{
v15 = &v140;
if ( v142 > 0xF )
v15 = (__int128 *)v140;
v16 = &v140;
if ( v142 > 0xF )
v16 = (__int128 *)v140;
v17 = -1;
do
++v17;
while ( *((_BYTE *)v16 + v17) );
sub_14007E1A0((__int64)v15, v17, Buf1);
sub_14007E470((unsigned __int8 *)Buf1, v149);
v137 = 0;
v18 = (char *)sub_14003D460(0x30u);
*(_QWORD *)&v137 = v18;
v138 = 40;
v139 = 47;
strcpy(v18, "2dc0e75c5070651ccb072bd2fe938607ea7e4ab9");
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v19 = -1;
do
++v19;
while ( v149[v19] );
sub_14003D230(Buf1, v149, v19);
v20 = Buf1;
if ( v136 > 0xF )
v20 = (void **)Buf1[0];
v21 = v135;
v22 = v135;
if ( v135 > 0x28 )
v22 = 40;
v23 = memcmp(v20, v18, v22);
if ( !v23 )
{
if ( v21 >= 0x28 )
v23 = v21 > 0x28;
else
v23 = -1;
}
sub_14003D310((__int64)Buf1);
j_j_free(v18);
if ( !v23 )
sub_140280240(&v120, (__int64 *)&v140);
}
if ( a2[2] )
sub_140280240(&v120, a2);
v24 = 0;
v113 = 0;
v25 = 0;
v114 = 0;
v26 = 0;
v116 = 0;
v115 = 0;
v144[0] = _mm_load_si128((const __m128i *)&xmmword_1408367B0);
v144[1] = _mm_load_si128((const __m128i *)&xmmword_1408367F0);
v144[2] = _mm_load_si128((const __m128i *)&xmmword_140836820);
v144[3] = _mm_load_si128((const __m128i *)&xmmword_140836830);
v144[4] = _mm_load_si128((const __m128i *)&xmmword_140836840);
v144[5] = _mm_load_si128((const __m128i *)&xmmword_140836850);
v144[6] = _mm_load_si128((const __m128i *)&xmmword_140836860);
v144[7] = _mm_load_si128((const __m128i *)&xmmword_140836870);
v144[8] = _mm_load_si128((const __m128i *)&xmmword_140836880);
v144[9] = _mm_load_si128((const __m128i *)&xmmword_140836890);
v145 = 5002;
v146 = 5003;
v147 = 5004;
*(_QWORD *)&v137 = v144;
*((_QWORD *)&v137 + 1) = &v148;
sub_14038CC90(v131, &v137);
v27 = v132;
v28 = (_DWORD *)*v132;
if ( (_QWORD *)*v132 != v132 )
{
do
{
v29 = v28[4];
v30 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v118 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v118);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v30 = *(_QWORD *)&qword_14090BFB0;
}
MainLevel = (_DWORD *)GameLevelManager::getMainLevel(v30, v29, 1u);
v32 = MainLevel[255] - MainLevel[256];
if ( v32 >= 20 )
{
v32 = 20;
}
else if ( v32 < 0 )
{
v32 = 0;
}
v33 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v117 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v117);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v33 = qword_14090BFE0;
}
if ( (unsigned __int8)GameStatsManager::hasCompletedLevel(v33, MainLevel) )
{
if ( MainLevel[243] == 5 )
v113 += v32;
else
v24 += v32;
if ( MainLevel[251] - MainLevel[252] == 1 )
++v25;
if ( MainLevel[168] == 5 )
++v26;
}
v28 = *(_DWORD **)v28;
}
while ( v28 != (_DWORD *)v27 );
v114 = v25;
v116 = v26;
}
v34 = 0;
v35 = 0;
v36 = *(_QWORD **)&qword_14090BFB0;
do
{
if ( v35 )
{
if ( v35 == 1 )
{
if ( !v36 )
{
v129 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v129);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v36 = *(_QWORD **)&qword_14090BFB0;
}
v37 = v36[118];
}
else
{
if ( v35 != 2 )
goto LABEL_101;
if ( !v36 )
{
v128 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v128);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v36 = *(_QWORD **)&qword_14090BFB0;
}
v37 = v36[129];
}
}
else
{
if ( !v36 )
{
v130 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v130);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v36 = *(_QWORD **)&qword_14090BFB0;
}
v37 = v36[107];
}
if ( v37 )
{
v38 = *(_QWORD *)(v37 + 56);
if ( v38 )
{
for ( i = *(_QWORD *)(v38 + 288); ; i = *(_QWORD *)(i + 288) )
{
v40 = *(_DWORD **)(v38 + 264);
v41 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v119 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v119);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v41 = qword_14090BFE0;
}
hasCompletedLevel = GameStatsManager::hasCompletedLevel(v41, v40);
if ( v40[255] - v40[256] <= 0 )
break;
LABEL_78:
if ( hasCompletedLevel && v40[255] - v40[256] > 0 )
{
v48 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v48 = qword_14090BFE0;
}
GameStatsManager::markLevelAsCompletedAndClaimed(v48, v40);
v49 = v40[255] - v40[256];
if ( v49 >= 10 )
{
v50 = 10;
}
else
{
v50 = v40[255] - v40[256];
if ( v49 < 0 )
v50 = 0;
}
if ( v40[243] == 5 )
v113 += v50;
else
v24 += v50;
if ( v40[251] - v40[252] == 1 )
++v114;
if ( (unsigned int)(v49 - 8) <= 1 )
++v26;
if ( v35 == 1 && v40[248] - v40[249] > 0 && v40[248] - v40[249] <= 100000 )
++v115;
}
v38 = i;
if ( !i )
{
v116 = v26;
v36 = *(_QWORD **)&qword_14090BFB0;
goto LABEL_101;
}
}
v43 = v40[82] - v40[83];
v44 = *(_QWORD *)(v122
+ 16
* (v124
& (0x100000001B3LL
* (HIBYTE(v43)
^ (0x100000001B3LL
* (BYTE2(v43)
^ (0x100000001B3LL
* ((unsigned __int8)((unsigned __int16)(*((_WORD *)v40 + 164) - *((_WORD *)v40 + 166)) >> 8)
^ (0x100000001B3LL
* ((unsigned __int8)(*((_BYTE *)v40 + 328) - *((_BYTE *)v40 + 332))
^ 0xCBF29CE484222325uLL)))))))))
+ 8);
if ( (void *)v44 != v121[0] )
{
if ( v43 == *(_DWORD *)(v44 + 16) )
goto LABEL_73;
while ( v44 != *(_QWORD *)(v122
+ 16
* (v124
& (0x100000001B3LL
* (((unsigned int)(v40[82] - v40[83]) >> 24)
^ (0x100000001B3LL
* ((unsigned __int8)((unsigned int)(v40[82] - v40[83]) >> 16)
^ (0x100000001B3LL
* ((unsigned __int8)((unsigned __int16)(*((_WORD *)v40 + 164)
- *((_WORD *)v40 + 166)) >> 8)
^ (0x100000001B3LL
* ((unsigned __int8)(*((_BYTE *)v40 + 328) - *((_BYTE *)v40 + 332))
^ 0xCBF29CE484222325uLL)))))))))) )
{
v44 = *(_QWORD *)(v44 + 8);
if ( v43 == *(_DWORD *)(v44 + 16) )
goto LABEL_73;
}
}
v44 = 0;
LABEL_73:
if ( v44 )
{
LODWORD(v118) = v40[82] - v40[83];
v45 = *(_DWORD *)(*(_QWORD *)sub_1402749A0(&v120, (__int64)Buf1, (unsigned __int8 *)&v118) + 20LL);
if ( (unsigned int)(v45 - 1) <= 9 )
{
v40[257] = v45;
v46 = (float)((float)rand() / 32767.0) * 1000.0;
v40[256] = (int)v46;
v40[255] = v45 + (int)v46;
if ( v45 == 10 )
{
v40[253] = 1;
v47 = (float)((float)rand() / 32767.0) * 1000.0;
v40[252] = (int)v47;
v40[251] = (int)v47 + 1;
}
}
v34 = 0;
}
goto LABEL_78;
}
}
LABEL_101:
++v35;
}
while ( v35 < 3 );
v51 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v36);
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v52 = sub_14003D460(0x120u);
Buf1[0] = v52;
v135 = 279;
v136 = 287;
v53 = v52;
v54 = "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";
v55 = 2;
do
{
*(_OWORD *)v53 = *(_OWORD *)v54;
*((_OWORD *)v53 + 1) = *((_OWORD *)v54 + 1);
*((_OWORD *)v53 + 2) = *((_OWORD *)v54 + 2);
*((_OWORD *)v53 + 3) = *((_OWORD *)v54 + 3);
*((_OWORD *)v53 + 4) = *((_OWORD *)v54 + 4);
*((_OWORD *)v53 + 5) = *((_OWORD *)v54 + 5);
*((_OWORD *)v53 + 6) = *((_OWORD *)v54 + 6);
v53 += 128;
*((_OWORD *)v53 - 1) = *((_OWORD *)v54 + 7);
v54 += 128;
--v55;
}
while ( v55 );
*(_OWORD *)v53 = *(_OWORD *)v54;
*((_DWORD *)v53 + 4) = *((_DWORD *)v54 + 4);
*((_WORD *)v53 + 10) = *((_WORD *)v54 + 10);
v53[22] = v54[22];
v52[279] = 0;
v56 = sub_14006C240((__int64 *)Buf1);
if ( v136 > 0xF )
{
v57 = Buf1[0];
if ( v136 + 1 >= 0x1000 )
{
v57 = *((void **)Buf1[0] - 1);
if ( (unsigned __int64)((char *)Buf1[0] - (char *)v57 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v57);
}
v135 = 0;
v136 = 15;
LOBYTE(Buf1[0]) = 0;
if ( cocos2d::CCArray::count(v56) > 1 )
{
v58 = 1;
do
{
v59 = cocos2d::CCArray::stringAtIndex(v56, v58 - 1);
v60 = (int)cocos2d::CCString::intValue(v59);
v61 = cocos2d::CCArray::stringAtIndex(v56, v58);
cocos2d::CCDictionary::setObject(v51, v61, v60);
v58 += 2;
}
while ( v58 < cocos2d::CCArray::count(v56) );
v34 = 0;
}
v62 = cocos2d::CCDictionary::allKeys(v51);
if ( cocos2d::CCArray::count(v62) )
{
do
{
v63 = *((int *)cocos2d::CCArray::objectAtIndex(v62, v34) + 14);
v64 = cocos2d::CCDictionary::valueForKey(v51, v63);
v65 = cocos2d::CCString::intValue(v64);
v66 = 10;
if ( v65 < 10 )
v66 = v65;
if ( v66 < 0 )
v66 = 0;
v67 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v67 = qword_14090BFE0;
}
GameStatsManager::setStarsForMapPack(v67, (unsigned int)v63, (unsigned int)v66);
++v34;
}
while ( v34 < cocos2d::CCArray::count(v62) );
v26 = v116;
}
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
}
CompletedMapPacks = (cocos2d::CCArray *)GameStatsManager::getCompletedMapPacks();
for ( j = 0; j < cocos2d::CCArray::count(CompletedMapPacks); ++j )
{
v70 = cocos2d::CCArray::stringAtIndex(CompletedMapPacks, j);
v71 = cocos2d::CCString::intValue(v70);
v72 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v72 = qword_14090BFE0;
}
v73 = cocos2d::CCString::createWithFormat("pack_%i", v71);
v74 = cocos2d::CCString::getCString(v73);
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v75 = -1;
do
++v75;
while ( v74[v75] );
sub_14003D230(Buf1, v74, v75);
v76 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v72 + 824), Buf1);
v77 = cocos2d::CCString::intValue(v76);
if ( v136 > 0xF )
{
v78 = Buf1[0];
if ( v136 + 1 >= 0x1000 )
{
v78 = *((void **)Buf1[0] - 1);
if ( (unsigned __int64)((char *)Buf1[0] - (char *)v78 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v78);
}
v24 += v77;
}
v79 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v79 = qword_14090BFE0;
}
v80 = 1;
if ( v24 < (int)GameStatsManager::getStat(v79, "6") )
{
for ( k = 1; k <= 33; ++k )
{
v82 = cocos2d::CCString::createWithFormat("geometry.ach.stars%02d", k);
v83 = cocos2d::CCString::getCString(v82);
*(_QWORD *)&v137 = Buf1;
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v84 = -1;
do
++v84;
while ( v83[v84] );
sub_14003D230(Buf1, v83, v84);
v85 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v119 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v119);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v85 = qword_14090BFD0;
}
GameManager::resetAchievement(v85, (__int64 *)Buf1);
}
}
v86 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v86 = qword_14090BFE0;
}
if ( v114 < (int)GameStatsManager::getStat(v86, &word_14070D048) )
{
for ( m = 1; m <= 27; ++m )
{
v88 = cocos2d::CCString::createWithFormat("geometry.ach.demon%02d", m);
v89 = cocos2d::CCString::getCString(v88);
*(_QWORD *)&v137 = Buf1;
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v90 = -1;
do
++v90;
while ( v89[v90] );
sub_14003D230(Buf1, v89, v90);
v91 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v119 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v119);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v91 = qword_14090BFD0;
}
GameManager::resetAchievement(v91, (__int64 *)Buf1);
}
}
v92 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v92 = qword_14090BFE0;
}
if ( v26 < (int)GameStatsManager::getStat(v92, "42") )
{
for ( n = 1; n <= 10; ++n )
{
v94 = cocos2d::CCString::createWithFormat("geometry.ach.insane%02d", n);
v95 = cocos2d::CCString::getCString(v94);
*(_QWORD *)&v137 = Buf1;
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v96 = -1;
do
++v96;
while ( v95[v96] );
sub_14003D230(Buf1, v95, v96);
v97 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v119 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v119);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v97 = qword_14090BFD0;
}
GameManager::resetAchievement(v97, (__int64 *)Buf1);
}
}
v98 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v98 = qword_14090BFE0;
}
if ( v115 < (int)GameStatsManager::getStat(v98, "15") )
{
do
{
v99 = cocos2d::CCString::createWithFormat("geometry.ach.daily%02d", v80);
v100 = cocos2d::CCString::getCString(v99);
*(_QWORD *)&v137 = Buf1;
*(_OWORD *)Buf1 = 0;
v135 = 0;
v136 = 0;
v101 = -1;
do
++v101;
while ( v100[v101] );
sub_14003D230(Buf1, v100, v101);
v102 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v119 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v119);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v102 = qword_14090BFD0;
}
GameManager::resetAchievement(v102, (__int64 *)Buf1);
++v80;
}
while ( v80 <= 7 );
}
v103 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v103 = qword_14090BFE0;
}
GameStatsManager::setStat(v103, "6", (unsigned int)v24);
v104 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v104 = qword_14090BFE0;
}
GameStatsManager::setStat(v104, "28", v113);
v105 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v105 = qword_14090BFE0;
}
GameStatsManager::setStat(v105, &word_14070D048, (unsigned int)v114);
v106 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v106 = qword_14090BFE0;
}
GameStatsManager::setStat(v106, "42", (unsigned int)v26);
v107 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v107 = qword_14090BFE0;
}
GameStatsManager::setStat(v107, "15", (unsigned int)v115);
GameManager::checkUsedIcons(v126);
v110 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
*(_QWORD *)&v137 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v137);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v110 = qword_14090BFE0;
}
*(_BYTE *)(v110 + 912) = v111;
*(_BYTE *)(AchievementManager::sharedState(v111, v108, v109) + 360) = v112;
sub_14003EA90(v133);
sub_14003EB00((void **)&v132);
sub_14003D310((__int64)&v140);
sub_14003D310((__int64)v143);
sub_14003EA90(&v122);
sub_14003EB00(v121);
sub_14003D310((__int64)v127);
}