//
// SetupTriggerPopup::onPage from 0x14060b680 to 0x14060b6eb (107 bytes)
//
// 3 xrefs:
// > SetupTriggerPopup::createPageButtons @ 0x14060b4b7
// > SetupTriggerPopup::createPageButtons @ 0x14060b581
// > ??> @ 0x14092fb40
//
// 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:35:14 +0000
//
__int64 __fastcall SetupTriggerPopup::onPage(__int64 a1, __int64 a2)
{
unsigned int v4; // esi
int v5; // eax
int v6; // edx
bool v7; // sf
__int64 v8; // rdx
v4 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 896));
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
v6 = *(_DWORD *)(a1 + 904);
v7 = v5 + v6 < 0;
v8 = (unsigned int)(v5 + v6);
*(_DWORD *)(a1 + 904) = v8;
if ( v7 )
{
v8 = v4 + (unsigned int)v8;
LABEL_5:
*(_DWORD *)(a1 + 904) = v8;
return SetupTriggerPopup::goToPage(a1, v8, 0);
}
if ( (int)v8 > (int)(v4 - 1) )
{
v8 = (unsigned int)v8 - v4;
goto LABEL_5;
}
return SetupTriggerPopup::goToPage(a1, v8, 0);
}