{"type": "func", "start": 4297931536, "end": 4297931760, "name": "GJOptionsLayer::onToggle", "pseudocode": "// \n// GJOptionsLayer::onToggle from 0x1002d3b10 to 0x1002d3bf0 (224 bytes)\n// \n// 2 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x1002d366c\n// > GameOptionsLayer::setupOptions @ 0x1002e1a5c\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall GJOptionsLayer::onToggle(GJOptionsLayer *a1, cocos2d::CCObject *a2)\n{\n  cocos2d::CCDictionary *m_variables; // x21\n  int v5; // w0\n  cocos2d::CCObject *v6; // x0\n  cocos2d::CCString *v7; // x21\n  GameManager *v8; // x20\n  const char *CString; // x0\n  char *v10; // x0\n  __int64 v11; // x0\n  void *__p[2]; // [xsp+8h] [xbp-38h] BYREF\n  char v13; // [xsp+1Fh] [xbp-21h]\n\n  m_variables = a1->m_variables;\n  v5 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);\n  v6 = cocos2d::CCDictionary::objectForKey(m_variables, v5);\n  if ( v6 )\n  {\n    v7 = (cocos2d::CCString *)v6;\n    v8 = GameManager::sharedState();\n    CString = cocos2d::CCString::getCString(v7);\n    GameManager::toggleGameVariable(v8, CString);\n    v10 = (char *)cocos2d::CCString::getCString(v7);\n    sub_100009900(__p, v10);\n    ((void (__fastcall *)(GJOptionsLayer *, void **))a1->didToggleGV)(a1, __p);\n    if ( v13 < 0 )\n      operator delete(__p[0]);\n  }\n  else\n  {\n    v11 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);\n    ((void (__fastcall *)(GJOptionsLayer *, __int64))a1->didToggle)(a1, v11);\n  }\n}", "assembly": "; \n; GJOptionsLayer::onToggle from 0x1002d3b10 to 0x1002d3bf0 (224 bytes)\n; \n; 2 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x1002d366c\n; > GameOptionsLayer::setupOptions @ 0x1002e1a5c\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSUB             SP, SP, #0x50                                          ; +0x0, 0x1002d3b10\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x4, 0x1002d3b14\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0x8, 0x1002d3b18\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0xc, 0x1002d3b1c\nADD             X29, SP, #0x40                                         ; +0x10, 0x1002d3b20\nMOV             X20, X1                                                ; +0x14, 0x1002d3b24\nMOV             X19, X0                                                ; +0x18, 0x1002d3b28\nLDR             X21, [X0,#0x3D0]                                       ; +0x1c, 0x1002d3b2c\nLDR             X8, [X1]                                               ; +0x20, 0x1002d3b30\nLDR             X8, [X8,#0x40]                                         ; +0x24, 0x1002d3b34\nMOV             X0, X1                                                 ; +0x28, 0x1002d3b38\nBLR             X8                                                     ; +0x2c, 0x1002d3b3c\nSXTW            X1, W0                                                 ; +0x30, 0x1002d3b40\nMOV             X0, X21                                                ; +0x34, 0x1002d3b44\nBL              cocos2d__CCDictionary__objectForKey                    ; +0x38, 0x1002d3b48\nCBZ             X0, loc_1002D3BBC                                      ; +0x3c, 0x1002d3b4c\nMOV             X21, X0                                                ; +0x40, 0x1002d3b50\nBL              GameManager__sharedState                               ; +0x44, 0x1002d3b54\nMOV             X20, X0                                                ; +0x48, 0x1002d3b58\nMOV             X0, X21                                                ; +0x4c, 0x1002d3b5c\nBL              cocos2d__CCString__getCString                          ; +0x50, 0x1002d3b60\nMOV             X1, X0                                                 ; +0x54, 0x1002d3b64\nMOV             X0, X20                                                ; +0x58, 0x1002d3b68\nBL              GameManager__toggleGameVariable                        ; +0x5c, 0x1002d3b6c\nMOV             X0, X21                                                ; +0x60, 0x1002d3b70\nBL              cocos2d__CCString__getCString                          ; +0x64, 0x1002d3b74\nMOV             X1, X0; __s                                            ; +0x68, 0x1002d3b78\nADD             X0, SP, #0x40+__p; int                                 ; +0x6c, 0x1002d3b7c\nBL              sub_100009900                                          ; +0x70, 0x1002d3b80\nLDR             X8, [X19]                                              ; +0x74, 0x1002d3b84\nLDR             X8, [X8,#0x5C8]                                        ; +0x78, 0x1002d3b88\nADD             X1, SP, #0x40+__p                                      ; +0x7c, 0x1002d3b8c\nMOV             X0, X19                                                ; +0x80, 0x1002d3b90\nBLR             X8                                                     ; +0x84, 0x1002d3b94\nLDRSB           W8, [SP,#0x40+var_21]                                  ; +0x88, 0x1002d3b98\nTBZ             W8, #0x1F, loc_1002D3BA8                               ; +0x8c, 0x1002d3b9c\nLDR             X0, [SP,#0x40+__p]; __p                                ; +0x90, 0x1002d3ba0\nBL              __ZdlPv; operator delete(void *)                       ; +0x94, 0x1002d3ba4\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x98, 0x1002d3ba8\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x9c, 0x1002d3bac\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0xa0, 0x1002d3bb0\nADD             SP, SP, #0x50 ; 'P'                                    ; +0xa4, 0x1002d3bb4\nRET                                                                    ; +0xa8, 0x1002d3bb8\nLDR             X8, [X20]                                              ; +0xac, 0x1002d3bbc\nLDR             X8, [X8,#0x40]                                         ; +0xb0, 0x1002d3bc0\nMOV             X0, X20                                                ; +0xb4, 0x1002d3bc4\nBLR             X8                                                     ; +0xb8, 0x1002d3bc8\nMOV             X1, X0                                                 ; +0xbc, 0x1002d3bcc\nLDR             X8, [X19]                                              ; +0xc0, 0x1002d3bd0\nLDR             X2, [X8,#0x5D0]                                        ; +0xc4, 0x1002d3bd4\nMOV             X0, X19                                                ; +0xc8, 0x1002d3bd8\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0xcc, 0x1002d3bdc\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0xd0, 0x1002d3be0\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0xd4, 0x1002d3be4\nADD             SP, SP, #0x50 ; 'P'                                    ; +0xd8, 0x1002d3be8\nBR              X2                                                     ; +0xdc, 0x1002d3bec", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x1002d366c", "GameOptionsLayer::setupOptions @ 0x1002e1a5c"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}