//
// GJSongBrowser::loadPage from 0x6e7658 to 0x6e7798 (320 bytes)
//
// 4 xrefs:
// > GJSongBrowser::init @ 0x6e77c8
// > GJSongBrowser::onNextPage @ 0x6e77e4
// > GJSongBrowser::onPrevPage @ 0x6e77f0
// > ??> @ 0x44b48
//
// 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:51:44 +0000
//
__int64 __fastcall GJSongBrowser::loadPage(GJSongBrowser *this, int a2)
{
__int64 v4; // x2
cocos2d::CCArray *v5; // x0
cocos2d::CCArray *v6; // x22
int v7; // w21
unsigned int v8; // w24
unsigned int v9; // w19
bool v10; // cc
unsigned int v11; // w1
cocos2d::CCObject *v12; // x0
unsigned int v13; // w19
*((_DWORD *)this + 156) = a2;
v4 = *((_QWORD *)this + 81);
if ( a2 <= 0 )
v5 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v4 + 344LL))(
*((_QWORD *)this + 81),
0);
else
v5 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v4 + 344LL))(
*((_QWORD *)this + 81),
1);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
v7 = 10 * a2;
v8 = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84));
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)) )
{
v9 = 10 * a2;
do
{
v10 = v9 > (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)) - 1;
v11 = v9++;
if ( v10 )
break;
v12 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 84), v11);
cocos2d::CCArray::addObject(v6, v12);
}
while ( v9 != v7 + 10 );
}
v13 = cocos2d::CCArray::count(v6) + v7;
if ( v13 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)) )
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 80) + 344LL))(*((_QWORD *)this + 80), 1);
else
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 80) + 344LL))(*((_QWORD *)this + 80), 0);
GJSongBrowser::setupPageInfo(this, v8, v7, 10);
return GJSongBrowser::setupSongBrowser(this, v6);
}