//
// LevelBrowserLayer::onProcessSelected from 0x100482c70 to 0x100482e26 (438 bytes)
//
// 1 xrefs:
// > LevelBrowserLayer::init @ 0x100481435
//
// 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:30:41 +0000
//
void __fastcall LevelBrowserLayer::onProcessSelected(__int64 a1, __int64 a2)
{
__int64 v2; // rax
unsigned int *v3; // rax
__int64 v4; // rcx
__int64 *v5; // rax
unsigned __int64 v6; // rcx
int v7; // r15d
__int64 v8; // rdx
__int64 v9; // rax
const char *CString; // r12
size_t v11; // rax
size_t v12; // r15
char *v13; // r13
size_t v14; // r12
__int64 *v15; // r14
unsigned int v16; // eax
char v17; // [rsp+0h] [rbp-50h]
const char *v18; // [rsp+8h] [rbp-48h]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v2 = *(_QWORD *)(a1 + 656);
if ( !v2 )
return;
v3 = *(unsigned int **)(v2 + 56);
v4 = *v3;
if ( !*v3 )
return;
v5 = *((__int64 **)v3 + 2);
v6 = (unsigned __int64)&v5[v4 - 1];
v7 = 0;
do
{
v8 = *v5;
if ( !*v5 )
break;
v8 = *(unsigned __int8 *)(v8 + 771);
v7 += v8;
++v5;
}
while ( (unsigned __int64)v5 <= v6 );
if ( v7 <= 0
|| (*(unsigned int (__fastcall **)(__int64, __int64, __int64, unsigned __int64))(*(_QWORD *)a2 + 64LL))(
a2,
a2,
v8,
v6) != 5 )
{
return;
}
v9 = sub_10088E820("Are you sure you want to delete the %i selected levels?", v17);
CString = (const char *)cocos2d::CCString::getCString(v9);
v11 = strlen(CString);
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v12 = v11;
if ( v11 >= 0x17 )
{
v18 = CString;
v14 = 26;
if ( (v11 | 7) != 0x17 )
v14 = (v11 | 7) + 1;
v13 = (char *)operator new(v14);
__p = v13;
__dst[0] = v14 + 1;
CString = v18;
__dst[1] = v12;
}
else
{
LOBYTE(__dst[0]) = 2 * v11;
v13 = (char *)__dst + 1;
if ( !v11 )
goto LABEL_16;
}
memmove(v13, CString, v12);
LABEL_16:
v13[v12] = 0;
v15 = (__int64 *)FLAlertLayer::create(a1 + 552, "Delete", __dst, "Back", "Delete", 0, 380.0, 0.0, 1.0);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
if ( v15 )
{
ButtonSprite::updateBGImage(v15[77], (__int64)"GJ_button_06.png");
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
(*(void (__fastcall **)(__int64 *, _QWORD))(*v15 + 72))(v15, v16);
(*(void (__fastcall **)(__int64 *))(*v15 + 1312))(v15);
}
}