//
// TutorialLayer::loadPage from 0x900474 to 0x9008b8 (1092 bytes)
//
// 3 xrefs:
// > TutorialLayer::init @ 0x900d48
// > TutorialLayer::onNext @ 0x900f60
// > ??> @ 0xe1f28
//
// 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::loadPage(TutorialLayer *this, unsigned int a2)
{
cocos2d::CCDirector *v4; // x0
cocos2d::CCDirector *v5; // x0
cocos2d::CCString *v6; // x0
cocos2d::CCSprite *CString; // x0
const char *v8; // x1
__int64 v9; // x22
__int64 (__fastcall *v10)(__int64, _BYTE *); // x21
AppDelegate *v11; // x0
void (__fastcall *v12)(__int64, _BYTE *); // x25
float v13; // s10
float v14; // s11
float v15; // s9
const char *v16; // x1
size_t v17; // x0
__int64 v18; // x23
void (__fastcall *v19)(__int64, _BYTE *); // x21
__int64 v20; // x2
char *v22; // [xsp+78h] [xbp+78h]
__int64 v23; // [xsp+88h] [xbp+88h] BYREF
_BYTE v24[8]; // [xsp+90h] [xbp+90h] BYREF
__int64 v25[2]; // [xsp+98h] [xbp+98h] BYREF
void *v26; // [xsp+A8h] [xbp+A8h]
__int64 v27[2]; // [xsp+B0h] [xbp+B0h] BYREF
void *v28; // [xsp+C0h] [xbp+C0h]
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 83) + 584LL))(*((_QWORD *)this + 83), 1);
v4 = (cocos2d::CCDirector *)TutorialLayer::removeTutorialTexture((__int64)this);
*((_DWORD *)this + 168) = a2;
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize(&v23, v5);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"tutorial_%02d.png",
(const char *)a2);
CString = (cocos2d::CCSprite *)cocos2d::CCString::getCString(v6);
v9 = cocos2d::CCSprite::create(CString, v8);
v10 = *(__int64 (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 0.0, 0.0);
v11 = (AppDelegate *)v10(v9, v24);
if ( *(_BYTE *)(AppDelegate::get(v11) + 36) )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v9 + 160LL))(v9, 2.0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 83) + 456LL))(*((_QWORD *)this + 83), v9);
v12 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v24,
(float)((float)(*(float *)&v23 * 0.5) + -210.0) + 10.0,
(float)((float)(*((float *)&v23 + 1) * 0.5) + -130.0) + 10.0);
v12(v9, v24);
v25[0] = 0;
v25[1] = 0;
v26 = nullptr;
std::string::__init(v25, &byte_11B8890, 0);
switch ( a2 )
{
case 1u:
std::string::assign(v25, "Tap the screen to jump.\nHold down to keep jumping.");
goto LABEL_4;
case 2u:
std::string::assign(v25, "Hold to fly up.\nRelease to fly down.");
goto LABEL_4;
case 3u:
std::string::assign(
v25,
"You can enter practice mode from the pause menu.\nPractice mode lets you place checkpoints.");
goto LABEL_18;
case 4u:
std::string::assign(
v25,
"You can place checkpoints manually, or use the auto-checkpoint feature.\n"
"Tap the delete button to remove your last checkpoint.");
v14 = 45.0;
v15 = 0.55;
v13 = -13.0;
break;
case 5u:
std::string::assign(
v25,
"Jump Orbs activate when you are on top of them.\n"
"Tap while touching an orb to interact with it and use its effect.");
LABEL_18:
v13 = -13.0;
v14 = 40.0;
v15 = 0.6;
break;
default:
LABEL_4:
v13 = 0.0;
v14 = 40.0;
v15 = 0.7;
break;
}
v16 = (char *)v25 + 1;
if ( (v25[0] & 1) != 0 )
v16 = (const char *)v26;
v22 = (char *)v16;
v27[0] = 0;
v27[1] = 0;
v28 = nullptr;
v17 = strlen(v16);
std::string::__init(v27, v22, v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 0.5, 1.0);
v18 = TextArea::create((char *)v27, "bigFont.fnt", (const cocos2d::CCPoint *)v24, 0, 0, 1.0, 400.0 / v15, v14);
if ( (v27[0] & 1) != 0 )
operator delete(v28);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v18 + 160LL))(v18, v15);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 83) + 456LL))(*((_QWORD *)this + 83), v18);
v19 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v18 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v24,
*(float *)&v23 * 0.5,
(float)((float)((float)(*((float *)&v23 + 1) * 0.5) + 130.0) - 75.0) + v13);
v19(v18, v24);
v20 = *((_QWORD *)this + 85);
if ( *((int *)this + 168) <= 4 )
{
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v20 + 344LL))(*((_QWORD *)this + 85), 1);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 85) + 1056LL))(*((_QWORD *)this + 85), 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 86) + 344LL))(*((_QWORD *)this + 86), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 86) + 1056LL))(*((_QWORD *)this + 86), 0);
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v20 + 344LL))(*((_QWORD *)this + 85), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 85) + 1056LL))(*((_QWORD *)this + 85), 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 86) + 344LL))(*((_QWORD *)this + 86), 1);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 86) + 1056LL))(*((_QWORD *)this + 86), 1);
}
if ( (v25[0] & 1) != 0 )
operator delete(v26);
return _stack_chk_guard;
}