//
// MusicBrowser::setupList from 0xb84fbc to 0xb85550 (1428 bytes)
//
// 8 xrefs:
// > MusicBrowser::onPage @ 0xb855f0
// > MusicBrowser::sortSelectClosed @ 0xb85654
// > MusicBrowser::FLAlert_Clicked @ 0xb856b0
// > MusicBrowser::onToggleView @ 0xb85744
// > MusicBrowser::onToggleSearch @ 0xb85984
// > MusicBrowser::setupMusicBrowser @ 0xb85a3c
// > MusicBrowser::textChanged @ 0xb87410
// > ??> @ 0x71ec0
//
// 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 13:02:30 +0000
//
__int64 __fastcall MusicBrowser::setupList(MusicBrowser *this, MusicSearchResult *a2)
{
unsigned __int64 v4; // x0
int v5; // w19
__int64 v6; // x0
cocos2d::CCString *v7; // x0
const char *CString; // x0
size_t v9; // x0
__int64 v10; // x1
void (__fastcall *v11)(MusicBrowser *, __int64, __int64); // x23
__int64 v12; // x0
MusicDownloadManager *v13; // x0
MusicDownloadManager *v14; // x0
int v15; // w1
unsigned int *v16; // x0
const char *v17; // x22
__int64 v18; // x3
__int64 v19; // x2
int v20; // w1
cocos2d::CCString *v21; // x0
const char *v22; // x0
size_t v23; // x0
char *v24; // x1
cocos2d::CCDirector *v25; // x0
__int64 v26; // x0
cocos2d::CCTouchDispatcher *v27; // x0
cocos2d::CCObject *v28; // x0
cocos2d::CCDirector *v29; // x0
cocos2d::CCArray *WinSize; // x0
cocos2d::CCArray *v31; // x21
__int64 v32; // x0
signed int v33; // w19
signed int v34; // w22
signed int v35; // w23
cocos2d::CCObject *v36; // x0
__int64 v37; // x0
cocos2d::CCLayerColor *v38; // x0
__int64 v39; // x3
__int64 v40; // x21
void (__fastcall *v41)(__int64, _BYTE *); // x22
signed int v42; // w19
ButtonSprite *v43; // x0
ButtonSprite *v44; // x0
char *v46; // [xsp+58h] [xbp+58h]
__int64 v47; // [xsp+58h] [xbp+58h]
char *v48; // [xsp+58h] [xbp+58h]
__int64 v49; // [xsp+60h] [xbp+60h] BYREF
_BYTE v50[8]; // [xsp+68h] [xbp+68h] BYREF
__int64 v51; // [xsp+70h] [xbp+70h] BYREF
size_t v52; // [xsp+78h] [xbp+78h]
void *v53; // [xsp+80h] [xbp+80h]
__int64 v54; // [xsp+88h] [xbp+88h] BYREF
size_t v55; // [xsp+90h] [xbp+90h]
void *v56; // [xsp+98h] [xbp+98h]
__int64 v57; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v58; // [xsp+A8h] [xbp+A8h]
void *v59; // [xsp+B0h] [xbp+B0h]
v4 = _stack_chk_guard;
if ( !a2 )
return _stack_chk_guard;
v5 = *((_DWORD *)this + 217);
if ( v5 > 0 )
{
v4 = *(unsigned int *)(MusicDownloadManager::sharedState(_stack_chk_guard) + 512);
if ( v5 != (_DWORD)v4 )
{
v6 = MusicDownloadManager::sharedState((MusicDownloadManager *)v4);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Music Library Updated to version %i",
(const char *)*(unsigned int *)(v6 + 512));
CString = (const char *)cocos2d::CCString::getCString(v7);
v51 = 0;
v46 = (char *)CString;
v52 = 0;
v53 = nullptr;
v9 = strlen(CString);
std::string::__init(&v51, v46, v9);
v54 = 0;
v10 = *(_QWORD *)this;
v55 = 0;
v56 = nullptr;
v11 = *(void (__fastcall **)(MusicBrowser *, __int64, __int64))(v10 + 464);
if ( (v51 & 1) != 0 )
{
std::string::__init(&v54, v53, v52);
}
else
{
v56 = v53;
v54 = v51;
v55 = v52;
}
v57 = 0;
v58 = 0;
v59 = nullptr;
std::string::__init(&v57, &byte_11B8890, 0);
v12 = TextAlertPopup::create((char *)&v54, 150, (char *)&v57, 1.0, 0.5);
v11(this, v12, 100);
if ( (v57 & 1) != 0 )
operator delete(v59);
if ( (v54 & 1) != 0 )
operator delete(v56);
v4 = (unsigned __int8)v51;
if ( (v51 & 1) != 0 )
{
operator delete(v53);
v14 = (MusicDownloadManager *)*(unsigned int *)(MusicDownloadManager::sharedState(v13) + 512);
v15 = *((_DWORD *)this + 176);
*((_DWORD *)this + 217) = (_DWORD)v14;
if ( v15 == 1 )
goto LABEL_12;
LABEL_15:
v16 = (unsigned int *)MusicDownloadManager::sharedState(v14);
v47 = v16[128];
v17 = "Music";
if ( *((_DWORD *)this + 176) == 1 )
goto LABEL_13;
LABEL_16:
v18 = *(unsigned int *)(MusicDownloadManager::sharedState((MusicDownloadManager *)v16) + 516);
v19 = v47;
goto LABEL_17;
}
}
}
v14 = (MusicDownloadManager *)*(unsigned int *)(MusicDownloadManager::sharedState((MusicDownloadManager *)v4) + 512);
v20 = *((_DWORD *)this + 176);
*((_DWORD *)this + 217) = (_DWORD)v14;
if ( v20 != 1 )
goto LABEL_15;
LABEL_12:
v16 = (unsigned int *)MusicDownloadManager::sharedState(v14);
v47 = v16[128];
v17 = "NCS";
if ( *((_DWORD *)this + 176) != 1 )
goto LABEL_16;
LABEL_13:
v18 = *(unsigned int *)(MusicDownloadManager::sharedState((MusicDownloadManager *)v16) + 520);
v19 = v47;
LABEL_17:
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s Library Version %i. Song Count: %i",
v17,
v19,
v18);
v22 = (const char *)cocos2d::CCString::getCString(v21);
v57 = 0;
v48 = (char *)v22;
v58 = 0;
v59 = nullptr;
v23 = strlen(v22);
std::string::__init(&v57, v48, v23);
v24 = (char *)&v57 + 1;
if ( (v57 & 1) != 0 )
v24 = (char *)v59;
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 91) + 928LL))(*((_QWORD *)this + 91), v24);
LoadingCircleSprite::hideCircle(*((LoadingCircleSprite **)this + 107));
v25 = *((cocos2d::CCDirector **)this + 90);
if ( v25 )
{
v26 = cocos2d::CCDirector::sharedDirector(v25);
v27 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v26 + 160LL))(v26);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v27, *((cocos2d::CCObject **)this + 90));
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 90) + 536LL))(*((_QWORD *)this + 90));
*((_QWORD *)this + 90) = 0;
}
cocos2d::CCObject::retain(a2);
v28 = *((cocos2d::CCObject **)this + 89);
if ( v28 )
v28 = (cocos2d::CCObject *)cocos2d::CCObject::release(v28);
*((_QWORD *)this + 89) = a2;
v29 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v28);
WinSize = (cocos2d::CCArray *)cocos2d::CCDirector::getWinSize(&v49, v29);
v31 = (cocos2d::CCArray *)cocos2d::CCArray::create(WinSize);
v32 = *((_QWORD *)this + 89);
v33 = 10 * *(_DWORD *)(v32 + 96);
v34 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(v32 + 64));
v35 = v33 + 9;
if ( v33 < v34 )
{
do
{
v36 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(
*(cocos2d::CCArray **)(*((_QWORD *)this + 89) + 64LL),
v33);
cocos2d::CCArray::addObject(v31, v36);
++v33;
}
while ( v33 <= v35 && v34 > v33 );
}
v37 = CustomListView::create(v31, (int)this + 672, 0, 23, 220.0, 340.0, 0.0);
v38 = GJCommentListLayer::create(v37, (__int64)&byte_11B8890, -13487566, 1u, 340.0, 220.0);
v39 = *((_QWORD *)this + 73);
*((_QWORD *)this + 90) = v38;
(*(void (__fastcall **)(__int64, cocos2d::CCLayerColor *, __int64))(*(_QWORD *)v39 + 464LL))(v39, v38, 10);
v40 = *((_QWORD *)this + 90);
v41 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v40 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v50,
(float)(*(float *)&v49 - 340.0) * 0.5,
(float)((float)(*((float *)&v49 + 1) - 220.0) * 0.5) + -10.0);
v41(v40, v50);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 95) + 344LL))(*((_QWORD *)this + 95), 1);
if ( (int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(*((_QWORD *)this + 89) + 64LL)) <= 0 )
v42 = 0;
else
v42 = vcvtps_s32_f32((float)(((unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(*((_QWORD *)this + 89)
+ 64LL))
- 1)
/ 0xA));
(*(void (__fastcall **)(_QWORD, bool))(**((_QWORD **)this + 93) + 344LL))(
*((_QWORD *)this + 93),
*(_DWORD *)(*((_QWORD *)this + 89) + 96LL) > 0);
(*(void (__fastcall **)(_QWORD, bool))(**((_QWORD **)this + 94) + 344LL))(
*((_QWORD *)this + 94),
*(_DWORD *)(*((_QWORD *)this + 89) + 96LL) < v42);
v43 = (ButtonSprite *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 102) + 1072LL))(*((_QWORD *)this + 102));
if ( *(_BYTE *)(*((_QWORD *)this + 89) + 132LL) )
ButtonSprite::updateBGImage(v43, "GJ_button_02.png");
else
ButtonSprite::updateBGImage(v43, "GJ_button_01.png");
v44 = (ButtonSprite *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 103) + 1072LL))(*((_QWORD *)this + 103));
if ( *(_BYTE *)(*((_QWORD *)this + 89) + 133LL) )
ButtonSprite::updateBGImage(v44, "GJ_button_02.png");
else
ButtonSprite::updateBGImage(v44, "GJ_button_01.png");
MusicBrowser::updateViewItems((__int64)this);
MusicBrowser::updatePageLabel(this);
if ( (v57 & 1) != 0 )
operator delete(v59);
return _stack_chk_guard;
}