//
// ClearPlatformerSavesPopup::FLAlert_Clicked from 0x1008b4f50 to 0x1008b50e3 (403 bytes)
//
// 2 xrefs:
// > sub_1008B5130 @ 0x1008b513c
// > ??> @ 0x100badb30
//
// 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:37:23 +0000
//
void __fastcall ClearPlatformerSavesPopup::FLAlert_Clicked(__int64 a1, __int64 a2, unsigned __int8 a3, double a4)
{
__int64 v4; // rax
int v5; // r14d
const char *v6; // rdx
char *v7; // rax
const char *CString; // r14
size_t v9; // rax
size_t v10; // rbx
char *v11; // r15
char v12; // r14
size_t v13; // r12
char *v14; // rbx
__int128 v15; // [rsp+0h] [rbp-50h] BYREF
void *__p; // [rsp+10h] [rbp-40h]
__int128 __dst; // [rsp+18h] [rbp-38h] BYREF
void *v18; // [rsp+28h] [rbp-28h]
if ( a3 ^ 1 | ((*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) != 1) )
return;
v4 = GameLevelManager::sharedState();
v5 = sub_10054BDE0(a4, v4, *(unsigned __int8 *)(a1 + 672));
sub_1008B4B80(a1, a4);
v6 = "s";
if ( v5 == 1 )
v6 = "";
v7 = sub_10088E820("Cleared %i platformer save%s.", v5, v6);
CString = (const char *)cocos2d::CCString::getCString((__int64)v7);
v9 = strlen(CString);
if ( v9 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v10 = v9;
if ( v9 >= 0x17 )
{
v13 = 26;
if ( (v9 | 7) != 0x17 )
v13 = (v9 | 7) + 1;
v11 = (char *)operator new(v13);
v18 = v11;
*(_QWORD *)&__dst = v13 + 1;
*((_QWORD *)&__dst + 1) = v10;
LABEL_12:
memmove(v11, CString, v10);
v11[v10] = 0;
v12 = __dst;
if ( (__dst & 1) == 0 )
goto LABEL_8;
LABEL_13:
sub_10001AD30(&v15, v18, *((unsigned __int64 *)&__dst + 1));
goto LABEL_14;
}
LOBYTE(__dst) = 2 * v9;
v11 = (char *)&__dst + 1;
if ( v9 )
goto LABEL_12;
BYTE1(__dst) = 0;
v12 = __dst;
if ( (__dst & 1) != 0 )
goto LABEL_13;
LABEL_8:
__p = v18;
v15 = __dst;
LABEL_14:
v14 = FLAlertLayer::create_1(0, (int)"Cleared", (__int64)&v15, (int)"OK", 0, 300.0);
if ( (v15 & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(char *))(*(_QWORD *)v14 + 1312LL))(v14);
if ( (v12 & 1) != 0 )
operator delete(v18);
}