//
// GJOptionsLayer::goToPage from 0x100371ab8 to 0x100371d0c (596 bytes)
//
// 3 xrefs:
// > GJOptionsLayer::init @ 0x100371a7c
// > GJOptionsLayer::onPrevPage @ 0x100371aa8
// > GJOptionsLayer::onNextPage @ 0x100371ab4
//
// 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 11:03:23 +0000
//
__int64 __fastcall GJOptionsLayer::goToPage(__int64 result, int a2)
{
int v2; // w9
int v3; // w22
__int64 v4; // x19
__int64 v5; // x20
void *v6; // x0
char *CString; // x0
__int64 v8; // x20
unsigned int v9; // w21
__int64 v10; // x0
__int64 v11; // x20
void *v12; // x0
char *v13; // x0
__int64 v14; // x20
__int64 v15; // x20
void *v16; // x0
char *v17; // x0
__int64 v18; // x20
unsigned int v19; // w21
__int64 v20; // x0
__int64 v21; // x20
void *v22; // x0
char *v23; // x0
__int64 v24; // x20
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v26; // [xsp+1Fh] [xbp-21h]
if ( a2 >= 0 )
v2 = a2;
else
v2 = *(_DWORD *)(result + 1028);
if ( *(_DWORD *)(result + 1028) >= a2 )
v3 = v2;
else
v3 = 0;
if ( *(_DWORD *)(result + 1016) != v3 )
{
v4 = result;
v5 = *(_QWORD *)(result + 1040);
v6 = sub_1003065B0("object_%i", *(_DWORD *)(result + 1016));
CString = (char *)cocos2d::CCString::getCString((__int64)v6);
sub_100009900(__p, CString);
v8 = cocos2d::CCDictionary::objectForKey(v5, __p);
if ( v26 < 0 )
operator delete(__p[0]);
if ( v8 && (unsigned int)sub_1002E757C(v8) )
{
v9 = 0;
do
{
v10 = sub_1002E75A0(v8, v9);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 344LL))(v10, 0);
++v9;
}
while ( v9 < (unsigned int)sub_1002E757C(v8) );
}
v11 = *(_QWORD *)(v4 + 1040);
v12 = sub_1003065B0("layer_%i", *(_DWORD *)(v4 + 1016));
v13 = (char *)cocos2d::CCString::getCString((__int64)v12);
sub_100009900(__p, v13);
v14 = cocos2d::CCDictionary::objectForKey(v11, __p);
if ( v26 < 0 )
operator delete(__p[0]);
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 344LL))(v14, 0);
v15 = *(_QWORD *)(v4 + 1040);
v16 = sub_1003065B0("object_%i", v3);
v17 = (char *)cocos2d::CCString::getCString((__int64)v16);
sub_100009900(__p, v17);
v18 = cocos2d::CCDictionary::objectForKey(v15, __p);
if ( v26 < 0 )
operator delete(__p[0]);
if ( v18 && (unsigned int)sub_1002E757C(v18) )
{
v19 = 0;
do
{
v20 = sub_1002E75A0(v18, v19);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 344LL))(v20, 1);
++v19;
}
while ( v19 < (unsigned int)sub_1002E757C(v18) );
}
v21 = *(_QWORD *)(v4 + 1040);
v22 = sub_1003065B0("layer_%i", v3);
v23 = (char *)cocos2d::CCString::getCString((__int64)v22);
sub_100009900(__p, v23);
v24 = cocos2d::CCDictionary::objectForKey(v21, __p);
if ( v26 < 0 )
operator delete(__p[0]);
if ( v24 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v24 + 344LL))(v24, 1);
*(_DWORD *)(v4 + 1016) = v3;
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v4 + 1056) + 344LL))(*(_QWORD *)(v4 + 1056), v3 > 0);
return (*(__int64 (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v4 + 1064) + 344LL))(
*(_QWORD *)(v4 + 1064),
*(_DWORD *)(v4 + 1016) < *(_DWORD *)(v4 + 1028));
}
return result;
}