//
// MenuLayer::FLAlert_Clicked from 0x1003920d0 to 0x10039230e (574 bytes)
//
// 2 xrefs:
// > sub_100392350 @ 0x10039235c
// > ??> @ 0x10091fae8
//
// 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 MenuLayer::FLAlert_Clicked(MenuLayer *a1, FLAlertLayer *a2, bool a3)
{
double v3; // xmm0_8
AppDelegate *v4; // rax
AppDelegate *v5; // rax
unsigned int v6; // r14d
unsigned int v7; // esi
int v8; // ecx
int v9; // r8d
int v10; // r9d
cocos2d::CCAction *v11; // r14
cocos2d::CCDirector *v12; // rax
cocos2d::CCActionManager *v13; // rax
cocos2d::CCString *v14; // rax
const char *CString; // r14
size_t v16; // rax
size_t v17; // rbx
char *v18; // r15
cocos2d::CCApplication *v19; // rax
GameManager *v20; // rax
GameManager *v21; // rax
GameManager *v22; // rax
size_t v23; // r12
cocos2d::CCApplication *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 *)(FLAlertLayer *))a2->getTag)(a2) )
{
case 0LL:
v4 = AppDelegate::get();
((void (__fastcall *)(AppDelegate *, __int64))v4->trySaveGame)(v4, 1);
v5 = AppDelegate::get();
AppDelegate::showLoadingCircle(v5, 0, 1, 1);
v6 = (unsigned int)cocos2d::CCDelayTime::create(0.5);
v7 = (unsigned int)cocos2d::CCCallFunc::create(a1, (cocos2d::SEL_CallFunc)(unsigned __int64)MenuLayer::endGame);
v11 = (cocos2d::CCAction *)sub_1003B5760(v6, v7, 0, v8, v9, v10);
v12 = cocos2d::CCDirector::sharedDirector();
v13 = (cocos2d::CCActionManager *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v12->getActionManager)(v12);
cocos2d::CCActionManager::addAction(v13, v11, a1, 0);
return;
case 1LL:
v20 = GameManager::sharedState();
GameManager::setGameVariable(v20, "0034", 1);
PlatformToolbox::activateGameCenter();
if ( PlatformToolbox::isLocalPlayerAuthenticated() )
{
v21 = GameManager::sharedState();
if ( GameManager::getGameVariable(v21, "0034") )
{
v22 = GameManager::sharedState();
GameManager::syncPlatformAchievements(v22);
PlatformToolbox::showAchievements();
}
else
{
MenuLayer::showGCQuestion(a1);
}
}
return;
case 2LL:
v14 = (cocos2d::CCString *)sub_1007AB580("https://www.robtopgames.com/download/gj%i", v26);
CString = cocos2d::CCString::getCString(v14);
v16 = strlen(CString);
if ( v16 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
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 *)(cocos2d::CCApplication *, char *))v24->openURL)(v24, v25);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
break;
case 3LL:
v19 = cocos2d::CCApplication::sharedApplication();
((void (__fastcall *)(cocos2d::CCApplication *, const char *))v19->openURL)(
v19,
"https://www.newgrounds.com/audio");
return;
default:
return;
}
}
}