//
// GameManager::firstLoad from 0x71f914 to 0x720008 (1780 bytes)
//
// 2 xrefs:
// > ??> @ 0xb1f58
// > ??> @ 0x1429608
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:52:23 +0000
//
__int64 __fastcall GameManager::firstLoad(GameManager *this)
{
__int64 v2; // x2
__int64 UGV; // x0
cocos2d::CCDictionary *v4; // x0
char *v5; // x19
cocos2d::CCDictionary *v6; // x24
cocos2d::CCString *i; // x0
GameManager *CString; // x22
GameManager *v9; // x0
int IntGameVariable; // w0
cocos2d::CCString *v11; // x0
const char *v12; // x0
size_t v13; // x0
cocos2d::CCObject *v14; // x28
size_t v15; // x0
int v16; // w26
cocos2d::CCObject *v17; // x0
cocos2d::CCObject *v18; // x19
cocos2d::CCObject *v19; // x1
cocos2d::CCObject *v20; // x0
cocos2d::CCObject *v21; // x19
cocos2d::CCObject *v22; // x1
cocos2d::CCObject *v23; // x0
cocos2d::CCObject *v24; // x19
cocos2d::CCObject *v25; // x1
int v26; // w0
int v27; // w0
int v28; // w0
int v29; // w1
int v30; // w0
FMODAudioEngine *v31; // x0
cocos2d::CCObject **v32; // x0
cocos2d::CCObject *Setup; // x0
GameLevelManager *v34; // x0
GameStatsManager *v35; // x0
GameStatsManager *v36; // x0
MusicDownloadManager *v37; // x0
MusicDownloadManager *v38; // x0
GJAccountManager *v39; // x0
GJAccountManager *v40; // x0
GJMultiplayerManager *v41; // x0
GJMultiplayerManager *v42; // x0
EditorSFXManager *v43; // x0
EditorSFXManager *v44; // x0
int v45; // w0
unsigned int v46; // w20
cocos2d::CCArray *v47; // x22
cocos2d::CCString *v48; // x0
const char *v49; // x0
char *v50; // x21
size_t v51; // x0
cocos2d::CCString *v52; // x0
unsigned int v53; // w2
__int64 v55; // x0
FMODAudioEngine *v56; // x0
FMODAudioEngine *v57; // x0
__int64 v58; // x1
cocos2d::CCObject *v59; // x0
cocos2d::CCObject *v60; // x19
cocos2d::CCObject *v61; // x1
char *v62; // [xsp+78h] [xbp+78h]
unsigned int v63; // [xsp+78h] [xbp+78h]
__int64 v64[2]; // [xsp+88h] [xbp+88h] BYREF
void *v65; // [xsp+98h] [xbp+98h]
__int64 v66; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v67; // [xsp+A8h] [xbp+A8h]
void *v68; // [xsp+B0h] [xbp+B0h]
__int64 v69; // [xsp+B8h] [xbp+B8h]
*((_BYTE *)this + 687) = 0;
v2 = _stack_chk_guard;
*((_BYTE *)this + 685) = 0;
*((_BYTE *)this + 686) = 0;
*((_BYTE *)this + 688) = 0;
*((_BYTE *)this + 689) = 0;
*((_BYTE *)this + 690) = 0;
*((_BYTE *)this + 691) = 0;
*((_QWORD *)this + 87) = 0;
v69 = v2;
GameManager::resetDPadSettings(this, 0);
GameManager::resetDPadSettings(this, 1);
UGV = *((unsigned __int8 *)this + 1026);
if ( !*((_BYTE *)this + 1026) )
{
v6 = nullptr;
v16 = 0;
goto LABEL_15;
}
v4 = *((cocos2d::CCDictionary **)this + 53);
if ( !v4 )
{
UGV = *((_QWORD *)this + 56);
v6 = nullptr;
if ( !UGV )
goto LABEL_56;
LABEL_13:
UGV = GameManager::getUGV(this, "30");
v16 = (unsigned __int8)UGV;
goto LABEL_15;
}
v5 = (char *)&dword_0 + 1;
v6 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v4);
for ( i = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%04i",
(const char *)&dword_0 + 1);
;
i = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%04i",
(const char *)(unsigned int)v5) )
{
CString = (GameManager *)cocos2d::CCString::getCString(i);
v9 = (GameManager *)GameManager::sharedState(CString);
IntGameVariable = GameManager::getIntGameVariable(v9, (char *)CString);
if ( IntGameVariable <= 0 )
goto LABEL_5;
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)IntGameVariable);
v12 = (const char *)cocos2d::CCString::getCString(v11);
v64[0] = 0;
v64[1] = 0;
v65 = nullptr;
v62 = (char *)v12;
v13 = strlen(v12);
std::string::__init(v64, v62, v13);
v14 = (cocos2d::CCObject *)cocos2d::CCString::create(v64);
v66 = 0;
v67 = 0;
v68 = nullptr;
v15 = strlen((const char *)CString);
std::string::__init(&v66, CString, v15);
cocos2d::CCDictionary::setObject((int)v6, v14);
if ( (v66 & 1) != 0 )
break;
if ( (v64[0] & 1) != 0 )
goto LABEL_10;
LABEL_5:
LODWORD(v5) = (_DWORD)v5 + 1;
if ( (_DWORD)v5 == 250 )
goto LABEL_11;
LABEL_6:
;
}
operator delete(v68);
if ( (v64[0] & 1) == 0 )
goto LABEL_5;
LABEL_10:
LODWORD(v5) = (_DWORD)v5 + 1;
operator delete(v65);
if ( (_DWORD)v5 != 250 )
goto LABEL_6;
LABEL_11:
UGV = *((unsigned __int8 *)this + 1026);
v16 = 0;
if ( *((_BYTE *)this + 1026) )
{
UGV = *((_QWORD *)this + 56);
if ( UGV )
goto LABEL_13;
LABEL_56:
v16 = 0;
}
LABEL_15:
v17 = (cocos2d::CCObject *)cocos2d::CCDictionary::create((cocos2d::CCDictionary *)UGV);
v18 = v17;
v19 = *((cocos2d::CCObject **)this + 53);
if ( v17 != v19 )
{
if ( v17 )
{
v17 = (cocos2d::CCObject *)cocos2d::CCObject::retain(v17);
v19 = *((cocos2d::CCObject **)this + 53);
}
if ( v19 )
v17 = (cocos2d::CCObject *)cocos2d::CCObject::release(v19);
*((_QWORD *)this + 53) = v18;
}
v20 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v17);
v21 = v20;
v22 = *((cocos2d::CCObject **)this + 54);
if ( v22 != v20 )
{
if ( v20 )
{
v20 = (cocos2d::CCObject *)cocos2d::CCObject::retain(v20);
v22 = *((cocos2d::CCObject **)this + 54);
}
if ( v22 )
v20 = (cocos2d::CCObject *)cocos2d::CCObject::release(v22);
*((_QWORD *)this + 54) = v21;
}
v23 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v20);
v24 = v23;
v25 = *((cocos2d::CCObject **)this + 56);
if ( v25 != v23 )
{
if ( v23 )
{
cocos2d::CCObject::retain(v23);
v25 = *((cocos2d::CCObject **)this + 56);
}
if ( v25 )
cocos2d::CCObject::release(v25);
*((_QWORD *)this + 56) = v24;
}
if ( !*((_QWORD *)this + 57) )
{
v59 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(nullptr);
v60 = v59;
v61 = *((cocos2d::CCObject **)this + 57);
if ( v61 != v59 )
{
if ( v59 )
{
cocos2d::CCObject::retain(v59);
v61 = *((cocos2d::CCObject **)this + 57);
}
if ( v61 )
cocos2d::CCObject::release(v61);
*((_QWORD *)this + 57) = v60;
}
}
if ( !*((_BYTE *)this + 1026) )
{
PlatformToolbox::getUniqueUserID(&v66);
if ( (*((_BYTE *)this + 608) & 1) != 0 )
{
**((_BYTE **)this + 78) = 0;
*((_QWORD *)this + 77) = 0;
}
else
{
*((_BYTE *)this + 609) = 0;
*((_BYTE *)this + 608) = 0;
}
std::string::reserve((__int64 *)this + 76, 0);
*((_QWORD *)this + 78) = v68;
v58 = v67;
*((_QWORD *)this + 76) = v66;
*((_QWORD *)this + 77) = v58;
}
std::string::assign((__int64 *)this + 79, "Player");
*((_DWORD *)this + 167) = 0;
v26 = rand();
*((_DWORD *)this + 260) = 0;
v27 = (int)(float)((float)((float)v26 * 4.6566e-10) * 1000.0);
*((_DWORD *)this + 166) = v27;
*((_DWORD *)this + 165) = v27;
v28 = rand();
*((_BYTE *)this + 1044) = 0;
v29 = *((unsigned __int8 *)this + 1026);
*((_DWORD *)this + 262) = 0;
v30 = (int)(float)((float)((float)v28 * 4.6566e-10) * 1000.0);
*((_DWORD *)this + 259) = v30;
*((_DWORD *)this + 258) = v30;
if ( !v29 )
{
*((_BYTE *)this + 600) = 1;
*((_BYTE *)this + 601) = 1;
*((_BYTE *)this + 602) = 1;
}
GameManager::resetAllIcons(this);
v31 = (FMODAudioEngine *)*((unsigned __int8 *)this + 1026);
if ( !*((_BYTE *)this + 1026) )
{
v55 = FMODAudioEngine::sharedEngine(v31);
v56 = (FMODAudioEngine *)FMODAudioEngine::setBackgroundMusicVolume(v55, 1.0);
v57 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v56);
v31 = FMODAudioEngine::setEffectsVolume(v57, 1.0);
}
v32 = (cocos2d::CCObject **)AchievementManager::sharedState(v31);
Setup = AchievementManager::firstSetup(v32);
v34 = (GameLevelManager *)GameLevelManager::sharedState(Setup);
v35 = (GameStatsManager *)GameLevelManager::firstSetup(v34);
v36 = (GameStatsManager *)GameStatsManager::sharedState(v35);
v37 = (MusicDownloadManager *)GameStatsManager::firstSetup(v36);
v38 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v37);
v39 = (GJAccountManager *)MusicDownloadManager::firstSetup(v38);
v40 = (GJAccountManager *)GJAccountManager::sharedState(v39);
v41 = (GJMultiplayerManager *)GJAccountManager::firstSetup(v40);
v42 = (GJMultiplayerManager *)GJMultiplayerManager::sharedState(v41);
v43 = (EditorSFXManager *)GJMultiplayerManager::firstSetup(v42);
v44 = (EditorSFXManager *)EditorSFXManager::sharedState(v43);
EditorSFXManager::firstSetup(v44);
v45 = *((unsigned __int8 *)this + 1026);
if ( *((_BYTE *)this + 1026) )
{
if ( v6 )
{
v46 = 0;
v47 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v6);
while ( v46 < (unsigned int)cocos2d::CCArray::count(v47) )
{
v48 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v47, v46);
v49 = (const char *)cocos2d::CCString::getCString(v48);
v66 = 0;
v67 = 0;
v50 = (char *)v49;
v68 = nullptr;
v51 = strlen(v49);
std::string::__init(&v66, v50, v51);
v52 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v6, &v66);
v53 = cocos2d::CCString::intValue(v52);
if ( (v66 & 1) != 0 )
{
v63 = v53;
operator delete(v68);
v53 = v63;
}
++v46;
GameManager::setIntGameVariable(this, v50, v53);
}
v45 = *((unsigned __int8 *)this + 1026);
}
}
else
{
*((_DWORD *)this + 264) = -1;
*((_BYTE *)this + 921) = 1;
*((_BYTE *)this + 922) = 0;
*((_BYTE *)this + 924) = 0;
*((_BYTE *)this + 925) = 0;
*((_BYTE *)this + 423) = 1;
*((_BYTE *)this + 932) = 0;
*((_BYTE *)this + 933) = 0;
*((_BYTE *)this + 934) = 0;
*((_BYTE *)this + 923) = 0;
GameManager::setGameVariable(this, "0002", 1u);
GameManager::setGameVariable(this, "0001", 1u);
GameManager::setGameVariable(this, "0026", 1u);
GameManager::setGameVariable(this, "0027", 1u);
GameManager::setGameVariable(this, "0200", 1u);
GameManager::setGameVariable(this, "0202", 1u);
GameManager::setGameVariable(this, "0023", 1u);
GameManager::setGameVariable(this, "0038", 1u);
GameManager::setGameVariable(this, "0043", 1u);
GameManager::setGameVariable(this, "0044", 1u);
GameManager::setIntGameVariable(this, "0050", 2u);
GameManager::setIntGameVariable(this, "0049", 6u);
GameManager::setGameVariable(this, "0046", 1u);
GameManager::setGameVariable(this, "0044", 1u);
GameManager::setGameVariable(this, "0036", 1u);
GameManager::setGameVariable(this, "0118", 1u);
GameManager::setGameVariable(this, "0117", 1u);
GameManager::setGameVariable(this, "0158", 1u);
GameManager::setGameVariable(this, "0121", 1u);
GameManager::setGameVariable(this, "0037", 1u);
GameManager::setGameVariable(this, "0184", 1u);
v45 = *((unsigned __int8 *)this + 1026);
}
if ( v45 && v16 )
GameManager::setUGV(this, "30", 1u);
*((_BYTE *)this + 504) = 1;
return _stack_chk_guard;
}