//
// SetupTriggerPopup::goToPage from 0xb1b430 to 0xb1b638 (520 bytes)
//
// 23 xrefs:
// > SetupSpawnPopup::init @ 0xa43ea4
// > SetupRotateCommandPopup::init @ 0xa7c01c
// > SetupSongTriggerPopup::updateApplyPrepare @ 0xaea4e8
// > SetupSongTriggerPopup::init @ 0xaeaf90
// > SetupOptionsTriggerPopup::init @ 0xb1a234
// > SetupTriggerPopup::onPage @ 0xb1b698
// > SetupTriggerPopup::onPage @ 0xb1b6b4
// > SetupTriggerPopup::hideAll @ 0xb1b6c0
// > SetupAreaMoveTriggerPopup::init @ 0xb3fb38
// > SetupAreaTransformTriggerPopup::init @ 0xb40698
// > SetupAreaRotateTriggerPopup::init @ 0xb40fd8
// > SetupAreaFadeTriggerPopup::init @ 0xb41904
// > SetupAreaTintTriggerPopup::init @ 0xb42488
// > SetupAreaTriggerPopup::init @ 0xb42cc4
// > SetupAdvFollowPopup::init @ 0xb49d50
// > SetupAdvFollowPopup::updateMode @ 0xb4c1c0
// > SetupKeyframeAnimPopup::init @ 0xb69afc
// > SetupSFXPopup::init @ 0xb6ee68
// > SetupSFXEditPopup::init @ 0xb700e0
// > SelectEventLayer::init @ 0xb80ab8
// > TabbedPopupLayer::showTab @ 0xc38a70
// > AccountBanPopup::init @ 0xc95884
// > ??> @ 0x7cf18
//
// 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:34 +0000
//
__int64 __fastcall SetupTriggerPopup::goToPage(cocos2d::CCArray **this, int a2, unsigned __int8 a3)
{
int v5; // w27
__int64 result; // x0
cocos2d::CCArray *v7; // x0
unsigned int v8; // w23
unsigned int v9; // w19
cocos2d::CCArray *v10; // x22
bool v11; // cf
unsigned int v12; // w1
cocos2d::CCArray *v13; // x0
unsigned int *v14; // x20
__int64 v15; // x1
unsigned int *v16; // x0
cocos2d::CCDictionary *v17; // x20
int v18; // w0
__int64 v19; // x0
__int64 v20; // x20
void (__fastcall *v21)(__int64, _QWORD); // x28
unsigned int v22; // w0
__int64 v23; // x0
__int64 v24; // x0
v5 = a3;
result = cocos2d::CCArray::count(*(this + 114));
if ( !(_DWORD)result )
return result;
if ( a2 >= (int)cocos2d::CCArray::count(*(this + 114)) )
{
if ( (int)cocos2d::CCArray::count(*(this + 114)) <= 1 )
goto LABEL_4;
LABEL_20:
if ( a2 >= (int)cocos2d::CCArray::count(*(this + 114)) )
a2 = cocos2d::CCArray::count(*(this + 114)) - 1;
goto LABEL_5;
}
if ( a2 > 0 )
goto LABEL_20;
LABEL_4:
a2 = 0;
LABEL_5:
v7 = *(this + 114);
v8 = 0;
*((_DWORD *)this + 230) = a2;
*((_BYTE *)this + 992) = v5;
if ( (unsigned int)cocos2d::CCArray::count(v7) )
{
do
{
v9 = 0;
v10 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(*(this + 114), v8);
while ( 1 )
{
v11 = v9 >= (unsigned int)cocos2d::CCArray::count(v10);
v12 = v9;
v13 = v10;
++v9;
if ( v11 )
break;
while ( 1 )
{
v14 = (unsigned int *)cocos2d::CCArray::objectAtIndex(v13, v12);
if ( !cocos2d::CCDictionary::objectForKey(*(this + 121), v14[2]) )
(*(void (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)v14 + 344LL))(
v14,
(a2 == v8) & (unsigned __int8)(v5 ^ 1));
v15 = *(_QWORD *)v14;
v16 = v14;
v17 = *(this + 95);
v18 = (*(__int64 (__fastcall **)(unsigned int *))(v15 + 64))(v16);
v19 = cocos2d::CCDictionary::objectForKey(v17, v18);
v20 = v19;
if ( !v19 )
break;
v21 = *(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v19 + 1000LL);
v22 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 352LL))(v19);
v21(v20, v22);
v11 = v9 >= (unsigned int)cocos2d::CCArray::count(v10);
v12 = v9;
v13 = v10;
++v9;
if ( v11 )
goto LABEL_13;
}
}
LABEL_13:
++v8;
}
while ( v8 < (unsigned int)cocos2d::CCArray::count(*(this + 114)) );
}
v23 = (__int64)*(this + 122);
if ( v23 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v23 + 344LL))(v23, v5 ^ 1u);
v24 = (__int64)*(this + 123);
if ( v24 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v24 + 344LL))(v24, v5 ^ 1u);
SetupTriggerPopup::refreshGroupVisibility(this);
return (*((__int64 (__fastcall **)(cocos2d::CCArray **))*this + 168))(this);
}