//
// GameManager::firstLoad from 0x1003b9e88 to 0x1003ba3b0 (1320 bytes)
//
// 1 xrefs:
// > ??> @ 0x100947308
//
// 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 11:03:58 +0000
//
void __fastcall GameManager::firstLoad(__int64 a1)
{
__int64 IntGameVariable; // x0
int v3; // w25
__int64 v4; // x21
void *v5; // x0
std::string::value_type *CString; // x23
__int64 v7; // x0
void *v8; // x0
char *v9; // x0
void *v10; // x24
unsigned __int8 v11; // w20
__int64 v12; // x0
_DWORD *v13; // x0
__int64 v14; // x0
_DWORD *v15; // x0
__int64 v16; // x0
_DWORD *v17; // x0
__int64 v18; // x0
void **v19; // x22
int v20; // w8
float v21; // s0
__int64 v22; // x0
__int64 v23; // x0
__int64 v24; // x0
_QWORD *v25; // x0
__int64 Setup; // x0
__int64 v27; // x0
__int64 v28; // x0
__int64 v29; // x0
__int64 v30; // x0
__n128 v31; // q0
__int64 v32; // x0
__int64 v33; // x22
unsigned int v34; // w23
__int64 v35; // x0
char *v36; // x24
__int64 v37; // x0
int v38; // w25
void *__p[2]; // [xsp+10h] [xbp-80h] BYREF
char v40; // [xsp+27h] [xbp-69h]
void *v41[2]; // [xsp+28h] [xbp-68h] BYREF
__int64 v42; // [xsp+38h] [xbp-58h]
*(_QWORD *)(a1 + 696) = 0;
*(_DWORD *)(a1 + 688) = 0;
*(_DWORD *)(a1 + 685) = 0;
sub_1003B84E0(a1 + 1316);
sub_1003B8608(a1, 1);
if ( *(_BYTE *)(a1 + 1026) == 1 )
{
if ( *(_QWORD *)(a1 + 424) )
{
v3 = 1;
v4 = cocos2d::CCDictionary::create(IntGameVariable);
do
{
v5 = sub_1003065B0("%04i", v3);
CString = (std::string::value_type *)cocos2d::CCString::getCString((__int64)v5);
v7 = GameManager::sharedState();
IntGameVariable = GameManager::getIntGameVariable(v7, CString);
if ( (int)IntGameVariable >= 1 )
{
v8 = sub_1003065B0("%i", IntGameVariable);
v9 = (char *)cocos2d::CCString::getCString((__int64)v8);
sub_100009900(v41, v9);
v10 = sub_1003064AC((__int128 *)v41);
sub_100009900(__p, CString);
IntGameVariable = cocos2d::CCDictionary::setObject(v4, v10, __p);
if ( v40 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v42) < 0 )
operator delete(v41[0]);
}
++v3;
}
while ( v3 != 250 );
if ( (*(_BYTE *)(a1 + 1026) & 1) == 0 )
goto LABEL_16;
}
else
{
v4 = 0;
}
if ( *(_QWORD *)(a1 + 448) )
{
IntGameVariable = GameManager::getUGV(a1, "30");
v11 = IntGameVariable;
goto LABEL_17;
}
}
else
{
v4 = 0;
}
LABEL_16:
v11 = 0;
LABEL_17:
v12 = cocos2d::CCDictionary::create(IntGameVariable);
v13 = sub_1003B9DB0(a1, v12);
v14 = cocos2d::CCDictionary::create(v13);
v15 = sub_1003B9DF8(a1, v14);
v16 = cocos2d::CCDictionary::create(v15);
v17 = sub_1000C0F94(a1, v16);
if ( !*(_QWORD *)(a1 + 456) )
{
v18 = cocos2d::CCDictionary::create(v17);
sub_1003B9E40(a1, v18);
}
if ( (*(_BYTE *)(a1 + 1026) & 1) == 0 )
{
sub_1001F916C(v41);
v19 = (void **)(a1 + 608);
if ( *(char *)(a1 + 631) < 0 )
operator delete(*v19);
*(_OWORD *)v19 = *(_OWORD *)v41;
*(_QWORD *)(a1 + 624) = v42;
}
std::string::assign((std::string *)(a1 + 632), "Player");
*(_DWORD *)(a1 + 668) = 0;
v20 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);
*(_DWORD *)(a1 + 664) = v20;
*(_DWORD *)(a1 + 660) = v20;
*(_DWORD *)(a1 + 1040) = 0;
v21 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
*(_DWORD *)(a1 + 1036) = (int)v21;
*(_DWORD *)(a1 + 1032) = (int)v21;
*(_BYTE *)(a1 + 1044) = 0;
*(_DWORD *)(a1 + 1048) = 0;
if ( (*(_BYTE *)(a1 + 1026) & 1) == 0 )
{
*(_WORD *)(a1 + 600) = 257;
*(_BYTE *)(a1 + 602) = 1;
}
sub_1003B67D0(a1);
if ( (*(_BYTE *)(a1 + 1026) & 1) == 0 )
{
v22 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::setBackgroundMusicVolume(v22, 1.0);
v23 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::setEffectsVolume(v23, 1.0);
}
v24 = AchievementManager::sharedState();
AchievementManager::firstSetup(v24);
v25 = (_QWORD *)GameLevelManager::sharedState();
Setup = GameLevelManager::firstSetup(v25);
v27 = GameStatsManager::sharedState(Setup);
sub_1003DCDD8(v27);
v28 = MusicDownloadManager::sharedState();
v29 = MusicDownloadManager::firstSetup(v28);
v30 = GJAccountManager::sharedState(v29);
GJAccountManager::firstSetup(v30);
GJMultiplayerManager::sharedState();
GJMultiplayerManager::firstSetup();
v32 = EditorSFXManager::sharedState(v31);
EditorSFXManager::firstSetup(v32);
if ( (*(_BYTE *)(a1 + 1026) & 1) != 0 )
{
if ( v4 )
{
v33 = cocos2d::CCDictionary::allKeys(v4);
if ( (unsigned int)sub_1002E757C(v33) )
{
v34 = 0;
do
{
v35 = cocos2d::CCArray::stringAtIndex(v33, v34);
v36 = (char *)cocos2d::CCString::getCString(v35);
sub_100009900(v41, v36);
v37 = cocos2d::CCDictionary::valueForKey(v4, v41);
v38 = cocos2d::CCString::intValue(v37);
if ( SHIBYTE(v42) < 0 )
operator delete(v41[0]);
GameManager::setIntGameVariable(a1, v36, v38);
++v34;
}
while ( v34 < (unsigned int)sub_1002E757C(v33) );
}
}
}
else
{
*(_DWORD *)(a1 + 1056) = -1;
*(_BYTE *)(a1 + 925) = 0;
*(_BYTE *)(a1 + 423) = 1;
*(_WORD *)(a1 + 932) = 0;
*(_BYTE *)(a1 + 934) = 0;
*(_DWORD *)(a1 + 921) = 1;
GameManager::setGameVariable(a1, "0002", 1);
GameManager::setGameVariable(a1, "0001", 1);
GameManager::setGameVariable(a1, "0026", 1);
GameManager::setGameVariable(a1, "0027", 1);
GameManager::setGameVariable(a1, "0200", 1);
GameManager::setGameVariable(a1, "0202", 1);
GameManager::setGameVariable(a1, "0038", 1);
GameManager::setGameVariable(a1, "0043", 1);
GameManager::setGameVariable(a1, "0044", 1);
GameManager::setIntGameVariable(a1, "0050", 2);
GameManager::setIntGameVariable(a1, "0049", 6);
GameManager::setGameVariable(a1, "0046", 1);
GameManager::setGameVariable(a1, "0044", 1);
GameManager::setGameVariable(a1, "0036", 1);
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);
GameManager::setGameVariable(a1, "0184", 1);
}
if ( (*(_BYTE *)(a1 + 1026) & v11 & 1) != 0 )
GameManager::setUGV(a1, "30", 1);
*(_BYTE *)(a1 + 504) = 1;
}