//
// GameStatsManager::recountSpecialStats from 0x1401e4450 to 0x1401e52ac (3676 bytes)
//
// 2 xrefs:
// > GameManager::dataLoaded @ 0x1401873e4
// > ??> @ 0x1406cc5dc
//
// 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=10
void GameStatsManager::recountSpecialStats(GameStatsManager *a1)
{
GameStatsManager *v1; // rbx
int v2; // edi
int v3; // esi
int TotalCollectedCurrency; // r12d
GameStatsManager *v5; // rcx
GameStatsManager *v6; // rcx
int v7; // r13d
float v8; // xmm0_4
int v9; // ecx
int v10; // ecx
cocos2d::CCDictionary *m_weeklyChest; // rbx
cocos2d::CCDictElement *m_pElements; // rbx
cocos2d::CCDictElement *i; // r15
cocos2d::CCObject *m_pObject; // rbx
cocos2d::CCArray *v15; // rcx
int v16; // r14d
unsigned int v17; // esi
struct cocos2d::CCObject *v18; // rax
cocos2d::CCArray *v19; // rcx
int v20; // r14d
unsigned int v21; // esi
struct cocos2d::CCObject *v22; // rax
cocos2d::CCArray *v23; // rcx
int v24; // r14d
unsigned int v25; // esi
struct cocos2d::CCObject *v26; // rax
cocos2d::CCArray *v27; // rcx
int v28; // r14d
unsigned int v29; // esi
struct cocos2d::CCObject *v30; // rax
cocos2d::CCArray *v31; // rcx
int v32; // r14d
unsigned int v33; // esi
struct cocos2d::CCObject *v34; // rax
cocos2d::CCArray *v35; // rcx
int v36; // r14d
unsigned int v37; // esi
struct cocos2d::CCObject *v38; // rax
cocos2d::CCArray *v39; // rcx
int v40; // r14d
unsigned int v41; // esi
struct cocos2d::CCObject *v42; // rax
cocos2d::CCArray *v43; // rcx
int v44; // r14d
unsigned int v45; // esi
struct cocos2d::CCObject *v46; // rax
cocos2d::CCArray *v47; // rcx
int v48; // r14d
unsigned int v49; // esi
struct cocos2d::CCObject *v50; // rax
cocos2d::CCArray *v51; // rcx
int v52; // r14d
unsigned int v53; // esi
struct cocos2d::CCObject *v54; // rax
cocos2d::CCArray *v55; // rcx
int v56; // r14d
unsigned int v57; // esi
struct cocos2d::CCObject *v58; // rax
cocos2d::CCArray *v59; // rcx
int v60; // r14d
unsigned int v61; // esi
struct cocos2d::CCObject *v62; // rax
cocos2d::CCArray *v63; // rcx
int v64; // r14d
unsigned int v65; // esi
struct cocos2d::CCObject *v66; // rax
cocos2d::CCArray *v67; // rcx
int v68; // r14d
unsigned int v69; // esi
struct cocos2d::CCObject *v70; // rax
cocos2d::CCDictionary *m_worldAdvertChests; // rcx
cocos2d::CCDictElement *v72; // rcx
cocos2d::CCDictElement *j; // rbx
int v74; // eax
int v75; // ecx
struct cocos2d::CCArray *v76; // rax
int v77; // r13d
cocos2d::ccArray *data; // rcx
__int64 num; // rax
cocos2d::CCString **arr; // r14
cocos2d::CCString **v81; // r15
const char *CString; // rax
size_t v83; // r8
const char *v84; // rcx
int v85; // ecx
int v86; // eax
__int64 v87; // rax
cocos2d::CCArray *v88; // rsi
unsigned int v89; // ebx
int v90; // r15d
int v91; // r13d
int v92; // edi
int v93; // r14d
struct cocos2d::CCObject *v94; // rax
int v95; // ebx
int v96; // r15d
GameStatsManager *v97; // r14
struct cocos2d::CCArray *v98; // rax
cocos2d::ccArray *v99; // rsi
__int64 v100; // rax
cocos2d::CCString **v101; // rsi
int v102; // r13d
const char *v103; // rax
size_t v104; // r8
const char *v105; // rcx
__int64 v106; // r12
struct cocos2d::CCObject *v107; // r14
cocos2d::CCString *v108; // rax
int v109; // ebx
struct cocos2d::CCObject *v110; // rax
bool m_dontNotify; // si
bool m_skipIncrementChallenge; // r14
GameStatsManager *v113; // rcx
int v114; // r8d
GameStatsManager *v115; // r12
GameStatsManager *v116; // rcx
int m; // ebx
cocos2d::CCString *v118; // rax
const char *v119; // rax
size_t v120; // r8
bool v121; // r9
GameManager *v122; // rcx
const char *v123; // rdx
char *v124; // rcx
__int64 v125; // rbx
__int64 v126; // rax
char isSpecialChestUnlocked; // bl
GameStatsManager *v128; // rcx
int v129; // ebx
GameStatsManager *v130; // rcx
GameManager *v131; // rcx
void *v133; // [rsp+20h] [rbp-89h]
int v134; // [rsp+28h] [rbp-81h]
int v135; // [rsp+28h] [rbp-81h]
int TotalCollectedDiamonds; // [rsp+2Ch] [rbp-7Dh]
int v137; // [rsp+30h] [rbp-79h]
int v138; // [rsp+34h] [rbp-75h]
int v139; // [rsp+38h] [rbp-71h]
int v140; // [rsp+3Ch] [rbp-6Dh]
int v141; // [rsp+40h] [rbp-69h]
int v142; // [rsp+44h] [rbp-65h]
int v143; // [rsp+48h] [rbp-61h]
int v144; // [rsp+4Ch] [rbp-5Dh]
int v145; // [rsp+50h] [rbp-59h]
int v146; // [rsp+54h] [rbp-55h]
int v147; // [rsp+58h] [rbp-51h]
void *v148; // [rsp+60h] [rbp-49h]
void *v149; // [rsp+60h] [rbp-49h]
cocos2d::CCString **k; // [rsp+60h] [rbp-49h]
cocos2d::CCString **v151; // [rsp+60h] [rbp-49h]
void *v152; // [rsp+60h] [rbp-49h]
void *v153; // [rsp+60h] [rbp-49h]
void *v154; // [rsp+60h] [rbp-49h]
void *v155; // [rsp+60h] [rbp-49h]
void *v156; // [rsp+60h] [rbp-49h]
int v157; // [rsp+68h] [rbp-41h]
int v158; // [rsp+70h] [rbp-39h]
cocos2d::CCString **v159; // [rsp+70h] [rbp-39h]
char v160[32]; // [rsp+78h] [rbp-31h] BYREF
char *String[2]; // [rsp+98h] [rbp-11h] BYREF
__int64 v162; // [rsp+A8h] [rbp-1h]
unsigned __int64 v163; // [rsp+B0h] [rbp+7h]
_BYTE v164[32]; // [rsp+B8h] [rbp+Fh] BYREF
v1 = a1;
v2 = 0;
v138 = 0;
v139 = 0;
v140 = 0;
v141 = 0;
v142 = 0;
v143 = 0;
v144 = 0;
v145 = 0;
v146 = 0;
v147 = 0;
v3 = 0;
v137 = 0;
TotalCollectedCurrency = GameStatsManager::getTotalCollectedCurrency(a1);
v134 = TotalCollectedCurrency;
v5 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v148 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v148);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v5 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::getStat(v5, "22") != TotalCollectedCurrency )
{
v6 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v149 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v149);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v6 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v6, "22", TotalCollectedCurrency);
}
TotalCollectedDiamonds = GameStatsManager::getTotalCollectedDiamonds(v1);
v7 = (int)floorf((float)TotalCollectedCurrency / 500.0);
v157 = v7;
v1->m_bonusKey.value = v7;
v8 = (float)((float)rand() / 32767.0) * 1000.0;
v1->m_bonusKey.seed = (int)v8;
v1->m_bonusKey.random = v7 + (int)v8;
GameStatsManager::removeErrorFromSpecialChests(v1);
v9 = 0;
v158 = 0;
do
{
if ( v9 )
{
v10 = v9 - 1;
if ( v10 )
{
if ( v10 != 1 )
goto LABEL_91;
m_weeklyChest = v1->m_weeklyChest;
}
else
{
m_weeklyChest = v1->m_miscChests;
}
}
else
{
m_weeklyChest = v1->m_dailyChests;
}
if ( m_weeklyChest )
{
m_pElements = m_weeklyChest->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
m_pObject = m_pElements->m_pObject;
v15 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v16 = 0;
if ( v15 )
{
v17 = 0;
if ( cocos2d::CCArray::count(v15) )
{
do
{
v18 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v17);
if ( LODWORD(v18[1].__vftable) == 7 )
v16 += v18[1].m_nLuaID;
++v17;
}
while ( v17 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
TotalCollectedCurrency += v16;
v19 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v20 = 0;
if ( v19 )
{
v21 = 0;
if ( cocos2d::CCArray::count(v19) )
{
do
{
v22 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v21);
if ( LODWORD(v22[1].__vftable) == 8 )
v20 += v22[1].m_nLuaID;
++v21;
}
while ( v21 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
TotalCollectedDiamonds += v20;
v23 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v24 = 0;
if ( v23 )
{
v25 = 0;
if ( cocos2d::CCArray::count(v23) )
{
do
{
v26 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v25);
if ( LODWORD(v26[1].__vftable) == 1 )
v24 += v26[1].m_nLuaID;
++v25;
}
while ( v25 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v138 += v24;
v27 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v28 = 0;
if ( v27 )
{
v29 = 0;
if ( cocos2d::CCArray::count(v27) )
{
do
{
v30 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v29);
if ( LODWORD(v30[1].__vftable) == 2 )
v28 += v30[1].m_nLuaID;
++v29;
}
while ( v29 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v139 += v28;
v31 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v32 = 0;
if ( v31 )
{
v33 = 0;
if ( cocos2d::CCArray::count(v31) )
{
do
{
v34 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v33);
if ( LODWORD(v34[1].__vftable) == 3 )
v32 += v34[1].m_nLuaID;
++v33;
}
while ( v33 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v140 += v32;
v35 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v36 = 0;
if ( v35 )
{
v37 = 0;
if ( cocos2d::CCArray::count(v35) )
{
do
{
v38 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v37);
if ( LODWORD(v38[1].__vftable) == 4 )
v36 += v38[1].m_nLuaID;
++v37;
}
while ( v37 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v141 += v36;
v39 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v40 = 0;
if ( v39 )
{
v41 = 0;
if ( cocos2d::CCArray::count(v39) )
{
do
{
v42 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v41);
if ( LODWORD(v42[1].__vftable) == 5 )
v40 += v42[1].m_nLuaID;
++v41;
}
while ( v41 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v142 += v40;
v43 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v44 = 0;
if ( v43 )
{
v45 = 0;
if ( cocos2d::CCArray::count(v43) )
{
do
{
v46 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v45);
if ( LODWORD(v46[1].__vftable) == 10 )
v44 += v46[1].m_nLuaID;
++v45;
}
while ( v45 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v143 += v44;
v47 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v48 = 0;
if ( v47 )
{
v49 = 0;
if ( cocos2d::CCArray::count(v47) )
{
do
{
v50 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v49);
if ( LODWORD(v50[1].__vftable) == 11 )
v48 += v50[1].m_nLuaID;
++v49;
}
while ( v49 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v144 += v48;
v51 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v52 = 0;
if ( v51 )
{
v53 = 0;
if ( cocos2d::CCArray::count(v51) )
{
do
{
v54 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v53);
if ( LODWORD(v54[1].__vftable) == 12 )
v52 += v54[1].m_nLuaID;
++v53;
}
while ( v53 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v145 += v52;
v55 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v56 = 0;
if ( v55 )
{
v57 = 0;
if ( cocos2d::CCArray::count(v55) )
{
do
{
v58 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v57);
if ( LODWORD(v58[1].__vftable) == 13 )
v56 += v58[1].m_nLuaID;
++v57;
}
while ( v57 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v146 += v56;
v59 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v60 = 0;
if ( v59 )
{
v61 = 0;
if ( cocos2d::CCArray::count(v59) )
{
do
{
v62 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v61);
if ( LODWORD(v62[1].__vftable) == 14 )
v60 += v62[1].m_nLuaID;
++v61;
}
while ( v61 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v147 += v60;
v63 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v64 = 0;
if ( v63 )
{
v65 = 0;
if ( cocos2d::CCArray::count(v63) )
{
do
{
v66 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v65);
if ( LODWORD(v66[1].__vftable) == 6 )
v64 += v66[1].m_nLuaID;
++v65;
}
while ( v65 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v7 += v64;
v67 = *(cocos2d::CCArray **)&m_pObject[1].m_nTag;
v68 = 0;
if ( v67 )
{
v69 = 0;
if ( cocos2d::CCArray::count(v67) )
{
do
{
v70 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&m_pObject[1].m_nTag, v69);
if ( LODWORD(v70[1].__vftable) == 15 )
v68 += v70[1].m_nLuaID;
++v69;
}
while ( v69 < cocos2d::CCArray::count(*(cocos2d::CCArray **)&m_pObject[1].m_nTag) );
}
}
v3 = v68 + v137;
v137 += v68;
m_pElements = i;
if ( !i )
break;
}
v157 = v7;
v134 = TotalCollectedCurrency;
}
}
v1 = a1;
LABEL_91:
v9 = v158 + 1;
v158 = v9;
}
while ( v9 < 3 );
m_worldAdvertChests = v1->m_worldAdvertChests;
if ( m_worldAdvertChests )
{
v72 = m_worldAdvertChests->m_pElements;
if ( v72 )
{
for ( j = (cocos2d::CCDictElement *)v72->hh.next; ; j = (cocos2d::CCDictElement *)j->hh.next )
{
v74 = cocos2d::CCString::intValue((cocos2d::CCString *)v72->m_pObject);
v75 = 200;
if ( v74 < 200 )
v75 = v74;
TotalCollectedCurrency += v75;
v72 = j;
if ( !j )
break;
}
v134 = TotalCollectedCurrency;
v1 = a1;
}
}
v76 = cocos2d::CCDictionary::allKeys(v1->m_treasureRoomChests);
v77 = 1;
if ( v76 )
{
data = v76->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (cocos2d::CCString **)data->arr;
v159 = arr;
v81 = &arr[num - 1];
for ( k = v81; arr <= v81; v3 = v137 )
{
if ( !*arr )
break;
CString = cocos2d::CCString::getCString(*arr);
*(_OWORD *)String = 0;
v162 = 0;
v163 = 0;
v83 = -1;
do
++v83;
while ( CString[v83] );
sub_14003A930(String, CString, v83);
v84 = (const char *)String;
if ( v163 > 0xF )
v84 = String[0];
v85 = atoi(v84);
if ( v85 <= 6000 )
{
if ( v85 <= 5000 )
{
if ( v85 <= 4000 )
{
if ( v85 <= 3000 )
{
if ( v85 <= 2000 )
{
v86 = 1;
if ( v85 > 1000 )
v86 = 5;
}
else
{
v86 = 10;
}
}
else
{
v86 = 25;
}
}
else
{
v86 = 50;
}
}
else
{
v86 = 100;
}
if ( v157 >= v86 )
{
v157 -= v86;
LABEL_123:
v87 = cocos2d::CCDictionary::objectForKey(v1->m_treasureRoomChests, String);
v88 = *(cocos2d::CCArray **)(v87 + 72);
if ( v88 )
{
v89 = 0;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(v87 + 72)) )
{
v90 = TotalCollectedDiamonds;
v91 = v138;
v92 = v139;
v93 = v140;
do
{
v94 = cocos2d::CCArray::objectAtIndex(v88, v89);
switch ( LODWORD(v94[1].__vftable) )
{
case 1:
v91 += v94[1].m_nLuaID;
break;
case 2:
v92 += v94[1].m_nLuaID;
break;
case 3:
v93 += v94[1].m_nLuaID;
break;
case 4:
v141 += v94[1].m_nLuaID;
break;
case 5:
v142 += v94[1].m_nLuaID;
break;
case 7:
TotalCollectedCurrency += v94[1].m_nLuaID;
break;
case 8:
v90 += v94[1].m_nLuaID;
break;
case 0xA:
v143 += v94[1].m_nLuaID;
break;
case 0xB:
v144 += v94[1].m_nLuaID;
break;
case 0xC:
v145 += v94[1].m_nLuaID;
break;
case 0xD:
v146 += v94[1].m_nLuaID;
break;
case 0xE:
v147 += v94[1].m_nLuaID;
break;
default:
break;
}
++v89;
}
while ( v89 < cocos2d::CCArray::count(v88) );
v140 = v93;
v139 = v92;
v138 = v91;
TotalCollectedDiamonds = v90;
v134 = TotalCollectedCurrency;
v2 = 0;
v77 = 1;
arr = v159;
v81 = k;
}
v1 = a1;
}
goto LABEL_142;
}
}
else if ( v3 >= 1 )
{
v137 = v3 - 1;
goto LABEL_123;
}
cocos2d::CCDictionary::removeObjectForKey(v1->m_treasureRoomChests, String);
LABEL_142:
sub_14003A830((__int64)String);
v159 = ++arr;
}
}
}
v95 = TotalCollectedDiamonds;
v96 = TotalCollectedDiamonds;
v97 = a1;
v98 = cocos2d::CCDictionary::allKeys(a1->m_purchasedItems);
if ( !v98 )
goto LABEL_166;
v99 = v98->data;
v100 = v99->num;
if ( !(_DWORD)v100 )
goto LABEL_166;
v101 = (cocos2d::CCString **)v99->arr;
v151 = &v101[v100 - 1];
if ( v101 > v151 )
goto LABEL_166;
v102 = v134;
while ( 2 )
{
if ( *v101 )
{
v103 = cocos2d::CCString::getCString(*v101);
*(_OWORD *)String = 0;
v162 = 0;
v163 = 0;
v104 = -1;
do
++v104;
while ( v103[v104] );
sub_14003A930(String, v103, v104);
v105 = (const char *)String;
if ( v163 > 0xF )
v105 = String[0];
v106 = atoi(v105);
v107 = cocos2d::CCDictionary::objectForKey(v97->m_storeItems, v106);
v108 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(a1->m_purchasedItems, String);
v109 = cocos2d::CCString::intValue(v108);
if ( v109 > 0 )
{
if ( v107 )
v109 = v107[6].m_uReference - v107[6].m_uAutoReleaseCount;
v97 = a1;
v110 = cocos2d::CCDictionary::objectForKey(a1->m_storeItems, v106);
if ( v110 && v110[6].m_uIndexInArray == 4 )
{
if ( v96 >= v109 )
{
v96 -= v109;
goto LABEL_164;
}
LABEL_163:
cocos2d::CCDictionary::removeObjectForKey(v97->m_purchasedItems, String);
}
else
{
if ( v102 < v109 )
goto LABEL_163;
v102 -= v109;
}
LABEL_164:
sub_14003A830((__int64)String);
if ( ++v101 > v151 )
break;
continue;
}
v97 = a1;
goto LABEL_163;
}
break;
}
v135 = v102;
v77 = 1;
TotalCollectedCurrency = v135;
v95 = TotalCollectedDiamonds;
LABEL_166:
m_dontNotify = AchievementManager::sharedState()->m_dontNotify;
m_skipIncrementChallenge = v97->m_skipIncrementChallenge;
AchievementManager::sharedState()->m_dontNotify = 1;
a1->m_skipIncrementChallenge = 1;
GameStatsManager::resetSpecialStatAchievements(v113);
v114 = TotalCollectedCurrency;
v115 = a1;
GameStatsManager::setStat(a1, "14", v114);
GameStatsManager::setStat(a1, "13", v95);
GameStatsManager::setStat(a1, (const char *)&word_14055A524, v96);
GameStatsManager::setStat(a1, (const char *)&word_140543238, v157);
GameStatsManager::setStat(a1, "43", v137);
GameStatsManager::setStat(a1, (const char *)&word_140544458, v138);
GameStatsManager::setStat(a1, (const char *)&word_14054445C, v139);
GameStatsManager::setStat(a1, (const char *)&word_140544450, v140);
GameStatsManager::setStat(a1, (const char *)&word_140544454, v141);
GameStatsManager::setStat(a1, (const char *)&word_140544448, v142);
GameStatsManager::setStat(a1, (const char *)&word_14054444C, v143);
GameStatsManager::setStat(a1, "24", v144);
GameStatsManager::setStat(a1, "25", v145);
GameStatsManager::setStat(a1, "26", v146);
GameStatsManager::setStat(a1, "27", v147);
for ( m = 6; m <= 15; ++m )
{
if ( !qword_1406C2EE8 )
{
v152 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v152);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
}
if ( GameStatsManager::isItemUnlocked(v116, GJItem, m) )
{
v118 = cocos2d::CCString::createWithFormat("geometry.ach.path%02d.00", m - 5);
v119 = cocos2d::CCString::getCString(v118);
*(_OWORD *)String = 0;
v162 = 0;
v163 = 0;
v120 = -1;
do
++v120;
while ( v119[v120] );
sub_14003A930(String, v119, v120);
v122 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v133 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v133);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v122 = (GameManager *)qword_1406C2ED8;
}
v123 = (const char *)String;
if ( v163 > 0xF )
v123 = String[0];
GameManager::reportAchievementWithID(v122, v123, 100, v121);
if ( v163 > 0xF )
{
v124 = String[0];
if ( v163 + 1 >= 0x1000 )
{
v124 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v124 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v124);
}
v162 = 0;
v163 = 15;
LOBYTE(String[0]) = 0;
}
}
do
{
v125 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v153 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v153);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v125 = qword_1406C2EE8;
}
GameStatsManager::getGauntletRewardKey(v116, v164, (unsigned int)v77);
v126 = sub_14003BDB0((__int64)v160, (__int64)v164);
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v125, v126);
sub_14003A830((__int64)v164);
if ( isSpecialChestUnlocked )
++v2;
++v77;
}
while ( v77 <= 60 );
v128 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v154 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v154);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v128 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v128, "40", v2);
v129 = cocos2d::CCDictionary::count(v115->m_completedLists);
v130 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v155 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v130 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::setStat(v130, "41", v129);
v131 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v156 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v156);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v131 = (GameManager *)qword_1406C2ED8;
}
GameManager::checkUsedIcons(v131);
AchievementManager::sharedState()->m_dontNotify = m_dontNotify;
v115->m_skipIncrementChallenge = m_skipIncrementChallenge;
}