//
// GameStatsManager::dataLoaded from 0x7bdfc8 to 0x7bf384 (5052 bytes)
//
// 2 xrefs:
// > GameManager::dataLoaded @ 0x5faec0
// > ??> @ 0xb8fe0
//
// 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 GameStatsManager::dataLoaded(GameStatsManager *a1, DS_Dictionary *a2)
{
int IntegerForKey; // w0
_BOOL4 m_pathBugFixed; // w1
cocos2d::CCDictionary *DictForKey; // x0
cocos2d::CCArray *v7; // x24
unsigned int v8; // w19
cocos2d::CCString *v9; // x0
char *CString; // x22
bool isSecretCoinValid; // w0
_BOOL4 v12; // w27
__int64 v13; // x1
__int64 *v14; // x0
unsigned int *v15; // x1
int v16; // w2
cocos2d::CCDictionary *v17; // x28
cocos2d::CCString *m_trueString; // x27
char *v19; // x0
cocos2d::CCDictionary *v20; // x0
cocos2d::CCDictionary *v21; // x19
cocos2d::CCArray *v22; // x22
unsigned int i; // w19
cocos2d::CCString *v24; // x0
const char *v25; // x20
cocos2d::CCDictionary *v26; // x0
cocos2d::CCDictionary *v27; // x1
cocos2d::CCDictionary *m_pendingUserCoins; // x2
cocos2d::CCDictionary *v29; // x0
cocos2d::CCDictionary *v30; // x19
cocos2d::CCDictionary *m_completedLevels; // x0
cocos2d::CCDictionary *v32; // x0
cocos2d::CCDictionary *v33; // x0
cocos2d::CCDictionary *v34; // x0
cocos2d::CCDictionary *v35; // x1
cocos2d::CCDictionary *m_onlineCurrencyScores; // x2
cocos2d::CCDictionary *v37; // x0
cocos2d::CCDictionary *v38; // x1
cocos2d::CCDictionary *m_gauntletCurrencyScores; // x2
cocos2d::CCDictionary *v40; // x0
cocos2d::CCDictionary *v41; // x1
cocos2d::CCDictionary *m_mainCurrencyScores; // x2
cocos2d::CCDictionary *v43; // x0
cocos2d::CCDictionary *v44; // x1
cocos2d::CCDictionary *m_timelyCurrencyScores; // x2
cocos2d::CCDictionary *v46; // x0
cocos2d::CCDictionary *v47; // x1
cocos2d::CCDictionary *m_onlineStars; // x2
cocos2d::CCDictionary *v49; // x0
cocos2d::CCDictionary *v50; // x1
cocos2d::CCDictionary *m_timelyStars; // x2
cocos2d::CCDictionary *v52; // x0
cocos2d::CCDictionary *v53; // x0
cocos2d::CCDictionary *v54; // x1
cocos2d::CCDictionary *m_timelyDiamondScores; // x2
cocos2d::CCDictionary *v56; // x0
cocos2d::CCDictionary *v57; // x1
cocos2d::CCDictionary *m_unusedCurrencyAwardDict; // x2
cocos2d::CCDictionary *v59; // x0
cocos2d::CCDictionary *v60; // x1
cocos2d::CCDictionary *m_dailyChests; // x2
cocos2d::CCDictionary *v62; // x0
cocos2d::CCDictionary *v63; // x1
cocos2d::CCDictionary *m_weeklyChest; // x2
cocos2d::CCDictionary *v65; // x0
cocos2d::CCDictionary *v66; // x1
cocos2d::CCDictionary *m_eventChest; // x2
cocos2d::CCDictionary *v68; // x0
cocos2d::CCDictionary *v69; // x1
cocos2d::CCDictionary *m_worldAdvertChests; // x2
cocos2d::CCDictionary *v71; // x0
cocos2d::CCDictionary *v72; // x25
cocos2d::CCArray *v73; // x0
cocos2d::ccArray *data; // x1
cocos2d::CCDictionary *v75; // x0
cocos2d::CCDictionary *v76; // x19
cocos2d::CCDictionary *m_upcomingChallenges; // x0
cocos2d::CCDictionary *v78; // x0
cocos2d::CCDictionary *v79; // x0
cocos2d::CCDictionary *v80; // x1
cocos2d::CCDictionary *m_completedLists; // x2
cocos2d::CCDictionary *v82; // x0
cocos2d::CCDictionary *v83; // x1
cocos2d::CCDictionary *m_treasureRoomChests; // x2
cocos2d::CCDictionary *v85; // x0
cocos2d::CCDictionary *v86; // x1
cocos2d::CCDictionary *m_wraithChests; // x2
cocos2d::CCDictionary *v88; // x0
cocos2d::CCDictionary *v89; // x0
cocos2d::CCDictionary *v90; // x1
cocos2d::CCDictionary *m_enabledItems; // x2
cocos2d::CCDictionary *v92; // x0
cocos2d::CCDictionary *v93; // x1
cocos2d::CCDictionary *m_unlockedGauntlets; // x2
int v95; // w19
int v96; // w0
int v97; // w20
int v98; // w0
StatKey v99; // w0
cocos2d::CCString *v100; // x0
int v101; // w27
char *v102; // x0
cocos2d::CCDictionary *v103; // x28
cocos2d::CCString *v104; // x0
int v105; // w28
char *v106; // x0
char *v107; // x0
unsigned __int64 v108; // x1
cocos2d::CCDictionary *v109; // x28
cocos2d::CCObject *v110; // x27
char *v111; // x0
unsigned int *v112; // x22
int v113; // w1
unsigned int *v114; // x1
int v115; // w2
unsigned int *v116; // x1
int v117; // w2
unsigned int *v118; // x1
int v119; // w2
cocos2d::CCDictionary *v120; // x28
char *v121; // x0
unsigned int *v122; // x1
int v123; // w2
bool BoolForKey; // w0
cocos2d::CCDictionary *m_playerStats; // x0
cocos2d::CCString **arr; // x20
__int64 v127; // x0
char *v128; // x24
cocos2d::CCString *v129; // x0
char *v130; // x0
__int64 v131; // x22
_DWORD *v132; // x0
_DWORD *v133; // x28
stl::StringData::Internal *m_data; // x1
char *v135; // x0
char *v136; // x19
int v137; // w20
StatKey v138; // w1
cocos2d::CCDictionary *m_verifiedUserCoins; // x0
cocos2d::CCDictionary *v140; // x0
cocos2d::CCDictionary *v141; // x1
int v142; // w22
int v143; // w0
float v144; // s0
unsigned int *v145; // x1
int v146; // w2
cocos2d::CCDictionary *m_miscChests; // x0
cocos2d::CCDictionary *v148; // x1
cocos2d::CCDictionary *v149; // x0
cocos2d::CCDictionary *v150; // x1
cocos2d::CCDictionary *v151; // x0
cocos2d::CCDictionary *v152; // x1
cocos2d::CCDictionary *m_challengeDiamonds; // x0
cocos2d::CCDictionary *v154; // x1
cocos2d::CCDictionary *v155; // x0
cocos2d::CCDictionary *v156; // x1
cocos2d::CCDictionary *v157; // x0
cocos2d::CCDictionary *v158; // x1
cocos2d::CCDictionary *v159; // x0
cocos2d::CCDictionary *v160; // x1
cocos2d::CCDictionary *m_gauntletDiamondScores; // x0
cocos2d::CCDictionary *v162; // x1
cocos2d::CCDictionary *v163; // x0
cocos2d::CCDictionary *v164; // x1
cocos2d::CCDictionary *v165; // x0
cocos2d::CCDictionary *v166; // x1
cocos2d::CCDictionary *v167; // x0
cocos2d::CCDictionary *v168; // x1
cocos2d::CCDictionary *v169; // x0
cocos2d::CCDictionary *v170; // x1
cocos2d::CCDictionary *v171; // x0
cocos2d::CCDictionary *v172; // x1
cocos2d::CCDictionary *v173; // x0
cocos2d::CCDictionary *v174; // x1
cocos2d::CCDictionary *m_activeChallenges; // x0
cocos2d::CCDictionary *m_purchasedItems; // x0
cocos2d::CCDictionary *v177; // x1
cocos2d::CCDictionary *v178; // x0
cocos2d::CCDictionary *v179; // x1
cocos2d::CCDictionary *v180; // x0
cocos2d::CCDictionary *v181; // x1
cocos2d::CCDictionary *v182; // x0
cocos2d::CCDictionary *v183; // x1
cocos2d::CCDictionary *v184; // x0
cocos2d::CCDictionary *v185; // x1
cocos2d::CCDictionary *v186; // x0
cocos2d::CCDictionary *v187; // x1
cocos2d::CCDictionary *v188; // x0
cocos2d::CCDictionary *v189; // x1
cocos2d::CCDictionary *m_completedMappacks; // x0
cocos2d::CCDictionary *v191; // x1
unsigned int *v192; // x22
int v193; // w1
char *v194[2]; // [xsp+0h] [xbp+0h] BYREF
char *v195; // [xsp+78h] [xbp+78h]
char *v196; // [xsp+80h] [xbp+80h]
int v197[2]; // [xsp+88h] [xbp+88h]
_BOOL4 v198; // [xsp+90h] [xbp+90h]
_BOOL4 isSecretCoin; // [xsp+94h] [xbp+94h]
cocos2d::CCDictionary *v200; // [xsp+98h] [xbp+98h]
char v201; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v202; // [xsp+B8h] [xbp+B8h] BYREF
std::string v203; // [xsp+C0h] [xbp+C0h] BYREF
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, "binaryVersion");
m_pathBugFixed = a1->m_pathBugFixed;
v198 = IntegerForKey == 38;
if ( m_pathBugFixed
|| (BoolForKey = DS_Dictionary::getBoolForKey(a2, "GS_29"), a1->m_pathBugFixed = BoolForKey, !v198)
|| BoolForKey )
{
DictForKey = DS_Dictionary::getDictForKey(a2, "GS_value", 0);
v200 = DictForKey;
if ( !a1->m_playerStats )
goto LABEL_125;
}
else
{
a1->m_tryFixPathBug = 1;
DictForKey = DS_Dictionary::getDictForKey(a2, "GS_value", 0);
v200 = DictForKey;
if ( !a1->m_playerStats )
{
LABEL_125:
if ( DictForKey )
{
cocos2d::CCObject::retain(DictForKey);
m_playerStats = a1->m_playerStats;
if ( m_playerStats )
cocos2d::CCObject::release(m_playerStats);
a1->m_playerStats = v200;
}
goto LABEL_17;
}
}
v7 = cocos2d::CCDictionary::allKeys(DictForKey);
*(_QWORD *)v197 = &v202;
v196 = &v201;
v8 = 0;
v195 = "8";
if ( (unsigned int)cocos2d::CCArray::count(v7) )
{
while ( 2 )
{
v9 = cocos2d::CCArray::stringAtIndex(v7, v8);
CString = (char *)cocos2d::CCString::getCString(v9);
switch ( atoi(CString) )
{
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 40:
case 41:
case 42:
case 43:
goto LABEL_15;
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
if ( !v198 || a1->m_tryFixPathBug )
goto LABEL_88;
goto LABEL_15;
default:
LABEL_88:
sub_D153B8((unsigned int)v194 + 192, CString);
v100 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v200, &v203);
v101 = cocos2d::CCString::intValue(v100);
v102 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v118 = (unsigned int *)((char *)v203.m_data.m_data - 8);
do
v119 = __ldaxr(v118);
while ( __stlxr(v119 - 1, v118) );
}
else
{
v119 = *((_DWORD *)v203.m_data.m_data - 2);
*((_DWORD *)v203.m_data.m_data - 2) = v119 - 1;
}
if ( v119 <= 0 )
operator delete(v102);
}
v103 = a1->m_playerStats;
sub_D153B8((unsigned int)v194 + 192, CString);
v104 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v103, &v203);
v105 = cocos2d::CCString::intValue(v104);
v106 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v116 = (unsigned int *)((char *)v203.m_data.m_data - 8);
do
v117 = __ldaxr(v116);
while ( __stlxr(v117 - 1, v116) );
}
else
{
v117 = *((_DWORD *)v203.m_data.m_data - 2);
*((_DWORD *)v203.m_data.m_data - 2) = v117 - 1;
}
if ( v117 <= 0 )
operator delete(v106);
}
sub_D153B8((unsigned int)v194 + 192, CString);
isSecretCoin = GameStatsManager::isSecretCoin((__int64)a1, (unsigned int)v194 + 192);
v107 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v114 = (unsigned int *)((char *)v203.m_data.m_data - 8);
do
v115 = __ldaxr(v114);
while ( __stlxr(v115 - 1, v114) );
}
else
{
v115 = *((_DWORD *)v203.m_data.m_data - 2);
*((_DWORD *)v203.m_data.m_data - 2) = v115 - 1;
}
if ( v115 <= 0 )
operator delete(v107);
}
if ( isSecretCoin )
{
sub_D153B8(v197[0], CString);
isSecretCoinValid = GameStatsManager::isSecretCoinValid((int)a1, *(_QWORD **)v197);
v12 = isSecretCoinValid;
if ( isSecretCoinValid )
{
v120 = a1->m_playerStats;
sub_D153B8((int)&v203, CString);
v12 = cocos2d::CCDictionary::objectForKey(v120, &v203) == 0;
v121 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v122 = (unsigned int *)((char *)v203.m_data.m_data - 8);
do
v123 = __ldaxr(v122);
while ( __stlxr(v123 - 1, v122) );
}
else
{
v123 = *((_DWORD *)v203.m_data.m_data - 2);
*((_DWORD *)v203.m_data.m_data - 2) = v123 - 1;
}
if ( v123 <= 0 )
operator delete(v121);
}
}
v13 = **(_QWORD **)v197;
v14 = (__int64 *)(**(_QWORD **)v197 - 24LL);
if ( v14 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v13 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v13 - 8);
*(_DWORD *)(v13 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v14);
}
if ( v12 )
{
v17 = a1->m_playerStats;
m_trueString = a1->m_trueString;
sub_D153B8((unsigned int)v194 + 192, CString);
cocos2d::CCDictionary::setObject((int)v17, m_trueString);
v19 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v192 = (unsigned int *)((char *)v203.m_data.m_data - 8);
do
v193 = __ldaxr(v192);
while ( __stlxr(v193 - 1, v192) );
}
else
{
v193 = *((_DWORD *)v203.m_data.m_data - 2);
*((_DWORD *)v203.m_data.m_data - 2) = v193 - 1;
}
if ( v193 <= 0 )
operator delete(v19);
}
GameStatsManager::incrementStat(a1, v195);
}
LABEL_15:
++v8;
goto LABEL_16;
}
if ( v105 < v101 )
v108 = (unsigned int)v101;
else
v108 = (unsigned int)v105;
v109 = a1->m_playerStats;
v110 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v108);
sub_D153B8((unsigned int)v194 + 192, CString);
cocos2d::CCDictionary::setObject((int)v109, v110);
v111 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_15;
if ( &pthread_create )
{
v112 = (unsigned int *)((char *)v203.m_data.m_data - 8);
do
v113 = __ldaxr(v112);
while ( __stlxr(v113 - 1, v112) );
}
else
{
v113 = *((_DWORD *)v203.m_data.m_data - 2);
*((_DWORD *)v203.m_data.m_data - 2) = v113 - 1;
}
if ( v113 > 0 )
goto LABEL_15;
++v8;
operator delete(v111);
LABEL_16:
if ( v8 >= (unsigned int)cocos2d::CCArray::count(v7) )
break;
continue;
}
break;
}
}
LABEL_17:
if ( a1->m_pathBugFixed || a1->m_tryFixPathBug )
goto LABEL_19;
v136 = (char *)&off_18 + 6;
v137 = 0;
do
{
while ( GameStatsManager::getStatFromKey(a1, (StatKey)v136) > 999 )
{
LODWORD(v136) = (_DWORD)v136 + 1;
v137 += 1000;
if ( (_DWORD)v136 == 40 )
goto LABEL_141;
}
v138 = (int)v136;
LODWORD(v136) = (_DWORD)v136 + 1;
v137 += GameStatsManager::getStatFromKey(a1, v138);
}
while ( (_DWORD)v136 != 40 );
LABEL_141:
if ( v137 <= 1000 )
{
LABEL_19:
v20 = DS_Dictionary::getDictForKey(a2, "GS_3", 0);
v21 = v20;
if ( !a1->m_verifiedUserCoins )
goto LABEL_143;
LABEL_20:
v22 = cocos2d::CCDictionary::allKeys(v20);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v22); ++i )
{
v24 = cocos2d::CCArray::stringAtIndex(v22, i);
v25 = cocos2d::CCString::getCString(v24);
if ( !GameStatsManager::hasUserCoin(a1, v25) )
{
GameStatsManager::storeUserCoin(a1, v25);
GameStatsManager::incrementStat(a1, "12");
}
}
goto LABEL_24;
}
a1->m_pathBugFixed = 1;
v20 = DS_Dictionary::getDictForKey(a2, "GS_3", 0);
v21 = v20;
if ( a1->m_verifiedUserCoins )
goto LABEL_20;
LABEL_143:
if ( v20 )
{
cocos2d::CCObject::retain(v20);
m_verifiedUserCoins = a1->m_verifiedUserCoins;
if ( m_verifiedUserCoins )
cocos2d::CCObject::release(m_verifiedUserCoins);
a1->m_verifiedUserCoins = v21;
v26 = DS_Dictionary::getDictForKey(a2, "GS_4", 0);
v27 = v26;
m_pendingUserCoins = a1->m_pendingUserCoins;
if ( !m_pendingUserCoins )
goto LABEL_147;
LABEL_25:
GameToolbox::mergeDictsSaveLargestInt(m_pendingUserCoins, v27);
goto LABEL_26;
}
LABEL_24:
v26 = DS_Dictionary::getDictForKey(a2, "GS_4", 0);
v27 = v26;
m_pendingUserCoins = a1->m_pendingUserCoins;
if ( m_pendingUserCoins )
goto LABEL_25;
LABEL_147:
v200 = v26;
if ( v26 )
{
cocos2d::CCObject::retain(v26);
v140 = a1->m_pendingUserCoins;
v141 = v200;
if ( v140 )
{
cocos2d::CCObject::release(v140);
v141 = v200;
}
a1->m_pendingUserCoins = v141;
}
LABEL_26:
v29 = DS_Dictionary::getDictForKey(a2, "GS_completed", 0);
v30 = v29;
if ( v29 && !a1->m_completedLevels )
{
cocos2d::CCObject::retain(v29);
m_completedLevels = a1->m_completedLevels;
if ( m_completedLevels )
cocos2d::CCObject::release(m_completedLevels);
a1->m_completedLevels = v30;
}
v32 = DS_Dictionary::getDictForKey(a2, "GS_5", 0);
if ( a1->m_completedMappacks )
{
GameToolbox::mergeDictsSaveLargestInt(a1->m_completedMappacks, v32);
}
else
{
v200 = v32;
if ( v32 )
{
cocos2d::CCObject::retain(v32);
m_completedMappacks = a1->m_completedMappacks;
v191 = v200;
if ( m_completedMappacks )
{
cocos2d::CCObject::release(m_completedMappacks);
v191 = v200;
}
a1->m_completedMappacks = v191;
}
}
v33 = DS_Dictionary::getDictForKey(a2, "GS_6", 0);
if ( a1->m_purchasedItems )
{
GameToolbox::mergeDictsSaveLargestInt(a1->m_purchasedItems, v33);
}
else
{
v200 = v33;
if ( v33 )
{
cocos2d::CCObject::retain(v33);
m_purchasedItems = a1->m_purchasedItems;
v177 = v200;
if ( m_purchasedItems )
{
cocos2d::CCObject::release(m_purchasedItems);
v177 = v200;
}
a1->m_purchasedItems = v177;
v34 = DS_Dictionary::getDictForKey(a2, "GS_7", 0);
v35 = v34;
m_onlineCurrencyScores = a1->m_onlineCurrencyScores;
if ( m_onlineCurrencyScores )
goto LABEL_36;
goto LABEL_230;
}
}
v34 = DS_Dictionary::getDictForKey(a2, "GS_7", 0);
v35 = v34;
m_onlineCurrencyScores = a1->m_onlineCurrencyScores;
if ( m_onlineCurrencyScores )
{
LABEL_36:
GameToolbox::mergeDictsSaveLargestInt(m_onlineCurrencyScores, v35);
goto LABEL_37;
}
LABEL_230:
v200 = v34;
if ( v34 )
{
cocos2d::CCObject::retain(v34);
v178 = a1->m_onlineCurrencyScores;
v179 = v200;
if ( v178 )
{
cocos2d::CCObject::release(v178);
v179 = v200;
}
a1->m_onlineCurrencyScores = v179;
v37 = DS_Dictionary::getDictForKey(a2, "GS_23", 0);
v38 = v37;
m_gauntletCurrencyScores = a1->m_gauntletCurrencyScores;
if ( m_gauntletCurrencyScores )
goto LABEL_38;
goto LABEL_234;
}
LABEL_37:
v37 = DS_Dictionary::getDictForKey(a2, "GS_23", 0);
v38 = v37;
m_gauntletCurrencyScores = a1->m_gauntletCurrencyScores;
if ( m_gauntletCurrencyScores )
{
LABEL_38:
GameToolbox::mergeDictsSaveLargestInt(m_gauntletCurrencyScores, v38);
goto LABEL_39;
}
LABEL_234:
v200 = v37;
if ( v37 )
{
cocos2d::CCObject::retain(v37);
v180 = a1->m_gauntletCurrencyScores;
v181 = v200;
if ( v180 )
{
cocos2d::CCObject::release(v180);
v181 = v200;
}
a1->m_gauntletCurrencyScores = v181;
v40 = DS_Dictionary::getDictForKey(a2, "GS_10", 0);
v41 = v40;
m_mainCurrencyScores = a1->m_mainCurrencyScores;
if ( m_mainCurrencyScores )
goto LABEL_40;
goto LABEL_238;
}
LABEL_39:
v40 = DS_Dictionary::getDictForKey(a2, "GS_10", 0);
v41 = v40;
m_mainCurrencyScores = a1->m_mainCurrencyScores;
if ( m_mainCurrencyScores )
{
LABEL_40:
GameToolbox::mergeDictsSaveLargestInt(m_mainCurrencyScores, v41);
goto LABEL_41;
}
LABEL_238:
v200 = v40;
if ( v40 )
{
cocos2d::CCObject::retain(v40);
v182 = a1->m_mainCurrencyScores;
v183 = v200;
if ( v182 )
{
cocos2d::CCObject::release(v182);
v183 = v200;
}
a1->m_mainCurrencyScores = v183;
v43 = DS_Dictionary::getDictForKey(a2, "GS_16", 0);
v44 = v43;
m_timelyCurrencyScores = a1->m_timelyCurrencyScores;
if ( m_timelyCurrencyScores )
goto LABEL_42;
goto LABEL_242;
}
LABEL_41:
v43 = DS_Dictionary::getDictForKey(a2, "GS_16", 0);
v44 = v43;
m_timelyCurrencyScores = a1->m_timelyCurrencyScores;
if ( m_timelyCurrencyScores )
{
LABEL_42:
GameToolbox::mergeDictsSaveLargestInt(m_timelyCurrencyScores, v44);
goto LABEL_43;
}
LABEL_242:
v200 = v43;
if ( v43 )
{
cocos2d::CCObject::retain(v43);
v184 = a1->m_timelyCurrencyScores;
v185 = v200;
if ( v184 )
{
cocos2d::CCObject::release(v184);
v185 = v200;
}
a1->m_timelyCurrencyScores = v185;
v46 = DS_Dictionary::getDictForKey(a2, "GS_9", 0);
v47 = v46;
m_onlineStars = a1->m_onlineStars;
if ( m_onlineStars )
goto LABEL_44;
goto LABEL_246;
}
LABEL_43:
v46 = DS_Dictionary::getDictForKey(a2, "GS_9", 0);
v47 = v46;
m_onlineStars = a1->m_onlineStars;
if ( m_onlineStars )
{
LABEL_44:
GameToolbox::mergeDictsSaveLargestInt(m_onlineStars, v47);
goto LABEL_45;
}
LABEL_246:
v200 = v46;
if ( v46 )
{
cocos2d::CCObject::retain(v46);
v186 = a1->m_onlineStars;
v187 = v200;
if ( v186 )
{
cocos2d::CCObject::release(v186);
v187 = v200;
}
a1->m_onlineStars = v187;
v49 = DS_Dictionary::getDictForKey(a2, "GS_17", 0);
v50 = v49;
m_timelyStars = a1->m_timelyStars;
if ( m_timelyStars )
goto LABEL_46;
goto LABEL_250;
}
LABEL_45:
v49 = DS_Dictionary::getDictForKey(a2, "GS_17", 0);
v50 = v49;
m_timelyStars = a1->m_timelyStars;
if ( m_timelyStars )
{
LABEL_46:
GameToolbox::mergeDictsSaveLargestInt(m_timelyStars, v50);
goto LABEL_47;
}
LABEL_250:
v200 = v49;
if ( v49 )
{
cocos2d::CCObject::retain(v49);
v188 = a1->m_timelyStars;
v189 = v200;
if ( v188 )
{
cocos2d::CCObject::release(v188);
v189 = v200;
}
a1->m_timelyStars = v189;
}
LABEL_47:
v52 = DS_Dictionary::getDictForKey(a2, "GS_18", 0);
if ( a1->m_gauntletDiamondScores )
{
GameToolbox::mergeDictsSaveLargestInt(a1->m_gauntletDiamondScores, v52);
}
else
{
v200 = v52;
if ( v52 )
{
cocos2d::CCObject::retain(v52);
m_gauntletDiamondScores = a1->m_gauntletDiamondScores;
v162 = v200;
if ( m_gauntletDiamondScores )
{
cocos2d::CCObject::release(m_gauntletDiamondScores);
v162 = v200;
}
a1->m_gauntletDiamondScores = v162;
v53 = DS_Dictionary::getDictForKey(a2, "GS_24", 0);
v54 = v53;
m_timelyDiamondScores = a1->m_timelyDiamondScores;
if ( m_timelyDiamondScores )
goto LABEL_50;
goto LABEL_198;
}
}
v53 = DS_Dictionary::getDictForKey(a2, "GS_24", 0);
v54 = v53;
m_timelyDiamondScores = a1->m_timelyDiamondScores;
if ( m_timelyDiamondScores )
{
LABEL_50:
GameToolbox::mergeDictsSaveLargestInt(m_timelyDiamondScores, v54);
goto LABEL_51;
}
LABEL_198:
v200 = v53;
if ( v53 )
{
cocos2d::CCObject::retain(v53);
v163 = a1->m_timelyDiamondScores;
v164 = v200;
if ( v163 )
{
cocos2d::CCObject::release(v163);
v164 = v200;
}
a1->m_timelyDiamondScores = v164;
v56 = DS_Dictionary::getDictForKey(a2, "GS_8", 0);
v57 = v56;
m_unusedCurrencyAwardDict = a1->m_unusedCurrencyAwardDict;
if ( m_unusedCurrencyAwardDict )
goto LABEL_52;
goto LABEL_202;
}
LABEL_51:
v56 = DS_Dictionary::getDictForKey(a2, "GS_8", 0);
v57 = v56;
m_unusedCurrencyAwardDict = a1->m_unusedCurrencyAwardDict;
if ( m_unusedCurrencyAwardDict )
{
LABEL_52:
GameToolbox::mergeDictsSaveLargestInt(m_unusedCurrencyAwardDict, v57);
goto LABEL_53;
}
LABEL_202:
v200 = v56;
if ( v56 )
{
cocos2d::CCObject::retain(v56);
v165 = a1->m_unusedCurrencyAwardDict;
v166 = v200;
if ( v165 )
{
cocos2d::CCObject::release(v165);
v166 = v200;
}
a1->m_unusedCurrencyAwardDict = v166;
v59 = DS_Dictionary::getDictForKey(a2, "GS_11", 0);
v60 = v59;
m_dailyChests = a1->m_dailyChests;
if ( m_dailyChests )
goto LABEL_54;
goto LABEL_206;
}
LABEL_53:
v59 = DS_Dictionary::getDictForKey(a2, "GS_11", 0);
v60 = v59;
m_dailyChests = a1->m_dailyChests;
if ( m_dailyChests )
{
LABEL_54:
GameToolbox::mergeDictsSkipConflict(m_dailyChests, v60);
goto LABEL_55;
}
LABEL_206:
v200 = v59;
if ( v59 )
{
cocos2d::CCObject::retain(v59);
v167 = a1->m_dailyChests;
v168 = v200;
if ( v167 )
{
cocos2d::CCObject::release(v167);
v168 = v200;
}
a1->m_dailyChests = v168;
v62 = DS_Dictionary::getDictForKey(a2, "GS_25", 0);
v63 = v62;
m_weeklyChest = a1->m_weeklyChest;
if ( m_weeklyChest )
goto LABEL_56;
goto LABEL_210;
}
LABEL_55:
v62 = DS_Dictionary::getDictForKey(a2, "GS_25", 0);
v63 = v62;
m_weeklyChest = a1->m_weeklyChest;
if ( m_weeklyChest )
{
LABEL_56:
GameToolbox::mergeDictsSkipConflict(m_weeklyChest, v63);
goto LABEL_57;
}
LABEL_210:
v200 = v62;
if ( v62 )
{
cocos2d::CCObject::retain(v62);
v169 = a1->m_weeklyChest;
v170 = v200;
if ( v169 )
{
cocos2d::CCObject::release(v169);
v170 = v200;
}
a1->m_weeklyChest = v170;
v65 = DS_Dictionary::getDictForKey(a2, "GS_31", 0);
v66 = v65;
m_eventChest = a1->m_eventChest;
if ( m_eventChest )
goto LABEL_58;
goto LABEL_214;
}
LABEL_57:
v65 = DS_Dictionary::getDictForKey(a2, "GS_31", 0);
v66 = v65;
m_eventChest = a1->m_eventChest;
if ( m_eventChest )
{
LABEL_58:
GameToolbox::mergeDictsSkipConflict(m_eventChest, v66);
goto LABEL_59;
}
LABEL_214:
v200 = v65;
if ( v65 )
{
cocos2d::CCObject::retain(v65);
v171 = a1->m_eventChest;
v172 = v200;
if ( v171 )
{
cocos2d::CCObject::release(v171);
v172 = v200;
}
a1->m_eventChest = v172;
v68 = DS_Dictionary::getDictForKey(a2, "GS_22", 0);
v69 = v68;
m_worldAdvertChests = a1->m_worldAdvertChests;
if ( m_worldAdvertChests )
goto LABEL_60;
goto LABEL_218;
}
LABEL_59:
v68 = DS_Dictionary::getDictForKey(a2, "GS_22", 0);
v69 = v68;
m_worldAdvertChests = a1->m_worldAdvertChests;
if ( m_worldAdvertChests )
{
LABEL_60:
GameToolbox::mergeDictsSkipConflict(m_worldAdvertChests, v69);
goto LABEL_61;
}
LABEL_218:
v200 = v68;
if ( !v68 )
{
LABEL_61:
v71 = DS_Dictionary::getDictForKey(a2, "GS_12", 0);
v72 = v71;
if ( a1->m_activeChallenges )
goto LABEL_62;
LABEL_222:
if ( v71 )
{
cocos2d::CCObject::retain(v71);
m_activeChallenges = a1->m_activeChallenges;
if ( m_activeChallenges )
cocos2d::CCObject::release(m_activeChallenges);
a1->m_activeChallenges = v72;
}
goto LABEL_64;
}
cocos2d::CCObject::retain(v68);
v173 = a1->m_worldAdvertChests;
v174 = v200;
if ( v173 )
{
cocos2d::CCObject::release(v173);
v174 = v200;
}
a1->m_worldAdvertChests = v174;
v71 = DS_Dictionary::getDictForKey(a2, "GS_12", 0);
v72 = v71;
if ( !a1->m_activeChallenges )
goto LABEL_222;
LABEL_62:
v73 = cocos2d::CCDictionary::allKeys(v71);
if ( v73 )
{
data = v73->data;
if ( data->num )
{
arr = (cocos2d::CCString **)data->arr;
v127 = 8LL * data->num - 8;
v128 = (char *)arr + v127;
if ( arr <= (cocos2d::CCString **)((char *)arr + v127) )
{
v129 = *arr;
if ( *arr )
{
while ( 1 )
{
v130 = (char *)cocos2d::CCString::getCString(v129);
sub_D153B8((unsigned int)v194 + 192, v130);
v131 = cocos2d::CCDictionary::objectForKey(v72, &v203);
v132 = (_DWORD *)cocos2d::CCDictionary::objectForKey(a1->m_activeChallenges, &v203);
v133 = v132;
if ( !v132 )
break;
if ( v132[24] != *(_DWORD *)(v131 + 96) )
goto LABEL_133;
if ( v132[14] != *(_DWORD *)(v131 + 56) )
goto LABEL_133;
v142 = *(_DWORD *)(v131 + 60) - *(_DWORD *)(v131 + 64);
if ( v132[15] - v132[16] >= v142 )
goto LABEL_133;
v132[17] = v142;
v143 = rand();
m_data = v203.m_data.m_data;
v144 = (float)((float)v143 * 4.6566e-10) * 1000.0;
v133[16] = (int)v144;
v133[15] = v142 + (int)v144;
v135 = (char *)m_data - 24;
if ( (__int64 *)((char *)m_data - 24) != &qword_124B6B0 )
{
LABEL_158:
if ( &pthread_create )
{
v145 = (unsigned int *)((char *)m_data - 8);
do
v146 = __ldaxr(v145);
while ( __stlxr(v146 - 1, v145) );
}
else
{
v146 = *((_DWORD *)m_data - 2);
*((_DWORD *)m_data - 2) = v146 - 1;
}
if ( v146 <= 0 )
operator delete(v135);
}
LABEL_134:
if ( v128 >= (char *)++arr )
{
v129 = *arr;
if ( *arr )
continue;
}
goto LABEL_64;
}
if ( !GameStatsManager::hasCompletedChallenge(a1, (GJChallengeItem *)v131) )
cocos2d::CCDictionary::setObject((int)a1->m_activeChallenges, (cocos2d::CCObject *)v131);
LABEL_133:
m_data = v203.m_data.m_data;
v135 = (char *)v203.m_data.m_data - 24;
if ( (__int64 *)v203.m_data.m_data - 3 != &qword_124B6B0 )
goto LABEL_158;
goto LABEL_134;
}
}
}
}
LABEL_64:
v75 = DS_Dictionary::getDictForKey(a2, "GS_15", 0);
v76 = v75;
if ( v75 && !a1->m_upcomingChallenges )
{
cocos2d::CCObject::retain(v75);
m_upcomingChallenges = a1->m_upcomingChallenges;
if ( m_upcomingChallenges )
cocos2d::CCObject::release(m_upcomingChallenges);
a1->m_upcomingChallenges = v76;
}
v78 = DS_Dictionary::getDictForKey(a2, "GS_14", 0);
if ( a1->m_challengeDiamonds )
{
GameToolbox::mergeDictsSaveLargestInt(a1->m_challengeDiamonds, v78);
}
else
{
v200 = v78;
if ( v78 )
{
cocos2d::CCObject::retain(v78);
m_challengeDiamonds = a1->m_challengeDiamonds;
v154 = v200;
if ( m_challengeDiamonds )
{
cocos2d::CCObject::release(m_challengeDiamonds);
v154 = v200;
}
a1->m_challengeDiamonds = v154;
v79 = DS_Dictionary::getDictForKey(a2, "GS_27", 0);
v80 = v79;
m_completedLists = a1->m_completedLists;
if ( m_completedLists )
goto LABEL_72;
goto LABEL_182;
}
}
v79 = DS_Dictionary::getDictForKey(a2, "GS_27", 0);
v80 = v79;
m_completedLists = a1->m_completedLists;
if ( m_completedLists )
{
LABEL_72:
GameToolbox::mergeDictsSaveLargestInt(m_completedLists, v80);
goto LABEL_73;
}
LABEL_182:
v200 = v79;
if ( v79 )
{
cocos2d::CCObject::retain(v79);
v155 = a1->m_completedLists;
v156 = v200;
if ( v155 )
{
cocos2d::CCObject::release(v155);
v156 = v200;
}
a1->m_completedLists = v156;
v82 = DS_Dictionary::getDictForKey(a2, "GS_19", 0);
v83 = v82;
m_treasureRoomChests = a1->m_treasureRoomChests;
if ( m_treasureRoomChests )
goto LABEL_74;
goto LABEL_186;
}
LABEL_73:
v82 = DS_Dictionary::getDictForKey(a2, "GS_19", 0);
v83 = v82;
m_treasureRoomChests = a1->m_treasureRoomChests;
if ( m_treasureRoomChests )
{
LABEL_74:
GameToolbox::mergeDictsSkipConflict(m_treasureRoomChests, v83);
goto LABEL_75;
}
LABEL_186:
v200 = v82;
if ( v82 )
{
cocos2d::CCObject::retain(v82);
v157 = a1->m_treasureRoomChests;
v158 = v200;
if ( v157 )
{
cocos2d::CCObject::release(v157);
v158 = v200;
}
a1->m_treasureRoomChests = v158;
v85 = DS_Dictionary::getDictForKey(a2, "GS_30", 0);
v86 = v85;
m_wraithChests = a1->m_wraithChests;
if ( m_wraithChests )
goto LABEL_76;
goto LABEL_190;
}
LABEL_75:
v85 = DS_Dictionary::getDictForKey(a2, "GS_30", 0);
v86 = v85;
m_wraithChests = a1->m_wraithChests;
if ( m_wraithChests )
{
LABEL_76:
GameToolbox::mergeDictsSkipConflict(m_wraithChests, v86);
goto LABEL_77;
}
LABEL_190:
v200 = v85;
if ( v85 )
{
cocos2d::CCObject::retain(v85);
v159 = a1->m_wraithChests;
v160 = v200;
if ( v159 )
{
cocos2d::CCObject::release(v159);
v160 = v200;
}
a1->m_wraithChests = v160;
}
LABEL_77:
v88 = DS_Dictionary::getDictForKey(a2, "GS_21", 0);
if ( a1->m_miscChests )
{
GameToolbox::mergeDictsSkipConflict(a1->m_miscChests, v88);
}
else
{
v200 = v88;
if ( v88 )
{
cocos2d::CCObject::retain(v88);
m_miscChests = a1->m_miscChests;
v148 = v200;
if ( m_miscChests )
{
cocos2d::CCObject::release(m_miscChests);
v148 = v200;
}
a1->m_miscChests = v148;
v89 = DS_Dictionary::getDictForKey(a2, "GS_28", 0);
v90 = v89;
m_enabledItems = a1->m_enabledItems;
if ( m_enabledItems )
goto LABEL_80;
goto LABEL_170;
}
}
v89 = DS_Dictionary::getDictForKey(a2, "GS_28", 0);
v90 = v89;
m_enabledItems = a1->m_enabledItems;
if ( m_enabledItems )
{
LABEL_80:
GameToolbox::mergeDictsSkipConflict(m_enabledItems, v90);
goto LABEL_81;
}
LABEL_170:
v200 = v89;
if ( v89 )
{
cocos2d::CCObject::retain(v89);
v149 = a1->m_enabledItems;
v150 = v200;
if ( v149 )
{
cocos2d::CCObject::release(v149);
v150 = v200;
}
a1->m_enabledItems = v150;
v92 = DS_Dictionary::getDictForKey(a2, "GS_32", 0);
v93 = v92;
m_unlockedGauntlets = a1->m_unlockedGauntlets;
if ( m_unlockedGauntlets )
goto LABEL_82;
goto LABEL_174;
}
LABEL_81:
v92 = DS_Dictionary::getDictForKey(a2, "GS_32", 0);
v93 = v92;
m_unlockedGauntlets = a1->m_unlockedGauntlets;
if ( m_unlockedGauntlets )
{
LABEL_82:
GameToolbox::mergeDictsSkipConflict(m_unlockedGauntlets, v93);
goto LABEL_83;
}
LABEL_174:
v200 = v92;
if ( v92 )
{
cocos2d::CCObject::retain(v92);
v151 = a1->m_unlockedGauntlets;
v152 = v200;
if ( v151 )
{
cocos2d::CCObject::release(v151);
v152 = v200;
}
a1->m_unlockedGauntlets = v152;
}
LABEL_83:
GameStatsManager::removeErrorFromSpecialChests(a1);
v95 = a1->m_bonusKey.random - a1->m_bonusKey.seed;
v96 = DS_Dictionary::getIntegerForKey(a2, "GS_20");
v97 = v96;
if ( v96 > v95 )
{
a1->m_bonusKey.value = v96;
v98 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_bonusKey.seed = v98;
a1->m_bonusKey.random = v97 + v98;
}
v99 = DS_Dictionary::getIntegerForKey(a2, "GS_26");
GameStatsManager::updateActivePath(a1, v99);
GameStatsManager::postLoadGameStats(a1);
}