//
// GJOptionsLayer::onToggle from 0x14039c170 to 0x14039c275 (261 bytes)
//
// 2 xrefs:
// > GJOptionsLayer::addToggleInternal @ 0x14039b314
// > ??> @ 0x14092336c
//
// This function is hookable on this platform (idp: pc, 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 11:31:15 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall GJOptionsLayer::onToggle(cocos2d::CCDictionary **a1, __int64 a2)
{
int v4; // eax
cocos2d::CCString *v5; // rbx
char *CString; // rax
__int64 v7; // rcx
const char *v8; // rax
size_t v9; // r8
cocos2d::CCDictionary *v11; // rbx
unsigned int v12; // eax
__int128 v13; // [rsp+20h] [rbp-28h] BYREF
__int64 v14; // [rsp+30h] [rbp-18h]
__int64 v15; // [rsp+38h] [rbp-10h]
void *v16; // [rsp+50h] [rbp+8h]
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
v5 = cocos2d::CCDictionary::objectForKey(a1[130], v4);
if ( v5 )
{
if ( !qword_14090BFD0 )
{
v16 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
CString = (char *)cocos2d::CCString::getCString(v5);
GameManager::toggleGameVariable(v7, CString);
v8 = cocos2d::CCString::getCString(v5);
v13 = 0;
v14 = 0;
v15 = 0;
v9 = -1;
do
++v9;
while ( v8[v9] );
sub_14003D230(&v13, v8, v9);
return (*((__int64 (__fastcall **)(cocos2d::CCDictionary **, __int128 *))*a1 + 151))(a1, &v13);
}
else
{
v11 = *a1;
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
return (*((__int64 (__fastcall **)(cocos2d::CCDictionary **, _QWORD))v11 + 152))(a1, v12);
}
}