//
// BrowseSmartTemplateLayer::goToPage from 0xb14b5c to 0xb14cb4 (344 bytes)
//
// 5 xrefs:
// > BrowseSmartTemplateLayer::onClick @ 0xb14cf8
// > BrowseSmartTemplateLayer::onClick @ 0xb14d1c
// > BrowseSmartKeyLayer::init @ 0xb182dc
// > BrowseSmartTemplateLayer::init @ 0xb19330
// > ??> @ 0x7f2a0
//
// This function is hookable on this platform (idp: arm, 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 13:01:31 +0000
//
__int64 __fastcall BrowseSmartTemplateLayer::goToPage(BrowseSmartTemplateLayer *this, unsigned int a2)
{
unsigned int i; // w23
unsigned int v4; // w19
_BOOL4 v5; // w22
cocos2d::CCArray *v6; // x21
__int64 v7; // x20
bool v8; // cf
unsigned int v9; // w1
*((_DWORD *)this + 170) = a2;
if ( (a2 & 0x80000000) != 0 )
{
*((_DWORD *)this + 170) = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)) - 1;
}
else if ( a2 > (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)) - 1 )
{
*((_DWORD *)this + 170) = 0;
}
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)); ++i )
{
v4 = 0;
v5 = *((_DWORD *)this + 170) == i;
v6 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 84), i);
while ( 1 )
{
v8 = v4 >= (unsigned int)cocos2d::CCArray::count(v6);
v9 = v4++;
if ( v8 )
break;
v7 = cocos2d::CCArray::objectAtIndex(v6, v9);
(*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v7 + 344LL))(v7, v5);
(*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v7 + 1056LL))(v7, v5);
}
}
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 84)) > 1 )
return BrowseSmartTemplateLayer::updateDots(this);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 87) + 344LL))(*((_QWORD *)this + 87), 0);
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 86) + 344LL))(*((_QWORD *)this + 86), 0);
}