//
// EditorSoundBrowserLayer::updatePageLabel from 0xcc8b14 to 0xcc8d30 (540 bytes)
//
// 5 xrefs:
// > EditorSoundBrowserLayer::loadEditorSoundsFinished @ 0xcc8dc8
// > EditorSoundBrowserLayer::loadEditorSoundsFailed @ 0xcc8e68
// > EditorSoundBrowserLayer::loadCurrentPage @ 0xcc92a0
// > EditorSoundBrowserLayer::loadCurrentPage @ 0xcc9488
// > ??> @ 0x49888
//
// 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::updatePageLabel(EditorSoundBrowserLayer *this)
{
int v2; // w1
cocos2d::CCArray *v3; // x0
int v4; // w21
int v5; // w0
int v6; // w2
unsigned int v7; // w21
unsigned int v8; // w20
int v9; // w0
__int64 v10; // x2
cocos2d::CCString *v11; // x0
char *CString; // x0
void (*v13)(void); // x2
cocos2d::CCArray *v14; // x0
_BOOL4 v15; // w20
__int64 v16; // x0
__int64 v17; // x0
__int64 v19; // [xsp+30h] [xbp+30h] BYREF
__int64 v20; // [xsp+38h] [xbp+38h]
void *v21; // [xsp+40h] [xbp+40h]
if ( !*((_QWORD *)this + 133) )
return _stack_chk_guard;
v2 = *((_DWORD *)this + 263);
v3 = *((cocos2d::CCArray **)this + 138);
v4 = 10 * v2;
if ( v3 )
{
v5 = cocos2d::CCArray::count(v3);
v6 = *((_DWORD *)this + 263);
if ( !v5 )
{
v3 = *((cocos2d::CCArray **)this + 138);
v7 = 0;
v8 = 10 * v6;
if ( v3 )
goto LABEL_5;
LABEL_21:
v19 = 0;
v10 = v8;
v20 = 0;
v21 = nullptr;
if ( v8 )
goto LABEL_6;
goto LABEL_22;
}
v3 = *((cocos2d::CCArray **)this + 138);
v8 = 10 * v6;
v7 = v4 + 1;
}
else
{
v8 = 10 * v2;
v7 = v4 + 1;
}
if ( !v3 )
goto LABEL_21;
LABEL_5:
v9 = cocos2d::CCArray::count(v3);
v19 = 0;
v10 = v9 + v8;
v20 = 0;
v21 = nullptr;
if ( v9 + v8 )
{
LABEL_6:
if ( *((_DWORD *)this + 262) <= 1u )
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%d-%d of %d",
(const char *)v7,
v10,
*((unsigned int *)this + 278));
else
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Page %d",
(const char *)(unsigned int)(*((_DWORD *)this + 263) + 1));
CString = (char *)cocos2d::CCString::getCString(v11);
std::string::assign(&v19, CString);
v13 = *(void (**)(void))(**((_QWORD **)this + 133) + 928LL);
goto LABEL_9;
}
LABEL_22:
std::string::assign(&v19, "No results");
v13 = *(void (**)(void))(**((_QWORD **)this + 133) + 928LL);
LABEL_9:
v13();
if ( *((_DWORD *)this + 262) <= 1u )
{
v15 = *((_DWORD *)this + 278) > 10 * (*((_DWORD *)this + 263) + 1);
}
else
{
v14 = *((cocos2d::CCArray **)this + 138);
if ( v14 )
v15 = (int)cocos2d::CCArray::count(v14) > 9;
else
v15 = 0;
}
v16 = *((_QWORD *)this + 134);
if ( v16 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v16 + 344LL))(v16, *((_DWORD *)this + 263) > 0);
v17 = *((_QWORD *)this + 135);
if ( v17 )
(*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v17 + 344LL))(v17, v15);
if ( (v19 & 1) != 0 )
operator delete(v21);
return _stack_chk_guard;
}