//
// GameLevelManager::dataLoaded from 0x7398fc to 0x73aa10 (4372 bytes)
//
// 2 xrefs:
// > GameManager::dataLoaded @ 0x5faecc
// > ??> @ 0x43158
//
// 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 GameLevelManager::dataLoaded(GameLevelManager *a1, DS_Dictionary *a2)
{
cocos2d::CCDictionary *DictForKey; // x0
cocos2d::CCDictionary *v5; // x19
cocos2d::CCDictElement *m_pElements; // x24
char *next; // x23
cocos2d::CCObject *m_pObject; // x0
cocos2d::CCObject *i; // x24
const void *v10; // x0
GJGameLevel *v11; // x0
GJGameLevel *v12; // x25
char *v13; // x0
char *v14; // x24
char *v15; // x1
unsigned int *v16; // x1
int v17; // w2
cocos2d::CCDictionary *v18; // x0
cocos2d::CCDictionary *v19; // x19
cocos2d::CCDictionary *m_onlineLevels; // x1
cocos2d::CCDictElement *v21; // x23
char *v22; // x24
cocos2d::CCObject *v23; // x0
GJGameLevel *j; // x23
const void *v25; // x0
GJGameLevel *v26; // x0
GJGameLevel *v27; // x23
char *v28; // x0
char *v29; // x23
char *v30; // x1
GameStatsManager *v31; // x0
unsigned int *v32; // x1
int v33; // w2
cocos2d::CCDictionary *v34; // x0
cocos2d::CCDictionary *v35; // x19
cocos2d::CCDictElement *v36; // x23
char *v37; // x24
cocos2d::CCObject *v38; // x0
GJGameLevel *k; // x23
const void *v40; // x0
GJGameLevel *v41; // x0
GJGameLevel *v42; // x23
char *v43; // x0
char *v44; // x23
char *v45; // x1
GameStatsManager *v46; // x0
unsigned int *v47; // x1
int v48; // w2
cocos2d::CCDictionary *v49; // x0
cocos2d::CCDictionary *v50; // x19
cocos2d::CCDictElement *v51; // x23
char *v52; // x24
cocos2d::CCObject *v53; // x0
GJGameLevel *m; // x23
const void *v55; // x0
GJGameLevel *v56; // x0
GJGameLevel *v57; // x23
char *v58; // x0
char *v59; // x23
char *v60; // x1
GameStatsManager *v61; // x0
unsigned int *v62; // x1
int v63; // w2
unsigned int v64; // w19
cocos2d::CCArray *ArrayForKey; // x22
cocos2d::CCDictionary *v66; // x25
const void *v67; // x0
cocos2d::CCObject *v68; // x0
cocos2d::CCObject *v69; // x26
char *LevelListKey; // x0
char *v71; // x0
cocos2d::CCDictElement *v72; // x23
char *v73; // x24
cocos2d::CCObject *v74; // x0
cocos2d::CCObject *n; // x23
const void *v76; // x0
cocos2d::CCObject *v77; // x0
cocos2d::CCObject *v78; // x1
char *v79; // x0
char *v80; // x23
char *v81; // x1
GameStatsManager *v82; // x0
unsigned int *v83; // x1
int v84; // w2
unsigned int *v85; // x1
int v86; // w2
cocos2d::CCDictionary *v87; // x0
cocos2d::CCDictionary *v88; // x0
cocos2d::CCDictionary *v89; // x19
cocos2d::CCDictionary *m_downloadedLevels; // x0
cocos2d::CCDictionary *v91; // x0
cocos2d::CCDictionary *v92; // x19
cocos2d::CCDictionary *m_searchFilters; // x0
cocos2d::CCDictionary *v94; // x0
cocos2d::CCDictionary *v95; // x19
cocos2d::CCDictionary *m_likedLevels; // x1
cocos2d::CCDictElement *v97; // x23
cocos2d::CCDictElement *v98; // x19
cocos2d::CCDictionary *v99; // x21
__int64 v100; // x27
char *v101; // x0
cocos2d::CCDictionary *v102; // x0
cocos2d::CCDictionary *v103; // x19
cocos2d::CCDictionary *m_ratedLevels; // x1
cocos2d::CCDictElement *v105; // x23
cocos2d::CCDictElement *v106; // x19
cocos2d::CCDictionary *v107; // x21
__int64 v108; // x27
char *v109; // x0
cocos2d::CCDictionary *v110; // x0
cocos2d::CCDictionary *v111; // x19
cocos2d::CCDictionary *m_ratedDemons; // x1
cocos2d::CCDictElement *v113; // x23
cocos2d::CCDictElement *v114; // x19
cocos2d::CCDictionary *v115; // x21
__int64 v116; // x27
char *v117; // x0
cocos2d::CCDictionary *v118; // x0
cocos2d::CCDictionary *v119; // x19
cocos2d::CCDictionary *m_reportedLevels; // x0
cocos2d::CCDictionary *v121; // x0
cocos2d::CCDictionary *v122; // x0
cocos2d::CCArray *v123; // x0
cocos2d::CCArray *v124; // x19
cocos2d::CCArray *m_smartTemplates; // x0
unsigned int *v126; // x1
int v127; // w3
cocos2d::CCString *m_trueString; // x27
char *v129; // x0
unsigned int *v130; // x1
int v131; // w2
unsigned int *v132; // x1
int v133; // w3
cocos2d::CCString *v134; // x27
char *v135; // x0
unsigned int *v136; // x1
int v137; // w2
unsigned int *v138; // x1
int v139; // w3
cocos2d::CCString *v140; // x27
char *v141; // x0
unsigned int *v142; // x1
int v143; // w2
cocos2d::CCDictionary *m_localLevelsFolders; // x0
cocos2d::CCDictionary *v145; // x1
cocos2d::CCDictionary *m_followedCreators; // x0
cocos2d::CCDictionary *v147; // x1
cocos2d::CCDictionary *m_onlineFolders; // x0
cocos2d::CCDictionary *v149; // x1
cocos2d::CCDictionary *v150; // x0
cocos2d::CCDictionary *m_dailyLevels; // x0
cocos2d::CCDictionary *m_gauntletLevels; // x0
cocos2d::CCDictionary *m_favoriteLists; // x0
cocos2d::CCDictionary *v154; // x0
cocos2d::CCDictionary *v155; // x0
cocos2d::CCDictionary *m_mainLevels; // x0
cocos2d::CCDictionary *v157; // x0
cocos2d::CCDictionary *v158; // [xsp+68h] [xbp+68h]
cocos2d::CCDictionary *v159; // [xsp+68h] [xbp+68h]
cocos2d::CCDictionary *v160; // [xsp+68h] [xbp+68h]
int v161[2]; // [xsp+68h] [xbp+68h]
int v162[2]; // [xsp+68h] [xbp+68h]
int v163[2]; // [xsp+68h] [xbp+68h]
std::string v164; // [xsp+80h] [xbp+80h] BYREF
DictForKey = DS_Dictionary::getDictForKey(a2, "GLM_01", 0);
v5 = DictForKey;
if ( a1->m_mainLevels )
{
if ( DictForKey )
{
m_pElements = DictForKey->m_pElements;
if ( m_pElements )
{
next = (char *)m_pElements->hh.next;
sub_D153B8((int)&v164, (char *)m_pElements);
m_pObject = m_pElements->m_pObject;
if ( !m_pObject )
goto LABEL_15;
LABEL_5:
for ( i = (cocos2d::CCObject *)_dynamic_cast(
m_pObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0); ; i = nullptr )
{
v10 = (const void *)cocos2d::CCDictionary::objectForKey(a1->m_mainLevels, &v164);
if ( v10 )
{
v11 = (GJGameLevel *)_dynamic_cast(
v10,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
v12 = v11;
if ( !i )
goto LABEL_12;
if ( v11 )
{
GJGameLevel::handleStatsConflict(v11);
goto LABEL_10;
}
}
else if ( !i )
{
goto LABEL_12;
}
cocos2d::CCDictionary::setObject((int)a1->m_mainLevels, i);
v12 = (GJGameLevel *)i;
LABEL_10:
if ( GJGameLevel::getNormalPercent(v12) > 99 )
{
v31 = GameStatsManager::sharedState();
GameStatsManager::completedLevel(v31, v12);
}
LABEL_12:
v13 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_13;
if ( &pthread_create )
{
v16 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v17 = __ldaxr(v16);
while ( __stlxr(v17 - 1, v16) );
}
else
{
v17 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v17 - 1;
}
if ( v17 > 0 )
{
LABEL_13:
if ( !next )
break;
}
else
{
operator delete(v13);
if ( !next )
break;
}
v14 = next;
v15 = next;
next = *((char **)next + 36);
sub_D153B8((int)&v164, v15);
m_pObject = *((cocos2d::CCObject **)v14 + 33);
if ( m_pObject )
goto LABEL_5;
LABEL_15:
;
}
}
}
}
else if ( DictForKey )
{
cocos2d::CCObject::retain(DictForKey);
m_mainLevels = a1->m_mainLevels;
if ( m_mainLevels )
cocos2d::CCObject::release(m_mainLevels);
a1->m_mainLevels = v5;
}
v18 = DS_Dictionary::getDictForKey(a2, "GLM_03", 0);
v19 = v18;
m_onlineLevels = a1->m_onlineLevels;
if ( m_onlineLevels )
{
if ( v18 )
{
v21 = v18->m_pElements;
if ( v21 )
{
v22 = (char *)v21->hh.next;
sub_D153B8((int)&v164, (char *)v21);
v23 = v21->m_pObject;
if ( !v23 )
goto LABEL_37;
LABEL_25:
for ( j = (GJGameLevel *)_dynamic_cast(
v23,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0); ; j = nullptr )
{
v25 = (const void *)cocos2d::CCDictionary::objectForKey(a1->m_onlineLevels, &v164);
if ( v25 )
{
v26 = (GJGameLevel *)_dynamic_cast(
v25,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
if ( !j )
goto LABEL_34;
if ( v26 )
{
if ( v26->m_levelVersion > j->m_levelVersion )
j = v26;
GJGameLevel::handleStatsConflict(j);
}
}
else if ( !j )
{
goto LABEL_34;
}
cocos2d::CCDictionary::setObject((int)a1->m_onlineLevels, j);
v27 = (GJGameLevel *)cocos2d::CCDictionary::objectForKey(a1->m_onlineLevels, &v164);
if ( GJGameLevel::getNormalPercent(v27) > 99 )
{
v46 = GameStatsManager::sharedState();
GameStatsManager::completedLevel(v46, v27);
}
LABEL_34:
v28 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_35;
if ( &pthread_create )
{
v32 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v33 - 1;
}
if ( v33 > 0 )
{
LABEL_35:
if ( !v22 )
goto LABEL_46;
}
else
{
operator delete(v28);
if ( !v22 )
{
LABEL_46:
m_onlineLevels = a1->m_onlineLevels;
break;
}
}
v29 = v22;
v30 = v22;
v22 = *((char **)v22 + 36);
sub_D153B8((int)&v164, v30);
v23 = *((cocos2d::CCObject **)v29 + 33);
if ( v23 )
goto LABEL_25;
LABEL_37:
;
}
}
}
}
else if ( v18 )
{
cocos2d::CCObject::retain(v18);
v157 = a1->m_onlineLevels;
if ( v157 )
cocos2d::CCObject::release(v157);
a1->m_onlineLevels = v19;
m_onlineLevels = v19;
}
GameLevelManager::verifyContainerOnlyHasLevels(a1, m_onlineLevels);
v34 = DS_Dictionary::getDictForKey(a2, "GLM_10", 0);
v35 = v34;
if ( a1->m_dailyLevels )
{
if ( v34 )
{
v36 = v34->m_pElements;
if ( v36 )
{
v37 = (char *)v36->hh.next;
sub_D153B8((int)&v164, (char *)v36);
v38 = v36->m_pObject;
if ( !v38 )
goto LABEL_63;
LABEL_51:
for ( k = (GJGameLevel *)_dynamic_cast(
v38,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0); ; k = nullptr )
{
v40 = (const void *)cocos2d::CCDictionary::objectForKey(a1->m_dailyLevels, &v164);
if ( v40 )
{
v41 = (GJGameLevel *)_dynamic_cast(
v40,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
if ( !k )
goto LABEL_60;
if ( v41 )
{
if ( v41->m_levelVersion > k->m_levelVersion )
k = v41;
GJGameLevel::handleStatsConflict(k);
}
}
else if ( !k )
{
goto LABEL_60;
}
cocos2d::CCDictionary::setObject((int)a1->m_dailyLevels, k);
v42 = (GJGameLevel *)cocos2d::CCDictionary::objectForKey(a1->m_dailyLevels, &v164);
if ( v42->m_orbCompletion.random - v42->m_orbCompletion.seed > 99 )
{
v61 = GameStatsManager::sharedState();
GameStatsManager::completedLevel(v61, v42);
}
LABEL_60:
v43 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_61;
if ( &pthread_create )
{
v47 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v48 = __ldaxr(v47);
while ( __stlxr(v48 - 1, v47) );
}
else
{
v48 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v48 - 1;
}
if ( v48 > 0 )
{
LABEL_61:
if ( !v37 )
break;
}
else
{
operator delete(v43);
if ( !v37 )
break;
}
v44 = v37;
v45 = v37;
v37 = *((char **)v37 + 36);
sub_D153B8((int)&v164, v45);
v38 = *((cocos2d::CCObject **)v44 + 33);
if ( v38 )
goto LABEL_51;
LABEL_63:
;
}
}
}
}
else if ( v34 )
{
cocos2d::CCObject::retain(v34);
m_dailyLevels = a1->m_dailyLevels;
if ( m_dailyLevels )
cocos2d::CCObject::release(m_dailyLevels);
a1->m_dailyLevels = v35;
}
v49 = DS_Dictionary::getDictForKey(a2, "GLM_16", 0);
v50 = v49;
if ( a1->m_gauntletLevels )
{
if ( v49 )
{
v51 = v49->m_pElements;
if ( v51 )
{
v52 = (char *)v51->hh.next;
sub_D153B8((int)&v164, (char *)v51);
v53 = v51->m_pObject;
if ( !v53 )
goto LABEL_87;
LABEL_75:
for ( m = (GJGameLevel *)_dynamic_cast(
v53,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0); ; m = nullptr )
{
v55 = (const void *)cocos2d::CCDictionary::objectForKey(a1->m_gauntletLevels, &v164);
if ( v55 )
{
v56 = (GJGameLevel *)_dynamic_cast(
v55,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
if ( !m )
goto LABEL_84;
if ( v56 )
{
if ( v56->m_levelVersion > m->m_levelVersion )
m = v56;
GJGameLevel::handleStatsConflict(m);
}
}
else if ( !m )
{
goto LABEL_84;
}
cocos2d::CCDictionary::setObject((int)a1->m_gauntletLevels, m);
v57 = (GJGameLevel *)cocos2d::CCDictionary::objectForKey(a1->m_gauntletLevels, &v164);
if ( v57->m_orbCompletion.random - v57->m_orbCompletion.seed > 99 )
{
v82 = GameStatsManager::sharedState();
GameStatsManager::completedLevel(v82, v57);
}
LABEL_84:
v58 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_85;
if ( &pthread_create )
{
v62 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v63 = __ldaxr(v62);
while ( __stlxr(v63 - 1, v62) );
}
else
{
v63 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v63 - 1;
}
if ( v63 > 0 )
{
LABEL_85:
if ( !v52 )
break;
}
else
{
operator delete(v58);
if ( !v52 )
break;
}
v59 = v52;
v60 = v52;
v52 = *((char **)v52 + 36);
sub_D153B8((int)&v164, v60);
v53 = *((cocos2d::CCObject **)v59 + 33);
if ( v53 )
goto LABEL_75;
LABEL_87:
;
}
}
}
}
else if ( v49 )
{
cocos2d::CCObject::retain(v49);
m_gauntletLevels = a1->m_gauntletLevels;
if ( m_gauntletLevels )
cocos2d::CCObject::release(m_gauntletLevels);
a1->m_gauntletLevels = v50;
}
v64 = 0;
ArrayForKey = DS_Dictionary::getArrayForKey(a2, "GLM_22", 0);
v66 = cocos2d::CCDictionary::create();
if ( (unsigned int)cocos2d::CCArray::count(ArrayForKey) )
{
do
{
v67 = (const void *)cocos2d::CCArray::objectAtIndex(ArrayForKey, v64);
if ( !v67 )
goto LABEL_101;
v68 = (cocos2d::CCObject *)_dynamic_cast(
v67,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJLevelList,
0);
v69 = v68;
if ( !v68 )
goto LABEL_101;
LevelListKey = (char *)GameLevelManager::getLevelListKey(a1, v68[6].m_uID);
sub_D153B8((int)&v164, LevelListKey);
cocos2d::CCDictionary::setObject((int)v66, v69);
v71 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_101;
if ( &pthread_create )
{
v83 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v84 = __ldaxr(v83);
while ( __stlxr(v84 - 1, v83) );
}
else
{
v84 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v84 - 1;
}
if ( v84 <= 0 )
{
++v64;
operator delete(v71);
}
else
{
LABEL_101:
++v64;
}
}
while ( v64 < (unsigned int)cocos2d::CCArray::count(ArrayForKey) );
}
if ( a1->m_favoriteLists )
{
if ( v66 )
{
v72 = v66->m_pElements;
if ( v72 )
{
v73 = (char *)v72->hh.next;
sub_D153B8((int)&v164, (char *)v66->m_pElements);
v74 = v72->m_pObject;
if ( !v74 )
goto LABEL_117;
LABEL_107:
for ( n = (cocos2d::CCObject *)_dynamic_cast(
v74,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJLevelList,
0); ; n = nullptr )
{
v76 = (const void *)cocos2d::CCDictionary::objectForKey(a1->m_favoriteLists, &v164);
if ( v76 )
{
v77 = (cocos2d::CCObject *)_dynamic_cast(
v76,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJLevelList,
0);
v78 = v77;
if ( n )
{
if ( !v77 )
goto LABEL_180;
if ( v77[6].m_nLuaID <= n[6].m_nLuaID )
v78 = n;
cocos2d::CCDictionary::setObject((int)a1->m_favoriteLists, v78);
}
}
else if ( n )
{
LABEL_180:
cocos2d::CCDictionary::setObject((int)a1->m_favoriteLists, n);
}
v79 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_115;
if ( &pthread_create )
{
v85 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v86 = __ldaxr(v85);
while ( __stlxr(v86 - 1, v85) );
}
else
{
v86 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v86 - 1;
}
if ( v86 > 0 )
{
LABEL_115:
if ( !v73 )
break;
}
else
{
operator delete(v79);
if ( !v73 )
break;
}
v80 = v73;
v81 = v73;
v73 = *((char **)v73 + 36);
sub_D153B8((int)&v164, v81);
v74 = *((cocos2d::CCObject **)v80 + 33);
if ( v74 )
goto LABEL_107;
LABEL_117:
;
}
}
}
}
else if ( v66 )
{
cocos2d::CCObject::retain(v66);
m_favoriteLists = a1->m_favoriteLists;
if ( m_favoriteLists )
cocos2d::CCObject::release(m_favoriteLists);
a1->m_favoriteLists = v66;
}
a1->m_activeDailyID = DS_Dictionary::getIntegerForKey(a2, "GLM_11");
a1->m_activeWeeklyID = DS_Dictionary::getIntegerForKey(a2, "GLM_17");
a1->m_activeEventID = DS_Dictionary::getIntegerForKey(a2, "GLM_23");
DS_Dictionary::addBoolValuesToMapForKey(a2, &a1->m_availableFilters, "GLM_09", 0);
DS_Dictionary::addBoolValuesToMapForKeySpecial(a2, &a1->m_availableFilters, "GLM_04", 0);
v87 = DS_Dictionary::getDictForKey(a2, "GLM_06", 0);
if ( a1->m_followedCreators )
{
GameToolbox::mergeDictsSaveLargestInt(a1->m_followedCreators, v87);
}
else
{
*(_QWORD *)v162 = v87;
if ( v87 )
{
cocos2d::CCObject::retain(v87);
m_followedCreators = a1->m_followedCreators;
v147 = *(cocos2d::CCDictionary **)v162;
if ( m_followedCreators )
{
cocos2d::CCObject::release(m_followedCreators);
v147 = *(cocos2d::CCDictionary **)v162;
}
a1->m_followedCreators = v147;
}
}
v88 = DS_Dictionary::getDictForKey(a2, "GLM_07", 0);
v89 = v88;
if ( v88 && !a1->m_downloadedLevels )
{
cocos2d::CCObject::retain(v88);
m_downloadedLevels = a1->m_downloadedLevels;
if ( m_downloadedLevels )
cocos2d::CCObject::release(m_downloadedLevels);
a1->m_downloadedLevels = v89;
}
v91 = DS_Dictionary::getDictForKey(a2, "GLM_08", 0);
v92 = v91;
if ( v91 && !a1->m_searchFilters )
{
cocos2d::CCObject::retain(v91);
m_searchFilters = a1->m_searchFilters;
if ( m_searchFilters )
cocos2d::CCObject::release(m_searchFilters);
a1->m_searchFilters = v92;
}
v94 = DS_Dictionary::getDictForKey(a2, "GLM_12", 0);
v95 = v94;
m_likedLevels = a1->m_likedLevels;
if ( m_likedLevels )
{
v97 = v94->m_pElements;
if ( v97 )
{
v98 = (cocos2d::CCDictElement *)v97->hh.next;
if ( cocos2d::CCDictionary::count(m_likedLevels) <= 0x3E7 )
{
while ( 1 )
{
v99 = a1->m_likedLevels;
sub_D153B8((int)&v164, (char *)v97);
v100 = cocos2d::CCDictionary::objectForKey(v99, &v164);
v101 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_147;
if ( &pthread_create )
{
v126 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v127 = __ldaxr(v126);
while ( __stlxr(v127 - 1, v126) );
}
else
{
v127 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v127 - 1;
}
if ( v127 > 0 )
{
LABEL_147:
if ( !v100 )
goto LABEL_187;
}
else
{
operator delete(v101);
if ( !v100 )
{
LABEL_187:
v158 = a1->m_likedLevels;
m_trueString = a1->m_trueString;
sub_D153B8((int)&v164, (char *)v97);
cocos2d::CCDictionary::setObject((int)v158, m_trueString);
v129 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v130 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v131 = __ldaxr(v130);
while ( __stlxr(v131 - 1, v130) );
}
else
{
v131 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v131 - 1;
}
if ( v131 <= 0 )
operator delete(v129);
}
}
}
if ( v98 )
{
v97 = v98;
v98 = (cocos2d::CCDictElement *)v98->hh.next;
if ( cocos2d::CCDictionary::count(a1->m_likedLevels) <= 0x3E7 )
continue;
}
break;
}
}
}
}
else if ( v94 )
{
cocos2d::CCObject::retain(v94);
v155 = a1->m_likedLevels;
if ( v155 )
cocos2d::CCObject::release(v155);
a1->m_likedLevels = v95;
}
v102 = DS_Dictionary::getDictForKey(a2, "GLM_13", 0);
v103 = v102;
m_ratedLevels = a1->m_ratedLevels;
if ( m_ratedLevels )
{
v105 = v102->m_pElements;
if ( v105 )
{
v106 = (cocos2d::CCDictElement *)v105->hh.next;
if ( cocos2d::CCDictionary::count(m_ratedLevels) <= 0x3E7 )
{
while ( 1 )
{
v107 = a1->m_ratedLevels;
sub_D153B8((int)&v164, (char *)v105);
v108 = cocos2d::CCDictionary::objectForKey(v107, &v164);
v109 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_154;
if ( &pthread_create )
{
v132 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v133 = __ldaxr(v132);
while ( __stlxr(v133 - 1, v132) );
}
else
{
v133 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v133 - 1;
}
if ( v133 > 0 )
{
LABEL_154:
if ( !v108 )
goto LABEL_198;
}
else
{
operator delete(v109);
if ( !v108 )
{
LABEL_198:
v159 = a1->m_ratedLevels;
v134 = a1->m_trueString;
sub_D153B8((int)&v164, (char *)v105);
cocos2d::CCDictionary::setObject((int)v159, v134);
v135 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v136 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v137 = __ldaxr(v136);
while ( __stlxr(v137 - 1, v136) );
}
else
{
v137 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v137 - 1;
}
if ( v137 <= 0 )
operator delete(v135);
}
}
}
if ( v106 )
{
v105 = v106;
v106 = (cocos2d::CCDictElement *)v106->hh.next;
if ( cocos2d::CCDictionary::count(a1->m_ratedLevels) <= 0x3E7 )
continue;
}
break;
}
}
}
}
else if ( v102 )
{
cocos2d::CCObject::retain(v102);
v150 = a1->m_ratedLevels;
if ( v150 )
cocos2d::CCObject::release(v150);
a1->m_ratedLevels = v103;
}
v110 = DS_Dictionary::getDictForKey(a2, "GLM_15", 0);
v111 = v110;
m_ratedDemons = a1->m_ratedDemons;
if ( m_ratedDemons )
{
v113 = v110->m_pElements;
if ( v113 )
{
v114 = (cocos2d::CCDictElement *)v113->hh.next;
if ( cocos2d::CCDictionary::count(m_ratedDemons) <= 0x3E7 )
{
while ( 1 )
{
v115 = a1->m_ratedDemons;
sub_D153B8((int)&v164, (char *)v113);
v116 = cocos2d::CCDictionary::objectForKey(v115, &v164);
v117 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_161;
if ( &pthread_create )
{
v138 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v139 = __ldaxr(v138);
while ( __stlxr(v139 - 1, v138) );
}
else
{
v139 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v139 - 1;
}
if ( v139 > 0 )
{
LABEL_161:
if ( !v116 )
goto LABEL_209;
}
else
{
operator delete(v117);
if ( !v116 )
{
LABEL_209:
v160 = a1->m_ratedDemons;
v140 = a1->m_trueString;
sub_D153B8((int)&v164, (char *)v113);
cocos2d::CCDictionary::setObject((int)v160, v140);
v141 = (char *)v164.m_data.m_data - 24;
if ( (__int64 *)v164.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v142 = (unsigned int *)((char *)v164.m_data.m_data - 8);
do
v143 = __ldaxr(v142);
while ( __stlxr(v143 - 1, v142) );
}
else
{
v143 = *((_DWORD *)v164.m_data.m_data - 2);
*((_DWORD *)v164.m_data.m_data - 2) = v143 - 1;
}
if ( v143 <= 0 )
operator delete(v141);
}
}
}
if ( v114 )
{
v113 = v114;
v114 = (cocos2d::CCDictElement *)v114->hh.next;
if ( cocos2d::CCDictionary::count(a1->m_ratedDemons) <= 0x3E7 )
continue;
}
break;
}
}
}
}
else if ( v110 )
{
cocos2d::CCObject::retain(v110);
v154 = a1->m_ratedDemons;
if ( v154 )
cocos2d::CCObject::release(v154);
a1->m_ratedDemons = v111;
}
v118 = DS_Dictionary::getDictForKey(a2, "GLM_14", 0);
v119 = v118;
if ( v118 && !a1->m_reportedLevels )
{
cocos2d::CCObject::retain(v118);
m_reportedLevels = a1->m_reportedLevels;
if ( m_reportedLevels )
cocos2d::CCObject::release(m_reportedLevels);
a1->m_reportedLevels = v119;
}
v121 = DS_Dictionary::getDictForKey(a2, "GLM_18", 0);
if ( a1->m_onlineFolders )
{
GameToolbox::mergeDictsSkipConflict(a1->m_onlineFolders, v121);
}
else
{
*(_QWORD *)v163 = v121;
if ( v121 )
{
cocos2d::CCObject::retain(v121);
m_onlineFolders = a1->m_onlineFolders;
v149 = *(cocos2d::CCDictionary **)v163;
if ( m_onlineFolders )
{
cocos2d::CCObject::release(m_onlineFolders);
v149 = *(cocos2d::CCDictionary **)v163;
}
a1->m_onlineFolders = v149;
}
}
v122 = DS_Dictionary::getDictForKey(a2, "GLM_19", 0);
if ( a1->m_localLevelsFolders )
{
GameToolbox::mergeDictsSkipConflict(a1->m_localLevelsFolders, v122);
}
else
{
*(_QWORD *)v161 = v122;
if ( v122 )
{
cocos2d::CCObject::retain(v122);
m_localLevelsFolders = a1->m_localLevelsFolders;
v145 = *(cocos2d::CCDictionary **)v161;
if ( m_localLevelsFolders )
{
cocos2d::CCObject::release(m_localLevelsFolders);
v145 = *(cocos2d::CCDictionary **)v161;
}
a1->m_localLevelsFolders = v145;
}
}
v123 = DS_Dictionary::getArrayForKey(a2, "GLM_20", 0);
v124 = v123;
if ( v123 && !a1->m_smartTemplates )
{
cocos2d::CCObject::retain(v123);
m_smartTemplates = a1->m_smartTemplates;
if ( m_smartTemplates )
cocos2d::CCObject::release(m_smartTemplates);
a1->m_smartTemplates = v124;
}
a1->m_leaderboardType = Top100;
GameLevelManager::limitSavedLevels(a1);
GameLevelManager::purgeUnusedLevels(a1);
GameLevelManager::updateUsernames(a1);
}