//
// MoreOptionsLayer::goToPage from 0x8f757c to 0x8f7994 (1048 bytes)
//
// 4 xrefs:
// > MoreOptionsLayer::init @ 0x8f8b44
// > MoreOptionsLayer::onNextPage @ 0x8f8d94
// > MoreOptionsLayer::onPrevPage @ 0x8f8da0
// > ??> @ 0x74038
//
// 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 12:57:01 +0000
//
__int64 __fastcall MoreOptionsLayer::goToPage(MoreOptionsLayer *this, int a2)
{
unsigned int v2; // w23
int v4; // w0
const char *v5; // x1
__int64 v6; // x19
const char *v7; // x0
size_t v8; // x0
cocos2d::CCArray *v9; // x21
unsigned int v10; // w19
__int64 v11; // x19
const char *v12; // x0
size_t v13; // x0
__int64 v14; // x19
__int64 v15; // x19
const char *v16; // x0
size_t v17; // x0
cocos2d::CCArray *v18; // x21
unsigned int v19; // w19
__int64 v20; // x19
const char *v21; // x0
size_t v22; // x0
__int64 v23; // x19
__int64 v24; // x2
__int64 v25; // x19
void (__fastcall *v26)(__int64, _QWORD); // x21
unsigned int v27; // w0
char *v28; // x1
unsigned int v30; // w1
__int64 v31; // x0
unsigned int v32; // w1
__int64 v33; // x0
char *v34; // [xsp+48h] [xbp+48h]
char *v35; // [xsp+48h] [xbp+48h]
char *v36; // [xsp+48h] [xbp+48h]
char *v37; // [xsp+48h] [xbp+48h]
__int64 v38; // [xsp+50h] [xbp+50h] BYREF
__int64 v39; // [xsp+58h] [xbp+58h]
void *v40; // [xsp+60h] [xbp+60h]
v2 = a2;
v4 = *((_DWORD *)this + 172);
if ( v4 < a2 )
{
v2 = 0;
}
else if ( a2 < 0 )
{
v2 = v4;
}
v5 = (const char *)*((unsigned int *)this + 170);
if ( (_DWORD)v5 != v2 )
{
v6 = *((_QWORD *)this + 87);
v7 = (const char *)MoreOptionsLayer::objectKey(this, v5);
v38 = 0;
v34 = (char *)v7;
v39 = 0;
v40 = nullptr;
v8 = strlen(v7);
std::string::__init(&v38, v34, v8);
v9 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v6, &v38);
if ( (v38 & 1) != 0 )
{
v10 = 0;
operator delete(v40);
if ( !v9 )
goto LABEL_7;
}
else
{
v10 = 0;
if ( !v9 )
goto LABEL_7;
}
while ( v10 < (unsigned int)cocos2d::CCArray::count(v9) )
{
v30 = v10++;
v31 = cocos2d::CCArray::objectAtIndex(v9, v30);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v31 + 344LL))(v31, 0);
}
LABEL_7:
v11 = *((_QWORD *)this + 87);
v12 = (const char *)MoreOptionsLayer::layerKey(this, (const char *)*((unsigned int *)this + 170));
v38 = 0;
v35 = (char *)v12;
v39 = 0;
v40 = nullptr;
v13 = strlen(v12);
std::string::__init(&v38, v35, v13);
v14 = cocos2d::CCDictionary::objectForKey(v11, &v38);
if ( (v38 & 1) != 0 )
{
operator delete(v40);
if ( !v14 )
{
LABEL_10:
v15 = *((_QWORD *)this + 87);
v16 = (const char *)MoreOptionsLayer::objectKey(this, (const char *)v2);
v38 = 0;
v36 = (char *)v16;
v39 = 0;
v40 = nullptr;
v17 = strlen(v16);
std::string::__init(&v38, v36, v17);
v18 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v15, &v38);
if ( (v38 & 1) != 0 )
{
v19 = 0;
operator delete(v40);
if ( !v18 )
goto LABEL_12;
}
else
{
v19 = 0;
if ( !v18 )
goto LABEL_12;
}
while ( v19 < (unsigned int)cocos2d::CCArray::count(v18) )
{
v32 = v19++;
v33 = cocos2d::CCArray::objectAtIndex(v18, v32);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v33 + 344LL))(v33, 1);
}
LABEL_12:
v20 = *((_QWORD *)this + 87);
v21 = (const char *)MoreOptionsLayer::layerKey(this, (const char *)v2);
v38 = 0;
v37 = (char *)v21;
v39 = 0;
v40 = nullptr;
v22 = strlen(v21);
std::string::__init(&v38, v37, v22);
v23 = cocos2d::CCDictionary::objectForKey(v20, &v38);
if ( (v38 & 1) != 0 )
{
operator delete(v40);
if ( !v23 )
{
LABEL_15:
v24 = *((_QWORD *)this + 89);
*((_DWORD *)this + 170) = v2;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v24 + 344LL))(v24, 1);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 90) + 344LL))(*((_QWORD *)this + 90), 1);
v25 = *((_QWORD *)this + 91);
v26 = *(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v25 + 1000LL);
v27 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v25 + 352LL))(v25);
v26(v25, v27);
v38 = 0;
v39 = 0;
v40 = nullptr;
std::string::__init(&v38, "Options", 7u);
switch ( *((_DWORD *)this + 170) )
{
case 0:
std::string::assign(&v38, "Gameplay");
break;
case 1:
case 2:
std::string::assign(&v38, "Visual");
break;
case 3:
std::string::assign(&v38, "Practice");
break;
case 4:
std::string::assign(&v38, "Performance");
break;
case 5:
std::string::assign(&v38, "Audio");
break;
case 6:
std::string::assign(&v38, "Other");
break;
default:
break;
}
v28 = (char *)&v38 + 1;
if ( (v38 & 1) != 0 )
v28 = (char *)v40;
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 94) + 928LL))(*((_QWORD *)this + 94), v28);
if ( (v38 & 1) != 0 )
operator delete(v40);
return _stack_chk_guard;
}
}
else if ( !v23 )
{
goto LABEL_15;
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v23 + 344LL))(v23, 1);
goto LABEL_15;
}
}
else if ( !v14 )
{
goto LABEL_10;
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 344LL))(v14, 0);
goto LABEL_10;
}
return _stack_chk_guard;
}