//
// TutorialLayer::init from 0x538ea8 to 0x539206 (862 bytes)
//
// 1 xrefs:
// > TutorialLayer::create @ 0x538b0a
//
// 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:52:13 +0000
//
int __fastcall TutorialLayer::init(TutorialLayer *this)
{
int v2; // r9
cocos2d::CCDirector *v3; // r0
cocos2d::CCLayer *WinSize; // r0
int v5; // r0
int v6; // r3
cocos2d::CCLayer *v7; // r0
int v8; // r0
int v9; // r6
void (__fastcall *v10)(int, _BYTE *); // r8
void (__fastcall *v11)(int, _BYTE *); // r8
const char *v12; // r2
int v13; // r6
void (__fastcall *v14)(int, _BYTE *); // r8
const char *v15; // r1
void (__fastcall *v16)(int, _DWORD); // r5
float *v17; // r0
int v18; // r0
cocos2d::CCMenu *v19; // r6
int v20; // r0
float v21; // s14
float v22; // s13
int v23; // r10
void (__fastcall *v24)(int, _BYTE *); // r11
ButtonSprite *v25; // r0
int v26; // r0
ButtonSprite *v27; // r0
int v28; // r0
int v29; // r10
void (__fastcall *v30)(int, _BYTE *); // r11
int v31; // r6
void (__fastcall *v32)(int, int); // r8
int v33; // r0
float v35; // [sp+10h] [bp-4Ch]
float v36; // [sp+10h] [bp-4Ch]
cocos2d::CCPoint *v37; // [sp+14h] [bp-48h]
float v38; // [sp+1Ch] [bp-40h] BYREF
float v39; // [sp+20h] [bp-3Ch]
int (__fastcall *v40)(TutorialLayer *, cocos2d::CCObject *); // [sp+24h] [bp-38h]
int v41; // [sp+28h] [bp-34h]
_DWORD (*v42)(TutorialLayer *__hidden, cocos2d::CCObject *); // [sp+2Ch] [bp-30h]
int v43; // [sp+30h] [bp-2Ch]
int (__fastcall *v44)(TutorialLayer *, cocos2d::CCObject *); // [sp+34h] [bp-28h]
int v45; // [sp+38h] [bp-24h]
_BYTE v46[8]; // [sp+3Ch] [bp-20h] BYREF
_BYTE v47[16]; // [sp+44h] [bp-18h] BYREF
v47[0] = 0;
v47[1] = 0;
v47[2] = 0;
v47[3] = -106;
v2 = cocos2d::CCLayerColor::initWithColor(this, v47);
if ( v2 )
{
(*(void (__fastcall **)(TutorialLayer *, int))(*(_DWORD *)this + 500))(this, 1);
v3 = (cocos2d::CCDirector *)(*(int (__fastcall **)(TutorialLayer *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v3);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v38);
v5 = cocos2d::CCLayer::create(WinSize);
v6 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v5;
v7 = (cocos2d::CCLayer *)(*(int (__fastcall **)(TutorialLayer *, int))(v6 + 228))(this, v5);
v8 = cocos2d::CCLayer::create(v7);
*((_DWORD *)this + 130) = v8;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v8);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v47, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v47);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v9 + 456))(v9, 255);
v10 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v47, 420.0, 260.0);
v10(v9, v47);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v9, -1);
v11 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v38 * 0.5, v39 * 0.5);
v11(v9, v47);
v13 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"How To Play", "bigFont.fnt", v12);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v13, 20);
v14 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v38 * 0.5, (float)((float)(v39 * 0.5) + 130.0) - 25.0);
v14(v13, v47);
if ( *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v13 + 164))(v13) > 300.0 )
{
v16 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v13 + 80);
v17 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v13 + 164))(v13);
v16(v13, 300.0 / *v17);
}
*((_DWORD *)this + 125) = -1;
v18 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v15);
v40 = TutorialLayer::onClose;
v41 = 0;
v19 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v18, 0, (int)this, (int)TutorialLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult((int)v19, 1.6);
v20 = cocos2d::CCMenu::create(v19, nullptr);
v21 = v39;
v22 = (float)(v38 * 0.5) - 210.0;
*((_DWORD *)this + 111) = v20;
v23 = v20;
v24 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v20 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v22 + 10.0, (float)((float)(v21 * 0.5) + 130.0) - 10.0);
v24(v23, v47);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 111),
10);
v25 = ButtonSprite::create(
(ButtonSprite *)"Next",
(const char *)off_DC,
0,
0.6,
0,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x42200000,
v35);
v42 = TutorialLayer::onNext;
v43 = 0;
v26 = CCMenuItemSpriteExtra::create((int)v25, 0, (int)this, (int)TutorialLayer::onNext, 0);
*((_DWORD *)this + 132) = v26;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v26);
v27 = ButtonSprite::create(
(ButtonSprite *)"Exit",
(const char *)off_DC,
0,
0.6,
0,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x42200000,
v36);
v44 = TutorialLayer::onClose;
v45 = 0;
v28 = CCMenuItemSpriteExtra::create((int)v27, 0, (int)this, (int)TutorialLayer::onClose, 0);
*((_DWORD *)this + 133) = v28;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v28);
v29 = *((_DWORD *)this + 132);
v30 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v29 + 92);
v37 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v47,
(float)((float)(v38 * 0.5) + 210.0) - 52.0,
(float)((float)(v39 * 0.5) - 130.0) + 50.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v46, v37);
v30(v29, v46);
v31 = *((_DWORD *)this + 133);
v32 = *(void (__fastcall **)(int, int))(*(_DWORD *)v31 + 92);
v33 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 132) + 96))(*((_DWORD *)this + 132));
v32(v31, v33);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 133) + 172))(*((_DWORD *)this + 133), 0);
*((_DWORD *)this + 131) = 0;
TutorialLayer::loadPage(this, (_BYTE *)&dword_0 + 1);
}
return v2;
}