{"type": "func", "start": 8309332, "end": 8309808, "name": "GJMGLayer::loadGroundSprites", "pseudocode": "// \n// GJMGLayer::loadGroundSprites from 0x7eca54 to 0x7ecc30 (476 bytes)\n// \n// 5 xrefs:\n// > GJMGLayer::init @ 0x7ecef4\n// > GJMGLayer::init @ 0x7ed04c\n// > GJMGLayer::updateGroundWidth @ 0x7ed36c\n// > GJMGLayer::updateGroundWidth @ 0x7ed37c\n// > <???> @ 0xb16a8\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 GJMGLayer::loadGroundSprites(GJMGLayer *a1, int a2, bool a3)\n{\n  cocos2d::CCSprite *m_ground1Sprite; // x20\n  cocos2d::CCSprite *m_ground2Sprite; // x0\n  cocos2d::CCArray *v6; // x19\n  cocos2d::CCArray *v7; // x0\n  int v8; // w22\n  cocos2d::CCSprite *v9; // x0\n  cocos2d::CCTexture2D *v10; // x1\n  float *v11; // x19\n  float v12; // s0\n  void (__fastcall *v13)(float *, cocos2d::CCPoint *); // x25\n  void (__fastcall *v14)(float *, cocos2d::CCPoint *); // x25\n  int v15; // w0\n  int v16; // w21\n  __int64 Object; // x0\n  cocos2d::CCPoint v18; // [xsp+50h] [xbp+50h] BYREF\n\n  m_ground1Sprite = a1->m_ground1Sprite;\n  m_ground2Sprite = a1->m_ground2Sprite;\n  if ( !a3 )\n    m_ground1Sprite = m_ground2Sprite;\n  if ( m_ground1Sprite )\n  {\n    v6 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)m_ground2Sprite);\n    if ( m_ground1Sprite->getChildren(m_ground1Sprite) )\n    {\n      v7 = m_ground1Sprite->getChildren(m_ground1Sprite);\n      cocos2d::CCArray::addObjectsFromArray(v6, v7);\n    }\n    if ( (unsigned int)cocos2d::CCArray::count(v6) != a2 )\n    {\n      if ( a2 > (unsigned int)cocos2d::CCArray::count(v6) )\n      {\n        v8 = cocos2d::CCArray::count(v6);\n        if ( a2 > v8 )\n        {\n          do\n          {\n            v9 = (cocos2d::CCSprite *)m_ground1Sprite->getTexture(m_ground1Sprite);\n            v11 = (float *)cocos2d::CCSprite::createWithTexture(v9, v10);\n            m_ground1Sprite->addChild(m_ground1Sprite, (cocos2d::CCNode *)v11);\n            v12 = (float)v8++;\n            v13 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_QWORD *)v11 + 184LL);\n            cocos2d::CCPoint::CCPoint(&v18, v12 * v11[108], 0.0);\n            v13(v11, &v18);\n            v14 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_QWORD *)v11 + 280LL);\n            cocos2d::CCPoint::CCPoint(&v18, 0.0, 0.0);\n            v14(v11, &v18);\n            (*(void (__fastcall **)(float *, void *))(*(_QWORD *)v11 + 944LL))(v11, &unk_ED4710);\n          }\n          while ( v8 != a2 );\n        }\n      }\n      else\n      {\n        v15 = cocos2d::CCArray::count(v6);\n        v16 = v15 - a2;\n        if ( v16 > 0 )\n        {\n          do\n          {\n            if ( !(unsigned int)cocos2d::CCArray::count(v6) )\n              break;\n            --v16;\n            Object = cocos2d::CCArray::lastObject(v6);\n            m_ground1Sprite->removeChild_0(m_ground1Sprite, (cocos2d::CCNode *)Object, 1);\n            cocos2d::CCArray::removeLastObject(v6, 1);\n          }\n          while ( v16 );\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJMGLayer::loadGroundSprites from 0x7eca54 to 0x7ecc30 (476 bytes)\n; \n; 5 xrefs:\n; > GJMGLayer::init @ 0x7ecef4\n; > GJMGLayer::init @ 0x7ed04c\n; > GJMGLayer::updateGroundWidth @ 0x7ed36c\n; > GJMGLayer::updateGroundWidth @ 0x7ed37c\n; > <???> @ 0xb16a8\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, 0x7eca54\nUXTB            W2, W2                                                 ; +0x4, 0x7eca58\nMOV             X29, SP                                                ; +0x8, 0x7eca5c\nSTP             X23, X24, [SP,#0x60+var_30]                            ; +0xc, 0x7eca60\nADRP            X24, #__stack_chk_guard_ptr@PAGE                       ; +0x10, 0x7eca64\nCMP             W2, WZR                                                ; +0x14, 0x7eca68\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x18, 0x7eca6c\nMOV             W21, W1                                                ; +0x1c, 0x7eca70\nLDR             X1, [X24,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x7eca74\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x24, 0x7eca78\nLDR             X20, [X0,#0x198]                                       ; +0x28, 0x7eca7c\nLDR             X0, [X0,#0x1A0]; this                                  ; +0x2c, 0x7eca80\nLDR             X1, [X1]                                               ; +0x30, 0x7eca84\nSTP             X25, X26, [SP,#0x60+var_20]                            ; +0x34, 0x7eca88\nSTR             X1, [X29,#0x60+var_8]                                  ; +0x38, 0x7eca8c\nCSEL            X20, X20, X0, NE                                       ; +0x3c, 0x7eca90\nCBZ             X20, loc_7ECBAC                                        ; +0x40, 0x7eca94\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x44, 0x7eca98\nMOV             X19, X0                                                ; +0x48, 0x7eca9c\nLDR             X1, [X20]                                              ; +0x4c, 0x7ecaa0\nMOV             X0, X20                                                ; +0x50, 0x7ecaa4\nLDR             X1, [X1,#0x1D8]                                        ; +0x54, 0x7ecaa8\nBLR             X1                                                     ; +0x58, 0x7ecaac\nCBZ             X0, loc_7ECAD0                                         ; +0x5c, 0x7ecab0\nLDR             X1, [X20]                                              ; +0x60, 0x7ecab4\nMOV             X0, X20                                                ; +0x64, 0x7ecab8\nLDR             X1, [X1,#0x1D8]                                        ; +0x68, 0x7ecabc\nBLR             X1                                                     ; +0x6c, 0x7ecac0\nMOV             X1, X0; cocos2d::CCArray *                             ; +0x70, 0x7ecac4\nMOV             X0, X19; this                                          ; +0x74, 0x7ecac8\nBL              _ZN7cocos2d7CCArray19addObjectsFromArrayEPS0_; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray*) ; +0x78, 0x7ecacc\nMOV             X0, X19; this                                          ; +0x7c, 0x7ecad0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x80, 0x7ecad4\nCMP             W0, W21                                                ; +0x84, 0x7ecad8\nB.EQ            loc_7ECBAC                                             ; +0x88, 0x7ecadc\nMOV             X0, X19; this                                          ; +0x8c, 0x7ecae0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x90, 0x7ecae4\nCMP             W21, W0                                                ; +0x94, 0x7ecae8\nMOV             X0, X19; this                                          ; +0x98, 0x7ecaec\nB.LS            loc_7ECBD8                                             ; +0x9c, 0x7ecaf0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xa0, 0x7ecaf4\nCMP             W21, W0                                                ; +0xa4, 0x7ecaf8\nMOV             W22, W0                                                ; +0xa8, 0x7ecafc\nB.LE            loc_7ECBAC                                             ; +0xac, 0x7ecb00\nADRP            X26, #unk_ED4710@PAGE                                  ; +0xb0, 0x7ecb04\nADD             X23, X29, #0x60+var_10                                 ; +0xb4, 0x7ecb08\nADD             X26, X26, #unk_ED4710@PAGEOFF                          ; +0xb8, 0x7ecb0c\nLDR             X1, [X20]                                              ; +0xbc, 0x7ecb10\nMOV             X0, X20                                                ; +0xc0, 0x7ecb14\nLDR             X1, [X1,#0x420]                                        ; +0xc4, 0x7ecb18\nBLR             X1                                                     ; +0xc8, 0x7ecb1c\nBL              _ZN7cocos2d8CCSprite17createWithTextureEPNS_11CCTexture2DE; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0xcc, 0x7ecb20\nMOV             X19, X0                                                ; +0xd0, 0x7ecb24\nLDR             X2, [X20]                                              ; +0xd4, 0x7ecb28\nMOV             X0, X20                                                ; +0xd8, 0x7ecb2c\nMOV             X1, X19                                                ; +0xdc, 0x7ecb30\nLDR             X2, [X2,#0x1B8]                                        ; +0xe0, 0x7ecb34\nBLR             X2                                                     ; +0xe4, 0x7ecb38\nSCVTF           S0, W22                                                ; +0xe8, 0x7ecb3c\nLDR             X1, [X19]                                              ; +0xec, 0x7ecb40\nLDR             S2, [X19,#0x1B0]                                       ; +0xf0, 0x7ecb44\nMOV             X0, X23; this                                          ; +0xf4, 0x7ecb48\nFMOV            S1, WZR; float                                         ; +0xf8, 0x7ecb4c\nADD             W22, W22, #1                                           ; +0xfc, 0x7ecb50\nLDR             X25, [X1,#0xB8]                                        ; +0x100, 0x7ecb54\nFMUL            S0, S0, S2; float                                      ; +0x104, 0x7ecb58\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x108, 0x7ecb5c\nMOV             X0, X19                                                ; +0x10c, 0x7ecb60\nMOV             X1, X23                                                ; +0x110, 0x7ecb64\nBLR             X25                                                    ; +0x114, 0x7ecb68\nFMOV            S0, WZR; float                                         ; +0x118, 0x7ecb6c\nLDR             X1, [X19]                                              ; +0x11c, 0x7ecb70\nMOV             X0, X23; this                                          ; +0x120, 0x7ecb74\nLDR             X25, [X1,#0x118]                                       ; +0x124, 0x7ecb78\nFMOV            S1, S0; float                                          ; +0x128, 0x7ecb7c\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x12c, 0x7ecb80\nMOV             X0, X19                                                ; +0x130, 0x7ecb84\nMOV             X1, X23                                                ; +0x134, 0x7ecb88\nBLR             X25                                                    ; +0x138, 0x7ecb8c\nLDR             X2, [X19]                                              ; +0x13c, 0x7ecb90\nMOV             X0, X19                                                ; +0x140, 0x7ecb94\nMOV             X1, X26                                                ; +0x144, 0x7ecb98\nLDR             X2, [X2,#0x3B0]                                        ; +0x148, 0x7ecb9c\nBLR             X2                                                     ; +0x14c, 0x7ecba0\nCMP             W22, W21                                               ; +0x150, 0x7ecba4\nB.NE            loc_7ECB10                                             ; +0x154, 0x7ecba8\nLDR             X24, [X24,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x158, 0x7ecbac\nLDR             X1, [X29,#0x60+var_8]                                  ; +0x15c, 0x7ecbb0\nLDR             X0, [X24]                                              ; +0x160, 0x7ecbb4\nCMP             X1, X0                                                 ; +0x164, 0x7ecbb8\nB.NE            loc_7ECC2C                                             ; +0x168, 0x7ecbbc\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x16c, 0x7ecbc0\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x170, 0x7ecbc4\nLDP             X23, X24, [SP,#0x60+var_30]                            ; +0x174, 0x7ecbc8\nLDP             X25, X26, [SP,#0x60+var_20]                            ; +0x178, 0x7ecbcc\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0x17c, 0x7ecbd0\nRET                                                                    ; +0x180, 0x7ecbd4\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x184, 0x7ecbd8\nSUB             W21, W0, W21                                           ; +0x188, 0x7ecbdc\nCMP             W21, WZR                                               ; +0x18c, 0x7ecbe0\nB.LE            loc_7ECBAC                                             ; +0x190, 0x7ecbe4\nMOV             X0, X19; this                                          ; +0x194, 0x7ecbe8\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x198, 0x7ecbec\nCBZ             W0, loc_7ECBAC                                         ; +0x19c, 0x7ecbf0\nMOV             X0, X19; this                                          ; +0x1a0, 0x7ecbf4\nSUB             W21, W21, #1                                           ; +0x1a4, 0x7ecbf8\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0x1a8, 0x7ecbfc\nMOV             X1, X0                                                 ; +0x1ac, 0x7ecc00\nLDR             X3, [X20]                                              ; +0x1b0, 0x7ecc04\nMOV             X0, X20                                                ; +0x1b4, 0x7ecc08\nMOV             W2, #1                                                 ; +0x1b8, 0x7ecc0c\nLDR             X3, [X3,#0x218]                                        ; +0x1bc, 0x7ecc10\nBLR             X3                                                     ; +0x1c0, 0x7ecc14\nMOV             X0, X19; this                                          ; +0x1c4, 0x7ecc18\nMOV             W1, #1; bool                                           ; +0x1c8, 0x7ecc1c\nBL              _ZN7cocos2d7CCArray16removeLastObjectEb; cocos2d::CCArray::removeLastObject(bool) ; +0x1cc, 0x7ecc20\nCBNZ            W21, loc_7ECBE8                                        ; +0x1d0, 0x7ecc24\nB               loc_7ECBAC                                             ; +0x1d4, 0x7ecc28\nBL              .__stack_chk_fail                                      ; +0x1d8, 0x7ecc2c", "xrefs": ["GJMGLayer::init @ 0x7ecef4", "GJMGLayer::init @ 0x7ed04c", "GJMGLayer::updateGroundWidth @ 0x7ed36c", "GJMGLayer::updateGroundWidth @ 0x7ed37c", "<???> @ 0xb16a8"], "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"}