//
// GJSongBrowser::loadPage from 0x1002659b4 to 0x100265b20 (364 bytes)
//
// 3 xrefs:
// > GJSongBrowser::init @ 0x1002659a0
// > GJSongBrowser::onPrevPage @ 0x100265ea0
// > GJSongBrowser::onNextPage @ 0x100265eac
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJSongBrowser::loadPage(GJSongBrowser *a1, int a2)
{
__int64 v4; // x0
cocos2d::CCObject *v5; // x21
unsigned int v6; // w22
__int64 v7; // x23
MusicDownloadManager *v8; // x0
cocos2d::CCArray *v9; // x21
int v10; // w20
int v11; // w22
unsigned int v12; // w23
unsigned int v14; // w23
_BOOL8 v15; // x1
a1->m_page = a2;
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_leftArrow->setVisible)(a1->m_leftArrow, a2 > 0);
v4 = sub_10024A36C((__int64)a1->m_downloadedSongs);
v5 = sub_10024A300(v4);
sub_10024A360((__int64)v5, (__int64)a1->m_downloadedSongs);
if ( (unsigned int)sub_10024A36C((__int64)v5) )
{
v6 = 0;
do
{
v7 = sub_10024A388((__int64)v5, v6);
v8 = MusicDownloadManager::sharedState();
if ( !MusicDownloadManager::isSongDownloaded(v8, *(_DWORD *)(v7 + 316)) )
sub_10024A444((__int64)a1->m_downloadedSongs);
++v6;
}
while ( v6 < (unsigned int)sub_10024A36C((__int64)v5) );
}
v9 = (cocos2d::CCArray *)sub_10024A15C();
v10 = 10 * a2;
v11 = sub_10024A36C((__int64)a1->m_downloadedSongs);
if ( (unsigned int)sub_10024A36C((__int64)a1->m_downloadedSongs) )
{
v12 = v10;
do
{
if ( v12 > (unsigned int)sub_10024A36C((__int64)a1->m_downloadedSongs) - 1 )
break;
sub_10024A388((__int64)a1->m_downloadedSongs, v12);
sub_10024A2D0((__int64)v9);
}
while ( (int)v12++ < v10 + 9 );
}
v14 = sub_10024A36C((__int64)v9) + v10;
v15 = v14 < (unsigned int)sub_10024A36C((__int64)a1->m_downloadedSongs);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _BOOL8))a1->m_rightArrow->setVisible)(a1->m_rightArrow, v15);
GJSongBrowser::setupPageInfo(a1, v11, v10, 10);
GJSongBrowser::setupSongBrowser(a1, v9);
}