//
// ParentalOptionsLayer::goToPage from 0x52f7cc to 0x52f99c (464 bytes)
//
// 3 xrefs:
// > ParentalOptionsLayer::onNextPage @ 0x52f9a6
// > ParentalOptionsLayer::onPrevPage @ 0x52f9b0
// > ParentalOptionsLayer::init @ 0x5326d2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:03 +0000
//
const char **__fastcall ParentalOptionsLayer::goToPage(const char **this, int a2)
{
const char **v2; // r5
const char *v3; // r6
const char *v4; // r1
int v5; // r7
const char *v6; // r9
size_t v7; // r0
cocos2d::CCArray *v8; // r9
const char *v9; // r7
const char *v10; // r0
const char *v11; // r9
size_t v12; // r0
int v13; // r7
unsigned int i; // r7
int v15; // r0
const char *v16; // r7
const char *v17; // r0
const char *v18; // r9
size_t v19; // r0
cocos2d::CCArray *v20; // r9
const char *v21; // r7
const char *v22; // r0
const char *v23; // r9
size_t v24; // r0
int v25; // r7
unsigned int j; // r7
int v27; // r0
const char *v28; // r0
int v29; // [sp+0h] [bp-14h] BYREF
int v30; // [sp+4h] [bp-10h]
int v31; // [sp+8h] [bp-Ch]
v2 = this;
if ( a2 > (int)*(this + 132) )
{
v3 = nullptr;
}
else
{
v3 = (const char *)(a2 & ~(a2 >> 31));
if ( a2 < 0 )
v3 = *(this + 132);
}
v4 = *(this + 130);
if ( v4 != v3 )
{
v5 = (int)*(this + 134);
v29 = 0;
v30 = 0;
v31 = 0;
v6 = (const char *)ParentalOptionsLayer::objectKey((ParentalOptionsLayer *)this, v4);
v7 = strlen(v6);
std::string::__init(&v29, v6, v7);
v8 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v5, &v29);
std::string::~string((int)&v29);
if ( v8 )
{
for ( i = 0; i < cocos2d::CCArray::count(v8); ++i )
{
v15 = cocos2d::CCArray::objectAtIndex(v8, i);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v15 + 172))(v15, 0);
}
}
v9 = v2[134];
v10 = (const char *)ParentalOptionsLayer::layerKey((ParentalOptionsLayer *)v2, v2[130]);
v29 = 0;
v30 = 0;
v31 = 0;
v11 = v10;
v12 = strlen(v10);
std::string::__init(&v29, v11, v12);
v13 = cocos2d::CCDictionary::objectForKey(v9, &v29);
std::string::~string((int)&v29);
if ( v13 )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v13 + 172))(v13, 0);
v16 = v2[134];
v17 = (const char *)ParentalOptionsLayer::objectKey((ParentalOptionsLayer *)v2, v3);
v29 = 0;
v30 = 0;
v31 = 0;
v18 = v17;
v19 = strlen(v17);
std::string::__init(&v29, v18, v19);
v20 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v16, &v29);
std::string::~string((int)&v29);
if ( v20 )
{
for ( j = 0; j < cocos2d::CCArray::count(v20); ++j )
{
v27 = cocos2d::CCArray::objectAtIndex(v20, j);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v27 + 172))(v27, 1);
}
}
v21 = v2[134];
v22 = (const char *)ParentalOptionsLayer::layerKey((ParentalOptionsLayer *)v2, v3);
v29 = 0;
v30 = 0;
v31 = 0;
v23 = v22;
v24 = strlen(v22);
std::string::__init(&v29, v23, v24);
v25 = cocos2d::CCDictionary::objectForKey(v21, &v29);
std::string::~string((int)&v29);
if ( v25 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 172))(v25, 1);
v28 = v2[141];
v2[130] = v3;
(*(void (__fastcall **)(const char *, bool))(*(_DWORD *)v28 + 172))(v28, (int)v3 > 0);
return (const char **)(*(int (__fastcall **)(const char *, bool))(*(_DWORD *)v2[142] + 172))(
v2[142],
(int)v2[130] < (int)v2[132]);
}
return this;
}