//
// GJLevelList::removeLevelFromList from 0x8578ac to 0x8579e4 (312 bytes)
//
// 2 xrefs:
// > LevelListLayer::cellPerformedAction @ 0xbaab68
// > ??> @ 0xea100
//
// This function is hookable on this platform (idp: arm, 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:55:30 +0000
//
__int64 __fastcall GJLevelList::removeLevelFromList(GJLevelList *this, GameToolbox *a2)
{
unsigned int v3; // w19
char *v4; // x3
char *v5; // x2
char *v6; // x0
int v7; // t1
__int64 v8; // x22
__int64 v10; // x22
char *v11; // x3
unsigned __int64 v12[3]; // [xsp+40h] [xbp+40h] BYREF
v3 = (unsigned int)a2;
v4 = *((char **)this + 40);
v5 = *((char **)this + 41);
if ( v4 != v5 )
{
if ( *(_DWORD *)v4 == (_DWORD)a2 )
{
LABEL_9:
v10 = v5 - (v4 + 4);
if ( v10 >> 2 )
{
v4 = (char *)memmove(v4, v4 + 4, v5 - (v4 + 4));
v5 = *((char **)this + 41);
}
v11 = &v4[v10];
if ( v11 != v5 )
*((_QWORD *)this + 41) = &v5[4 * ~((unsigned __int64)(v5 - 4 - v11) >> 2)];
GJLevelList::updateLevelsString(this);
}
else
{
v6 = v4 + 4;
while ( 1 )
{
v4 = v6;
if ( v6 == v5 )
break;
v7 = *(_DWORD *)v6;
v6 += 4;
if ( v7 == (_DWORD)a2 )
goto LABEL_9;
}
}
}
v8 = *((_QWORD *)this + 67);
GameToolbox::intToString(v12, (GameToolbox *)v3);
cocos2d::CCDictionary::removeObjectForKey(v8, v12);
if ( (v12[0] & 1) != 0 )
operator delete((void *)v12[2]);
*((_BYTE *)this + 399) = 1;
return _stack_chk_guard;
}