//
// EditorSoundBrowserLayer::loadCurrentPage from 0xcc8f3c to 0xcc9550 (1556 bytes)
//
// 6 xrefs:
// > EditorSoundBrowserLayer::setMode @ 0xcc9610
// > EditorSoundBrowserLayer::onPrevPage @ 0xccad54
// > EditorSoundBrowserLayer::onNextPage @ 0xccadac
// > EditorSoundBrowserLayer::onRefresh @ 0xccade0
// > EditorSoundBrowserLayer::rebuildContent @ 0xccadec
// > ??> @ 0xa5fb8
//
// 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:06:22 +0000
//
__int64 __fastcall EditorSoundBrowserLayer::loadCurrentPage(EditorSoundBrowserLayer *this, unsigned __int8 a2, char a3)
{
int v3; // w21
int v5; // s0
__int64 v6; // x0
__int64 v7; // x0
EditorSFXManager *v8; // x0
GJAccountManager *v9; // x0
int v10; // w24
GJSearchObject *v11; // x23
const char *Key; // x27
unsigned __int64 v13; // x0
size_t v14; // x25
size_t v15; // x24
unsigned __int64 v16; // x1
char *v17; // x28
char *v18; // x0
size_t v19; // x24
GameLevelManager *v20; // x2
size_t v21; // x3
char v22; // w0
char *v23; // x25
char *v24; // x0
int v25; // w24
__int64 v26; // x2
size_t v27; // x2
__int64 v28; // x2
size_t v29; // x3
unsigned __int64 v30; // x0
GameLevelManager *v31; // x0
const char *v32; // x1
cocos2d::CCNode **v33; // x0
GameLevelManager *v34; // x0
EditorSFXManager *v35; // x0
EditorSFXManager *v36; // x0
cocos2d::CCArray *MyConfigs; // x0
cocos2d::CCArray *v38; // x21
cocos2d::CCArray *v39; // x24
int i; // w19
bool v41; // cc
int v42; // w19
int v43; // w23
unsigned int v44; // w1
cocos2d::CCObject *v45; // x0
EditorSoundBrowserLayer *v46; // x0
cocos2d::CCArray *v47; // x1
cocos2d::CCArray *v48; // x0
__int64 *v49; // x3
__int64 v50; // x1
EditorSFXManager *v52; // x0
unsigned __int64 v53; // x0
__int64 v54; // x0
__int64 v55; // x0
int v56; // w1
const char *v57; // x1
cocos2d::CCString *v58; // x0
char *CString; // x0
cocos2d::CCArray *v60; // x0
unsigned __int64 v61; // x0
unsigned __int64 v62; // x0
unsigned __int8 v63; // w2
__int64 v64; // [xsp+60h] [xbp+60h] BYREF
size_t v65; // [xsp+68h] [xbp+68h]
void *v66; // [xsp+70h] [xbp+70h]
GameLevelManager *v67; // [xsp+78h] [xbp+78h] BYREF
size_t v68; // [xsp+80h] [xbp+80h]
void *v69; // [xsp+88h] [xbp+88h]
__int64 v70; // [xsp+90h] [xbp+90h] BYREF
size_t v71; // [xsp+98h] [xbp+98h]
void *v72; // [xsp+A0h] [xbp+A0h]
v3 = a2;
v5 = 0;
if ( a3 )
{
v6 = *((_QWORD *)this + 132);
if ( v6 )
{
v7 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v6 + 544) + 424LL) + 488LL);
v5 = *(_DWORD *)((*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 192LL))(v7, 0.0) + 4);
}
}
*((_DWORD *)this + 300) = v5;
EditorSoundBrowserLayer::clearCells(this);
if ( (*((_BYTE *)this + 1144) & 1) != 0 )
{
**((_BYTE **)this + 145) = 0;
*((_QWORD *)this + 144) = 0;
v8 = (EditorSFXManager *)*((unsigned int *)this + 262);
if ( (unsigned int)v8 > 1 )
goto LABEL_6;
LABEL_37:
if ( (_DWORD)v8 )
{
v35 = (EditorSFXManager *)EditorSFXManager::sharedState(v8);
if ( v35 )
{
v36 = (EditorSFXManager *)EditorSFXManager::sharedState(v35);
MyConfigs = (cocos2d::CCArray *)EditorSFXManager::getMyConfigs(v36);
v38 = MyConfigs;
goto LABEL_40;
}
}
else
{
v35 = (EditorSFXManager *)EditorSFXManager::sharedState(v8);
if ( v35 )
{
v52 = (EditorSFXManager *)EditorSFXManager::sharedState(v35);
MyConfigs = (cocos2d::CCArray *)EditorSFXManager::getFavoriteConfigs(v52);
v38 = MyConfigs;
LABEL_40:
v39 = (cocos2d::CCArray *)cocos2d::CCArray::create(MyConfigs);
if ( v38 )
{
for ( i = *((_DWORD *)this + 263); i > 0; *((_DWORD *)this + 263) = --i )
{
v41 = 10 * i < (int)cocos2d::CCArray::count(v38);
i = *((_DWORD *)this + 263);
if ( v41 )
break;
}
v42 = 10 * i;
v43 = v42 + 10;
while ( v42 < (int)cocos2d::CCArray::count(v38) && v42 < v43 )
{
v44 = v42++;
v45 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v38, v44);
cocos2d::CCArray::addObject(v39, v45);
}
*((_DWORD *)this + 278) = cocos2d::CCArray::count(v38);
}
goto LABEL_49;
}
}
v39 = (cocos2d::CCArray *)cocos2d::CCArray::create(v35);
LABEL_49:
v46 = this;
v47 = v39;
LABEL_55:
EditorSoundBrowserLayer::layoutCells(v46, v47, (cocos2d::CCLabelBMFont *)"No lists found.");
EditorSoundBrowserLayer::updatePageLabel(this);
return _stack_chk_guard;
}
v8 = (EditorSFXManager *)*((unsigned int *)this + 262);
*((_BYTE *)this + 1145) = 0;
*((_BYTE *)this + 1144) = 0;
if ( (unsigned int)v8 <= 1 )
goto LABEL_37;
LABEL_6:
if ( (_DWORD)v8 != 9 )
{
v9 = (GJAccountManager *)(unsigned int)((_DWORD)v8 - 2);
v64 = 0;
v65 = 0;
v66 = nullptr;
switch ( (int)v9 )
{
case 0:
v53 = GJAccountManager::sharedState(v9);
if ( !v53 )
goto LABEL_84;
v55 = GJAccountManager::sharedState((GJAccountManager *)v53);
v56 = *(_DWORD *)(v55 + 352);
v53 = *(unsigned int *)(v55 + 356);
v57 = (const char *)(unsigned int)(v56 - v53);
if ( (int)v57 <= 0 )
goto LABEL_84;
v58 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%d", v57);
CString = (char *)cocos2d::CCString::getCString(v58);
std::string::assign(&v64, CString);
v10 = 5;
goto LABEL_9;
case 2:
v10 = 3;
goto LABEL_9;
case 3:
v53 = GJAccountManager::sharedState(v9);
if ( v53 )
{
v54 = GJAccountManager::sharedState((GJAccountManager *)v53);
v53 = (unsigned int)(*(_DWORD *)(v54 + 352) - *(_DWORD *)(v54 + 356));
if ( (int)v53 > 0 )
{
v10 = 13;
goto LABEL_9;
}
}
LABEL_84:
*((_DWORD *)this + 278) = 0;
v60 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v53);
EditorSoundBrowserLayer::layoutCells(this, v60, (cocos2d::CCLabelBMFont *)"No lists found.");
EditorSoundBrowserLayer::updatePageLabel(this);
break;
case 4:
v10 = 2;
goto LABEL_9;
case 5:
v10 = 1;
goto LABEL_9;
case 6:
v10 = 4;
goto LABEL_9;
case 7:
v49 = (__int64 *)((char *)this + 1120);
goto LABEL_60;
default:
v10 = 6;
goto LABEL_9;
}
goto LABEL_34;
}
v48 = (cocos2d::CCArray *)*((unsigned __int8 *)this + 1120);
v49 = (__int64 *)((char *)this + 1120);
v50 = (unsigned __int8)v48 >> 1;
if ( ((unsigned __int8)v48 & 1) != 0 )
v50 = *((_QWORD *)this + 141);
if ( !v50 )
{
*((_DWORD *)this + 278) = 0;
v47 = (cocos2d::CCArray *)cocos2d::CCArray::create(v48);
v46 = this;
goto LABEL_55;
}
v64 = 0;
v65 = 0;
v66 = nullptr;
LABEL_60:
if ( &v64 != v49 )
{
if ( (*((_BYTE *)this + 1120) & 1) != 0 )
std::string::assign(&v64, (const void *)v49[2], v49[1]);
else
std::string::assign(&v64, (char *)this + 1121, *((_BYTE *)this + 1120) >> 1);
}
v10 = 0;
LABEL_9:
v70 = 0;
v71 = 0;
v72 = nullptr;
if ( (v64 & 1) != 0 )
{
std::string::__init(&v70, v66, v65);
}
else
{
v70 = v64;
v71 = v65;
v72 = v66;
}
v11 = (GJSearchObject *)GJSearchObject::create(v10, (char *)&v70);
if ( (v70 & 1) != 0 )
operator delete(v72);
*((_DWORD *)v11 + 98) = *((_DWORD *)this + 263);
v67 = nullptr;
v68 = 0;
v69 = nullptr;
std::string::__init((__int64 *)&v67, "es_", 3u);
Key = (const char *)GJSearchObject::getKey(v11);
v13 = strlen(Key);
v14 = v13;
if ( ((unsigned __int8)v67 & 1) != 0 )
{
v15 = v68;
v16 = ((unsigned __int64)v67 & 0xFFFFFFFFFFFFFFFELL) - 1;
if ( v13 <= v16 - v68 )
goto LABEL_15;
LABEL_79:
std::string::__grow_by_and_replace((__int64)&v67, v16, v15 + v13 - v16, v15, v15, 0, v13, Key);
goto LABEL_21;
}
v15 = (unsigned __int8)v67 >> 1;
v16 = 22;
if ( v13 > 22 - v15 )
goto LABEL_79;
LABEL_15:
if ( v13 )
{
v17 = (char *)&v67 + 1;
if ( ((unsigned __int8)v67 & 1) != 0 )
v17 = (char *)v69;
v18 = &v17[v15];
v19 = v15 + v14;
memcpy(v18, Key, v14);
if ( ((unsigned __int8)v67 & 1) != 0 )
v68 = v19;
else
LOBYTE(v67) = 2 * v19;
v17[v19] = 0;
}
LABEL_21:
v20 = v67;
v21 = v68;
v22 = *((_BYTE *)this + 1144);
v72 = v69;
v67 = nullptr;
v68 = 0;
v70 = (__int64)v20;
v71 = v21;
v69 = nullptr;
if ( (v22 & 1) != 0 )
{
**((_BYTE **)this + 145) = 0;
*((_QWORD *)this + 144) = 0;
if ( (*((_BYTE *)this + 1144) & 1) != 0 )
{
v23 = *((char **)this + 145);
v24 = (char *)this + 1145;
v25 = 1;
LABEL_24:
v26 = *((_QWORD *)this + 144);
goto LABEL_25;
}
v61 = *((_BYTE *)this + 1144) >> 1;
if ( v61 <= 0x16 )
goto LABEL_27;
v62 = (v61 + 16) & 0xFFFFFFFFFFFFFFF0LL;
if ( v62 == 23 )
goto LABEL_27;
if ( v62 - 1 > 0x16 )
{
v24 = (char *)operator new(v62);
v63 = *((_BYTE *)this + 1144);
v25 = v63 & 1;
if ( (v63 & 1) == 0 )
{
LABEL_92:
v23 = (char *)this + 1145;
v26 = v63 >> 1;
LABEL_25:
v27 = v26 + 1;
if ( v27 )
{
memcpy(v24, v23, v27);
if ( !v25 )
goto LABEL_27;
}
else if ( !v25 )
{
goto LABEL_27;
}
operator delete(v23);
goto LABEL_27;
}
}
else
{
v24 = (char *)operator new(v62);
v63 = *((_BYTE *)this + 1144);
v25 = v63 & 1;
if ( (v63 & 1) == 0 )
goto LABEL_92;
}
v23 = *((char **)this + 145);
goto LABEL_24;
}
LABEL_27:
v28 = v70;
v29 = v71;
v30 = (unsigned __int8)v67;
*((_QWORD *)this + 145) = v72;
*((_QWORD *)this + 143) = v28;
*((_QWORD *)this + 144) = v29;
if ( (v30 & 1) != 0 )
operator delete(v69);
if ( v3 )
{
v31 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v30);
v32 = (char *)this + 1145;
if ( (*((_BYTE *)this + 1144) & 1) != 0 )
v32 = *((const char **)this + 145);
v30 = GameLevelManager::resetTimerForKey(v31, v32);
}
*(_QWORD *)(GameLevelManager::sharedState((GameLevelManager *)v30) + 1328) = (char *)this + 1016;
v33 = EditorSoundBrowserLayer::showLoading(this, 1);
v34 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v33);
GameLevelManager::getEditorSoundConfigs(v34, v11);
LABEL_34:
if ( (v64 & 1) != 0 )
operator delete(v66);
return _stack_chk_guard;
}