//
// LevelInfoLayer::onPlay from 0x1002ac4a0 to 0x1002acd1a (2170 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x1002b1bb4
// > LevelInfoLayer::keyDown @ 0x1002b1c7f
// > sub_1002B1CA0 @ 0x1002b1ce0
// > LevelInfoLayer::init @ 0x1002aa9f7
//
// This function is hookable on this platform (idp: pc, 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:27:59 +0000
//
void __fastcall LevelInfoLayer::onPlay(_BYTE *data, const void *a2, __int64 a3)
{
__int64 v3; // rbx
__int64 v4; // rdi
__int64 v5; // rax
std::string::size_type size; // r14
unsigned __int64 v7; // xmm0_8
const char *v8; // rsi
__int64 v9; // rax
__int64 v10; // rdi
char GameVariable; // al
__int64 v12; // rdx
__int64 v13; // rcx
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rdi
double v17; // xmm0_8
__int64 v18; // rax
__int64 v19; // r14
__int64 v20; // rdi
__int64 v21; // rdx
__int64 v22; // rax
int v23; // r14d
int v24; // eax
int v25; // ecx
int v26; // r8d
int v27; // r9d
__int64 v28; // rax
__int64 v29; // rax
__int64 v30; // rdi
unsigned __int8 v31; // al
__int64 v32; // rcx
__int64 v33; // rax
_BYTE *v34; // rbx
__int64 v35; // rax
__int64 v36; // rcx
int v37; // eax
const std::string::value_type *v38; // rsi
const char *v39; // rsi
__int64 v40; // rax
char *v41; // r12
__int64 v42; // rax
double v43; // xmm0_8
char *v44; // r12
__int64 v45; // rax
double v46; // xmm0_8
char *v47; // r15
__int64 v48; // rax
__int64 v49; // rdi
double v50; // xmm0_8
char *v51; // r14
__int64 v52; // r14
__int64 v53; // rax
__int64 v54; // rbx
void *v55[3]; // [rsp+0h] [rbp-B0h] BYREF
void *v56[3]; // [rsp+18h] [rbp-98h] BYREF
void *v57[2]; // [rsp+30h] [rbp-80h] BYREF
void *v58; // [rsp+40h] [rbp-70h]
void *v59[3]; // [rsp+48h] [rbp-68h] BYREF
std::string v60; // [rsp+60h] [rbp-50h] BYREF
__int16 v61; // [rsp+78h] [rbp-38h] BYREF
char v62; // [rsp+7Ah] [rbp-36h]
float v63; // [rsp+7Ch] [rbp-34h]
__int16 v64; // [rsp+80h] [rbp-30h] BYREF
char v65; // [rsp+82h] [rbp-2Eh]
_WORD v66[22]; // [rsp+84h] [rbp-2Ch] BYREF
if ( data[488] )
return;
v3 = (__int64)data;
if ( data[645] != 1 )
return;
if ( *((_QWORD *)data + 69) )
{
v4 = cocos2d::CCDirector::sharedDirector(data, a2);
if ( *(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 192LL))(v4) + 129)
|| (data = (_BYTE *)cocos2d::CCDirector::sharedDirector(v4, a2),
*(_BYTE *)((*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)data + 192LL))(data) + 131) == 1) )
{
LevelInfoLayer::onEdit(v3);
return;
}
}
v5 = *(_QWORD *)(v3 + 504);
if ( *(_DWORD *)(v5 + 1140) == 4 )
goto LABEL_13;
if ( (*(_BYTE *)(v5 + 392) & 1) != 0 )
{
a2 = *(const void **)(v5 + 408);
data = &v60;
sub_10001AD30(&v60, a2, *(_QWORD *)(v5 + 400));
}
else
{
v60 = *(std::string *)(v5 + 392);
}
if ( (*(_BYTE *)&v60.__r_.__value_.__s.0 & 1) != 0 )
{
data = v60.__r_.__value_.__l.__data_;
size = v60.__r_.__value_.__l.__size_;
operator delete(v60.__r_.__value_.__l.__data_);
if ( !size )
{
LABEL_13:
LevelInfoLayer::downloadLevel(v3);
return;
}
}
else if ( !(*(_BYTE *)&v60.__r_.__value_.__l.0 >> 1) )
{
goto LABEL_13;
}
v7 = GameManager::sharedState(data, a2, a3).u64[0];
v8 = "0083";
v10 = v9;
GameVariable = GameManager::getGameVariable(v9, "0083");
v13 = *(_QWORD *)(v3 + 504);
if ( !GameVariable && *(_DWORD *)(v13 + 608) && !*(_BYTE *)(v13 + 1048) )
{
v14 = MusicDownloadManager::sharedState(v10);
v8 = (const char *)*(unsigned int *)(*(_QWORD *)(v3 + 504) + 608LL);
v10 = v14;
if ( !(unsigned __int8)MusicDownloadManager::isSongDownloaded(v14, v8, *(double *)&v7) )
{
LevelInfoLayer::showSongWarning(v3);
return;
}
v13 = *(_QWORD *)(v3 + 504);
}
if ( *(int *)(v13 + 964) > 0 && *(_DWORD *)(v13 + 968) == *(_DWORD *)(v13 + 972) )
{
v7 = GameManager::sharedState(v10, v8, v12).u64[0];
v8 = "0063";
v16 = v15;
if ( !(unsigned __int8)GameManager::getGameVariable(v15, "0063") )
{
GameManager::sharedState(v16, "0063", v12);
GameManager::setGameVariable(v40, "0063", 1);
sub_10000E4E0(
v55,
"This level contains unverified user coins (bronze).\n"
"The coins will not count until they become verified (silver).");
v34 = (_BYTE *)FLAlertLayer::create_1(v3 + 440, "Unverified Coins", v55, "OK", 0, 300.0);
if ( ((__int64)v55[0] & 1) != 0 )
operator delete(v55[2]);
goto LABEL_53;
}
}
if ( *(_BYTE *)(v3 + 744) )
goto LABEL_25;
v30 = *(_QWORD *)(v3 + 504);
v31 = *(_BYTE *)(v30 + 1472);
if ( (v31 & 1) != 0 )
v32 = *(_QWORD *)(v30 + 1480);
else
v32 = v31 >> 1;
if ( v32 && (*(_DWORD *)(v30 + 1520) != *(_DWORD *)(v30 + 788) || *(_DWORD *)(v30 + 1524) != 4) )
{
sub_1005839A0(v30);
v30 = *(_QWORD *)(v3 + 504);
v31 = *(_BYTE *)(v30 + 1472);
}
if ( (v31 & 1) != 0 )
v33 = *(_QWORD *)(v30 + 1480);
else
v33 = v31 >> 1;
if ( v33 )
{
sub_10000E4E0(v56, "There is a saved checkpoint for this level.\nDo you want to load it?");
v34 = (_BYTE *)FLAlertLayer::create_1(v3 + 440, "Load Save", v56, "New Game", "Load Save", 380.0);
if ( ((__int64)v56[0] & 1) != 0 )
operator delete(v56[2]);
sub_100494AC0(v34);
v34[656] = 1;
(*(void (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)v34 + 72LL))(v34, 14);
LABEL_53:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v34 + 1312LL))(v34);
return;
}
v7 = GameManager::sharedState(v30, v8, v12).u64[0];
if ( (unsigned __int8)GameManager::getGameVariable(v35, "0082")
|| (v36 = *(_QWORD *)(v3 + 504), v37 = *(_DWORD *)(v36 + 620) - *(_DWORD *)(v36 + 624), v37 < 40001)
|| *(_BYTE *)(v36 + 1200) )
{
LABEL_25:
if ( !*(_BYTE *)(v3 + 488) )
{
v17 = (*(double (__fastcall **)(__int64, _QWORD, double))(*(_QWORD *)v3 + 1072LL))(v3, 0, *(double *)&v7);
*(_BYTE *)(v3 + 488) = 1;
v18 = FMODAudioEngine::sharedEngine(v17);
FMODAudioEngine::stopAllMusic(v18, 1);
v19 = FMODAudioEngine::sharedEngine(v17);
sub_10000E4E0(v57, "playSound_01.ogg");
v20 = v19;
FMODAudioEngine::playEffect(v19, v57, 1.0, 0.0, 0.30000001);
if ( ((__int64)v57[0] & 1) != 0 )
{
v20 = (__int64)v58;
operator delete(v58);
}
GameManager::sharedState(v20, v57, v21);
*(_BYTE *)(v22 + 1136) = 1;
v23 = cocos2d::CCDelayTime::create(0.0);
v24 = cocos2d::CCCallFunc::create(v3, LevelInfoLayer::playStep2, 0);
v28 = sub_10039EB60(v23, v24, 0, v25, v26, v27);
cocos2d::CCNode::runAction(v3, v28);
v65 = 115;
v64 = 11776;
LOBYTE(v66[1]) = -38;
v66[0] = 22272;
v62 = 0;
v61 = -156;
v29 = *(_QWORD *)(v3 + 504);
if ( *(_DWORD *)(v29 + 920) - *(_DWORD *)(v29 + 924) < 100001 )
{
if ( *(_BYTE *)(v29 + 649) == 1 )
{
v65 = 23;
v64 = 5911;
memset(v66, 43, 3);
}
}
else
{
v65 = 23;
v64 = 5911;
memset(v66, 43, 3);
v62 = 0;
v61 = 13055;
}
v41 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"d_circle_01_001.png", 0.0);
(*(void (__fastcall **)(char *, __int16 *))(*(_QWORD *)v41 + 960LL))(v41, &v64);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v41 + 160LL))(v41, 1.88);
v63 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720)) * 0.5;
v42 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720));
sub_100278250((float *)&v60, v63, *(float *)(v42 + 4) * 0.5);
(*(void (__fastcall **)(char *, std::string *))(*(_QWORD *)v41 + 184LL))(v41, &v60);
v43 = (*(double (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(v3 + 720) + 464LL))(
*(_QWORD *)(v3 + 720),
v41,
4294967291LL);
v44 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"d_circle_01_001.png", v43);
(*(void (__fastcall **)(char *, __int16 *))(*(_QWORD *)v44 + 960LL))(v44, &v64);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v44 + 160LL))(v44, 1.63);
v63 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720)) * 0.5;
v45 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720));
sub_100278250((float *)&v60, v63, *(float *)(v45 + 4) * 0.5);
(*(void (__fastcall **)(char *, std::string *))(*(_QWORD *)v44 + 184LL))(v44, &v60);
v46 = (*(double (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(v3 + 720) + 464LL))(
*(_QWORD *)(v3 + 720),
v44,
4294967294LL);
v47 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"d_circle_01_001.png", v46);
(*(void (__fastcall **)(char *, _WORD *))(*(_QWORD *)v47 + 960LL))(v47, v66);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v47 + 160LL))(v47, 1.75);
v63 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720)) * 0.5;
v48 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720));
sub_100278250((float *)&v60, v63, *(float *)(v48 + 4) * 0.5);
(*(void (__fastcall **)(char *, std::string *))(*(_QWORD *)v47 + 184LL))(v47, &v60);
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(v3 + 720) + 464LL))(
*(_QWORD *)(v3 + 720),
v47,
4294967292LL);
v49 = *(_QWORD *)(v3 + 720);
memset(&v60, 125, 3);
v50 = (*(double (__fastcall **)(__int64, std::string *))(*(_QWORD *)v49 + 960LL))(v49, &v60);
v51 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"d_circle_01_001.png", v50);
(*(void (__fastcall **)(char *, __int16 *))(*(_QWORD *)v51 + 960LL))(v51, &v61);
v52 = cocos2d::CCProgressTimer::create(v51);
*(_QWORD *)(v3 + 728) = v52;
v63 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720)) * 0.5;
v53 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 720) + 328LL))(*(_QWORD *)(v3 + 720));
sub_100278250((float *)&v60, v63, 0.5 * *(float *)(v53 + 4));
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v52 + 184LL))(v52, &v60);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(v3 + 728) + 160LL))(*(_QWORD *)(v3 + 728), 1.75);
cocos2d::CCProgressTimer::setPercentage(*(_QWORD *)(v3 + 728), 0.0);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(v3 + 720) + 464LL))(
*(_QWORD *)(v3 + 720),
*(_QWORD *)(v3 + 728),
4294967293LL);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v3 + 496) + 1000LL))(*(_QWORD *)(v3 + 496), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(v3 + 736) + 344LL) + 1000LL))(
*(_QWORD *)(*(_QWORD *)(v3 + 736) + 344LL),
0);
}
return;
}
memset(&v60, 0, sizeof(v60));
v38 = "This level has a high object count and can be unstable on some devices. This may affect perf"
"ormance, load time etc.";
if ( (unsigned int)v37 >= 0x13881 )
v38 = "This level has a VERY HIGH object count and can be unstable on some devices. This may affect <"
"cg>performance, load time etc.";
std::string::assign(&v60, v38);
if ( (*(_BYTE *)&v60.__r_.__value_.__s.0 & 1) != 0 )
v39 = v60.__r_.__value_.__l.__data_;
else
v39 = v60.__r_.__value_.__s.__data_;
sub_10000E4E0(v59, v39);
v54 = FLAlertLayer::create_1(v3 + 440, "High Objects", v59, "Cancel", "Play", 380.0);
if ( ((__int64)v59[0] & 1) != 0 )
operator delete(v59[2]);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v54 + 72LL))(v54, 10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v54 + 1312LL))(v54);
if ( (*(_BYTE *)&v60.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v60.__r_.__value_.__l.__data_);
}