//
// CommunityCreditsPage::goToPage from 0x14012f120 to 0x14012f237 (279 bytes)
//
// 5 xrefs:
// > CommunityCreditsPage::init @ 0x14012f075
// > CommunityCreditsPage::onSwitchPage @ 0x14012f11a
// > ??> @ 0x140898940
// > ??> @ 0x1408989a0
// > ??> @ 0x140916d24
//
// 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 11:27:02 +0000
//
int __fastcall CommunityCreditsPage::goToPage(__int64 a1, int a2)
{
int result; // eax
__int64 v5; // rdx
int v6; // r13d
int v7; // r12d
int v8; // edi
__int64 v9; // r14
struct cocos2d::CCObject *v10; // rax
unsigned int *v11; // rbx
__int64 v12; // rax
_QWORD *v13; // rbx
_QWORD *i; // rsi
__int64 v15; // rdx
result = cocos2d::CCDictionary::count(*(cocos2d::CCDictionary **)(a1 + 664));
v6 = result;
if ( a2 >= 0 )
{
v7 = result - 1;
if ( a2 <= result - 1 && a2 != *(_DWORD *)(a1 + 688) )
{
v8 = 0;
*(_DWORD *)(a1 + 688) = a2;
if ( result > 0 )
{
v9 = 0;
do
{
v10 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 664), v9);
if ( v10 )
{
v11 = *((unsigned int **)v10 + 7);
v12 = *v11;
if ( (_DWORD)v12 )
{
v13 = *((_QWORD **)v11 + 2);
for ( i = &v13[v12 - 1]; v13 <= i; ++v13 )
{
if ( !*v13 )
break;
LOBYTE(v5) = v8 == a2;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*v13 + 336LL))(*v13, v5);
}
}
}
++v8;
++v9;
}
while ( v8 < v6 );
}
LOBYTE(v5) = a2 > 0;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 672) + 336LL))(*(_QWORD *)(a1 + 672), v5);
LOBYTE(v15) = a2 < v7;
return (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 680) + 336LL))(*(_QWORD *)(a1 + 680), v15);
}
}
return result;
}