//
// CommunityCreditsPage::goToPage from 0x100320ca0 to 0x100320daa (266 bytes)
//
// 2 xrefs:
// > CommunityCreditsPage::init @ 0x100320bd3
// > CommunityCreditsPage::onSwitchPage @ 0x100320c8f
//
// 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 CommunityCreditsPage::goToPage(CommunityCreditsPage *a1, int a2)
{
unsigned int v2; // eax
intptr_t v3; // r15
cocos2d::CCObject *v4; // rax
cocos2d::CCObject_vtbl *v5; // rax
void (__cdecl *v6)(cocos2d::CCObject *__hidden); // rbx
unsigned __int64 v7; // r12
__int64 v8; // [rsp+8h] [rbp-38h]
int v9; // [rsp+10h] [rbp-30h]
v2 = cocos2d::CCDictionary::count(a1->m_pageObjects);
if ( a2 >= 0 && (int)v2 > a2 && a1->m_page != a2 )
{
a1->m_page = a2;
v8 = v2;
v9 = v2 - 1;
v3 = 0;
do
{
v4 = cocos2d::CCDictionary::objectForKey(a1->m_pageObjects, v3);
if ( v4 )
{
v5 = v4[1].__vftable;
if ( LODWORD(v5->copyWithZone) )
{
v6 = v5->~CCObject_0;
v7 = (unsigned __int64)v6 + 8 * LODWORD(v5->copyWithZone) - 8;
do
{
if ( !*(_QWORD *)v6 )
break;
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)v6 + 328LL))(*(_QWORD *)v6, v3 == a2);
v6 = (void (__cdecl *)(cocos2d::CCObject *__hidden))((char *)v6 + 8);
}
while ( (unsigned __int64)v6 <= v7 );
}
}
++v3;
}
while ( v3 != v8 );
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_prevButton->setVisible)(a1->m_prevButton, a2 != 0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_nextButton->setVisible)(a1->m_nextButton, v9 > a2);
}
}