//
// ParentalOptionsLayer::incrementCountForPage from 0x8efe88 to 0x8effcc (324 bytes)
//
// 3 xrefs:
// > ParentalOptionsLayer::addToggle @ 0x8f278c
// > ParentalOptionsLayer::addMasterToggle @ 0x8f66f0
// > ??> @ 0xfc538
//
// 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:56:57 +0000
//
__int64 __fastcall ParentalOptionsLayer::incrementCountForPage(ParentalOptionsLayer *this, const char *a2)
{
unsigned int v3; // w22
int v4; // w0
__int64 v5; // x24
cocos2d::CCObject *v6; // x23
const char *v7; // x25
size_t v8; // x0
size_t v9; // x19
unsigned __int64 v10; // x0
char *v11; // x3
__int64 v13; // [xsp+50h] [xbp+50h] BYREF
size_t v14; // [xsp+58h] [xbp+58h]
void *v15; // [xsp+60h] [xbp+60h]
v3 = (unsigned int)a2;
v4 = ParentalOptionsLayer::countForPage(this, a2);
v5 = *((_QWORD *)this + 85);
v6 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(v4 + 1));
v13 = 0;
v7 = (const char *)ParentalOptionsLayer::pageKey(this, (const char *)v3);
v14 = 0;
v15 = nullptr;
v8 = strlen(v7);
v9 = v8;
if ( v8 > 0xFFFFFFFFFFFFFFEFLL )
sub_62CD3C();
if ( v8 > 0x16 )
{
v10 = (v8 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v13 = v10 | 1;
v11 = (char *)operator new(v10);
v15 = v11;
v14 = v9;
LABEL_4:
v11 = (char *)memcpy(v11, v7, v9);
goto LABEL_5;
}
LOBYTE(v13) = 2 * v8;
v11 = (char *)&v13 + 1;
if ( v8 )
goto LABEL_4;
LABEL_5:
v11[v9] = 0;
cocos2d::CCDictionary::setObject(v5, v6);
if ( (v13 & 1) != 0 )
operator delete(v15);
return _stack_chk_guard;
}