{"type": "func", "start": 9209228, "end": 9209528, "name": "GJOptionsLayer::incrementCountForPage", "pseudocode": "// \n// GJOptionsLayer::incrementCountForPage from 0x8c858c to 0x8c86b8 (300 bytes)\n// \n// 3 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x8dae64\n// > GameOptionsLayer::setupOptions @ 0x8dc1b4\n// > <???> @ 0x71dd8\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 GJOptionsLayer::incrementCountForPage(GJOptionsLayer *a1, int a2)\n{\n  int v4; // w0\n  cocos2d::CCDictionary *m_values; // x23\n  cocos2d::CCObject *v6; // x22\n  char *v7; // x0\n  void *v8; // x0\n  unsigned int *v9; // x2\n  int v10; // w1\n  __int64 v11; // [xsp+50h] [xbp+50h] BYREF\n\n  v4 = GJOptionsLayer::countForPage(a1, a2);\n  m_values = a1->m_values;\n  v6 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(\n                              (cocos2d::CCString *)\"%i\",\n                              (const char *)(unsigned int)(v4 + 1));\n  v7 = (char *)GJOptionsLayer::pageKey(a1, a2);\n  sub_D153B8((int)&v11, v7);\n  cocos2d::CCDictionary::setObject((int)m_values, v6);\n  v8 = (void *)(v11 - 24);\n  if ( (__int64 *)(v11 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v9 = (unsigned int *)(v11 - 8);\n      do\n        v10 = __ldaxr(v9);\n      while ( __stlxr(v10 - 1, v9) );\n    }\n    else\n    {\n      v10 = *(_DWORD *)(v11 - 8);\n      *(_DWORD *)(v11 - 8) = v10 - 1;\n    }\n    if ( v10 <= 0 )\n      operator delete(v8);\n  }\n}", "assembly": "; \n; GJOptionsLayer::incrementCountForPage from 0x8c858c to 0x8c86b8 (300 bytes)\n; \n; 3 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x8dae64\n; > GameOptionsLayer::setupOptions @ 0x8dc1b4\n; > <???> @ 0x71dd8\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\nSTP             X29, X30, [SP,#var_60]!                                ; +0x0, 0x8c858c\nMOV             X29, SP                                                ; +0x4, 0x8c8590\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0x8c8594\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8c8598\nADD             X20, X29, #0x60+var_10                                 ; +0x10, 0x8c859c\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x14, 0x8c85a0\nSTP             X23, X24, [SP,#0x60+var_30]                            ; +0x18, 0x8c85a4\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x8c85a8\nMOV             X21, X0                                                ; +0x20, 0x8c85ac\nMOV             W24, W1                                                ; +0x24, 0x8c85b0\nLDR             X2, [X2]                                               ; +0x28, 0x8c85b4\nSTR             X2, [X29,#0x60+var_8]                                  ; +0x2c, 0x8c85b8\nBL              _ZN14GJOptionsLayer12countForPageEi; GJOptionsLayer::countForPage(int) ; +0x30, 0x8c85bc\nADD             W1, W0, #1; char *                                     ; +0x34, 0x8c85c0\nADRP            X0, #(aSongidI+8)@PAGE; \"%i\"                           ; +0x38, 0x8c85c4\nLDR             X23, [X21,#0x3E0]                                      ; +0x3c, 0x8c85c8\nADD             X0, X0, #(aSongidI+8)@PAGEOFF; this                    ; +0x40, 0x8c85cc\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x44, 0x8c85d0\nMOV             X22, X0                                                ; +0x48, 0x8c85d4\nMOV             W1, W24; int                                           ; +0x4c, 0x8c85d8\nMOV             X0, X21; this                                          ; +0x50, 0x8c85dc\nBL              _ZN14GJOptionsLayer7pageKeyEi; GJOptionsLayer::pageKey(int) ; +0x54, 0x8c85e0\nMOV             X1, X0; char *                                         ; +0x58, 0x8c85e4\nADD             X2, X29, #0x60+var_20                                  ; +0x5c, 0x8c85e8\nMOV             X0, X20; int                                           ; +0x60, 0x8c85ec\nBL              sub_D153B8                                             ; +0x64, 0x8c85f0\nMOV             X0, X23; int                                           ; +0x68, 0x8c85f4\nMOV             X1, X22; this                                          ; +0x6c, 0x8c85f8\nMOV             X2, X20                                                ; +0x70, 0x8c85fc\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectERKSs; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const&) ; +0x74, 0x8c8600\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x78, 0x8c8604\nLDR             X2, [X29,#0x60+var_10]                                 ; +0x7c, 0x8c8608\nSUB             X0, X2, #0x18; p                                       ; +0x80, 0x8c860c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x84, 0x8c8610\nCMP             X0, X1                                                 ; +0x88, 0x8c8614\nB.NE            loc_8C8644                                             ; +0x8c, 0x8c8618\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x90, 0x8c861c\nLDR             X1, [X29,#0x60+var_8]                                  ; +0x94, 0x8c8620\nLDR             X0, [X19]                                              ; +0x98, 0x8c8624\nCMP             X1, X0                                                 ; +0x9c, 0x8c8628\nB.NE            loc_8C8688                                             ; +0xa0, 0x8c862c\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0xa4, 0x8c8630\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0xa8, 0x8c8634\nLDP             X23, X24, [SP,#0x60+var_30]                            ; +0xac, 0x8c8638\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0xb0, 0x8c863c\nRET                                                                    ; +0xb4, 0x8c8640\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xb8, 0x8c8644\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xbc, 0x8c8648\nCBZ             X1, loc_8C8678                                         ; +0xc0, 0x8c864c\nSUB             X2, X2, #8                                             ; +0xc4, 0x8c8650\nLDAXR           W1, [X2]                                               ; +0xc8, 0x8c8654\nSUB             W3, W1, #1                                             ; +0xcc, 0x8c8658\nSTLXR           W4, W3, [X2]                                           ; +0xd0, 0x8c865c\nCBNZ            W4, loc_8C8654                                         ; +0xd4, 0x8c8660\nCMP             W1, WZR                                                ; +0xd8, 0x8c8664\nB.GT            loc_8C861C                                             ; +0xdc, 0x8c8668\nADD             X1, X29, #0x60+var_18                                  ; +0xe0, 0x8c866c\nBL              j__ZdlPv; operator delete(void *)                      ; +0xe4, 0x8c8670\nB               loc_8C861C                                             ; +0xe8, 0x8c8674\nLDUR            W1, [X2,#-8]                                           ; +0xec, 0x8c8678\nSUB             W3, W1, #1                                             ; +0xf0, 0x8c867c\nSTUR            W3, [X2,#-8]                                           ; +0xf4, 0x8c8680\nB               loc_8C8664                                             ; +0xf8, 0x8c8684\nBL              .__stack_chk_fail                                      ; +0xfc, 0x8c8688\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x100, 0x8c868c\nMOV             X19, X0                                                ; +0x104, 0x8c8690\nLDR             X0, [X29,#0x60+var_10]                                 ; +0x108, 0x8c8694\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x10c, 0x8c8698\nSUB             X0, X0, #0x18                                          ; +0x110, 0x8c869c\nCMP             X0, X1                                                 ; +0x114, 0x8c86a0\nB.EQ            loc_8C86B0                                             ; +0x118, 0x8c86a4\nADD             X1, X29, #0x60+var_18                                  ; +0x11c, 0x8c86a8\nBL              sub_4DC698                                             ; +0x120, 0x8c86ac\nMOV             X0, X19                                                ; +0x124, 0x8c86b0\nBL              _Unwind_Resume                                         ; +0x128, 0x8c86b4", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x8dae64", "GameOptionsLayer::setupOptions @ 0x8dc1b4", "<???> @ 0x71dd8"], "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"}