//
// SetupTriggerPopup::goToPage from 0x100219e40 to 0x10021a047 (519 bytes)
//
// 22 xrefs:
// > SetupRotateCommandPopup::init @ 0x100002455
// > SetupKeyframeAnimPopup::init @ 0x1001e1ff2
// > SetupTriggerPopup::onPage @ 0x100219dbd
// > SetupTriggerPopup::hideAll @ 0x10021a0bc
// > SetupSpawnPopup::init @ 0x10027b477
// > SetupSongTriggerPopup::init @ 0x1002c074a
// > SetupSongTriggerPopup::updateApplyPrepare @ 0x1002c0aa8
// > SetupSongTriggerPopup::valueDidChange @ 0x1002c0de7
// > SetupAdvFollowPopup::init @ 0x1002f3824
// > SetupAdvFollowPopup::updateMode @ 0x1002f4571
// > SetupSFXPopup::init @ 0x1004b2c02
// > SetupSFXEditPopup::init @ 0x1004b4b0b
// > SetupAreaMoveTriggerPopup::init @ 0x1004ce8c9
// > SetupAreaTransformTriggerPopup::init @ 0x1004d13fc
// > sub_1004D1A60 @ 0x1004d20e3
// > sub_1004D2720 @ 0x1004d2dac
// > SetupAreaTintTriggerPopup::init @ 0x1004d3e1b
// > SetupAreaTriggerPopup::init @ 0x1004d4fa6
// > SelectEventLayer::init @ 0x1005a6815
// > TabbedPopupLayer::showTab @ 0x10063fd21
// > SetupOptionsTriggerPopup::init @ 0x1006bab8e
// > sub_10098E530 @ 0x10098ed1b
//
// 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:27:01 +0000
//
__int64 __fastcall SetupTriggerPopup::goToPage(__int64 a1, int a2, unsigned __int8 a3)
{
int v4; // r15d
__int64 result; // rax
int v7; // ecx
int v8; // eax
unsigned int v9; // r14d
__int64 v10; // r13
bool v11; // r15
unsigned int v12; // r14d
unsigned int *v13; // r12
__int64 v14; // rsi
__int64 v15; // r15
__int64 v16; // rsi
__int64 v17; // rax
__int64 v18; // r12
unsigned __int8 v19; // al
__int64 v20; // rdi
__int64 v21; // rdi
unsigned int v22; // [rsp+4h] [rbp-3Ch]
unsigned int v23; // [rsp+8h] [rbp-38h]
int v24; // [rsp+Ch] [rbp-34h]
unsigned __int8 v25; // [rsp+10h] [rbp-30h]
unsigned __int8 v26; // [rsp+17h] [rbp-29h]
v4 = a2;
result = sub_1007FEF90(*(_QWORD *)(a1 + 912));
if ( (_DWORD)result )
{
v7 = sub_1007FEF90(*(_QWORD *)(a1 + 912));
v8 = a2;
if ( v7 <= a2 )
v8 = sub_1007FEF90(*(_QWORD *)(a1 + 912)) - 1;
if ( v8 <= 0 )
{
v4 = 0;
}
else if ( (int)sub_1007FEF90(*(_QWORD *)(a1 + 912)) <= a2 )
{
v4 = sub_1007FEF90(*(_QWORD *)(a1 + 912)) - 1;
}
*(_DWORD *)(a1 + 920) = v4;
v25 = a3;
*(_BYTE *)(a1 + 992) = a3;
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 912)) )
{
v26 = a3 ^ 1;
v9 = 0;
v24 = v4;
do
{
v10 = sub_1007FEFE0(*(_QWORD *)(a1 + 912), v9);
v23 = v9;
v11 = v9 == v4;
if ( (unsigned int)sub_1007FEF90(v10) )
{
v12 = 0;
v22 = v26 & v11;
do
{
v13 = (unsigned int *)sub_1007FEFE0(v10, v12);
v14 = v13[2];
if ( !cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 968)) )
{
v14 = v22;
(*(void (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)v13 + 344LL))(v13, v22);
}
v15 = *(_QWORD *)(a1 + 760);
v16 = (*(int (__fastcall **)(unsigned int *, __int64))(*(_QWORD *)v13 + 64LL))(v13, v14);
v17 = cocos2d::CCDictionary::objectForKey_1(v15);
if ( v17 )
{
v18 = v17;
v19 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 352LL))(v17, v16);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v18 + 1000LL))(v18, v19);
}
++v12;
}
while ( v12 < (unsigned int)sub_1007FEF90(v10) );
}
v9 = v23 + 1;
v4 = v24;
}
while ( v23 + 1 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 912)) );
}
v20 = *(_QWORD *)(a1 + 976);
if ( v20 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v20 + 344LL))(v20, v25 ^ 1u);
v21 = *(_QWORD *)(a1 + 984);
if ( v21 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v21 + 344LL))(v21, v25 ^ 1u);
SetupTriggerPopup::refreshGroupVisibility(a1);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1344LL))(a1);
}
return result;
}