//
// LevelPage::onInfo from 0x100434c80 to 0x100435188 (1288 bytes)
//
// 1 xrefs:
// > LevelSelectLayer::onInfo @ 0x100432a5a
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall LevelPage::onInfo(LevelPage *a1, cocos2d::CCObject *a2)
{
__int128 v2; // xmm0
GJGameLevel *m_level; // rdi
int v5; // ecx
char *v6; // rbx
size_t v7; // rax
size_t v8; // r14
char *v9; // r15
size_t v10; // rax
size_t v11; // r14
char *v12; // r15
cocos2d::CCString *v13; // rax
const char *CString; // rbx
size_t v15; // rax
size_t v16; // r14
char *v17; // r15
size_t v18; // r12
__int64 v19; // r14
size_t v20; // r12
__int64 v21; // r14
char *v22; // rdi
size_t v23; // r12
char *v24; // rbx
size_t v25; // rax
size_t v26; // r14
char *v27; // r15
size_t v28; // r12
__int64 v29; // rbx
LevelPage *v30; // [rsp+0h] [rbp-B0h]
_QWORD __dst[2]; // [rsp+8h] [rbp-A8h] BYREF
void *__p; // [rsp+18h] [rbp-98h]
_QWORD v33[2]; // [rsp+20h] [rbp-90h] BYREF
void *v34; // [rsp+30h] [rbp-80h]
_QWORD v35[2]; // [rsp+38h] [rbp-78h] BYREF
void *v36; // [rsp+48h] [rbp-68h]
__int128 v37; // [rsp+50h] [rbp-60h] BYREF
void *longStorage; // [rsp+60h] [rbp-50h]
_QWORD v39[2]; // [rsp+68h] [rbp-48h] BYREF
char *__s; // [rsp+78h] [rbp-38h]
char v41; // [rsp+87h] [rbp-29h]
m_level = a1->m_level;
if ( !m_level )
return;
v5 = m_level->m_levelID.random - m_level->m_levelID.seed;
if ( v5 == -2 )
{
v6 = (char *)operator new(0x78u);
strcpy(
v6,
"The path leads to an old tower. It's been left alone for years, with little reason to explore.");
v10 = strlen(v6);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(1.061491113770224e170);
v11 = v10;
if ( v10 >= 0x17 )
{
v20 = 26;
if ( (v10 | 7) != 0x17 )
v20 = (v10 | 7) + 1;
v12 = (char *)operator new(v20);
v34 = v12;
v33[0] = v20 | 1;
v33[1] = v11;
}
else
{
LOBYTE(v33[0]) = 2 * v10;
v12 = (char *)v33 + 1;
if ( !v10 )
goto LABEL_30;
}
memcpy(v12, v6, v11);
LABEL_30:
v12[v11] = 0;
v21 = FLAlertLayer::create_1(0, "The Tower", v33, "OK", 0, 360.0);
if ( (v33[0] & 1) != 0 )
operator delete(v34);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 1288LL))(v21);
goto LABEL_33;
}
if ( v5 == -1 )
{
v6 = (char *)operator new(0x50u);
strcpy(v6, "Roses are red\nViolets are blue\nWelcome to\n2.2");
v7 = strlen(v6);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(5.327551305176471e276);
v8 = v7;
if ( v7 >= 0x17 )
{
v18 = 26;
if ( (v7 | 7) != 0x17 )
v18 = (v7 | 7) + 1;
v9 = (char *)operator new(v18);
__p = v9;
__dst[0] = v18 | 1;
__dst[1] = v8;
}
else
{
LOBYTE(__dst[0]) = 2 * v7;
v9 = (char *)__dst + 1;
if ( !v7 )
goto LABEL_23;
}
memcpy(v9, v6, v8);
LABEL_23:
v9[v8] = 0;
v19 = FLAlertLayer::create_1(0, "It's a secret...", __dst, "OK", 0, 360.0);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 1288LL))(v19);
LABEL_33:
v22 = v6;
LABEL_34:
operator delete(v22);
return;
}
v30 = a1;
if ( (m_level->m_levelName.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(
&v37,
m_level->m_levelName.m_data.m_long.longStorage,
m_level->m_levelName.m_data.m_long.size,
*(double *)&v2);
m_level = v30->m_level;
}
else
{
longStorage = m_level->m_levelName.m_data.m_long.longStorage;
v2 = *(_OWORD *)&m_level->m_levelName.m_data.m_short.sizex2;
v37 = v2;
}
v41 = v37;
GJGameLevel::getNormalPercent(m_level);
v13 = (cocos2d::CCString *)sub_1007AB580(
"%s\n"
"Total Attempts: %i\n"
"Total Jumps: %i\n"
"Normal: %i%%\n"
"Practice: %i%%",
(char)v30);
CString = cocos2d::CCString::getCString(v13);
v15 = strlen(CString);
if ( v15 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v2);
v16 = v15;
if ( v15 >= 0x17 )
{
v23 = 26;
if ( (v15 | 7) != 0x17 )
v23 = (v15 | 7) + 1;
v17 = (char *)operator new(v23);
__s = v17;
v39[0] = v23 | 1;
v39[1] = v16;
goto LABEL_39;
}
LOBYTE(v39[0]) = 2 * v15;
v17 = (char *)v39 + 1;
if ( v15 )
LABEL_39:
memmove(v17, CString, v16);
v17[v16] = 0;
if ( (v37 & 1) != 0 )
operator delete(longStorage);
if ( (v39[0] & 1) != 0 )
v24 = __s;
else
v24 = (char *)v39 + 1;
v25 = strlen(v24);
if ( v25 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v2);
v26 = v25;
if ( v25 >= 0x17 )
{
v28 = 26;
if ( (v25 | 7) != 0x17 )
v28 = (v25 | 7) + 1;
v27 = (char *)operator new(v28);
v36 = v27;
v35[0] = v28 | 1;
v35[1] = v26;
goto LABEL_52;
}
LOBYTE(v35[0]) = 2 * v25;
v27 = (char *)v35 + 1;
if ( v25 )
LABEL_52:
memmove(v27, v24, v26);
v27[v26] = 0;
v29 = FLAlertLayer::create_1(0, "Level Stats", v35, "OK", 0, 300.0);
if ( (v35[0] & 1) != 0 )
operator delete(v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v29 + 1288LL))(v29);
if ( (v39[0] & 1) != 0 )
{
v22 = __s;
goto LABEL_34;
}
}