//
// GJOptionsLayer::addGVToggle from 0x10029c580 to 0x10029c68b (267 bytes)
//
// 23 xrefs:
// > EditorOptionsLayer::setupOptions @ 0x10029dd6d
// > EditorOptionsLayer::setupOptions @ 0x10029dd8a
// > EditorOptionsLayer::setupOptions @ 0x10029dda7
// > EditorOptionsLayer::setupOptions @ 0x10029ddc4
// > EditorOptionsLayer::setupOptions @ 0x10029dde1
// > EditorOptionsLayer::setupOptions @ 0x10029ddfe
// > EditorOptionsLayer::setupOptions @ 0x10029de1b
// > EditorOptionsLayer::setupOptions @ 0x10029de38
// > EditorOptionsLayer::setupOptions @ 0x10029de55
// > EditorOptionsLayer::setupOptions @ 0x10029de72
// > EditorOptionsLayer::setupOptions @ 0x10029deaa
// > EditorOptionsLayer::setupOptions @ 0x10029dec7
// > EditorOptionsLayer::setupOptions @ 0x10029dee4
// > EditorOptionsLayer::setupOptions @ 0x10029df01
// > EditorOptionsLayer::setupOptions @ 0x10029df1e
// > EditorOptionsLayer::setupOptions @ 0x10029df3b
// > EditorOptionsLayer::setupOptions @ 0x10029df58
// > EditorOptionsLayer::setupOptions @ 0x10029df75
// > EditorOptionsLayer::setupOptions @ 0x10029df92
// > EditorOptionsLayer::setupOptions @ 0x10029dfaf
// > EditorOptionsLayer::setupOptions @ 0x10029dfcc
// > EditorOptionsLayer::setupOptions @ 0x10029dfe9
// > EditorOptionsLayer::setupOptions @ 0x10029e006
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJOptionsLayer::addGVToggle(GJOptionsLayer *a1, const char *a2, const char *a3, const char *a4)
{
double v4; // xmm0_8
int v7; // ebx
GameManager *v8; // rax
bool GameVariable; // al
cocos2d::CCDictionary *m_variables; // r15
size_t v11; // rax
size_t v12; // r12
char *v13; // r13
cocos2d::CCDictionary *v14; // rbx
size_t v15; // r15
cocos2d::CCObject *v16; // rax
_QWORD __dst[2]; // [rsp+8h] [rbp-48h] BYREF
void *__p; // [rsp+18h] [rbp-38h]
int v19; // [rsp+24h] [rbp-2Ch]
v7 = atoi(a3);
v8 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v8, a3);
GJOptionsLayer::addToggleInternal(a1, a2, v7, GameVariable, a4);
m_variables = a1->m_variables;
v11 = strlen(a3);
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v4);
v12 = v11;
if ( v11 >= 0x17 )
{
v19 = v7;
v14 = m_variables;
v15 = 26;
if ( (v11 | 7) != 0x17 )
v15 = (v11 | 7) + 1;
v13 = (char *)operator new(v15);
__p = v13;
__dst[0] = v15 + 1;
m_variables = v14;
v7 = v19;
__dst[1] = v12;
goto LABEL_8;
}
LOBYTE(__dst[0]) = 2 * v11;
v13 = (char *)__dst + 1;
if ( v11 )
LABEL_8:
memcpy(v13, a3, v12);
v13[v12] = 0;
v16 = (cocos2d::CCObject *)sub_1007AB360(__dst);
cocos2d::CCDictionary::setObject(m_variables, v16, v7);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}