//
// LevelPage::init from 0x511ce4 to 0x512536 (2130 bytes)
//
// 1 xrefs:
// > LevelPage::create @ 0x5125b2
//
// 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:51:33 +0000
//
int __fastcall LevelPage::init(cocos2d::CCObject **this, GJGameLevel *a2)
{
cocos2d::CCDirector *v3; // r0
cocos2d::CCArray *v4; // r0
cocos2d::CCObject *v5; // r0
cocos2d::CCArray *v6; // r0
cocos2d::CCObject *v7; // r0
cocos2d::CCMenu *v8; // r0
cocos2d::CCObject *v9; // r0
cocos2d::CCObject *v10; // r3
int v11; // r7
void (__fastcall *v12)(int, _DWORD *); // r8
int v13; // r0
int v14; // r6
int (__fastcall *v15)(int, _DWORD *); // r7
cocos2d::CCSprite *v16; // r0
int v17; // r10
void (__fastcall *v18)(int, int); // r6
int v19; // r0
int v20; // r0
void (__fastcall *v21)(int, _DWORD *); // r7
float *v22; // r0
int v23; // r6
float v24; // s17
int v25; // r0
int v26; // r0
const char *v27; // r1
cocos2d::CCObject *v28; // r6
void (__fastcall *v29)(cocos2d::CCObject *, _BYTE *); // r7
const char *v30; // r1
cocos2d::CCObject *v31; // r0
int v32; // r1
float v33; // s17
void (__fastcall *v34)(cocos2d::CCLabelBMFont *, _BYTE *); // r7
void (__fastcall *v35)(cocos2d::CCLabelBMFont *, _BYTE *); // r7
int v36; // r0
const char *v37; // r1
cocos2d::CCObject *v38; // r7
const char *v39; // r1
cocos2d::CCObject *v40; // r0
int v41; // r0
void (__fastcall *v42)(int, _BYTE *); // r3
int v43; // r11
void (__fastcall *v44)(int, _BYTE *); // r9
int v45; // r11
void (__fastcall *v46)(int, int); // r9
int v47; // r0
const char *v48; // r2
cocos2d::CCObject *v49; // r0
cocos2d::CCObject *v50; // r3
void (__fastcall *v51)(int, int); // r11
int v52; // r0
const char *v53; // r2
cocos2d::CCObject *v54; // r0
cocos2d::CCObject *v55; // r3
void (__fastcall *v56)(int, int); // r11
int v57; // r0
const char *v58; // r2
cocos2d::CCObject *v59; // r11
int v60; // r6
const char *v61; // r2
cocos2d::CCObject *v62; // r6
void (__fastcall *v63)(cocos2d::CCObject *, _BYTE *); // r11
int v64; // r7
const char *v65; // r2
cocos2d::CCObject *v66; // r0
cocos2d::CCObject *v67; // r7
void (__fastcall *v68)(cocos2d::CCObject *, _BYTE *); // r6
const char *v69; // r1
cocos2d::CCObject *v70; // r0
const char *v71; // r1
cocos2d::CCObject *v72; // r0
int v73; // r7
void (__fastcall *v74)(int, _BYTE *); // r6
const char *v75; // r2
cocos2d::CCObject *v76; // r0
int v77; // r6
void (__fastcall *v78)(int, _BYTE *); // r7
int v79; // r6
void (__fastcall *v80)(int, _BYTE *); // r7
int v81; // r9
int v82; // r8
cocos2d::CCArray *v83; // r0
cocos2d::CCObject *v84; // r0
const char *v85; // r1
cocos2d::CCObject *v86; // r6
void (__fastcall *v87)(cocos2d::CCObject *, _BYTE *); // r9
cocos2d::CCArray *v88; // r0
cocos2d::CCObject *v90; // r0
PlatformToolbox *v91; // r0
const char *v92; // r1
int isControllerConnected; // r8
cocos2d::CCObject *v94; // r6
void (__fastcall *v95)(cocos2d::CCObject *, _BYTE *); // r9
int v96; // r10
cocos2d::CCLabelBMFont *v98; // [sp+8h] [bp-4Ch]
cocos2d::CCLabelBMFont *v99; // [sp+8h] [bp-4Ch]
cocos2d::CCLabelBMFont *v100; // [sp+8h] [bp-4Ch]
int v101; // [sp+Ch] [bp-48h]
void (__fastcall *v102)(cocos2d::CCObject *, _BYTE *); // [sp+14h] [bp-40h]
int v103; // [sp+14h] [bp-40h]
int v104; // [sp+14h] [bp-40h]
void (__fastcall *v105)(cocos2d::CCObject *, _BYTE *); // [sp+14h] [bp-40h]
_BYTE v106[4]; // [sp+18h] [bp-3Ch] BYREF
float v107; // [sp+1Ch] [bp-38h] BYREF
float v108; // [sp+20h] [bp-34h]
_BYTE v109[8]; // [sp+24h] [bp-30h] BYREF
_BYTE v110[8]; // [sp+2Ch] [bp-28h] BYREF
_BYTE v111[8]; // [sp+34h] [bp-20h] BYREF
_DWORD v112[4]; // [sp+3Ch] [bp-18h] BYREF
v101 = cocos2d::CCLayer::init((cocos2d::CCLayer *)this);
if ( v101 )
{
v3 = (cocos2d::CCDirector *)(*((int (__fastcall **)(cocos2d::CCObject **, int))*this + 125))(this, 1);
cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v107);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v112, 340.0, 95.0);
v4 = (cocos2d::CCArray *)cocos2d::CCSize::operator=(this + 93, v112);
v5 = (cocos2d::CCObject *)cocos2d::CCArray::create(v4);
*(this + 98) = v5;
v6 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v5);
v7 = (cocos2d::CCObject *)cocos2d::CCArray::create(v6);
*(this + 97) = v7;
v8 = (cocos2d::CCMenu *)cocos2d::CCObject::retain(v7);
v9 = (cocos2d::CCObject *)cocos2d::CCMenu::create(v8);
v10 = *this;
*(this + 82) = v9;
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))v10 + 58))(this, v9, -1);
v11 = (int)*(this + 82);
v12 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v112, v107 * 0.5, (float)(v108 * 0.5) + 60.0);
v12(v11, v112);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v112, 0.0, 0.0, 80.0, 80.0);
v13 = cocos2d::extension::CCScale9Sprite::create("square02_001.png", v112);
*(this + 83) = (cocos2d::CCObject *)v13;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 456))(v13, 125);
(*(void (__fastcall **)(_DWORD, char *))(*(_DWORD *)*(this + 83) + 160))(*(this + 83), (char *)this + 372);
v14 = (int)*(this + 83);
v15 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v14 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v112, v107 * 0.5, (float)(v108 * 0.5) + 50.0);
v16 = (cocos2d::CCSprite *)v15(v14, v112);
v17 = cocos2d::CCSprite::create(v16);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v17 + 228))(v17, *(this + 83));
v18 = *(void (__fastcall **)(int, int))(*(_DWORD *)v17 + 160);
v19 = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 83) + 164))(*(this + 83));
v18(v17, v19);
v20 = (int)*(this + 83);
v21 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v20 + 92);
v22 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v20 + 164))(v20);
v23 = (int)*(this + 83);
v24 = *v22;
v25 = (*(int (__fastcall **)(int))(*(_DWORD *)v23 + 164))(v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v112, v24 * 0.5, *(float *)(v25 + 4) * 0.5);
v21(v23, v112);
v112[0] = LevelPage::onPlay;
v112[1] = 0;
v26 = CCMenuItemSpriteExtra::create(v17, 0, (int)this, (int)LevelPage::onPlay, 0);
*(_DWORD *)(v26 + 312) = 1066192077;
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 82) + 228))(*(this + 82), v26);
cocos2d::CCArray::addObject(*(this + 98), *(this + 82));
v106[0] = 0;
v106[1] = 0;
v106[2] = 0;
v28 = (cocos2d::CCObject *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v27);
(*(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v28 + 480))(v28, v106);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v28 + 456))(v28, 125);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v28 + 80))(v28, 1065353216);
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))*this + 58))(this, v28, 3);
v29 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v28 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, v107 * 0.5, (float)(v108 * 0.5) - 30.0);
v29(v28, v111);
cocos2d::CCArray::addObject(*(this + 98), v28);
v31 = (cocos2d::CCObject *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v30);
*(this + 89) = v31;
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v31 + 64))(v31, 1065218998);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 89) + 72))(*(this + 89), 1063004406);
(*(void (__fastcall **)(_DWORD, void *))(*(_DWORD *)*(this + 89) + 480))(*(this + 89), &unk_BECC4C);
v32 = (int)*(this + 89);
*(this + 88) = *(cocos2d::CCObject **)(v32 + 344);
v33 = *(float *)(v32 + 344) - (float)(*(float *)(v32 + 344) * 0.992);
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v28 + 232))(v28);
v98 = *(this + 89);
v34 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_DWORD *)v98 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, 0.0, 0.5);
v34(v98, v111);
v99 = *(this + 89);
v35 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_DWORD *)v99 + 92);
v36 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v28 + 164))(v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, v33 * 0.5, *(float *)(v36 + 4) * 0.5);
v35(v99, v111);
v38 = (cocos2d::CCObject *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v37);
(*(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v38 + 480))(v38, v106);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v38 + 456))(v38, 125);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v38 + 80))(v38, 1065353216);
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))*this + 58))(this, v38, 3);
v102 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v38 + 92);
v100 = (cocos2d::CCLabelBMFont *)(*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v28 + 96))(v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, -50.0);
cocos2d::CCPoint::operator+(v111, v100, v110);
v102(v38, v111);
cocos2d::CCArray::addObject(*(this + 98), v38);
v40 = (cocos2d::CCObject *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v39);
*(this + 90) = v40;
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v40 + 64))(v40, 1065218998);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 90) + 72))(*(this + 90), 1063004406);
v41 = (int)*(this + 90);
v42 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v41 + 480);
v111[0] = 0;
v111[1] = -1;
v111[2] = -1;
v42(v41, v111);
(*(void (__fastcall **)(cocos2d::CCObject *, _DWORD, int))(*(_DWORD *)v38 + 232))(v38, *(this + 90), 1);
v43 = (int)*(this + 90);
v44 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v43 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, 0.0, 0.5);
v44(v43, v111);
v45 = (int)*(this + 90);
v46 = *(void (__fastcall **)(int, int))(*(_DWORD *)v45 + 92);
v47 = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 89) + 96))(*(this + 89));
v46(v45, v47);
v49 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)" ", "bigFont.fnt", v48);
v50 = *this;
*(this + 84) = v49;
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))v50 + 58))(this, v49, 4);
v103 = (int)*(this + 84);
v51 = *(void (__fastcall **)(int, int))(*(_DWORD *)v103 + 92);
v52 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v28 + 96))(v28);
v51(v103, v52);
(*(void (__fastcall **)(_DWORD, float))(*(_DWORD *)*(this + 84) + 80))(*(this + 84), 0.5);
cocos2d::CCArray::addObject(*(this + 98), *(this + 84));
v54 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)" ", "bigFont.fnt", v53);
v55 = *this;
*(this + 85) = v54;
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))v55 + 58))(this, v54, 4);
v104 = (int)*(this + 85);
v56 = *(void (__fastcall **)(int, int))(*(_DWORD *)v104 + 92);
v57 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v38 + 96))(v38);
v56(v104, v57);
(*(void (__fastcall **)(_DWORD, float))(*(_DWORD *)*(this + 85) + 80))(*(this + 85), 0.5);
cocos2d::CCArray::addObject(*(this + 98), *(this + 85));
v59 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)"Normal Mode",
"bigFont.fnt",
v58);
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))*this + 58))(this, v59, 4);
v105 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v59 + 92);
v60 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v28 + 96))(v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, 20.0);
cocos2d::CCPoint::operator+(v111, v60, v110);
v105(v59, v111);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_DWORD *)v59 + 80))(v59, 0.5);
cocos2d::CCArray::addObject(*(this + 98), v59);
v62 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)"Practice Mode",
"bigFont.fnt",
v61);
(*((void (__fastcall **)(cocos2d::CCObject **, cocos2d::CCObject *, int))*this + 58))(this, v62, 4);
v63 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v62 + 92);
v64 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v38 + 96))(v38);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, 20.0);
cocos2d::CCPoint::operator+(v111, v64, v110);
v63(v62, v111);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_DWORD *)v62 + 80))(v62, 0.5);
cocos2d::CCArray::addObject(*(this + 98), v62);
v66 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)" ", "bigFont.fnt", v65);
*(this + 86) = v66;
v67 = v66;
v68 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v66 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, 0.0, 0.5);
v68(v67, v111);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 83) + 228))(*(this + 83), *(this + 86));
cocos2d::CCArray::addObject(*(this + 97), *(this + 86));
v70 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"diffIcon_01_btn_001.png",
v69);
*(this + 91) = v70;
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 83) + 228))(*(this + 83), v70);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 91) + 80))(*(this + 91), 1066192077);
cocos2d::CCArray::addObject(*(this + 97), *(this + 91));
v72 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_starsIcon_001.png",
v71);
*(this + 92) = v72;
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 83) + 228))(*(this + 83), v72);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 92) + 80))(*(this + 92), 1060320051);
v73 = (int)*(this + 92);
v74 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v73 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, *((float *)this + 93) - 15.0, *((float *)this + 94) - 13.0);
v74(v73, v111);
cocos2d::CCArray::addObject(*(this + 97), *(this + 92));
v76 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)" ", "bigFont.fnt", v75);
*(this + 87) = v76;
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 83) + 228))(*(this + 83), v76);
v77 = (int)*(this + 87);
v78 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v77 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, 1.0, 0.5);
v78(v77, v111);
v79 = (int)*(this + 87);
v80 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v79 + 92);
v81 = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 92) + 96))(*(this + 92));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, -12.0, 0.5);
cocos2d::CCPoint::operator+(v111, v81, v110);
v82 = 2;
v80(v79, v111);
(*(void (__fastcall **)(_DWORD, float))(*(_DWORD *)*(this + 87) + 80))(*(this + 87), 0.5);
v83 = (cocos2d::CCArray *)cocos2d::CCArray::addObject(*(this + 97), *(this + 87));
v84 = (cocos2d::CCObject *)cocos2d::CCArray::create(v83);
*(this + 95) = v84;
cocos2d::CCObject::retain(v84);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, *((float *)this + 93) - 16.0, 16.0);
do
{
v86 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_coinsIcon_001.png",
v85);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 83) + 228))(*(this + 83), v86);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v86 + 80))(v86, 1065353216);
v87 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v86 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, (float)v82 * -26.0, 0.0);
cocos2d::CCPoint::operator+(v111, v109, v110);
v87(v86, v111);
cocos2d::CCArray::addObject(*(this + 95), v86);
v88 = (cocos2d::CCArray *)cocos2d::CCArray::addObject(*(this + 97), v86);
}
while ( v82-- != 0 );
v90 = (cocos2d::CCObject *)cocos2d::CCArray::create(v88);
*(this + 96) = v90;
v91 = (PlatformToolbox *)cocos2d::CCObject::retain(v90);
isControllerConnected = PlatformToolbox::isControllerConnected(v91);
if ( isControllerConnected )
{
v94 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"controllerBtn_Start_001.png",
v92);
(*(void (__fastcall **)(int, cocos2d::CCObject *, int))(*(_DWORD *)v17 + 232))(v17, v94, 10);
v95 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v94 + 92);
v96 = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 83) + 96))(*(this + 83));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, -35.0);
cocos2d::CCPoint::operator+(v111, v96, v110);
v95(v94, v111);
cocos2d::CCArray::addObject(*(this + 97), v94);
return isControllerConnected;
}
}
return v101;
}