//
// LevelBrowserLayer::onRemoveAllFavorites from 0x1403e8950 to 0x1403e8c43 (755 bytes)
//
// 2 xrefs:
// > LevelBrowserLayer::init @ 0x1403e31ab
// > ??> @ 0x140925028
//
// 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:44 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall LevelBrowserLayer::onRemoveAllFavorites(__int64 a1)
{
__int64 v2; // rax
char *v3; // rdi
__int64 v4; // rbx
__int64 v5; // r15
int v6; // r12d
__int64 v7; // rsi
__int64 v8; // rax
cocos2d::CCObject *v9; // rbx
char *v10; // rax
__int128 v11; // [rsp+50h] [rbp-49h] BYREF
__int64 v12; // [rsp+60h] [rbp-39h]
__int64 v13; // [rsp+68h] [rbp-31h]
__int128 *v14; // [rsp+70h] [rbp-29h]
_BYTE v15[32]; // [rsp+80h] [rbp-19h] BYREF
__int128 v16; // [rsp+A0h] [rbp+7h]
__int64 v17; // [rsp+B0h] [rbp+17h]
__int64 v18; // [rsp+B8h] [rbp+1Fh]
v16 = 0;
v17 = 0;
v18 = 15;
LOBYTE(v16) = 0;
v2 = *(_QWORD *)(a1 + 664);
if ( v2 && *(_DWORD *)(v2 + 320) == 103 )
{
v3 = (char *)sub_14003D460(0x50u);
v4 = 73;
v5 = 79;
strcpy(v3, "Remove all lists from favorites?\nSearch and folder filters apply.");
}
else
{
v3 = (char *)sub_14003D460(0x70u);
v4 = 110;
v5 = 111;
strcpy(
v3,
"Remove all levels from favorites?\nSearch and folder filters apply.\nLevels will not be deleted.");
}
*(_QWORD *)&v16 = v3;
v18 = v5;
v17 = v4;
v6 = a1 + 552;
if ( !a1 )
v6 = 0;
v11 = 0;
v12 = 0;
v13 = 0;
v7 = 0x7FFFFFFFFFFFFFFFLL;
if ( (v4 | 0xFuLL) <= 0x7FFFFFFFFFFFFFFFLL )
{
v7 = v4 | 0xF;
if ( (v4 | 0xFuLL) < 0x16 )
v7 = 22;
}
*(_QWORD *)&v11 = sub_14003D460(v7 + 1);
v12 = v4;
v13 = v7;
memcpy((void *)v11, v3, v4 + 1);
v14 = &v11;
v8 = sub_14003F4F0((__int64)v15, (__int64)&v11);
v9 = FLAlertLayer::create(
v6,
(int)"Remove Favorites",
v8,
(__int64)"Cancel",
(__int64)"Remove",
1135869952,
0,
0,
1065353216);
sub_14003D310((__int64)&v11);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 64LL))(v9, 2);
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v9 + 1064LL))(v9);
v10 = v3;
if ( (unsigned __int64)(v5 + 1) >= 0x1000 )
{
v3 = *((char **)v3 - 1);
if ( (unsigned __int64)(v10 - v3 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v3);
}