//
// LevelBrowserLayer::onRemoveAllFavorites from 0x1402ce770 to 0x1402cea36 (710 bytes)
//
// 2 xrefs:
// > LevelBrowserLayer::init @ 0x1402ca090
// > ??> @ 0x1406d2dd4
//
// 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=2
void LevelBrowserLayer::onRemoveAllFavorites(LevelBrowserLayer *a1, cocos2d::CCObject *a2)
{
int v2; // ebx
GJSearchObject *m_searchObject; // rax
char *v4; // rdi
__int64 v5; // rsi
__int64 v6; // r15
int v7; // r12d
__int64 v8; // rbx
__int64 v9; // rax
FLAlertLayer *v10; // rbx
char *v11; // rax
__int128 v12; // [rsp+50h] [rbp-49h] BYREF
__int64 v13; // [rsp+60h] [rbp-39h]
__int64 v14; // [rsp+68h] [rbp-31h]
__int128 *v15; // [rsp+70h] [rbp-29h]
_BYTE v16[32]; // [rsp+80h] [rbp-19h] BYREF
__int128 v17; // [rsp+A0h] [rbp+7h]
__int64 v18; // [rsp+B0h] [rbp+17h]
__int64 v19; // [rsp+B8h] [rbp+1Fh]
v2 = (int)a1;
v17 = 0;
v18 = 0;
v19 = 15;
LOBYTE(v17) = 0;
m_searchObject = a1->m_searchObject;
if ( m_searchObject && m_searchObject->m_searchType == FavouriteLists )
{
v4 = (char *)sub_14003AA10(0x50u);
v5 = 73;
v6 = 79;
strcpy(v4, "Remove all lists from favorites?\nSearch and folder filters apply.");
}
else
{
v4 = (char *)sub_14003AA10(0x70u);
v5 = 110;
v6 = 111;
strcpy(
v4,
"Remove all levels from favorites?\nSearch and folder filters apply.\nLevels will not be deleted.");
}
*(_QWORD *)&v17 = v4;
v19 = v6;
v18 = v5;
v7 = v2 + 552;
v12 = 0;
v13 = 0;
v8 = 0x7FFFFFFFFFFFFFFFLL;
v14 = 15;
if ( (v5 | 0xFuLL) <= 0x7FFFFFFFFFFFFFFFLL )
{
v8 = v5 | 0xF;
if ( (v5 | 0xFuLL) < 0x16 )
v8 = 22;
}
*(_QWORD *)&v12 = sub_14003AA10(v8 + 1);
v13 = v5;
v14 = v8;
memcpy((void *)v12, v4, v5 + 1);
v15 = &v12;
v9 = sub_14003BDB0((__int64)v16, (__int64)&v12);
v10 = FLAlertLayer::create(
v7,
(int)"Remove Favorites",
v9,
(__int64)"Cancel",
(__int64)"Remove",
1135869952,
0,
0,
1065353216);
sub_14003A830((__int64)&v12);
v10->setTag(v10, 2);
v10->show(v10);
v11 = v4;
if ( (unsigned __int64)(v6 + 1) >= 0x1000 )
{
v4 = *((char **)v4 - 1);
if ( (unsigned __int64)(v11 - v4 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v4);
}