//
// AppDelegate::applicationDidFinishLaunching from 0x5bdffc to 0x5be228 (556 bytes)
//
// 2 xrefs:
// > ??> @ 0xa3e48
// > ??> @ 0x1145580
//
// 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
//
bool AppDelegate::applicationDidFinishLaunching(AppDelegate *a1)
{
cocos2d::CCDirector *v2; // x19
cocos2d::CCFileUtils *v3; // x23
void *v4; // x0
ObjectDecoder *v5; // x23
GJObjectDecoder *v6; // x0
bool v7; // zf
ObjectDecoderDelegate *v8; // x0
GameManager *v9; // x0
GameManager *v10; // x0
float DeviceRefreshRate; // s0
cocos2d::CCScene *v12; // x0
unsigned int *v14; // x2
int v15; // w1
__int64 v16; // [xsp+50h] [xbp+50h] BYREF
struct timeval tv; // [xsp+58h] [xbp+58h] BYREF
BYTE1(a1->m_startupScriptFilename.m_data.m_data) = 0;
gettimeofday(&tv, nullptr);
srand(LODWORD(tv.tv_sec) * LODWORD(tv.tv_usec));
qword_1241D58 = tv.tv_usec * tv.tv_sec;
v2 = cocos2d::CCDirector::sharedDirector();
v3 = cocos2d::CCFileUtils::sharedFileUtils();
sub_D153B8((int)&v16, "/data/data/com.robtopx.geometryjump/");
sub_D18EA8(&v3[15], &v16);
v4 = (void *)(v16 - 24);
if ( (__int64 *)(v16 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v16 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *(_DWORD *)(v16 - 8);
*(_DWORD *)(v16 - 8) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v4);
}
AppDelegate::setupGLView(a1);
cocos2d::CCDirector::setProjection(v2, kCCDirectorProjection2D);
CCContentManager::sharedManager();
v5 = ObjectDecoder::sharedDecoder();
v6 = GJObjectDecoder::sharedDecoder();
v7 = v6 == nullptr;
v8 = &v6->ObjectDecoderDelegate;
if ( v7 )
v8 = nullptr;
v5->m_delegate = v8;
GameManager::sharedState();
LocalLevelManager::sharedState();
v9 = GameManager::sharedState();
GameManager::loadVideoSettings(v9);
v10 = GameManager::sharedState();
GameManager::startUpdate(v10);
cocos2d::CCDirector::getContentScaleFactor(v2);
*(&a1->m_gamePaused + 3) = 0;
cocos2d::CCDirector::setDepthTest(v2, 0);
DeviceRefreshRate = PlatformToolbox::getDeviceRefreshRate();
v2->setAnimationInterval(v2, (float)(1.0 / DeviceRefreshRate));
v2->m_bDisplayStats = 1;
*(&a1->m_gamePaused + 1) = 0;
AdToolbox::setupAds();
v12 = LoadingLayer::scene(0);
cocos2d::CCDirector::runWithScene(v2, v12);
return 1;
}