//
// GameManager::firstLoad from 0x417dec to 0x4182a6 (1210 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:47:42 +0000
//
unsigned int __fastcall GameManager::firstLoad(GameManager *this)
{
int v2; // r3
cocos2d::CCDictionary *IntGameVariable; // r0
cocos2d::CCDictionary *v4; // r6
const char *v5; // r9
cocos2d::CCString *v6; // r0
GameManager *CString; // r10
GameManager *v8; // r0
cocos2d::CCString *v9; // r0
const char *v10; // r0
const char *v11; // r8
size_t v12; // r0
cocos2d::CCObject *v13; // r11
size_t v14; // r0
cocos2d::CCDictionary *v15; // r5
cocos2d::CCObject *v16; // r0
cocos2d::CCObject *v17; // r7
cocos2d::CCObject *v18; // r0
cocos2d::CCObject *v19; // r7
cocos2d::CCObject *v20; // r0
cocos2d::CCObject *v21; // r7
cocos2d::CCObject *v22; // r0
cocos2d::CCObject *v23; // r7
cocos2d::CCObject *v24; // r0
int v25; // r9
int v26; // r0
int v27; // r1
int v28; // r2
int v29; // r0
int v30; // s15
int v31; // r0
int v32; // r3
int v33; // s15
FMODAudioEngine *v34; // r0
FMODAudioEngine *v35; // r0
FMODAudioEngine *v36; // r0
FMODAudioEngine *v37; // r0
cocos2d::CCObject **v38; // r0
cocos2d::CCObject *Setup; // r0
GameLevelManager *v40; // r0
GameStatsManager *v41; // r0
GameStatsManager *v42; // r0
MusicDownloadManager *v43; // r0
MusicDownloadManager *v44; // r0
GJAccountManager *v45; // r0
GJAccountManager *v46; // r0
GJMultiplayerManager *v47; // r0
GJMultiplayerManager *v48; // r0
EditorSFXManager *v49; // r0
EditorSFXManager *v50; // r0
unsigned int result; // r0
int v52; // r3
int v53; // r3
unsigned int v54; // r7
cocos2d::CCArray *v55; // r10
cocos2d::CCString *v56; // r0
const char *v57; // r0
char *v58; // r11
size_t v59; // r0
cocos2d::CCString *v60; // r0
int v61; // r3
cocos2d::CCString *v62; // [sp+8h] [bp-2Ch]
int v63[3]; // [sp+14h] [bp-20h] BYREF
int v64; // [sp+20h] [bp-14h] BYREF
int v65; // [sp+24h] [bp-10h]
int v66; // [sp+28h] [bp-Ch]
int v67; // [sp+2Ch] [bp-8h]
*((_BYTE *)this + 491) = 0;
*((_BYTE *)this + 489) = 0;
*((_BYTE *)this + 490) = 0;
v2 = _stack_chk_guard;
*((_BYTE *)this + 492) = 0;
*((_BYTE *)this + 493) = 0;
v67 = v2;
*((_BYTE *)this + 494) = 0;
*((_QWORD *)this + 62) = 0;
*((_BYTE *)this + 495) = 0;
GameManager::resetDPadSettings(this, 0);
IntGameVariable = (cocos2d::CCDictionary *)GameManager::resetDPadSettings(this, 1);
if ( *((_BYTE *)this + 814) )
{
v4 = *((cocos2d::CCDictionary **)this + 80);
if ( v4 )
{
v5 = (char *)&dword_0 + 1;
v4 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(IntGameVariable);
do
{
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%04i", v5);
CString = (GameManager *)cocos2d::CCString::getCString(v6);
v8 = (GameManager *)GameManager::sharedState(CString);
IntGameVariable = (cocos2d::CCDictionary *)GameManager::getIntGameVariable(v8, (char *)CString);
if ( (int)IntGameVariable > 0 )
{
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)IntGameVariable);
v10 = (const char *)cocos2d::CCString::getCString(v9);
memset(v63, 0, sizeof(v63));
v11 = v10;
v12 = strlen(v10);
std::string::__init(v63, v11, v12);
v13 = (cocos2d::CCObject *)cocos2d::CCString::create(v63);
v64 = 0;
v65 = 0;
v66 = 0;
v14 = strlen((const char *)CString);
std::string::__init(&v64, CString, v14);
cocos2d::CCDictionary::setObject((int)v4, v13);
std::string::~string((int)&v64);
IntGameVariable = (cocos2d::CCDictionary *)std::string::~string((int)v63);
}
++v5;
}
while ( v5 != (_BYTE *)&dword_F8 + 2 );
}
}
else
{
v4 = nullptr;
}
v15 = (cocos2d::CCDictionary *)*((unsigned __int8 *)this + 814);
if ( *((_BYTE *)this + 814) )
{
v15 = *((cocos2d::CCDictionary **)this + 83);
if ( v15 )
{
IntGameVariable = (cocos2d::CCDictionary *)GameManager::getUGV(this, "30");
v15 = IntGameVariable;
}
}
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(IntGameVariable);
v17 = v16;
if ( *((cocos2d::CCObject **)this + 80) != v16 )
{
if ( v16 )
cocos2d::CCObject::retain(v16);
v16 = *((cocos2d::CCObject **)this + 80);
if ( v16 )
v16 = (cocos2d::CCObject *)cocos2d::CCObject::release(v16);
*((_DWORD *)this + 80) = v17;
}
v18 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v16);
v19 = v18;
if ( *((cocos2d::CCObject **)this + 81) != v18 )
{
if ( v18 )
cocos2d::CCObject::retain(v18);
v18 = *((cocos2d::CCObject **)this + 81);
if ( v18 )
v18 = (cocos2d::CCObject *)cocos2d::CCObject::release(v18);
*((_DWORD *)this + 81) = v19;
}
v20 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v18);
v21 = v20;
if ( *((cocos2d::CCObject **)this + 83) != v20 )
{
if ( v20 )
cocos2d::CCObject::retain(v20);
v20 = *((cocos2d::CCObject **)this + 83);
if ( v20 )
v20 = (cocos2d::CCObject *)cocos2d::CCObject::release(v20);
*((_DWORD *)this + 83) = v21;
}
if ( !*((_DWORD *)this + 84) )
{
v22 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v20);
v23 = v22;
if ( *((cocos2d::CCObject **)this + 84) != v22 )
{
if ( v22 )
cocos2d::CCObject::retain(v22);
v24 = *((cocos2d::CCObject **)this + 84);
if ( v24 )
cocos2d::CCObject::release(v24);
*((_DWORD *)this + 84) = v23;
}
}
v25 = *((unsigned __int8 *)this + 814);
if ( !*((_BYTE *)this + 814) )
{
PlatformToolbox::getUniqueUserID((PlatformToolbox *)&v64);
if ( (*((_BYTE *)this + 436) & 1) != 0 )
{
**((_BYTE **)this + 111) = v25;
*((_DWORD *)this + 110) = v25;
}
else
{
*((_BYTE *)this + 437) = 0;
*((_BYTE *)this + 436) = 0;
}
std::string::reserve((int *)this + 109, 0);
v26 = v64;
v27 = v65;
v28 = v66;
v64 = 0;
v65 = 0;
v66 = 0;
*((_DWORD *)this + 109) = v26;
*((_DWORD *)this + 110) = v27;
*((_DWORD *)this + 111) = v28;
std::string::~string((int)&v64);
}
std::string::assign((int *)this + 112, "Player");
*((_DWORD *)this + 118) = 0;
v29 = rand();
*((_DWORD *)this + 207) = 0;
v30 = (int)(float)((float)((float)v29 * 4.6566e-10) * 1000.0);
*((_DWORD *)this + 117) = v30;
*((_DWORD *)this + 116) = v30;
v31 = rand();
v32 = *((unsigned __int8 *)this + 814);
*((_BYTE *)this + 832) = 0;
*((_DWORD *)this + 209) = 0;
v33 = (int)(float)((float)((float)v31 * 4.6566e-10) * 1000.0);
*((_DWORD *)this + 206) = v33;
*((_DWORD *)this + 205) = v33;
if ( !v32 )
{
*((_BYTE *)this + 432) = 1;
*((_BYTE *)this + 433) = 1;
*((_BYTE *)this + 434) = 1;
}
v34 = (FMODAudioEngine *)GameManager::resetAllIcons(this);
if ( !*((_BYTE *)this + 814) )
{
v35 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v34);
v36 = FMODAudioEngine::setBackgroundMusicVolume(v35, 1.0);
v37 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v36);
v34 = FMODAudioEngine::setEffectsVolume(v37, 1.0);
}
v38 = (cocos2d::CCObject **)AchievementManager::sharedState(v34);
Setup = AchievementManager::firstSetup(v38);
v40 = (GameLevelManager *)GameLevelManager::sharedState(Setup);
v41 = (GameStatsManager *)GameLevelManager::firstSetup(v40);
v42 = (GameStatsManager *)GameStatsManager::sharedState(v41);
v43 = (MusicDownloadManager *)GameStatsManager::firstSetup(v42);
v44 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v43);
v45 = (GJAccountManager *)MusicDownloadManager::firstSetup(v44);
v46 = (GJAccountManager *)GJAccountManager::sharedState(v45);
v47 = (GJMultiplayerManager *)GJAccountManager::firstSetup(v46);
v48 = (GJMultiplayerManager *)GJMultiplayerManager::sharedState(v47);
v49 = (EditorSFXManager *)GJMultiplayerManager::firstSetup(v48);
v50 = (EditorSFXManager *)EditorSFXManager::sharedState(v49);
result = EditorSFXManager::firstSetup(v50);
if ( *((_BYTE *)this + 814) )
{
if ( v4 )
{
v54 = 0;
v55 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v4);
while ( 1 )
{
result = cocos2d::CCArray::count(v55);
if ( v54 >= result )
break;
v56 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v55, v54);
v57 = (const char *)cocos2d::CCString::getCString(v56);
v64 = 0;
v65 = 0;
v66 = 0;
v58 = (char *)v57;
v59 = strlen(v57);
std::string::__init(&v64, v58, v59);
v60 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v4, &v64);
v62 = (cocos2d::CCString *)cocos2d::CCString::intValue(v60);
std::string::~string((int)&v64);
GameManager::setIntGameVariable(this, v58, (const char *)v62, v61);
++v54;
}
}
}
else
{
*((_BYTE *)this + 722) = 0;
*((_BYTE *)this + 724) = 0;
*((_BYTE *)this + 725) = 0;
*((_BYTE *)this + 732) = 0;
*((_BYTE *)this + 733) = 0;
*((_BYTE *)this + 734) = 0;
*((_BYTE *)this + 723) = 0;
*((_DWORD *)this + 211) = -1;
*((_BYTE *)this + 721) = 1;
*((_BYTE *)this + 319) = 1;
GameManager::setGameVariable(this, "0002", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0001", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0026", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0027", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0200", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0202", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0023", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0038", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0043", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0044", (_BYTE *)&dword_0 + 1);
GameManager::setIntGameVariable(this, "0050", (_BYTE *)&dword_0 + 2, v52);
GameManager::setIntGameVariable(this, "0049", &byte_6, v53);
GameManager::setGameVariable(this, "0046", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0044", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0036", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0118", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0117", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0158", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0121", (_BYTE *)&dword_0 + 1);
GameManager::setGameVariable(this, "0037", (_BYTE *)&dword_0 + 1);
result = GameManager::setGameVariable(this, "0184", (_BYTE *)&dword_0 + 1);
}
if ( *((_BYTE *)this + 814) && v15 )
result = GameManager::setUGV(this, "30", (_BYTE *)&dword_0 + 1);
*((_BYTE *)this + 384) = 1;
return result;
}