//
// ShardsPage::goToPage from 0x1004c1ab0 to 0x1004c1be5 (309 bytes)
//
// 2 xrefs:
// > ShardsPage::init @ 0x1004c16b7
// > ShardsPage::onSwitchPage @ 0x1004c1a9f
//
// 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:31:06 +0000
//
void __fastcall ShardsPage::goToPage(__int64 a1, int a2)
{
int v2; // eax
__int64 v3; // rcx
__int64 i; // r15
__int64 v5; // r13
__int64 v6; // rax
unsigned int *v7; // rax
_QWORD *v8; // rbx
unsigned __int64 v9; // r14
__int64 v10; // r14
__int64 v11; // r14
__int64 v12; // rax
const char *v13; // rsi
__int64 v14; // rax
__int64 v15; // [rsp-40h] [rbp-40h]
if ( (unsigned int)a2 <= 3 && *(_DWORD *)(a1 + 696) != a2 )
{
*(_DWORD *)(a1 + 696) = a2;
v2 = cocos2d::CCDictionary::count(*(_QWORD *)(a1 + 664));
v3 = a1;
if ( v2 > 0 )
{
v15 = (unsigned int)v2;
for ( i = 0; i != v15; ++i )
{
v5 = v3;
v6 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(v3 + 664), i);
if ( v6 )
{
v7 = *(unsigned int **)(v6 + 56);
if ( *v7 )
{
v8 = *((_QWORD **)v7 + 2);
v9 = (unsigned __int64)&v8[*v7 - 1];
do
{
if ( !*v8 )
break;
(*(void (__fastcall **)(_QWORD, bool))(*(_QWORD *)*v8 + 344LL))(*v8, i == a2);
++v8;
}
while ( (unsigned __int64)v8 <= v9 );
}
}
v3 = v5;
}
}
v10 = v3;
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v3 + 672) + 344LL))(*(_QWORD *)(v3 + 672), a2 != 0);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v10 + 680) + 344LL))(*(_QWORD *)(v10 + 680), a2 != 3);
v11 = *(_QWORD *)(v10 + 688);
v12 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v13 = "tier1Icon_001.png";
if ( a2 >= 2 )
v13 = "tier2Icon_001.png";
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v12, v13);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 1160LL))(v11, v14);
}
}