//
// LevelBrowserLayer::FLAlert_Clicked from 0x1403ea2a0 to 0x1403eaa60 (1984 bytes)
//
// 3 xrefs:
// > LevelListLayer::FLAlert_Clicked @ 0x14042f383
// > ??> @ 0x140789a70
// > ??> @ 0x14092513c
//
// 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 11:31:45 +0000
//
// Hidden C++ exception states: #wind=10
void __fastcall LevelBrowserLayer::FLAlert_Clicked(_QWORD *a1, __int64 a2, char a3)
{
unsigned int v5; // edi
char v6; // r14
int v7; // eax
__int64 v8; // rcx
int v9; // eax
int v10; // eax
int v11; // eax
cocos2d::CCObject *v12; // rsi
int v13; // ebx
__int64 v14; // r13
int v15; // r14d
int Stat; // eax
cocos2d::CCString *v17; // rax
const char *CString; // rax
size_t v19; // r8
__int64 v20; // rbx
struct cocos2d::CCString *v21; // rax
void *v22; // rcx
int v23; // ecx
__int64 v24; // rdx
__int64 *i; // r8
__int64 v26; // r9
__int64 v27; // rax
__int64 v28; // rax
__int64 v29; // rcx
__int64 v30; // rax
unsigned int *v31; // rcx
__int64 v32; // rax
__int64 *v33; // rcx
__int64 v34; // rax
__int64 v35; // rax
int v36; // ebx
__int64 v37; // rcx
cocos2d::CCArray *SavedLevelLists; // rbx
unsigned int *v39; // rsi
__int64 v40; // rcx
__int64 v41; // rbx
__int64 v42; // rdx
__int64 v43; // rcx
__int64 v44; // r8
__int64 v45; // r9
struct cocos2d::CCScene *v46; // rdi
__int64 v47; // rcx
cocos2d::CCObject *v48; // rax
struct cocos2d::CCScene *v49; // rbx
__int64 v50; // rcx
cocos2d::CCDirector *v51; // rax
__int64 v52; // rcx
cocos2d::CCArray *v53; // rbx
__int64 v54; // rdx
bool v55; // si
__int64 v56; // rax
int v57; // ebx
__int64 v58; // rcx
cocos2d::CCArray *SavedLevels; // rsi
__int64 v60; // rdx
bool v61; // bl
struct cocos2d::CCObject *v62; // rbx
_QWORD *v63; // rcx
__int64 v64; // rcx
void *v65; // [rsp+30h] [rbp-29h]
void *v66; // [rsp+30h] [rbp-29h]
void *v67; // [rsp+30h] [rbp-29h]
void *v68; // [rsp+30h] [rbp-29h]
void *v69; // [rsp+30h] [rbp-29h]
void *v70; // [rsp+30h] [rbp-29h]
void *v71; // [rsp+30h] [rbp-29h]
void *v72; // [rsp+38h] [rbp-21h]
__int128 v73; // [rsp+40h] [rbp-19h] BYREF
__int64 v74; // [rsp+50h] [rbp-9h]
__int64 v75; // [rsp+58h] [rbp-1h]
void *Block[2]; // [rsp+60h] [rbp+7h] BYREF
__int64 v77; // [rsp+70h] [rbp+17h]
unsigned __int64 v78; // [rsp+78h] [rbp+1Fh]
v5 = 0;
v6 = 0;
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) - 1;
if ( !v7 )
{
if ( !a3 )
return;
v56 = a1[14];
if ( v56 )
v57 = *(_DWORD *)(v56 + 452);
else
v57 = 0;
v58 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v69 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v69);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v58 = *(_QWORD *)&qword_14090BFB0;
}
SavedLevels = GameLevelManager::getSavedLevels(v58, 0, v57);
v60 = a1[14];
v61 = false;
if ( v60 )
{
sub_14003F4F0((__int64)&v73, v60 + 328);
v6 = 5;
if ( v74 )
v61 = true;
}
if ( (v6 & 1) != 0 )
sub_14003D310((__int64)&v73);
if ( v61 )
{
sub_14003F4F0((__int64)&v73, a1[14] + 328LL);
SavedLevels = sub_1403E91C0((__int64)(a1 - 69), (__int64)SavedLevels, &v73);
}
if ( cocos2d::CCArray::count(SavedLevels) )
{
do
{
v62 = cocos2d::CCArray::objectAtIndex(SavedLevels, v5);
if ( !*((_BYTE *)v62 + 984) )
{
v63 = *(_QWORD **)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v70 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v70);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v63 = *(_QWORD **)&qword_14090BFB0;
}
GameLevelManager::deleteLevel(v63, v62);
}
++v5;
}
while ( v5 < cocos2d::CCArray::count(SavedLevels) );
}
v64 = qword_14090C070;
if ( !qword_14090C070 )
{
v71 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v71);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v64 = qword_14090C070;
}
MusicDownloadManager::clearUnusedSongs(v64);
goto LABEL_89;
}
v9 = v7 - 1;
if ( !v9 )
{
if ( !a3 )
return;
v35 = a1[14];
if ( v35 )
{
v36 = *(_DWORD *)(v35 + 452);
if ( *(_DWORD *)(v35 + 320) == 103 )
{
v37 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v66 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v66);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v37 = *(_QWORD *)&qword_14090BFB0;
}
SavedLevelLists = GameLevelManager::getSavedLevelLists(v37, v36);
if ( cocos2d::CCArray::count(SavedLevelLists) )
{
do
{
v39 = (unsigned int *)cocos2d::CCArray::objectAtIndex(SavedLevelLists, v5);
v40 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v67 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v67);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v40 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::deleteLevelList(v40, v39);
++v5;
}
while ( v5 < cocos2d::CCArray::count(SavedLevelLists) );
}
(*(void (__fastcall **)(_QWORD *, _QWORD))(*(a1 - 69) + 992LL))(a1 - 69, 0);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*(a1 - 69) + 1008LL))(a1 - 69, 0);
v41 = a1[14];
v46 = (struct cocos2d::CCScene *)cocos2d::CCScene::create(v43, v42, v44, v45);
*(_QWORD *)(cocos2d::CCApplication::sharedApplication(v47) + 232) = v46;
v48 = LevelBrowserLayer::create(v41);
(*(void (__fastcall **)(struct cocos2d::CCScene *, cocos2d::CCObject *))(*(_QWORD *)v46 + 464LL))(v46, v48);
v49 = cocos2d::CCTransitionFade::create(0.5, v46);
v51 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v50);
cocos2d::CCDirector::replaceScene(v51, v49);
return;
}
}
else
{
v36 = 0;
}
v52 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v68 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v68);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v52 = *(_QWORD *)&qword_14090BFB0;
}
v53 = GameLevelManager::getSavedLevels(v52, 1, v36);
v54 = a1[14];
v55 = false;
if ( v54 )
{
sub_14003F4F0((__int64)&v73, v54 + 328);
v6 = 18;
if ( v74 )
v55 = true;
}
if ( (v6 & 2) != 0 )
sub_14003D310((__int64)&v73);
if ( v55 )
{
sub_14003F4F0((__int64)&v73, a1[14] + 328LL);
v53 = sub_1403E91C0((__int64)(a1 - 69), (__int64)v53, &v73);
}
if ( cocos2d::CCArray::count(v53) )
{
do
*((_BYTE *)cocos2d::CCArray::objectAtIndex(v53, v5++) + 984) = 0;
while ( v5 < cocos2d::CCArray::count(v53) );
}
LABEL_89:
(*(void (__fastcall **)(_QWORD *, _QWORD))(*(a1 - 69) + 992LL))(a1 - 69, 0);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*(a1 - 69) + 1008LL))(a1 - 69, 0);
LevelBrowserLayer::onSaved(a1 - 69);
return;
}
v10 = v9 - 3;
if ( v10 )
{
v11 = v10 - 1;
if ( v11 )
{
if ( v11 == 1 )
{
v12 = (cocos2d::CCObject *)a1[35];
if ( v12 )
{
if ( a3 )
{
v13 = *((_DWORD *)v12 + 248) - *((_DWORD *)v12 + 249);
v14 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v72 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v72);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v14 = qword_14090BFE0;
}
if ( v13 > 0 && !(unsigned __int8)GameStatsManager::isDailyRecall(v14, v13) )
{
if ( v13 <= 200000 )
{
v15 = 1;
if ( v13 > 100000 )
v15 = 3;
}
else
{
v15 = 5;
}
Stat = GameStatsManager::getStat(v14, &word_140737620);
if ( Stat >= v15 )
{
GameStatsManager::setStat(v14, &word_140737620, Stat - v15);
v17 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v13);
CString = cocos2d::CCString::getCString(v17);
*(_OWORD *)Block = 0;
v77 = 0;
v78 = 0;
v19 = -1;
do
++v19;
while ( CString[v19] );
sub_14003D230(Block, CString, v19);
v20 = *(_QWORD *)(v14 + 856);
v21 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v15);
cocos2d::CCDictionary::setObject(v20, v21, Block);
if ( v78 > 0xF )
{
v22 = Block[0];
if ( v78 + 1 >= 0x1000 )
{
v22 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v22 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v22);
}
v77 = 0;
v78 = 15;
LOBYTE(Block[0]) = 0;
HIWORD(v73) = 0;
v74 = 13;
v75 = 15;
strcpy((char *)&v73, "buyItem03.ogg");
v23 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v65 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v65);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v23 = qword_14090BF60;
}
FMODAudioEngine::playEffect_1(v23, (__int64)&v73);
v26 = (unsigned int)(*((_DWORD *)v12 + 248) - *((_DWORD *)v12 + 249));
v27 = a1[7];
if ( v27 )
{
v28 = *(_QWORD *)(v27 + 544);
if ( v28 )
{
v29 = *(_QWORD *)(v28 + 424);
if ( v29 )
{
v30 = *(_QWORD *)(v29 + 584);
if ( v30 )
{
v31 = *(unsigned int **)(v30 + 56);
v32 = *v31;
if ( (_DWORD)v32 )
{
v33 = *((__int64 **)v31 + 2);
for ( i = &v33[v32 - 1]; v33 <= i; ++v33 )
{
v24 = *v33;
if ( !*v33 )
break;
if ( *(_DWORD *)(*(_QWORD *)(v24 + 568) + 1412LL) == (_DWORD)v26 )
{
LevelCell::playRecallUnlock(*v33);
goto LABEL_36;
}
}
}
}
}
}
}
LevelBrowserLayer::reloadPageRows(a1 - 69, v24, i, v26);
}
}
}
LABEL_36:
a1[35] = 0;
cocos2d::CCObject::release(v12);
}
}
}
else if ( a3 )
{
v34 = cocos2d::CCApplication::sharedApplication(v8);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v34 + 96LL))(v34, "https://www.boomlings.com/GDRating");
}
}
else if ( a3 )
{
LevelBrowserLayer::deleteSelected((__int64)(a1 - 69));
}
}