{"type": "func", "start": 9209556, "end": 9210020, "name": "GJOptionsLayer::objectsForPage", "pseudocode": "// \n// GJOptionsLayer::objectsForPage from 0x8c86d4 to 0x8c88a4 (464 bytes)\n// \n// 4 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x8dae70\n// > EditorOptionsLayer::setupOptions @ 0x8db694\n// > GameOptionsLayer::setupOptions @ 0x8dc2b4\n// > <???> @ 0xb3d78\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\ncocos2d::CCArray *GJOptionsLayer::objectsForPage(GJOptionsLayer *a1, int a2)\n{\n  cocos2d::CCDictionary *m_values; // x20\n  char *v5; // x0\n  cocos2d::CCArray *v6; // x20\n  cocos2d::CCArray *v7; // x0\n  unsigned int *v9; // x1\n  int v10; // w2\n  GJOptionsLayer *v11; // x0\n  cocos2d::CCDictionary *v12; // x23\n  char *v13; // x0\n  char *v14; // x21\n  unsigned int *v15; // x1\n  int v16; // w0\n  std::string v17; // [xsp+60h] [xbp+60h] BYREF\n\n  m_values = a1->m_values;\n  v5 = (char *)GJOptionsLayer::objectKey(a1, a2);\n  sub_D153B8((int)&v17, v5);\n  v6 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(m_values, &v17);\n  v7 = (cocos2d::CCArray *)((char *)v17.m_data.m_data - 24);\n  if ( (__int64 *)v17.m_data.m_data - 3 == &qword_124B6B0 )\n    goto LABEL_2;\n  if ( &pthread_create )\n  {\n    v9 = (unsigned int *)((char *)v17.m_data.m_data - 8);\n    do\n      v10 = __ldaxr(v9);\n    while ( __stlxr(v10 - 1, v9) );\n  }\n  else\n  {\n    v10 = *((_DWORD *)v17.m_data.m_data - 2);\n    *((_DWORD *)v17.m_data.m_data - 2) = v10 - 1;\n  }\n  if ( v10 > 0 )\n  {\nLABEL_2:\n    if ( v6 )\n      return v6;\n  }\n  else\n  {\n    operator delete(v7);\n    if ( v6 )\n      return v6;\n  }\n  v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);\n  v11 = a1;\n  v12 = a1->m_values;\n  v13 = (char *)GJOptionsLayer::objectKey(v11, a2);\n  sub_D153B8((int)&v17, v13);\n  cocos2d::CCDictionary::setObject((int)v12, v6);\n  v14 = (char *)v17.m_data.m_data - 24;\n  if ( (__int64 *)v17.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v15 = (unsigned int *)((char *)v17.m_data.m_data - 8);\n      do\n        v16 = __ldaxr(v15);\n      while ( __stlxr(v16 - 1, v15) );\n    }\n    else\n    {\n      v16 = *((_DWORD *)v17.m_data.m_data - 2);\n      *((_DWORD *)v17.m_data.m_data - 2) = v16 - 1;\n    }\n    if ( v16 <= 0 )\n      operator delete(v14);\n  }\n  return v6;\n}", "assembly": "; \n; GJOptionsLayer::objectsForPage from 0x8c86d4 to 0x8c88a4 (464 bytes)\n; \n; 4 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x8dae70\n; > EditorOptionsLayer::setupOptions @ 0x8db694\n; > GameOptionsLayer::setupOptions @ 0x8dc2b4\n; > <???> @ 0xb3d78\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_70]!                                ; +0x0, 0x8c86d4\nMOV             X29, SP                                                ; +0x4, 0x8c86d8\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x8c86dc\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8c86e0\nSTR             X25, [SP,#0x70+var_30]                                 ; +0x10, 0x8c86e4\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x14, 0x8c86e8\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x18, 0x8c86ec\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x8c86f0\nMOV             W25, W1                                                ; +0x20, 0x8c86f4\nADD             X21, X29, #0x70+var_10                                 ; +0x24, 0x8c86f8\nLDR             X20, [X0,#0x3E0]                                       ; +0x28, 0x8c86fc\nMOV             X23, X0                                                ; +0x2c, 0x8c8700\nADD             X24, X29, #0x70+var_20                                 ; +0x30, 0x8c8704\nLDR             X2, [X2]                                               ; +0x34, 0x8c8708\nSTR             X2, [X29,#0x70+var_8]                                  ; +0x38, 0x8c870c\nBL              _ZN14GJOptionsLayer9objectKeyEi; GJOptionsLayer::objectKey(int) ; +0x3c, 0x8c8710\nMOV             X1, X0; char *                                         ; +0x40, 0x8c8714\nMOV             X2, X24                                                ; +0x44, 0x8c8718\nMOV             X0, X21; int                                           ; +0x48, 0x8c871c\nBL              sub_D153B8                                             ; +0x4c, 0x8c8720\nMOV             X0, X20                                                ; +0x50, 0x8c8724\nMOV             X1, X21                                                ; +0x54, 0x8c8728\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x58, 0x8c872c\nADRP            X22, #off_122EFE8@PAGE                                 ; +0x5c, 0x8c8730\nLDR             X1, [X29,#0x70+var_10]                                 ; +0x60, 0x8c8734\nMOV             X20, X0                                                ; +0x64, 0x8c8738\nSUB             X0, X1, #0x18; p                                       ; +0x68, 0x8c873c\nLDR             X2, [X22,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0x6c, 0x8c8740\nCMP             X0, X2                                                 ; +0x70, 0x8c8744\nB.NE            loc_8C8780                                             ; +0x74, 0x8c8748\nCBZ             X20, loc_8C87B4                                        ; +0x78, 0x8c874c\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x7c, 0x8c8750\nMOV             X0, X20                                                ; +0x80, 0x8c8754\nLDR             X2, [X29,#0x70+var_8]                                  ; +0x84, 0x8c8758\nLDR             X1, [X19]                                              ; +0x88, 0x8c875c\nCMP             X2, X1                                                 ; +0x8c, 0x8c8760\nB.NE            loc_8C8858                                             ; +0x90, 0x8c8764\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x94, 0x8c8768\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x98, 0x8c876c\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0x9c, 0x8c8770\nLDR             X25, [SP,#0x70+var_30]                                 ; +0xa0, 0x8c8774\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xa4, 0x8c8778\nRET                                                                    ; +0xa8, 0x8c877c\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0xac, 0x8c8780\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xb0, 0x8c8784\nCBZ             X2, loc_8C8838                                         ; +0xb4, 0x8c8788\nSUB             X1, X1, #8                                             ; +0xb8, 0x8c878c\nLDAXR           W2, [X1]                                               ; +0xbc, 0x8c8790\nSUB             W3, W2, #1                                             ; +0xc0, 0x8c8794\nSTLXR           W4, W3, [X1]                                           ; +0xc4, 0x8c8798\nCBNZ            W4, loc_8C8790                                         ; +0xc8, 0x8c879c\nCMP             W2, WZR                                                ; +0xcc, 0x8c87a0\nB.GT            loc_8C874C                                             ; +0xd0, 0x8c87a4\nADD             X1, X29, #0x70+var_18                                  ; +0xd4, 0x8c87a8\nBL              j__ZdlPv; operator delete(void *)                      ; +0xd8, 0x8c87ac\nCBNZ            X20, loc_8C8750                                        ; +0xdc, 0x8c87b0\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0xe0, 0x8c87b4\nMOV             X20, X0                                                ; +0xe4, 0x8c87b8\nMOV             W1, W25; int                                           ; +0xe8, 0x8c87bc\nMOV             X0, X23; this                                          ; +0xec, 0x8c87c0\nLDR             X23, [X23,#0x3E0]                                      ; +0xf0, 0x8c87c4\nBL              _ZN14GJOptionsLayer9objectKeyEi; GJOptionsLayer::objectKey(int) ; +0xf4, 0x8c87c8\nMOV             X1, X0; char *                                         ; +0xf8, 0x8c87cc\nMOV             X2, X24                                                ; +0xfc, 0x8c87d0\nMOV             X0, X21; int                                           ; +0x100, 0x8c87d4\nBL              sub_D153B8                                             ; +0x104, 0x8c87d8\nMOV             X0, X23; int                                           ; +0x108, 0x8c87dc\nMOV             X1, X20; this                                          ; +0x10c, 0x8c87e0\nMOV             X2, X21                                                ; +0x110, 0x8c87e4\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectERKSs; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const&) ; +0x114, 0x8c87e8\nLDR             X1, [X29,#0x70+var_10]                                 ; +0x118, 0x8c87ec\nLDR             X22, [X22,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0x11c, 0x8c87f0\nSUB             X21, X1, #0x18                                         ; +0x120, 0x8c87f4\nCMP             X21, X22                                               ; +0x124, 0x8c87f8\nB.EQ            loc_8C8750                                             ; +0x128, 0x8c87fc\nADRP            X0, #pthread_create_ptr_0@PAGE                         ; +0x12c, 0x8c8800\nLDR             X0, [X0,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x130, 0x8c8804\nCBZ             X0, loc_8C8848                                         ; +0x134, 0x8c8808\nSUB             X1, X1, #8                                             ; +0x138, 0x8c880c\nLDAXR           W0, [X1]                                               ; +0x13c, 0x8c8810\nSUB             W2, W0, #1                                             ; +0x140, 0x8c8814\nSTLXR           W3, W2, [X1]                                           ; +0x144, 0x8c8818\nCBNZ            W3, loc_8C8810                                         ; +0x148, 0x8c881c\nCMP             W0, WZR                                                ; +0x14c, 0x8c8820\nB.GT            loc_8C8750                                             ; +0x150, 0x8c8824\nMOV             X0, X21; p                                             ; +0x154, 0x8c8828\nADD             X1, X29, #0x70+var_18                                  ; +0x158, 0x8c882c\nBL              j__ZdlPv; operator delete(void *)                      ; +0x15c, 0x8c8830\nB               loc_8C8750                                             ; +0x160, 0x8c8834\nLDUR            W2, [X1,#-8]                                           ; +0x164, 0x8c8838\nSUB             W3, W2, #1                                             ; +0x168, 0x8c883c\nSTUR            W3, [X1,#-8]                                           ; +0x16c, 0x8c8840\nB               loc_8C87A0                                             ; +0x170, 0x8c8844\nLDUR            W0, [X1,#-8]                                           ; +0x174, 0x8c8848\nSUB             W2, W0, #1                                             ; +0x178, 0x8c884c\nSTUR            W2, [X1,#-8]                                           ; +0x17c, 0x8c8850\nB               loc_8C8820                                             ; +0x180, 0x8c8854\nBL              .__stack_chk_fail                                      ; +0x184, 0x8c8858\nMOV             X19, X0                                                ; +0x188, 0x8c885c\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x18c, 0x8c8860\nLDR             X22, [X22,#0xFE8]                                      ; +0x190, 0x8c8864\nSUB             X0, X0, #0x18                                          ; +0x194, 0x8c8868\nCMP             X0, X22                                                ; +0x198, 0x8c886c\nB.NE            loc_8C8898                                             ; +0x19c, 0x8c8870\nMOV             X0, X19                                                ; +0x1a0, 0x8c8874\nBL              _Unwind_Resume                                         ; +0x1a4, 0x8c8878\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x1a8, 0x8c887c\nMOV             X19, X0                                                ; +0x1ac, 0x8c8880\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x1b0, 0x8c8884\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x1b4, 0x8c8888\nSUB             X0, X0, #0x18                                          ; +0x1b8, 0x8c888c\nCMP             X0, X1                                                 ; +0x1bc, 0x8c8890\nB.EQ            loc_8C8874                                             ; +0x1c0, 0x8c8894\nADD             X1, X29, #0x70+var_18                                  ; +0x1c4, 0x8c8898\nBL              sub_4DC698                                             ; +0x1c8, 0x8c889c\nB               loc_8C8874                                             ; +0x1cc, 0x8c88a0", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x8dae70", "EditorOptionsLayer::setupOptions @ 0x8db694", "GameOptionsLayer::setupOptions @ 0x8dc2b4", "<???> @ 0xb3d78"], "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"}