//
// LevelBrowserLayer::setupLevelBrowser from 0x7f8414 to 0x7f8704 (752 bytes)
//
// 8 xrefs:
// > LevelBrowserLayer::loadPage @ 0x7f9088
// > LevelBrowserLayer::loadLevelsFinished @ 0x7fced8
// > LevelBrowserLayer::onEnter @ 0x7fd0a8
// > LevelListLayer::setIDPopupClosed @ 0xba97d8
// > LevelListLayer::cellPerformedAction @ 0xbaab18
// > LevelListLayer::init @ 0xbafa3c
// > LevelListLayer::onRefreshLevelList @ 0xbb08f8
// > ??> @ 0x65470
//
// 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:54:39 +0000
//
__int64 __fastcall LevelBrowserLayer::setupLevelBrowser(LevelBrowserLayer *this, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
__int64 v5; // x0
cocos2d::CCTouchDispatcher *v6; // x0
cocos2d::CCDirector *v7; // x0
int v8; // w0
float v9; // s8
_DWORD *v10; // x2
unsigned int v11; // w0
int v12; // w3
__int64 v13; // x22
char *v14; // x1
__int64 v15; // x1
__int64 v16; // x22
void (__fastcall *v17)(__int64, _BYTE *); // x20
_BOOL8 v19; // [xsp+48h] [xbp+48h]
int v20; // [xsp+48h] [xbp+48h]
__int64 v21; // [xsp+50h] [xbp+50h] BYREF
_BYTE v22[8]; // [xsp+58h] [xbp+58h] BYREF
__int64 v23[2]; // [xsp+60h] [xbp+60h] BYREF
void *v24; // [xsp+70h] [xbp+70h]
v4 = *((cocos2d::CCDirector **)this + 76);
if ( v4 )
{
v5 = cocos2d::CCDirector::sharedDirector(v4);
v6 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 160LL))(v5);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v6, *((cocos2d::CCObject **)this + 76));
v4 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 76) + 536LL))(*((_QWORD *)this + 76));
*((_QWORD *)this + 76) = 0;
}
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize(&v21, v7);
v8 = *((_DWORD *)this + 192);
if ( v8 <= 0 )
v9 = 220.0;
else
v9 = (float)v8;
v10 = *((_DWORD **)this + 83);
v11 = v10[79];
if ( v10[108] == 1 )
{
v12 = 25;
if ( v11 == 102 )
goto LABEL_24;
}
else if ( v11 == 26 )
{
v20 = v10[105];
a2 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(LevelBrowserLayer *, cocos2d::CCArray *))(*(_QWORD *)this
+ 1368LL))(
this,
a2);
v12 = v20;
}
else if ( v11 <= 0x1A )
{
if ( v11 == 14 )
{
v12 = 12;
}
else
{
if ( v11 != 25 )
{
v12 = 13;
if ( v11 == 9 )
goto LABEL_12;
goto LABEL_22;
}
a2 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(LevelBrowserLayer *, cocos2d::CCArray *))(*(_QWORD *)this
+ 1368LL))(
this,
a2);
v12 = 26;
}
}
else if ( v11 == 101 )
{
v12 = 20;
}
else
{
if ( v11 > 0x65 )
{
if ( v11 != 102 )
{
v12 = 25;
if ( v11 == 103 )
goto LABEL_12;
LABEL_22:
v12 = 4;
goto LABEL_12;
}
LABEL_24:
if ( *((_BYTE *)this + 748) )
v12 = 28;
else
v12 = 27;
if ( a2 )
goto LABEL_13;
goto LABEL_28;
}
v12 = 5;
if ( v11 != 98 )
v12 = 4;
}
LABEL_12:
if ( a2 )
{
LABEL_13:
v13 = CustomListView::create(a2, (int)this + 576, 0, v12, v9, 356.0, *((float *)this + 194));
goto LABEL_14;
}
LABEL_28:
v13 = 0;
LABEL_14:
v19 = (unsigned int)(*(_DWORD *)(*((_QWORD *)this + 83) + 316LL) - 25) <= 1;
LevelBrowserLayer::getSearchTitle(this, v23);
v14 = (char *)v23 + 1;
if ( (v23[0] & 1) != 0 )
v14 = (char *)v24;
v15 = GJListLayer::create(v13, v14, 4282282687LL, v19, 356.0, v9);
*((_QWORD *)this + 76) = v15;
if ( (v23[0] & 1) != 0 )
{
operator delete(v24);
v15 = *((_QWORD *)this + 76);
}
(*(void (__fastcall **)(LevelBrowserLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v15);
v16 = *((_QWORD *)this + 76);
v17 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v16 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v22,
(float)(*(float *)&v21 - 356.0) * 0.5,
(float)((float)((float)((float)(*((float *)&v21 + 1) - v9) * 0.5) + -10.0) + 5.0) + *((float *)this + 193));
v17(v16, v22);
return _stack_chk_guard;
}