//
// CommunityCreditsPage::goToPage from 0x10030c040 to 0x10030c14a (266 bytes)
//
// 2 xrefs:
// > CommunityCreditsPage::init @ 0x10030bf73
// > CommunityCreditsPage::onSwitchPage @ 0x10030c02f
//
// This function is hookable on this platform (idp: pc, 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:28:37 +0000
//
__int64 __fastcall CommunityCreditsPage::goToPage(__int64 a1, int a2)
{
__int64 result; // rax
__int64 v3; // r15
__int64 v4; // rax
unsigned int *v5; // rax
_QWORD *v6; // rbx
unsigned __int64 v7; // r12
__int64 v8; // [rsp+8h] [rbp-38h]
int v9; // [rsp+10h] [rbp-30h]
result = cocos2d::CCDictionary::count(*(_QWORD *)(a1 + 664));
if ( a2 >= 0 && (int)result > a2 && *(_DWORD *)(a1 + 688) != a2 )
{
*(_DWORD *)(a1 + 688) = a2;
v8 = (unsigned int)result;
v9 = result - 1;
v3 = 0;
do
{
v4 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 664), v3);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
if ( *v5 )
{
v6 = *((_QWORD **)v5 + 2);
v7 = (unsigned __int64)&v6[*v5 - 1];
do
{
if ( !*v6 )
break;
(*(void (__fastcall **)(_QWORD, bool))(*(_QWORD *)*v6 + 344LL))(*v6, v3 == a2);
++v6;
}
while ( (unsigned __int64)v6 <= v7 );
}
}
++v3;
}
while ( v3 != v8 );
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 672) + 344LL))(*(_QWORD *)(a1 + 672), a2 != 0);
return (*(__int64 (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 680) + 344LL))(*(_QWORD *)(a1 + 680), v9 > a2);
}
return result;
}