//
// MenuLayer::FLAlert_Clicked from 0x10037d010 to 0x10037d24e (574 bytes)
//
// 2 xrefs:
// > sub_10037D290 @ 0x10037d29c
// > ??> @ 0x100b27e30
//
// 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:29:07 +0000
//
void __fastcall MenuLayer::FLAlert_Clicked(__int64 a1, __int64 a2, int a3)
{
__int64 v4; // rdi
__int64 v5; // rax
__int64 v6; // rdi
__int64 v7; // rsi
int v8; // ecx
int v9; // r8d
int v10; // r9d
__int64 v11; // r14
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
const char *CString; // r14
size_t v16; // rax
size_t v17; // rbx
char *v18; // r15
__int64 v19; // rax
__int64 v20; // rdi
__int64 v21; // rax
__int64 v22; // rdi
size_t v23; // r12
__int64 v24; // rax
char *v25; // rsi
char v26; // [rsp+0h] [rbp-40h]
_QWORD __dst[2]; // [rsp+8h] [rbp-38h] BYREF
void *__p; // [rsp+18h] [rbp-28h]
if ( a3 )
{
switch ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) )
{
case 0LL:
v4 = AppDelegate::get(a2, a2);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 64LL))(v4, 1);
v5 = AppDelegate::get(v4, 1);
AppDelegate::showLoadingCircle(v5, 0, 1, 1);
v6 = cocos2d::CCDelayTime::create(0.5);
v7 = cocos2d::CCCallFunc::create(a1, MenuLayer::endGame, 0);
v11 = sub_10039EB60(v6, v7, 0, v8, v9, v10);
v12 = cocos2d::CCDirector::sharedDirector(v6, v7);
v13 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 144LL))(v12);
cocos2d::CCActionManager::addAction(v13, v11, a1, 0);
return;
case 1LL:
v20 = GameManager::sharedState();
GameManager::setGameVariable(v20, "0034");
PlatformToolbox::activateGameCenter();
if ( (unsigned __int8)PlatformToolbox::isLocalPlayerAuthenticated() )
{
v21 = GameManager::sharedState();
if ( (unsigned __int8)GameManager::getGameVariable(v21, "0034") )
{
v22 = GameManager::sharedState();
GameManager::syncPlatformAchievements(v22, (__int64)"0034");
PlatformToolbox::showAchievements();
}
else
{
MenuLayer::showGCQuestion(a1);
}
}
return;
case 2LL:
v14 = sub_10088E820("https://www.robtopgames.com/download/gj%i", v26);
CString = (const char *)cocos2d::CCString::getCString(v14);
v16 = strlen(CString);
if ( v16 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v17 = v16;
if ( v16 >= 0x17 )
{
v23 = 26;
if ( (v16 | 7) != 0x17 )
v23 = (v16 | 7) + 1;
v18 = (char *)operator new(v23);
__p = v18;
__dst[0] = v23 + 1;
__dst[1] = v17;
}
else
{
LOBYTE(__dst[0]) = 2 * v16;
v18 = (char *)__dst + 1;
if ( !v16 )
goto LABEL_16;
}
memmove(v18, CString, v17);
LABEL_16:
v18[v17] = 0;
v24 = cocos2d::CCApplication::sharedApplication();
if ( (__dst[0] & 1) != 0 )
v25 = (char *)__p;
else
v25 = (char *)__dst + 1;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 104LL))(v24, v25);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
break;
case 3LL:
v19 = cocos2d::CCApplication::sharedApplication();
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v19 + 104LL))(
v19,
"https://www.newgrounds.com/audio");
return;
default:
return;
}
}
}