//
// MenuGameLayer::init from 0x492f20 to 0x493306 (998 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:49:39 +0000
//
int __fastcall MenuGameLayer::init(PlayerObject **this)
{
int v2; // r7
cocos2d::CCDirector *v3; // r0
GameManager *WinSize; // r0
GameManager *v5; // r5
int v6; // r0
cocos2d::CCSprite *BGTexture; // r0
const char *v8; // r1
PlayerObject *v9; // r0
int v10; // r0
int v11; // r8
int (__fastcall *v12)(int, _BYTE *); // r9
AppDelegate *v13; // r0
int v14; // r8
void (__fastcall *v15)(int, int); // r9
AppDelegate *v16; // r0
int v17; // r0
int BGColor; // r0
char v19; // r3
int v20; // r0
float v21; // s16
float v22; // s15
int v23; // r0
float v24; // s16
float v25; // s15
GameManager *v26; // r0
int v27; // r0
int v28; // r2
PlayerObject *v29; // r0
PlayerObject *v30; // r3
int v31; // r8
int (__fastcall *v32)(int, _DWORD *); // r9
GameManager *v33; // r0
GameManager *v34; // r0
int v35; // r9
GameManager *v36; // r0
char v37; // r8
int v38; // r0
GameManager *v39; // r0
int v40; // s15
int *v41; // r0
PlayerObject *v42; // r3
int v43; // r11
GameManager *v44; // r0
GameManager *v45; // r11
int v46; // r0
int v47; // r0
GameManager *v48; // r0
GameManager *v49; // r11
int v50; // r0
int v51; // r0
GameManager *updated; // r0
unsigned __int8 *v53; // r0
int v54; // r11
int v55; // r0
int v56; // r10
GameManager *v57; // r0
int v58; // s15
bool v60; // [sp+4h] [bp-50h]
int v61; // [sp+8h] [bp-4Ch]
int (__fastcall *v62)(int, _DWORD *); // [sp+8h] [bp-4Ch]
int (__fastcall *v63)(int, _DWORD *); // [sp+8h] [bp-4Ch]
int v64; // [sp+8h] [bp-4Ch]
int v65; // [sp+Ch] [bp-48h]
char v66; // [sp+10h] [bp-44h] BYREF
char v67; // [sp+11h] [bp-43h]
char v68; // [sp+12h] [bp-42h]
_BYTE v69[8]; // [sp+14h] [bp-40h] BYREF
int (__fastcall *v70)(PlayerObject **, float); // [sp+1Ch] [bp-38h]
int v71; // [sp+20h] [bp-34h]
_DWORD v72[2]; // [sp+24h] [bp-30h] BYREF
_DWORD v73[4]; // [sp+2Ch] [bp-28h] BYREF
_BYTE v74[8]; // [sp+3Ch] [bp-18h] BYREF
float v75; // [sp+44h] [bp-10h]
v2 = cocos2d::CCLayer::init((cocos2d::CCLayer *)this);
if ( v2 )
{
v3 = (cocos2d::CCDirector *)(*((int (__fastcall **)(PlayerObject **, int))*this + 125))(this, 1);
cocos2d::CCDirector::sharedDirector(v3);
WinSize = (GameManager *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v69);
v5 = (GameManager *)GameManager::sharedState(WinSize);
v6 = GameManager::sharedState(v5);
BGTexture = (cocos2d::CCSprite *)GameManager::getBGTexture(v5, *(const char **)(v6 + 768));
v9 = (PlayerObject *)cocos2d::CCSprite::create(BGTexture, v8);
*(this + 86) = v9;
v73[0] = 9729;
v73[1] = 9729;
v73[2] = 10497;
v73[3] = 10497;
v10 = (*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)v9 + 536))(v9);
cocos2d::CCTexture2D::setTexParameters(v10, v73);
(*((void (__fastcall **)(PlayerObject **, _DWORD, int))*this + 58))(this, *(this + 86), -100);
v11 = (int)*(this + 86);
v12 = *(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v11 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, 0.0, 0.0);
v13 = (AppDelegate *)v12(v11, v74);
v14 = (int)*(this + 86);
v15 = *(void (__fastcall **)(int, int))(*(_DWORD *)v14 + 80);
v16 = (AppDelegate *)AppDelegate::get(v13);
v17 = AppDelegate::bgScale(v16);
v15(v14, v17);
v67 = 102;
BGColor = MenuGameLayer::getBGColor((MenuGameLayer *)this, 0);
v19 = BYTE1(BGColor);
v66 = BGColor;
v68 = BYTE2(BGColor);
v20 = (int)*(this + 86);
v67 = v19;
*(this + 82) = (PlayerObject *)((char *)*(this + 82) + 1);
(*(void (__fastcall **)(int, char *))(*(_DWORD *)v20 + 480))(v20, &v66);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v74, (PlayerObject *)((char *)*(this + 86) + 336));
v21 = v75;
v22 = COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 86) + 84))(*(this + 86)));
v23 = (int)*(this + 86);
v24 = v21 * v22;
v25 = v75 + v75;
*((float *)this + 88) = v24;
v75 = v25;
v26 = (GameManager *)(*(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v23 + 568))(v23, v74);
v27 = GameManager::sharedState(v26);
v29 = (PlayerObject *)GJGroundLayer::create(*(GJGroundLayer **)(v27 + 772), 1, v28);
v30 = *this;
*(this + 87) = v29;
(*((void (__fastcall **)(PlayerObject **, PlayerObject *, int))v30 + 58))(this, v29, 100);
v31 = (int)*(this + 87);
v32 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v31 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, 0.0, 90.0);
v33 = (GameManager *)v32(v31, v72);
v34 = (GameManager *)GameManager::sharedState(v33);
v35 = *((_DWORD *)v34 + 162) - *((_DWORD *)v34 + 163);
v36 = (GameManager *)GameManager::sharedState(v34);
v37 = *((_BYTE *)v36 + 712);
v38 = GameManager::sharedState(v36);
*(_DWORD *)(v38 + 656) = 1;
v61 = v38;
v39 = (GameManager *)rand();
v40 = (int)(float)((float)((float)(int)v39 * 4.6566e-10) * 1000.0);
*(_DWORD *)(v61 + 652) = v40;
*(_DWORD *)(v61 + 648) = v40 + 1;
*(_BYTE *)(GameManager::sharedState(v39) + 712) = 0;
v41 = PlayerObject::create(
(PlayerObject *)((char *)&dword_0 + 1),
(_BYTE *)&dword_0 + 1,
nullptr,
(GJBaseGameLayer *)this,
nullptr,
v60);
v42 = *this;
*(this + 85) = (PlayerObject *)v41;
(*((void (__fastcall **)(PlayerObject **, int *, int))v42 + 58))(this, v41, 60);
PlayerObject::addAllParticles(*(this + 85));
v43 = (int)*(this + 85);
v62 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v43 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, 0.0, 105.0);
v44 = (GameManager *)v62(v43, v72);
v65 = (int)*(this + 85);
v63 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v65 + 480);
v45 = (GameManager *)GameManager::sharedState(v44);
v46 = rand();
v47 = GameManager::colorForIdx(v45, (int)(float)((float)((float)v46 * 4.6566e-10) * 108.0));
LOWORD(v72[0]) = v47;
BYTE2(v72[0]) = BYTE2(v47);
v48 = (GameManager *)v63(v65, v72);
v64 = (int)*(this + 85);
v49 = (GameManager *)GameManager::sharedState(v48);
v50 = rand();
v51 = GameManager::colorForIdx(v49, (int)(float)((float)((float)v50 * 4.6566e-10) * 108.0));
LOWORD(v72[0]) = v51;
BYTE2(v72[0]) = BYTE2(v51);
PlayerObject::setSecondColor(v64, (unsigned __int8 *)v72);
updated = (GameManager *)PlayerObject::updateGlowColor(*(this + 85));
*((_DWORD *)*(this + 85) + 535) = 1056964608;
v53 = (unsigned __int8 *)GameManager::sharedState(updated);
v54 = v53[872];
if ( !v53[872] )
{
*(_BYTE *)(GameManager::sharedState((GameManager *)v53) + 872) = 1;
PlayerObject::toggleDartMode((int)*(this + 85), 1, v54);
v53 = (unsigned __int8 *)PlayerObject::toggleDartMode((int)*(this + 85), v54, v54);
}
v55 = GameManager::sharedState((GameManager *)v53);
*(_DWORD *)(v55 + 656) = v35;
v56 = v55;
v57 = (GameManager *)rand();
v58 = (int)(float)((float)((float)(int)v57 * 4.6566e-10) * 1000.0);
*(_DWORD *)(v56 + 652) = v58;
*(_DWORD *)(v56 + 648) = v58 + v35;
*(_BYTE *)(GameManager::sharedState(v57) + 712) = v37;
cocos2d::CCNode::scheduleUpdate((cocos2d::CCNode *)this);
v70 = MenuGameLayer::tryJump;
v71 = 0;
cocos2d::CCNode::schedule(this, MenuGameLayer::tryJump, 0, 1048576000);
v72[1] = 0;
v72[0] = MenuGameLayer::updateColor;
cocos2d::CCNode::schedule(this, MenuGameLayer::updateColor, 0, 1084227584);
MenuGameLayer::updateColor((MenuGameLayer *)this, 0.0);
PlayerObject::stopStreak2((cocos2d::CCNode **)*(this + 85));
MenuGameLayer::resetPlayer((MenuGameLayer *)this);
}
return v2;
}