//
// GJOptionsLayer::addGVToggle from 0xa35204 to 0xa3536c (360 bytes)
//
// 27 xrefs:
// > EditorOptionsLayer::setupOptions @ 0xa353d8
// > EditorOptionsLayer::setupOptions @ 0xa35404
// > EditorOptionsLayer::setupOptions @ 0xa35434
// > EditorOptionsLayer::setupOptions @ 0xa3545c
// > EditorOptionsLayer::setupOptions @ 0xa3547c
// > EditorOptionsLayer::setupOptions @ 0xa3549c
// > EditorOptionsLayer::setupOptions @ 0xa354bc
// > EditorOptionsLayer::setupOptions @ 0xa354dc
// > EditorOptionsLayer::setupOptions @ 0xa354fc
// > EditorOptionsLayer::setupOptions @ 0xa3551c
// > EditorOptionsLayer::setupOptions @ 0xa35544
// > EditorOptionsLayer::setupOptions @ 0xa35564
// > EditorOptionsLayer::setupOptions @ 0xa35584
// > EditorOptionsLayer::setupOptions @ 0xa355a4
// > EditorOptionsLayer::setupOptions @ 0xa355c4
// > EditorOptionsLayer::setupOptions @ 0xa355e4
// > EditorOptionsLayer::setupOptions @ 0xa35604
// > EditorOptionsLayer::setupOptions @ 0xa35624
// > EditorOptionsLayer::setupOptions @ 0xa35644
// > EditorOptionsLayer::setupOptions @ 0xa35664
// > EditorOptionsLayer::setupOptions @ 0xa35684
// > EditorOptionsLayer::setupOptions @ 0xa356a4
// > EditorOptionsLayer::setupOptions @ 0xa356c4
// > EditorOptionsLayer::setupOptions @ 0xa356e4
// > SFXSettingsPopup::setupOptions @ 0xb8de30
// > FindObjectOptionsLayer::setupOptions @ 0xcbca94
// > ??> @ 0x91930
//
// 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:59:49 +0000
//
CCMenuItemToggler *__fastcall GJOptionsLayer::addGVToggle(cocos2d::CCDictionary **this, char *a2, char *a3, char *a4)
{
GameManager *v7; // x0
int v8; // w25
GameManager *v9; // x0
unsigned __int8 GameVariable; // w0
CCMenuItemToggler *v11; // x24
size_t v12; // x0
size_t v13; // x19
cocos2d::CCDictionary *v14; // x26
unsigned __int64 v15; // x0
char *v16; // x3
cocos2d::CCObject *v17; // x0
__int64 v20; // [xsp+60h] [xbp+60h] BYREF
size_t v21; // [xsp+68h] [xbp+68h]
void *v22; // [xsp+70h] [xbp+70h]
v7 = (GameManager *)atoi(a3);
v8 = (int)v7;
v9 = (GameManager *)GameManager::sharedState(v7);
GameVariable = GameManager::getGameVariable(v9, a3);
v11 = GJOptionsLayer::addToggleInternal((GJOptionsLayer *)this, a2, v8, GameVariable, a4);
v20 = 0;
v21 = 0;
v22 = nullptr;
v12 = strlen(a3);
v13 = v12;
v14 = *(this + 131);
if ( v12 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D99C();
if ( v12 > 0x16 )
{
v15 = (v12 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v20 = v15 | 1;
v16 = (char *)operator new(v15);
v22 = v16;
v21 = v13;
LABEL_4:
v16 = (char *)memcpy(v16, a3, v13);
goto LABEL_5;
}
LOBYTE(v20) = 2 * v12;
v16 = (char *)&v20 + 1;
if ( v12 )
goto LABEL_4;
LABEL_5:
v16[v13] = 0;
v17 = (cocos2d::CCObject *)cocos2d::CCString::create(&v20);
cocos2d::CCDictionary::setObject(v14, v17, v8);
if ( (v20 & 1) != 0 )
operator delete(v22);
return v11;
}