//
// TutorialLayer::loadPage from 0x10025327c to 0x100253600 (900 bytes)
//
// 2 xrefs:
// > TutorialLayer::init @ 0x1002531e4
// > sub_100253264 @ 0x100253278
//
// 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 11:01:32 +0000
//
void __fastcall TutorialLayer::loadPage(__int64 a1, int a2)
{
__int64 v4; // x0
__int64 v5; // x0
__int64 CString; // x0
__int64 v7; // x21
float v8; // s10
__int64 v9; // x0
float v10; // s8
float v11; // s9
const std::string::value_type *v12; // x1
const std::string::value_type *v13; // x1
int v14; // w8
std::string *v15; // x1
void *v16; // x20
int v17; // w20
double v18; // [xsp+10h] [xbp-80h] BYREF
void *__p[2]; // [xsp+18h] [xbp-78h] BYREF
char v20; // [xsp+2Fh] [xbp-61h]
std::string v21; // [xsp+30h] [xbp-60h] BYREF
__int64 v22; // [xsp+48h] [xbp-48h] BYREF
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 664) + 584LL))(*(_QWORD *)(a1 + 664), 1);
sub_10025363C(a1);
*(_DWORD *)(a1 + 672) = a2;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v4, &v22);
v5 = sub_1003065B0("tutorial_%02d.png", a2);
CString = cocos2d::CCString::getCString(v5);
v7 = cocos2d::CCSprite::create(CString);
v8 = 0.0;
sub_1000262BC((float *)&v21, 0.0, 0.0);
v9 = (*(__int64 (__fastcall **)(__int64, std::string *))(*(_QWORD *)v7 + 296LL))(v7, &v21);
if ( *(_BYTE *)(AppDelegate::get(v9) + 36) == 1 )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 160LL))(v7, 2.0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 664) + 456LL))(*(_QWORD *)(a1 + 664), v7);
sub_1000262BC(
(float *)&v21,
(float)((float)(*(float *)&v22 * 0.5) + -210.0) + 10.0,
(float)((float)(*((float *)&v22 + 1) * 0.5) + -130.0) + 10.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v7 + 184LL))(v7, &v21);
sub_100009900(&v21, "");
v10 = 0.7;
v11 = 40.0;
if ( a2 <= 2 )
{
if ( a2 == 1 )
{
v13 = "Tap the screen to jump.\nHold down to keep jumping.";
}
else
{
if ( a2 != 2 )
goto LABEL_18;
v13 = "Hold to fly up.\nRelease to fly down.";
}
std::string::assign(&v21, v13);
goto LABEL_16;
}
if ( a2 == 3 )
{
v12 = "You can enter practice mode from the pause menu.\nPractice mode lets you place checkpoints.";
LABEL_12:
std::string::assign(&v21, v12);
v8 = -13.0;
v10 = 0.6;
LABEL_16:
v14 = 1109393408;
goto LABEL_17;
}
if ( a2 != 4 )
{
if ( a2 != 5 )
goto LABEL_18;
v12 = "Jump Orbs activate when you are on top of them.\n"
"Tap while touching an orb to interact with it and use its effect.";
goto LABEL_12;
}
std::string::assign(
&v21,
"You can place checkpoints manually, or use the auto-checkpoint feature.\n"
"Tap the delete button to remove your last checkpoint.");
v8 = -13.0;
v10 = 0.55;
v14 = 1110704128;
LABEL_17:
v11 = *(float *)&v14;
LABEL_18:
if ( (v21.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v15 = &v21;
else
v15 = (std::string *)v21.__r_.__value_.__r.__words[0];
sub_100009900(__p, (char *)v15);
sub_1000262BC((float *)&v18, 0.5, 1.0);
v16 = TextArea::create((__int64)__p, (__int64)"bigFont.fnt", &v18, 0, 0, 1.0, 400.0 / v10, v11);
if ( v20 < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v16 + 160LL))(v16, v10);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 664) + 456LL))(*(_QWORD *)(a1 + 664), v16);
sub_1000262BC(
(float *)&v18,
*(float *)&v22 * 0.5,
v8 + (float)((float)((float)(*((float *)&v22 + 1) * 0.5) + 130.0) + -75.0));
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v16 + 184LL))(v16, &v18);
v17 = *(_DWORD *)(a1 + 672);
(*(void (**)(void))(**(_QWORD **)(a1 + 680) + 344LL))();
if ( v17 < 5 )
{
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 680) + 1056LL))(*(_QWORD *)(a1 + 680), 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 344LL))(*(_QWORD *)(a1 + 688), 0);
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 680) + 1056LL))(*(_QWORD *)(a1 + 680), 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 688) + 344LL))(*(_QWORD *)(a1 + 688), 1);
}
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 688) + 1056LL))(*(_QWORD *)(a1 + 688), v17 > 4);
if ( SHIBYTE(v21.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v21.__r_.__value_.__l.__data_);
}