//
// MoreVideoOptionsLayer::goToPage from 0x100115ae0 to 0x100115d34 (596 bytes)
//
// 3 xrefs:
// > MoreVideoOptionsLayer::init @ 0x1001156ac
// > MoreVideoOptionsLayer::onPrevPage @ 0x100115ad0
// > MoreVideoOptionsLayer::onNextPage @ 0x100115adc
//
// 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 10:59:10 +0000
//
__int64 __fastcall MoreVideoOptionsLayer::goToPage(__int64 result, int a2)
{
int v2; // w9
int v3; // w22
__int64 v4; // x19
__int64 v5; // x20
__int64 v6; // x0
char *CString; // x0
__int64 v8; // x20
__int64 v9; // x21
__int64 v10; // x0
__int64 v11; // x20
__int64 v12; // x0
char *v13; // x0
__int64 v14; // x20
__int64 v15; // x20
__int64 v16; // x0
char *v17; // x0
__int64 v18; // x20
__int64 v19; // x21
__int64 v20; // x0
__int64 v21; // x20
__int64 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 + 668);
if ( *(_DWORD *)(result + 668) >= a2 )
v3 = v2;
else
v3 = 0;
if ( *(_DWORD *)(result + 660) != v3 )
{
v4 = result;
v5 = *(_QWORD *)(result + 672);
v6 = sub_1003065B0("object_%i", *(_DWORD *)(result + 660));
CString = (char *)cocos2d::CCString::getCString(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 = (unsigned int)(v9 + 1);
}
while ( (unsigned int)v9 < (unsigned int)sub_1002E757C(v8) );
}
v11 = *(_QWORD *)(v4 + 672);
v12 = sub_1003065B0("layer_%i", *(_DWORD *)(v4 + 660));
v13 = (char *)cocos2d::CCString::getCString(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 + 672);
v16 = sub_1003065B0("object_%i", v3);
v17 = (char *)cocos2d::CCString::getCString(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 = (unsigned int)(v19 + 1);
}
while ( (unsigned int)v19 < (unsigned int)sub_1002E757C(v18) );
}
v21 = *(_QWORD *)(v4 + 672);
v22 = sub_1003065B0("layer_%i", v3);
v23 = (char *)cocos2d::CCString::getCString(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 + 660) = v3;
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v4 + 688) + 344LL))(*(_QWORD *)(v4 + 688), v3 > 0);
return (*(__int64 (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v4 + 696) + 344LL))(
*(_QWORD *)(v4 + 696),
*(_DWORD *)(v4 + 660) < *(_DWORD *)(v4 + 668));
}
return result;
}