//
// GameManager::dataLoaded from 0x5fa87c to 0x5fbefc (5760 bytes)
//
// 2 xrefs:
// > ??> @ 0x805b0
// > ??> @ 0x1149d70
//
// 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 GameManager::dataLoaded(GameManager *a1, DS_Dictionary *a2)
{
ObjectDecoder *v4; // x21
GJObjectDecoder *v5; // x0
ObjectDecoderDelegate *v6; // x0
cocos2d::CCDictionary *v7; // x0
void *v8; // x0
void *v9; // x0
int v10; // w22
int IntegerForKey; // w0
int v12; // w26
int v13; // w2
int v14; // w0
int v15; // w26
int v16; // w2
int v17; // w0
int v18; // w26
int v19; // w2
int v20; // w0
int v21; // w26
int v22; // w2
int v23; // w0
int v24; // w26
int v25; // w2
int v26; // w26
int v27; // w2
int v28; // w22
int v29; // w2
int v30; // w26
int v31; // w2
int v32; // w22
int v33; // w2
int v34; // w26
int v35; // w2
int v36; // w22
int v37; // w2
int v38; // w26
int v39; // w2
int v40; // w22
int v41; // w2
int v42; // w26
int v43; // w2
int v44; // w22
int v45; // w2
int v46; // w2
int v47; // w22
int v48; // w2
AchievementManager *v49; // x0
GameStatsManager *v50; // x0
GameLevelManager *v51; // x0
MusicDownloadManager *v52; // x0
KeybindingsManager *v53; // x0
int v54; // w22
GameStatsManager *v55; // x0
GameStatsManager *v56; // x0
GJAccountManager *v57; // x0
GJAccountManager *v58; // x0
void *v59; // x0
int v60; // w0
int v61; // w25
int v62; // w2
GameLevelManager *v63; // x0
GJGameLevel *MainLevel; // x25
GameStatsManager *v65; // x0
GameStatsManager *v66; // x0
GameStatsManager *v67; // x0
GameStatsManager *v68; // x0
GameStatsManager *v69; // x0
GameStatsManager *v70; // x0
GameStatsManager *v71; // x0
GameStatsManager *v72; // x0
GameStatsManager *v73; // x0
GameStatsManager *v74; // x0
GameStatsManager *v75; // x0
GameStatsManager *v76; // x0
GameStatsManager *v77; // x0
GameStatsManager *v78; // x0
GameStatsManager *v79; // x0
bool BoolForKey; // w0
GameStatsManager *v81; // x20
GameLevelManager *v82; // x0
GJGameLevel *v83; // x0
GameStatsManager *v84; // x20
GameLevelManager *v85; // x0
GJGameLevel *v86; // x0
GameStatsManager *v87; // x20
GameLevelManager *v88; // x0
GJGameLevel *v89; // x0
void *v90; // x20
unsigned int *v91; // x2
int v92; // w0
void *v93; // x0
void *v94; // x0
void *v95; // x0
void *v96; // x0
void *v97; // x0
void *v98; // x0
void *v99; // x0
void *v100; // x0
void *v101; // x0
void *v102; // x0
void *v103; // x0
float FloatForKey; // s10
float v105; // s0
float v106; // s0
float v107; // s1
GJAccountManager *v108; // x0
GJMultiplayerManager *v109; // x0
GameStatsManager *v110; // x0
GameStatsManager *v111; // x0
cocos2d::CCDictionary *m_unlockValueKeeper; // x0
cocos2d::CCDictionary *v113; // x1
GameStatsManager *v114; // x0
unsigned int *v115; // x1
int v116; // w2
unsigned int *v117; // x1
int v118; // w2
GameStatsManager *v119; // x0
unsigned int *v120; // x1
int v121; // w2
cocos2d::CCDictionary *v122; // x0
cocos2d::CCDictionary *v123; // x21
cocos2d::CCDictionary *m_customObjectDict; // x1
cocos2d::CCDictionary *DictForKey; // x0
cocos2d::CCDictionary *v126; // x21
cocos2d::CCDictionary *m_valueKeeper; // x1
unsigned int *v128; // x1
int v129; // w2
unsigned int *v130; // x1
int v131; // w2
unsigned int *v132; // x1
int v133; // w2
unsigned int *v134; // x1
int v135; // w2
unsigned int *v136; // x1
int v137; // w2
unsigned int *v138; // x1
int v139; // w2
unsigned int *v140; // x1
int v141; // w2
unsigned int *v142; // x1
int v143; // w2
unsigned int *v144; // x1
int v145; // w2
unsigned int *v146; // x1
int v147; // w2
unsigned int *v148; // x1
int v149; // w2
cocos2d::CCDictionary *v150; // [xsp+78h] [xbp+78h]
cocos2d::CCPoint v151; // [xsp+90h] [xbp+90h] BYREF
v4 = ObjectDecoder::sharedDecoder();
v5 = GJObjectDecoder::sharedDecoder();
if ( v5 )
v6 = &v5->ObjectDecoderDelegate;
else
v6 = nullptr;
v4->m_delegate = v6;
if ( !a1->m_valueKeeper )
{
DictForKey = DS_Dictionary::getDictForKey(a2, "valueKeeper", 0);
v126 = DictForKey;
m_valueKeeper = a1->m_valueKeeper;
if ( DictForKey != m_valueKeeper )
{
if ( DictForKey )
{
cocos2d::CCObject::retain(DictForKey);
m_valueKeeper = a1->m_valueKeeper;
}
if ( m_valueKeeper )
cocos2d::CCObject::release(m_valueKeeper);
a1->m_valueKeeper = v126;
}
}
v7 = DS_Dictionary::getDictForKey(a2, "unlockValueKeeper", 0);
if ( a1->m_unlockValueKeeper )
{
GameToolbox::mergeDictsSaveLargestInt(a1->m_unlockValueKeeper, v7);
}
else
{
v150 = v7;
if ( v7 )
{
cocos2d::CCObject::retain(v7);
m_unlockValueKeeper = a1->m_unlockValueKeeper;
v113 = v150;
if ( m_unlockValueKeeper )
{
cocos2d::CCObject::release(m_unlockValueKeeper);
v113 = v150;
}
a1->m_unlockValueKeeper = v113;
}
}
if ( !a1->m_customObjectDict )
{
v122 = DS_Dictionary::getDictForKey(a2, "customObjectDict", 0);
v123 = v122;
m_customObjectDict = a1->m_customObjectDict;
if ( m_customObjectDict != v122 )
{
if ( v122 )
{
cocos2d::CCObject::retain(v122);
m_customObjectDict = a1->m_customObjectDict;
}
if ( m_customObjectDict )
cocos2d::CCObject::release(m_customObjectDict);
a1->m_customObjectDict = v123;
}
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "playerUDID");
sub_D163D4(&a1->m_playerUDID, &v151);
v8 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v117 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v118 = __ldaxr(v117);
while ( __stlxr(v118 - 1, v117) );
}
else
{
v118 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v118 - 1;
}
if ( v118 <= 0 )
operator delete(v8);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "playerName");
sub_D163D4(&a1->m_playerName, &v151);
v9 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v115 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v116 = __ldaxr(v115);
while ( __stlxr(v116 - 1, v115) );
}
else
{
v116 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v116 - 1;
}
if ( v116 <= 0 )
operator delete(v9);
}
v10 = 1;
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, "playerUserID");
a1->m_playerUserID.value = IntegerForKey;
v12 = IntegerForKey;
v13 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerUserID.seed = v13;
a1->m_playerUserID.random = v12 + v13;
v14 = DS_Dictionary::getIntegerForKey(a2, "playerFrame");
a1->m_playerFrame.value = v14;
v15 = v14;
v16 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerFrame.seed = v16;
a1->m_playerFrame.random = v15 + v16;
v17 = DS_Dictionary::getIntegerForKey(a2, "playerColor");
a1->m_playerColor.value = v17;
v18 = v17;
v19 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerColor.seed = v19;
a1->m_playerColor.random = v18 + v19;
v20 = DS_Dictionary::getIntegerForKey(a2, "playerColor2");
a1->m_playerColor2.value = v20;
v21 = v20;
v22 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerColor2.seed = v22;
a1->m_playerColor2.random = v21 + v22;
v23 = DS_Dictionary::getIntegerForKey(a2, "playerColor3");
a1->m_playerGlowColor.value = v23;
v24 = v23;
v25 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerGlowColor.seed = v25;
a1->m_playerGlowColor.random = v24 + v25;
if ( DS_Dictionary::getIntegerForKey(a2, "playerShip") > 1 )
v10 = DS_Dictionary::getIntegerForKey(a2, "playerShip");
a1->m_playerShip.value = v10;
v26 = 1;
v27 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerShip.seed = v27;
a1->m_playerShip.random = v10 + v27;
if ( DS_Dictionary::getIntegerForKey(a2, "playerBall") > 1 )
v26 = DS_Dictionary::getIntegerForKey(a2, "playerBall");
a1->m_playerBall.value = v26;
v28 = 1;
v29 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerBall.seed = v29;
a1->m_playerBall.random = v26 + v29;
if ( DS_Dictionary::getIntegerForKey(a2, "playerBird") > 1 )
v28 = DS_Dictionary::getIntegerForKey(a2, "playerBird");
a1->m_playerBird.value = v28;
v30 = 1;
v31 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerBird.seed = v31;
a1->m_playerBird.random = v28 + v31;
if ( DS_Dictionary::getIntegerForKey(a2, "playerDart") > 1 )
v30 = DS_Dictionary::getIntegerForKey(a2, "playerDart");
a1->m_playerDart.value = v30;
v32 = 1;
v33 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerDart.seed = v33;
a1->m_playerDart.random = v30 + v33;
if ( DS_Dictionary::getIntegerForKey(a2, "playerRobot") > 1 )
v32 = DS_Dictionary::getIntegerForKey(a2, "playerRobot");
a1->m_playerRobot.value = v32;
v34 = 1;
v35 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerRobot.seed = v35;
a1->m_playerRobot.random = v32 + v35;
if ( DS_Dictionary::getIntegerForKey(a2, "playerSpider") > 1 )
v34 = DS_Dictionary::getIntegerForKey(a2, "playerSpider");
a1->m_playerSpider.value = v34;
v36 = 1;
v37 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerSpider.seed = v37;
a1->m_playerSpider.random = v34 + v37;
if ( DS_Dictionary::getIntegerForKey(a2, "playerJetpack") > 1 )
v36 = DS_Dictionary::getIntegerForKey(a2, "playerJetpack");
a1->m_playerJetpack.value = v36;
v38 = 1;
v39 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerJetpack.seed = v39;
a1->m_playerJetpack.random = v36 + v39;
if ( DS_Dictionary::getIntegerForKey(a2, "playerSwing") > 1 )
v38 = DS_Dictionary::getIntegerForKey(a2, "playerSwing");
a1->m_playerSwing.value = v38;
v40 = 1;
v41 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerSwing.seed = v41;
a1->m_playerSwing.random = v38 + v41;
if ( DS_Dictionary::getIntegerForKey(a2, "playerStreak") > 1 )
v40 = DS_Dictionary::getIntegerForKey(a2, "playerStreak");
a1->m_playerStreak.value = v40;
v42 = 1;
v43 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerStreak.seed = v43;
a1->m_playerStreak.random = v40 + v43;
if ( DS_Dictionary::getIntegerForKey(a2, "playerShipStreak") > 1 )
v42 = DS_Dictionary::getIntegerForKey(a2, "playerShipStreak");
a1->m_playerShipFire.value = v42;
v44 = 1;
v45 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerShipFire.seed = v45;
a1->m_playerShipFire.random = v42 + v45;
if ( DS_Dictionary::getIntegerForKey(a2, "playerDeathEffect") > 1 )
v44 = DS_Dictionary::getIntegerForKey(a2, "playerDeathEffect");
a1->m_playerDeathEffect.value = v44;
v46 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_playerDeathEffect.seed = v46;
a1->m_playerDeathEffect.random = v44 + v46;
a1->m_playerGlow = DS_Dictionary::getBoolForKey(a2, "playerGlow");
a1->m_playerIconType = DS_Dictionary::getIntegerForKey(a2, "playerIconType");
v47 = DS_Dictionary::getIntegerForKey(a2, "secretNumber");
v48 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_secretNumber.random = v48;
a1->m_secretNumber.seed = v47 + v48;
a1->m_disableThumbstick = GameManager::getGameVariable(a1, "0028");
v49 = AchievementManager::sharedState();
AchievementManager::dataLoaded(v49, a2);
v50 = GameStatsManager::sharedState();
GameStatsManager::dataLoaded(v50, a2);
v51 = GameLevelManager::sharedState();
GameLevelManager::dataLoaded(v51, a2);
v52 = MusicDownloadManager::sharedState();
MusicDownloadManager::dataLoaded(v52, a2);
v53 = KeybindingsManager::sharedState();
KeybindingsManager::dataLoaded(v53, a2);
v54 = DS_Dictionary::getIntegerForKey(a2, "binaryVersion");
AchievementManager::sharedState()->m_dontNotify = 1;
v55 = GameStatsManager::sharedState();
GameStatsManager::recountSpecialStats(v55);
if ( !a1->m_loaded )
{
v110 = GameStatsManager::sharedState();
GameStatsManager::tryFixPathBug(v110);
v111 = GameStatsManager::sharedState();
GameStatsManager::verifyPathAchievements(v111);
}
v56 = GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(v56, GJItem, 16) )
{
a1->m_customMenuSongID = 0;
a1->m_customPracticeSongID = 0;
}
a1->m_showSongMarkers = DS_Dictionary::getBoolForKey(a2, "showSongMarkers");
a1->m_showBPMMarkers = DS_Dictionary::getBoolForKey(a2, "showBPMMarkers");
a1->m_showProgressBar = DS_Dictionary::getBoolForKey(a2, "showProgressBar");
a1->m_clickedEditor = DS_Dictionary::getBoolForKey(a2, "clickedEditor");
a1->m_clickedGarage = DS_Dictionary::getBoolForKey(a2, "clickedGarage");
a1->m_clickedName = DS_Dictionary::getBoolForKey(a2, "clickedName");
a1->m_clickedPractice = DS_Dictionary::getBoolForKey(a2, "clickedPractice");
a1->m_showedEditorGuide = DS_Dictionary::getBoolForKey(a2, "showedEditorGuide");
a1->m_showedRateDiffDialog = DS_Dictionary::getBoolForKey(a2, "showedRateDiffDialog");
a1->m_showedRateStarDialog = DS_Dictionary::getBoolForKey(a2, "showedRateStarDialog");
a1->m_showedLowDetailDialog = DS_Dictionary::getBoolForKey(a2, "showedLowDetailDialog");
a1->m_hasRatedGame = DS_Dictionary::getBoolForKey(a2, "hasRatedGame");
if ( !a1->m_loaded )
{
a1->m_performanceMode = DS_Dictionary::getBoolForKey(a2, "performanceMode");
a1->m_recordGameplay = DS_Dictionary::getBoolForKey(a2, "recordGameplay");
a1->m_bootups = DS_Dictionary::getIntegerForKey(a2, "bootups") + 1;
a1->m_bgVolume = DS_Dictionary::getFloatForKey(a2, "bgVolume");
a1->m_sfxVolume = DS_Dictionary::getFloatForKey(a2, "sfxVolume");
a1->m_timeOffset = (float)DS_Dictionary::getIntegerForKey(a2, "timeOffset");
a1->m_resolution = DS_Dictionary::getIntegerForKey(a2, "resolution");
a1->m_texQuality = DS_Dictionary::getIntegerForKey(a2, "texQuality");
a1->m_customFPSTarget = DS_Dictionary::getFloatForKey(a2, "customFPSTarget");
a1->m_customMenuSongID = DS_Dictionary::getIntegerForKey(a2, "customMenuSongID");
a1->m_customPracticeSongID = DS_Dictionary::getIntegerForKey(a2, "customPracticeSongID");
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpad01");
GameManager::loadDpadFromString((int)a1, (__int64)&a1->m_dpad1, &v151);
v93 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v128 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v129 = __ldaxr(v128);
while ( __stlxr(v129 - 1, v128) );
}
else
{
v129 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v129 - 1;
}
if ( v129 <= 0 )
operator delete(v93);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpad02");
GameManager::loadDpadFromString((int)a1, (__int64)&a1->m_dpad2, &v151);
v94 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v130 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v131 = __ldaxr(v130);
while ( __stlxr(v131 - 1, v130) );
}
else
{
v131 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v131 - 1;
}
if ( v131 <= 0 )
operator delete(v94);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpad03");
GameManager::loadDpadFromString((int)a1, (__int64)&a1->m_dpad3, &v151);
v95 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v134 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v135 = __ldaxr(v134);
while ( __stlxr(v135 - 1, v134) );
}
else
{
v135 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v135 - 1;
}
if ( v135 <= 0 )
operator delete(v95);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpad04");
GameManager::loadDpadFromString((int)a1, (__int64)&a1->m_dpad4, &v151);
v96 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v132 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v133 = __ldaxr(v132);
while ( __stlxr(v133 - 1, v132) );
}
else
{
v133 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v133 - 1;
}
if ( v133 <= 0 )
operator delete(v96);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpad05");
GameManager::loadDpadFromString((int)a1, (__int64)&a1->m_dpad5, &v151);
v97 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v142 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v143 = __ldaxr(v142);
while ( __stlxr(v143 - 1, v142) );
}
else
{
v143 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v143 - 1;
}
if ( v143 <= 0 )
operator delete(v97);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpadLayout01");
sub_D163D4(&a1->m_dpadLayout1, &v151);
v98 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v138 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v139 = __ldaxr(v138);
while ( __stlxr(v139 - 1, v138) );
}
else
{
v139 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v139 - 1;
}
if ( v139 <= 0 )
operator delete(v98);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpadLayout02");
sub_D163D4(&a1->m_dpadLayout2, &v151);
v99 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v146 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v147 = __ldaxr(v146);
while ( __stlxr(v147 - 1, v146) );
}
else
{
v147 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v147 - 1;
}
if ( v147 <= 0 )
operator delete(v99);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpadLayout03");
sub_D163D4(&a1->m_dpadLayout3, &v151);
v100 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v136 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v137 = __ldaxr(v136);
while ( __stlxr(v137 - 1, v136) );
}
else
{
v137 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v137 - 1;
}
if ( v137 <= 0 )
operator delete(v100);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpadLayoutDual01");
sub_D163D4(&a1->m_dpadLayoutDual1, &v151);
v101 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v144 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v145 = __ldaxr(v144);
while ( __stlxr(v145 - 1, v144) );
}
else
{
v145 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v145 - 1;
}
if ( v145 <= 0 )
operator delete(v101);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpadLayoutDual02");
sub_D163D4(&a1->m_dpadLayoutDual2, &v151);
v102 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v140 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v141 = __ldaxr(v140);
while ( __stlxr(v141 - 1, v140) );
}
else
{
v141 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v141 - 1;
}
if ( v141 <= 0 )
operator delete(v102);
}
DS_Dictionary::getStringForKey((__int64 *)&v151, a2, "dpadLayoutDual03");
sub_D163D4(&a1->m_dpadLayoutDual3, &v151);
v103 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v148 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v149 = __ldaxr(v148);
while ( __stlxr(v149 - 1, v148) );
}
else
{
v149 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v149 - 1;
}
if ( v149 <= 0 )
operator delete(v103);
}
a1->m_practiceOpacity = DS_Dictionary::getFloatForKey(a2, "practiceOpacity");
FloatForKey = DS_Dictionary::getFloatForKey(a2, "practicePosX");
v105 = DS_Dictionary::getFloatForKey(a2, "practicePosY");
cocos2d::CCPoint::CCPoint(&v151, FloatForKey, v105);
cocos2d::CCPoint::operator=(&a1->m_practicePos, v106, v107);
v108 = GJAccountManager::sharedState();
GJAccountManager::dataLoaded(v108, a2);
v109 = GJMultiplayerManager::sharedState();
GJMultiplayerManager::dataLoaded(v109, a2);
}
if ( v54 <= 39 )
a1->m_timeOffset = 0.0;
GameManager::prepareDPadSettings(a1);
v57 = GJAccountManager::sharedState();
if ( v57->m_accountID - v57->m_unkInt1 > 0 )
{
GameLevelManager::sharedState()->m_leaderboardType = Friends;
v58 = GJAccountManager::sharedState();
sub_D18D28(&v151, &v58->m_username);
sub_D163D4(&a1->m_playerName, &v151);
v59 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v120 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v121 = __ldaxr(v120);
while ( __stlxr(v121 - 1, v120) );
}
else
{
v121 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v121 - 1;
}
if ( v121 <= 0 )
operator delete(v59);
}
}
v60 = DS_Dictionary::getIntegerForKey(a2, "hasRP");
a1->m_hasRP.value = v60;
v61 = v60;
v62 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_hasRP.seed = v62;
a1->m_hasRP.random = v61 + v62;
a1->m_hasDRP = DS_Dictionary::getBoolForKey(a2, "hasDRP");
if ( !a1->m_loaded )
{
if ( v54 > 20 )
{
GameManager::verifyAchievementUnlocks(a1);
goto LABEL_47;
}
GameManager::verifyCoinUnlocks(a1);
}
GameManager::verifyAchievementUnlocks(a1);
if ( v54 <= 3 )
{
GameManager::verifyStarUnlocks(a1);
LABEL_59:
v63 = GameLevelManager::sharedState();
MainLevel = GameLevelManager::getMainLevel(v63, 14, 0);
v65 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedLevel(v65, MainLevel) )
{
v119 = GameStatsManager::sharedState();
GameStatsManager::completedDemonLevel(v119, MainLevel);
}
goto LABEL_61;
}
if ( v54 <= 10 )
goto LABEL_59;
LABEL_47:
if ( v54 != 11 )
{
if ( v54 > 47 )
goto LABEL_49;
goto LABEL_62;
}
LABEL_61:
GameManager::setGameVariable(a1, "0002", 1);
GameManager::setGameVariable(a1, "0001", 1);
LABEL_62:
v66 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v66, "3", 0);
v67 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v67, "6", 0);
v68 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v68, "5", 0);
v69 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v69, &byte_F2CA20, 0);
v70 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v70, "15", 0);
v71 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v71, "40", 0);
v72 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v72, "42", 0);
v73 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v73, "8", 0);
v74 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v74, &byte_F78BA8, 0);
v75 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v75, "1", 0);
v76 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v76, "7", 0);
v77 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v77, "12", 0);
v78 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v78, "13", 0);
v79 = GameStatsManager::sharedState();
GameStatsManager::incrementStat(v79, "41", 0);
if ( v54 <= 22 )
{
a1->m_bgVolume = 1.0;
a1->m_sfxVolume = 1.0;
GameManager::setGameVariable(a1, "0026", 1);
GameManager::setGameVariable(a1, "0027", 1);
goto LABEL_64;
}
LABEL_49:
if ( v54 <= 24 )
{
LABEL_64:
BoolForKey = DS_Dictionary::getBoolForKey(a2, "gameCenterEnabled");
GameManager::setGameVariable(a1, "0034", BoolForKey);
goto LABEL_65;
}
if ( v54 > 27 )
{
if ( v54 > 47 )
goto LABEL_52;
goto LABEL_68;
}
LABEL_65:
GameManager::setGameVariable(a1, "0038", 1);
GameManager::setGameVariable(a1, "0043", 1);
GameManager::setGameVariable(a1, "0046", 1);
GameManager::setGameVariable(a1, "0044", 1);
GameManager::setGameVariable(a1, "0036", 1);
if ( a1->m_playerStreak.random == 2 )
a1->m_playerGlow = 1;
v81 = GameStatsManager::sharedState();
v82 = GameLevelManager::sharedState();
v83 = GameLevelManager::getMainLevel(v82, 14, 0);
GameStatsManager::checkCoinAchievement(v81, v83);
v84 = GameStatsManager::sharedState();
v85 = GameLevelManager::sharedState();
v86 = GameLevelManager::getMainLevel(v85, 18, 0);
GameStatsManager::checkCoinAchievement(v84, v86);
v87 = GameStatsManager::sharedState();
v88 = GameLevelManager::sharedState();
v89 = GameLevelManager::getMainLevel(v88, 20, 0);
GameStatsManager::checkCoinAchievement(v87, v89);
LABEL_68:
a1->m_recordGameplay = 0;
if ( v54 <= 28 )
{
if ( !a1->m_loaded )
{
v114 = GameStatsManager::sharedState();
GameStatsManager::verifyUserCoins(v114);
}
goto LABEL_71;
}
LABEL_52:
if ( v54 <= 37 )
{
LABEL_71:
GameManager::setGameVariable(a1, "0012", 0);
GameManager::setGameVariable(a1, "0016", 0);
GameManager::setUGV(a1, "28", 0);
GameManager::setUGV(a1, "29", 0);
GameManager::setGameVariable(a1, "0118", 1);
GameManager::setGameVariable(a1, "0117", 1);
GameManager::setGameVariable(a1, "0158", 1);
GameManager::setGameVariable(a1, "0121", 1);
GameManager::setGameVariable(a1, "0037", 1);
goto LABEL_72;
}
if ( v54 > 40 )
{
if ( v54 > 44 || a1->m_loaded )
goto LABEL_55;
goto LABEL_74;
}
LABEL_72:
if ( a1->m_loaded )
goto LABEL_55;
a1->m_practiceOpacity = 1.0;
LABEL_74:
sub_D153B8((int)&v151, &byte_F288A0);
GameManager::recountUserStats(a1, &v151);
v90 = (void *)(*(_QWORD *)&v151 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v151 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v91 = (unsigned int *)(*(_QWORD *)&v151 - 8LL);
do
v92 = __ldaxr(v91);
while ( __stlxr(v92 - 1, v91) );
}
else
{
v92 = *(_DWORD *)(*(_QWORD *)&v151 - 8LL);
*(_DWORD *)(*(_QWORD *)&v151 - 8LL) = v92 - 1;
}
if ( v92 <= 0 )
operator delete(v90);
}
LABEL_55:
GameManager::checkSteamAchievementUnlock(a1);
AchievementManager::sharedState()->m_dontNotify = 0;
if ( GameManager::getIntGameVariable(a1, "0049") <= 5 )
{
GameManager::setIntGameVariable(a1, "0049", 6);
if ( GameManager::getIntGameVariable(a1, "0050") > 1 )
goto LABEL_57;
LABEL_81:
GameManager::setIntGameVariable(a1, "0050", 2);
goto LABEL_57;
}
if ( GameManager::getIntGameVariable(a1, "0050") <= 1 )
goto LABEL_81;
LABEL_57:
a1->m_loaded = 1;
}