//
// GameStatsManager::recountSpecialStats from 0x100075d00 to 0x100076ccd (4045 bytes)
//
// 1 xrefs:
// > GameManager::dataLoaded @ 0x100389990
//
// 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 GameStatsManager::recountSpecialStats(GameStatsManager *a1)
{
__m128 v1; // xmm0
int TotalCollectedCurrency; // r12d
GameStatsManager *v3; // rax
GameStatsManager *v4; // rax
int v5; // r14d
double v6; // xmm0_8
int v7; // ecx
cocos2d::CCDictionary **v8; // rax
cocos2d::CCDictionary *v9; // rax
cocos2d::CCDictElement *i; // rax
int v11; // r15d
cocos2d::CCObject *m_pObject; // r14
__int64 v13; // rdi
int v14; // r13d
int v15; // r15d
unsigned int v16; // ebx
__int64 v17; // rax
__int64 v18; // rdi
int v19; // r15d
unsigned int v20; // ebx
__int64 v21; // rax
__int64 v22; // rdi
int v23; // r15d
unsigned int v24; // ebx
__int64 v25; // rax
__int64 v26; // rdi
int v27; // r15d
unsigned int v28; // ebx
__int64 v29; // rax
__int64 v30; // rdi
int v31; // r15d
unsigned int v32; // ebx
__int64 v33; // rax
__int64 v34; // rdi
int v35; // r15d
unsigned int v36; // ebx
__int64 v37; // rax
__int64 v38; // rdi
int v39; // r15d
unsigned int v40; // ebx
__int64 v41; // rax
__int64 v42; // rdi
int v43; // r15d
unsigned int v44; // ebx
__int64 v45; // rax
__int64 v46; // rdi
int v47; // r15d
unsigned int v48; // ebx
__int64 v49; // rax
__int64 v50; // rdi
int v51; // r15d
unsigned int v52; // ebx
__int64 v53; // rax
__int64 v54; // rdi
unsigned int v55; // ebx
int v56; // r15d
__int64 v57; // rax
__int64 v58; // rdi
unsigned int v59; // ebx
__int64 v60; // rax
__int64 v61; // rdi
int v62; // r13d
int v63; // r12d
unsigned int v64; // ebx
__int64 v65; // rax
__int64 v66; // rdi
unsigned int v67; // ebx
__int64 v68; // rax
cocos2d::CCDictionary *m_worldAdvertChests; // rax
cocos2d::CCDictElement *j; // rbx
cocos2d::CCString *v71; // rdi
int v72; // eax
cocos2d::CCArray *v73; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCString **arr; // r14
const char *CString; // r15
size_t v77; // rax
size_t v78; // rbx
char *v79; // rax
char *v80; // rdi
int v81; // eax
int v82; // ebx
int v83; // r15d
GameStatsManager *v84; // rdx
int v85; // eax
int v86; // ecx
const char *v87; // r12
size_t v88; // r15
char *v89; // r12
__int64 v90; // rax
__int64 v91; // r15
unsigned int v92; // ebx
__int64 v93; // rax
cocos2d::CCDictionary *m_purchasedItems; // rdi
cocos2d::CCArray *v95; // rax
cocos2d::ccArray *v96; // rax
cocos2d::CCDictionary **v97; // r14
unsigned __int64 v98; // r12
const char *v99; // rbx
size_t v100; // rax
size_t v101; // r15
char *v102; // r13
char *v103; // rdi
intptr_t v104; // r13
cocos2d::CCObject *v105; // rbx
cocos2d::CCString *v106; // rax
int v107; // r15d
cocos2d::CCObject *v108; // rax
int v109; // eax
bool v110; // cc
const char *v111; // r13
__int64 v112; // rax
size_t v113; // rbx
int v114; // eax
GameStatsManager *v115; // rdi
int k; // ebx
cocos2d::CCString *v117; // rax
const char *v118; // r12
size_t v119; // rax
size_t v120; // r15
char *v121; // r13
__int64 v122; // rax
size_t v123; // r14
GameManager *v124; // rax
char *v125; // rsi
int v126; // ebx
int m; // r14d
GameStatsManager *v128; // rax
GameStatsManager *v129; // rax
unsigned int v130; // ebx
GameStatsManager *v131; // rax
GameManager *v132; // rax
cocos2d::CCDictionary **p_m_dailyChests; // [rsp+0h] [rbp-B0h]
cocos2d::CCDictionary **p_m_miscChests; // [rsp+8h] [rbp-A8h]
cocos2d::CCDictionary **p_m_weeklyChest; // [rsp+10h] [rbp-A0h]
int v136; // [rsp+18h] [rbp-98h]
bool m_skipIncrementChallenge; // [rsp+18h] [rbp-98h]
int v138; // [rsp+1Ch] [rbp-94h]
int v139; // [rsp+20h] [rbp-90h]
int v140; // [rsp+24h] [rbp-8Ch]
int v141; // [rsp+28h] [rbp-88h]
int v142; // [rsp+2Ch] [rbp-84h]
int v143; // [rsp+30h] [rbp-80h]
int v144; // [rsp+34h] [rbp-7Ch]
int v145; // [rsp+38h] [rbp-78h]
int v146; // [rsp+3Ch] [rbp-74h]
int v147; // [rsp+40h] [rbp-70h]
int v148; // [rsp+44h] [rbp-6Ch]
cocos2d::CCDictElement *next; // [rsp+48h] [rbp-68h]
unsigned __int64 v150; // [rsp+48h] [rbp-68h]
int v151; // [rsp+48h] [rbp-68h]
int v152; // [rsp+54h] [rbp-5Ch]
bool m_dontNotify; // [rsp+54h] [rbp-5Ch]
size_t __dst; // [rsp+60h] [rbp-50h] BYREF
size_t v156; // [rsp+68h] [rbp-48h]
char *v157; // [rsp+70h] [rbp-40h]
int TotalCollectedDiamonds; // [rsp+7Ch] [rbp-34h]
int v159; // [rsp+80h] [rbp-30h]
int v160; // [rsp+84h] [rbp-2Ch]
TotalCollectedCurrency = GameStatsManager::getTotalCollectedCurrency(a1);
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "22") != TotalCollectedCurrency )
{
v4 = GameStatsManager::sharedState();
GameStatsManager::setStat(v4, "22", TotalCollectedCurrency);
}
TotalCollectedDiamonds = GameStatsManager::getTotalCollectedDiamonds(a1);
v1.f32[0] = (float)TotalCollectedCurrency / 500.0;
v5 = (int)_mm_round_ss(v1, v1, 9).f32[0];
a1->m_bonusKey.value = v5;
HIDWORD(v6) = 0;
*(float *)&v6 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
a1->m_bonusKey.seed = (int)*(float *)&v6;
v159 = v5;
a1->m_bonusKey.random = v5 + (int)*(float *)&v6;
GameStatsManager::removeErrorFromSpecialChests(a1);
p_m_weeklyChest = &a1->m_weeklyChest;
p_m_miscChests = &a1->m_miscChests;
p_m_dailyChests = &a1->m_dailyChests;
v144 = 0;
v146 = 0;
v148 = 0;
v139 = 0;
v141 = 0;
v142 = 0;
v143 = 0;
v145 = 0;
v147 = 0;
v138 = 0;
v140 = 0;
v7 = 0;
do
{
v8 = p_m_dailyChests;
if ( v7 )
{
v8 = p_m_miscChests;
if ( v7 == 2 )
v8 = p_m_weeklyChest;
}
v9 = *v8;
v136 = v7;
if ( v9 )
{
for ( i = v9->m_pElements; ; i = next )
{
if ( !i )
goto LABEL_4;
m_pObject = i->m_pObject;
next = (cocos2d::CCDictElement *)i->hh.next;
v13 = *(_QWORD *)&m_pObject[1].m_nTag;
v14 = 0;
if ( v13 )
{
v160 = 0;
v15 = 0;
if ( (unsigned int)sub_100720070(v13) )
{
v16 = 0;
v15 = 0;
do
{
v17 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v16);
if ( *(_DWORD *)(v17 + 56) == 7 )
v15 += *(_DWORD *)(v17 + 68);
++v16;
}
while ( v16 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v18 = *(_QWORD *)&m_pObject[1].m_nTag;
TotalCollectedCurrency += v15;
if ( v18 )
{
v160 = 0;
v19 = 0;
if ( (unsigned int)sub_100720070(v18) )
{
v20 = 0;
v19 = 0;
do
{
v21 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v20);
if ( *(_DWORD *)(v21 + 56) == 8 )
v19 += *(_DWORD *)(v21 + 68);
++v20;
}
while ( v20 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v22 = *(_QWORD *)&m_pObject[1].m_nTag;
TotalCollectedDiamonds += v19;
if ( v22 )
{
v160 = 0;
v23 = 0;
if ( (unsigned int)sub_100720070(v22) )
{
v24 = 0;
v23 = 0;
do
{
v25 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v24);
if ( *(_DWORD *)(v25 + 56) == 1 )
v23 += *(_DWORD *)(v25 + 68);
++v24;
}
while ( v24 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v38 = *(_QWORD *)&m_pObject[1].m_nTag;
v144 += v23;
if ( v38 )
{
v160 = 0;
v39 = 0;
if ( (unsigned int)sub_100720070(v38) )
{
v40 = 0;
v39 = 0;
do
{
v41 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v40);
if ( *(_DWORD *)(v41 + 56) == 2 )
v39 += *(_DWORD *)(v41 + 68);
++v40;
}
while ( v40 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v46 = *(_QWORD *)&m_pObject[1].m_nTag;
v146 += v39;
if ( v46 )
{
v160 = 0;
v47 = 0;
if ( (unsigned int)sub_100720070(v46) )
{
v48 = 0;
v47 = 0;
do
{
v49 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v48);
if ( *(_DWORD *)(v49 + 56) == 3 )
v47 += *(_DWORD *)(v49 + 68);
++v48;
}
while ( v48 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v54 = *(_QWORD *)&m_pObject[1].m_nTag;
v148 += v47;
if ( v54 && (unsigned int)sub_100720070(v54) )
{
v55 = 0;
v56 = 0;
do
{
v57 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v55);
if ( *(_DWORD *)(v57 + 56) == 4 )
v56 += *(_DWORD *)(v57 + 68);
++v55;
}
while ( v55 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
v160 = v56;
}
}
}
}
}
}
else
{
v160 = 0;
}
v26 = *(_QWORD *)&m_pObject[1].m_nTag;
if ( v26 )
{
v14 = 0;
v27 = 0;
if ( (unsigned int)sub_100720070(v26) )
{
v28 = 0;
v27 = 0;
do
{
v29 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v28);
if ( *(_DWORD *)(v29 + 56) == 5 )
v27 += *(_DWORD *)(v29 + 68);
++v28;
}
while ( v28 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v30 = *(_QWORD *)&m_pObject[1].m_nTag;
v141 += v27;
if ( v30 )
{
v14 = 0;
v31 = 0;
if ( (unsigned int)sub_100720070(v30) )
{
v32 = 0;
v31 = 0;
do
{
v33 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v32);
if ( *(_DWORD *)(v33 + 56) == 10 )
v31 += *(_DWORD *)(v33 + 68);
++v32;
}
while ( v32 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v34 = *(_QWORD *)&m_pObject[1].m_nTag;
v142 += v31;
if ( v34 )
{
v14 = 0;
v35 = 0;
if ( (unsigned int)sub_100720070(v34) )
{
v36 = 0;
v35 = 0;
do
{
v37 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v36);
if ( *(_DWORD *)(v37 + 56) == 11 )
v35 += *(_DWORD *)(v37 + 68);
++v36;
}
while ( v36 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v42 = *(_QWORD *)&m_pObject[1].m_nTag;
v143 += v35;
if ( v42 )
{
v14 = 0;
v43 = 0;
if ( (unsigned int)sub_100720070(v42) )
{
v44 = 0;
v43 = 0;
do
{
v45 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v44);
if ( *(_DWORD *)(v45 + 56) == 12 )
v43 += *(_DWORD *)(v45 + 68);
++v44;
}
while ( v44 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v50 = *(_QWORD *)&m_pObject[1].m_nTag;
v145 += v43;
if ( v50 )
{
v14 = 0;
v51 = 0;
if ( (unsigned int)sub_100720070(v50) )
{
v52 = 0;
v51 = 0;
do
{
v53 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v52);
if ( *(_DWORD *)(v53 + 56) == 13 )
v51 += *(_DWORD *)(v53 + 68);
++v52;
}
while ( v52 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v58 = *(_QWORD *)&m_pObject[1].m_nTag;
v147 += v51;
if ( v58 && (unsigned int)sub_100720070(v58) )
{
v59 = 0;
v14 = 0;
do
{
v60 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v59);
if ( *(_DWORD *)(v60 + 56) == 14 )
v14 += *(_DWORD *)(v60 + 68);
++v59;
}
while ( v59 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
}
}
}
}
}
v61 = *(_QWORD *)&m_pObject[1].m_nTag;
if ( !v61 )
{
v11 = 0;
goto LABEL_11;
}
v152 = v14;
v62 = TotalCollectedCurrency;
v11 = 0;
v63 = 0;
if ( (unsigned int)sub_100720070(v61) )
{
v64 = 0;
v63 = 0;
do
{
v65 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v64);
if ( *(_DWORD *)(v65 + 56) == 6 )
v63 += *(_DWORD *)(v65 + 68);
++v64;
}
while ( v64 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
}
v66 = *(_QWORD *)&m_pObject[1].m_nTag;
v159 += v63;
if ( !v66 )
break;
TotalCollectedCurrency = v62;
if ( !(unsigned int)sub_100720070(v66) )
goto LABEL_99;
v67 = 0;
v11 = 0;
v14 = v152;
do
{
v68 = sub_1007200C0(*(_QWORD *)&m_pObject[1].m_nTag, v67);
if ( *(_DWORD *)(v68 + 56) == 15 )
v11 += *(_DWORD *)(v68 + 68);
++v67;
}
while ( v67 < (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) );
LABEL_11:
v140 += v11;
v139 += v160;
v138 += v14;
}
TotalCollectedCurrency = v62;
LABEL_99:
v14 = v152;
goto LABEL_11;
}
LABEL_4:
v7 = v136 + 1;
}
while ( v136 != 2 );
m_worldAdvertChests = a1->m_worldAdvertChests;
if ( m_worldAdvertChests )
{
for ( j = m_worldAdvertChests->m_pElements; j; TotalCollectedCurrency += v72 )
{
v71 = (cocos2d::CCString *)j->m_pObject;
j = (cocos2d::CCDictElement *)j->hh.next;
v72 = cocos2d::CCString::intValue(v71);
if ( v72 >= 200 )
v72 = 200;
}
}
v73 = cocos2d::CCDictionary::allKeys(a1->m_treasureRoomChests);
v160 = TotalCollectedCurrency;
if ( v73 )
{
data = v73->data;
if ( data->num )
{
arr = (cocos2d::CCString **)data->arr;
v150 = (unsigned __int64)&arr[data->num - 1];
while ( 1 )
{
if ( !*arr )
goto LABEL_153;
CString = cocos2d::CCString::getCString(*arr);
v77 = strlen(CString);
if ( v77 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_202:
sub_100006BF0(v6);
v78 = v77;
if ( v77 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v77;
v79 = (char *)&__dst + 1;
if ( v78 )
goto LABEL_122;
BYTE1(__dst) = 0;
v80 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
goto LABEL_115;
LABEL_116:
v81 = atoi(v80);
if ( v81 > 6000 )
{
v86 = 1;
v82 = -1;
v83 = 0;
v85 = v140;
v84 = a1;
}
else
{
v82 = 0;
v83 = 100;
v84 = a1;
if ( v81 <= 5000 )
{
v83 = 50;
if ( v81 <= 4000 )
{
v83 = 25;
if ( v81 <= 3000 )
{
v83 = 10;
if ( v81 <= 2000 )
{
v83 = 4 * (v81 >= 1001) + 1;
v85 = v159;
v86 = v83;
}
else
{
v85 = v159;
v86 = 10;
}
}
else
{
v85 = v159;
v86 = 25;
}
}
else
{
v85 = v159;
v86 = 50;
}
}
else
{
v85 = v159;
v86 = 100;
}
}
if ( v86 <= v85 )
{
v90 = cocos2d::CCDictionary::objectForKey_1(v84->m_treasureRoomChests, &__dst);
v140 += v82;
v159 -= v83;
v91 = *(_QWORD *)(v90 + 72);
if ( v91 )
{
v92 = 0;
while ( v92 < (unsigned int)sub_100720070(v91) )
{
v93 = sub_1007200C0(v91, v92);
switch ( *(_DWORD *)(v93 + 56) )
{
case 1:
v144 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 2:
v146 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 3:
v148 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 4:
v139 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 5:
v141 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 7:
v160 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 8:
TotalCollectedDiamonds += *(_DWORD *)(v93 + 68);
++v92;
break;
case 0xA:
v142 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 0xB:
v143 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 0xC:
v145 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 0xD:
v147 += *(_DWORD *)(v93 + 68);
++v92;
break;
case 0xE:
v138 += *(_DWORD *)(v93 + 68);
goto LABEL_136;
default:
LABEL_136:
++v92;
break;
}
}
}
}
else
{
cocos2d::CCDictionary::removeObjectForKey_1(v84->m_treasureRoomChests, &__dst);
}
if ( (__dst & 1) != 0 )
operator delete(v157);
if ( (unsigned __int64)++arr > v150 )
goto LABEL_153;
}
v87 = CString;
v88 = (v77 | 7) + 1;
if ( (v77 | 7) == 0x17 )
v88 = 26;
v79 = (char *)operator new(v88);
v157 = v79;
__dst = v88 + 1;
CString = v87;
v156 = v78;
LABEL_122:
v89 = v79;
memmove(v79, CString, v78);
v89[v78] = 0;
v80 = (char *)&__dst + 1;
if ( (__dst & 1) == 0 )
goto LABEL_116;
LABEL_115:
v80 = v157;
goto LABEL_116;
}
}
LABEL_153:
m_purchasedItems = a1->m_purchasedItems;
v95 = cocos2d::CCDictionary::allKeys(m_purchasedItems);
if ( v95 )
{
v96 = v95->data;
if ( v96->num )
{
v97 = (cocos2d::CCDictionary **)v96->arr;
v98 = (unsigned __int64)&v97[v96->num - 1];
v151 = TotalCollectedDiamonds;
while ( 1 )
{
m_purchasedItems = *v97;
if ( !*v97 )
goto LABEL_184;
v99 = cocos2d::CCString::getCString((cocos2d::CCString *)m_purchasedItems);
v100 = strlen(v99);
if ( v100 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_202;
v101 = v100;
if ( v100 >= 0x17 )
{
v111 = v99;
v112 = v100 | 7;
v113 = 26;
if ( (v101 | 7) != 0x17 )
v113 = v112 + 1;
v157 = (char *)operator new(v113);
__dst = v113 + 1;
v156 = v101;
v99 = v111;
v102 = v157;
}
else
{
LOBYTE(__dst) = 2 * v100;
v102 = (char *)&__dst + 1;
if ( !v100 )
{
BYTE1(__dst) = 0;
v103 = (char *)&__dst + 1;
if ( (__dst & 1) == 0 )
goto LABEL_163;
LABEL_162:
v103 = v157;
goto LABEL_163;
}
}
memmove(v102, v99, v101);
v102[v101] = 0;
v103 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
goto LABEL_162;
LABEL_163:
v104 = atoi(v103);
v105 = cocos2d::CCDictionary::objectForKey(a1->m_storeItems, v104);
v106 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(a1->m_purchasedItems, &__dst);
v107 = cocos2d::CCString::intValue(v106);
if ( v107 > 0 )
{
if ( v105 )
v107 = v105[6].m_nTag - v105[6].m_uReference;
m_purchasedItems = a1->m_storeItems;
v108 = cocos2d::CCDictionary::objectForKey(m_purchasedItems, v104);
if ( v108 && v108[6].m_eObjType == 4 )
{
v109 = 0;
if ( v151 >= v107 )
v109 = v107;
v110 = v151 < v107;
v151 -= v109;
if ( !v110 )
goto LABEL_181;
}
else
{
v114 = 0;
if ( v160 >= v107 )
v114 = v107;
v110 = v160 < v107;
v160 -= v114;
if ( !v110 )
goto LABEL_181;
}
}
m_purchasedItems = a1->m_purchasedItems;
cocos2d::CCDictionary::removeObjectForKey_1(m_purchasedItems, &__dst);
LABEL_181:
if ( (__dst & 1) != 0 )
{
m_purchasedItems = (cocos2d::CCDictionary *)v157;
operator delete(v157);
}
if ( (unsigned __int64)++v97 > v98 )
goto LABEL_184;
}
}
}
v151 = TotalCollectedDiamonds;
LABEL_184:
m_dontNotify = AchievementManager::sharedState()->m_dontNotify;
m_skipIncrementChallenge = a1->m_skipIncrementChallenge;
AchievementManager::sharedState()->m_dontNotify = 1;
a1->m_skipIncrementChallenge = 1;
GameStatsManager::resetSpecialStatAchievements((GameStatsManager *)m_purchasedItems);
GameStatsManager::setStat(a1, "14", v160);
GameStatsManager::setStat(a1, "13", TotalCollectedDiamonds);
GameStatsManager::setStat(a1, "29", v151);
GameStatsManager::setStat(a1, "21", v159);
GameStatsManager::setStat(a1, "43", v140);
GameStatsManager::setStat(a1, "18", v144);
GameStatsManager::setStat(a1, "19", v146);
GameStatsManager::setStat(a1, "17", v148);
GameStatsManager::setStat(a1, "16", v139);
GameStatsManager::setStat(a1, "20", v141);
GameStatsManager::setStat(a1, "23", v142);
GameStatsManager::setStat(a1, "24", v143);
GameStatsManager::setStat(a1, "25", v145);
GameStatsManager::setStat(a1, "26", v147);
v115 = a1;
GameStatsManager::setStat(a1, "27", v138);
for ( k = 6; k != 16; ++k )
{
GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(v115, GJItem, k) )
continue;
v117 = (cocos2d::CCString *)sub_1007AB580("geometry.ach.path%02d.00", (char)p_m_dailyChests);
v118 = cocos2d::CCString::getCString(v117);
v119 = strlen(v118);
if ( v119 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_202;
v120 = v119;
if ( v119 >= 0x17 )
{
v122 = v119 | 7;
v123 = 26;
if ( (v120 | 7) != 0x17 )
v123 = v122 + 1;
v121 = (char *)operator new(v123);
v157 = v121;
__dst = v123 + 1;
v156 = v120;
}
else
{
LOBYTE(__dst) = 2 * v119;
v121 = (char *)&__dst + 1;
if ( !v119 )
goto LABEL_195;
}
memmove(v121, v118, v120);
LABEL_195:
v121[v120] = 0;
v124 = GameManager::sharedState();
v125 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
v125 = v157;
v115 = (GameStatsManager *)v124;
GameManager::reportAchievementWithID(v124, v125, 100, 0);
if ( (__dst & 1) != 0 )
{
v115 = (GameStatsManager *)v157;
operator delete(v157);
}
}
v126 = 0;
for ( m = 1; m != 61; ++m )
{
v128 = GameStatsManager::sharedState();
v126 += GameStatsManager::isGauntletChestUnlocked(v128, m);
}
v129 = GameStatsManager::sharedState();
GameStatsManager::setStat(v129, "40", v126);
v130 = cocos2d::CCDictionary::count(a1->m_completedLists);
v131 = GameStatsManager::sharedState();
GameStatsManager::setStat(v131, "41", v130);
v132 = GameManager::sharedState();
GameManager::checkUsedIcons(v132);
AchievementManager::sharedState()->m_dontNotify = m_dontNotify;
a1->m_skipIncrementChallenge = m_skipIncrementChallenge;
}