//
// TutorialLayer::init from 0x9008e0 to 0x900d7c (1180 bytes)
//
// 3 xrefs:
// > TutorialLayer::create @ 0x900ee4
// > ??> @ 0x86a40
// > ??> @ 0x1464160
//
// 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 12:57:06 +0000
//
__int64 __fastcall TutorialLayer::init(TutorialLayer *this)
{
unsigned __int8 v2; // w0
unsigned int v3; // w22
cocos2d::CCDirector *v5; // x0
cocos2d::CCDirector *v6; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v8; // x0
cocos2d::CCLayer *v9; // x0
__int64 v10; // x0
__int64 v11; // x23
void (__fastcall *v12)(__int64, _BYTE *); // x25
void (__fastcall *v13)(__int64, _BYTE *); // x25
const char *v14; // x2
__int64 v15; // x23
void (__fastcall *v16)(__int64, _BYTE *); // x25
float v17; // s0
__int64 v18; // x0
cocos2d::CCMenu *v19; // x25
__int64 v20; // x25
float v21; // s1
void (__fastcall *v22)(__int64, _BYTE *); // x27
const char *v23; // x6
__int64 v24; // x0
__int64 v25; // x0
const char *v26; // x6
__int64 v27; // x0
__int64 v28; // x0
__int64 v29; // x24
cocos2d::CCNode *v30; // x26
void (__fastcall *v31)(__int64, __int64 *); // x25
__int64 v32; // x20
void (__fastcall *v33)(__int64, __int64); // x23
__int64 v34; // x0
void (__fastcall *v35)(__int64, float); // x25
float *v36; // x0
__int64 v37; // [xsp+78h] [xbp+78h] BYREF
__int64 v38; // [xsp+80h] [xbp+80h] BYREF
_BYTE v39[16]; // [xsp+88h] [xbp+88h] BYREF
v39[0] = 0;
v39[1] = 0;
v39[2] = 0;
v39[3] = -106;
v2 = cocos2d::CCLayerColor::initWithColor(this, v39);
v3 = v2;
if ( v2 )
{
(*(void (__fastcall **)(TutorialLayer *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v5 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(TutorialLayer *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v6 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v5);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v37, v6);
v8 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v8;
v9 = (cocos2d::CCLayer *)(*(__int64 (__fastcall **)(TutorialLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v8);
v10 = cocos2d::CCLayer::create(v9);
*((_QWORD *)this + 83) = v10;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v10);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v39, 0.0, 0.0, 80.0, 80.0);
v11 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v39);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 912LL))(v11, 0xFFFFFFFFLL);
v12 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v11 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v39, 420.0, 260.0);
v12(v11, v39);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v11,
0xFFFFFFFFLL);
v13 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v11 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, *(float *)&v37 * 0.5, *((float *)&v37 + 1) * 0.5);
v13(v11, v39);
v15 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"How To Play", "bigFont.fnt", v14);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v15,
20);
v16 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v39,
*(float *)&v37 * 0.5,
(float)((float)(*((float *)&v37 + 1) * 0.5) + 130.0) - 25.0);
v16(v15, v39);
v17 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 328LL))(v15);
if ( v17 > 300.0 )
{
v35 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 160LL);
v36 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 328LL))(v15, v17);
v35(v15, 300.0 / *v36);
}
*((_DWORD *)this + 160) = -1;
v18 = cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_closeBtn_001.png",
(const char *)0xFFFFFFFFLL);
v19 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v18, 0, (__int64)this, (__int64)TutorialLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v19, 1.6);
v20 = cocos2d::CCMenu::create(v19, nullptr);
v21 = *(float *)&v37;
*((_QWORD *)this + 69) = v20;
v22 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v39,
(float)((float)(v21 * 0.5) + -210.0) + 10.0,
(float)((float)(*((float *)&v37 + 1) * 0.5) + 130.0) - 10.0);
v22(v20, v39);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
*((_QWORD *)this + 69),
10);
v24 = ButtonSprite::create(
(ButtonSprite *)"Next",
(const char *)&qword_D8 + 4,
0,
0,
0.6,
"bigFont.fnt",
"GJ_button_01.png",
v23,
40.0);
v25 = CCMenuItemSpriteExtra::create(v24, 0, (__int64)this, (__int64)TutorialLayer::onNext, 0);
*((_QWORD *)this + 85) = v25;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v25);
v27 = ButtonSprite::create(
(ButtonSprite *)"Exit",
(const char *)&qword_D8 + 4,
0,
0,
0.6,
"bigFont.fnt",
"GJ_button_01.png",
v26,
40.0);
v28 = CCMenuItemSpriteExtra::create(v27, 0, (__int64)this, (__int64)TutorialLayer::onClose, 0);
*((_QWORD *)this + 86) = v28;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v28);
v29 = *((_QWORD *)this + 85);
v30 = *((cocos2d::CCNode **)this + 69);
v31 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v29 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v39,
(float)((float)(*(float *)&v37 * 0.5) + 210.0) - 52.0,
(float)((float)(*((float *)&v37 + 1) * 0.5) + -130.0) + 50.0);
cocos2d::CCNode::convertToNodeSpace(&v38, v30, (const cocos2d::CCPoint *)v39);
v31(v29, &v38);
v32 = *((_QWORD *)this + 86);
v33 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v32 + 184LL);
v34 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 85) + 192LL))(*((_QWORD *)this + 85));
v33(v32, v34);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 86) + 344LL))(*((_QWORD *)this + 86), 0);
*((_DWORD *)this + 168) = 0;
TutorialLayer::loadPage(this, 1u);
}
return v3;
}