//
// MenuLayer::FLAlert_Clicked from 0x140336150 to 0x14033635a (522 bytes)
//
// 2 xrefs:
// > ??> @ 0x1405ab270
// > ??> @ 0x1406d5210
//
// 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
//
// Hidden C++ exception states: #wind=10
void MenuLayer::FLAlert_Clicked(MenuLayer *a1, FLAlertLayer *a2, bool a3)
{
int v4; // eax
__int64 v5; // rdx
__int64 v6; // rcx
int v7; // eax
int v8; // eax
__int64 v9; // rax
cocos2d::CCString *v10; // rax
const char *CString; // rax
size_t v12; // r8
__int64 v13; // rdx
__int64 v14; // rcx
__int64 v15; // rax
void **v16; // rdx
void *v17; // rcx
GameManager *v18; // rcx
__int64 v19; // rdx
__int64 v20; // rcx
__int64 v21; // rax
__int64 v22; // rdx
__int64 v23; // rdx
__int64 v24; // rcx
struct cocos2d::CCDelayTime *v25; // rbx
__int64 v26; // rax
struct cocos2d::CCSequence *v27; // rbx
__int64 v28; // rcx
__int64 v29; // rax
GameManager *v30; // rax
bool v31; // [rsp+20h] [rbp-38h]
void *v32; // [rsp+20h] [rbp-38h]
void *Block[2]; // [rsp+28h] [rbp-30h] BYREF
__int64 v34; // [rsp+38h] [rbp-20h]
unsigned __int64 v35; // [rsp+40h] [rbp-18h]
if ( a3 )
{
v4 = a2->getTag(a2);
if ( v4 )
{
v7 = v4 - 1;
if ( v7 )
{
v8 = v7 - 1;
if ( v8 )
{
if ( v8 == 1 )
{
v9 = cocos2d::CCApplication::sharedApplication(v6, v5);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v9 + 88LL))(
v9,
"https://www.newgrounds.com/audio");
}
}
else
{
v10 = cocos2d::CCString::createWithFormat("https://www.robtopgames.com/download/gj%i", 0);
CString = cocos2d::CCString::getCString(v10);
*(_OWORD *)Block = 0;
v34 = 0;
v35 = 0;
v12 = -1;
do
++v12;
while ( CString[v12] );
sub_14003A930(Block, CString, v12);
v15 = cocos2d::CCApplication::sharedApplication(v14, v13);
v16 = Block;
if ( v35 > 0xF )
v16 = (void **)Block[0];
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v15 + 88LL))(v15, v16);
if ( v35 > 0xF )
{
v17 = Block[0];
if ( v35 + 1 >= 0x1000 )
{
v17 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v17);
}
}
}
else
{
v18 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v32 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v18 = (GameManager *)qword_1406C2ED8;
}
GameManager::setGameVariable(v18, "0034", 1);
}
}
else
{
*(_BYTE *)(cocos2d::CCApplication::sharedApplication(v6, v5) + 121) = 1;
v21 = cocos2d::CCApplication::sharedApplication(v20, v19);
LOBYTE(v22) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v21 + 48LL))(v21, v22);
cocos2d::CCApplication::sharedApplication(v24, v23);
v25 = cocos2d::CCDelayTime::create(0.5);
v26 = cocos2d::CCCallFunc::create(&a1[-1].m_fVertexZ, MenuLayer::endGame);
v27 = cocos2d::CCSequence::create(v25, v26, 0);
v29 = cocos2d::CCDirector::sharedDirector(v28);
v30 = (GameManager *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v29 + 128LL))(v29);
cocos2d::CCActionManager::addAction(v30, v27, (MenuLayer *)((char *)a1 - 408), 0, v31);
}
}
}