{"type": "func", "start": 8304660, "end": 8305160, "name": "GJGroundLayer::loadGroundSprites", "pseudocode": "// \n// GJGroundLayer::loadGroundSprites from 0x7eb814 to 0x7eba08 (500 bytes)\n// \n// 5 xrefs:\n// > GJGroundLayer::init @ 0x7ec14c\n// > GJGroundLayer::init @ 0x7ec21c\n// > GJGroundLayer::updateGroundWidth @ 0x7ec3f4\n// > GJGroundLayer::updateGroundWidth @ 0x7ec404\n// > <???> @ 0x82020\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 GJGroundLayer::loadGroundSprites(GJGroundLayer *a1, int a2, bool a3)\n{\n  _BOOL4 v3; // w24\n  cocos2d::CCSprite *m_ground1Sprite; // x0\n  cocos2d::CCSprite *m_ground2Sprite; // x20\n  cocos2d::CCArray *v8; // x19\n  cocos2d::CCArray *v9; // x0\n  int v10; // w27\n  cocos2d::CCSprite *v11; // x0\n  cocos2d::CCTexture2D *v12; // x1\n  float *v13; // x19\n  float v14; // s1\n  void (__fastcall *v15)(float *, cocos2d::CCPoint *); // x28\n  float v16; // s0\n  void (__fastcall *v17)(float *, cocos2d::CCPoint *); // x28\n  int v18; // w0\n  int v19; // w21\n  __int64 Object; // x0\n  cocos2d::CCPoint v21; // [xsp+60h] [xbp+60h] BYREF\n\n  v3 = a3;\n  m_ground1Sprite = a1->m_ground1Sprite;\n  m_ground2Sprite = a1->m_ground2Sprite;\n  if ( a3 )\n    m_ground2Sprite = m_ground1Sprite;\n  if ( m_ground2Sprite )\n  {\n    v8 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)m_ground1Sprite);\n    if ( m_ground2Sprite->getChildren(m_ground2Sprite) )\n    {\n      v9 = m_ground2Sprite->getChildren(m_ground2Sprite);\n      cocos2d::CCArray::addObjectsFromArray(v8, v9);\n    }\n    if ( (unsigned int)cocos2d::CCArray::count(v8) != a2 )\n    {\n      if ( a2 > (unsigned int)cocos2d::CCArray::count(v8) )\n      {\n        v10 = cocos2d::CCArray::count(v8);\n        if ( a2 > v10 )\n        {\n          do\n          {\n            v11 = (cocos2d::CCSprite *)m_ground2Sprite->getTexture(m_ground2Sprite);\n            v13 = (float *)cocos2d::CCSprite::createWithTexture(v11, v12);\n            m_ground2Sprite->addChild(m_ground2Sprite, (cocos2d::CCNode *)v13);\n            v14 = 0.0;\n            v15 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_QWORD *)v13 + 184LL);\n            v16 = (float)v10 * v13[108];\n            if ( v3 )\n              v14 = -a1->m_ground1Offset;\n            ++v10;\n            cocos2d::CCPoint::CCPoint(&v21, v16, v14);\n            v15(v13, &v21);\n            v17 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_QWORD *)v13 + 280LL);\n            cocos2d::CCPoint::CCPoint(&v21, 0.0, 1.0);\n            v17(v13, &v21);\n            (*(void (__fastcall **)(float *, void *))(*(_QWORD *)v13 + 944LL))(v13, &unk_ED4710);\n          }\n          while ( v10 != a2 );\n        }\n      }\n      else\n      {\n        v18 = cocos2d::CCArray::count(v8);\n        v19 = v18 - a2;\n        if ( v19 > 0 )\n        {\n          do\n          {\n            if ( !(unsigned int)cocos2d::CCArray::count(v8) )\n              break;\n            --v19;\n            Object = cocos2d::CCArray::lastObject(v8);\n            m_ground2Sprite->removeChild_0(m_ground2Sprite, (cocos2d::CCNode *)Object, 1);\n            cocos2d::CCArray::removeLastObject(v8, 1);\n          }\n          while ( v19 );\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJGroundLayer::loadGroundSprites from 0x7eb814 to 0x7eba08 (500 bytes)\n; \n; 5 xrefs:\n; > GJGroundLayer::init @ 0x7ec14c\n; > GJGroundLayer::init @ 0x7ec21c\n; > GJGroundLayer::updateGroundWidth @ 0x7ec3f4\n; > GJGroundLayer::updateGroundWidth @ 0x7ec404\n; > <???> @ 0x82020\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, 0x7eb814\nMOV             X29, SP                                                ; +0x4, 0x7eb818\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x8, 0x7eb81c\nADRP            X23, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x7eb820\nUXTB            W24, W2                                                ; +0x10, 0x7eb824\nSTP             X25, X26, [SP,#0x70+var_30]                            ; +0x14, 0x7eb828\nMOV             X25, X0                                                ; +0x18, 0x7eb82c\nLDR             X0, [X0,#0x198]; this                                  ; +0x1c, 0x7eb830\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x20, 0x7eb834\nMOV             W21, W1                                                ; +0x24, 0x7eb838\nLDR             X1, [X23,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x28, 0x7eb83c\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x2c, 0x7eb840\nLDR             X20, [X25,#0x1A0]                                      ; +0x30, 0x7eb844\nCMP             W24, WZR                                               ; +0x34, 0x7eb848\nLDR             X1, [X1]                                               ; +0x38, 0x7eb84c\nSTP             X27, X28, [SP,#0x70+var_20]                            ; +0x3c, 0x7eb850\nSTR             X1, [X29,#0x70+var_8]                                  ; +0x40, 0x7eb854\nCSEL            X20, X20, X0, EQ                                       ; +0x44, 0x7eb858\nCBZ             X20, loc_7EB980                                        ; +0x48, 0x7eb85c\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x4c, 0x7eb860\nMOV             X19, X0                                                ; +0x50, 0x7eb864\nLDR             X1, [X20]                                              ; +0x54, 0x7eb868\nMOV             X0, X20                                                ; +0x58, 0x7eb86c\nLDR             X1, [X1,#0x1D8]                                        ; +0x5c, 0x7eb870\nBLR             X1                                                     ; +0x60, 0x7eb874\nCBZ             X0, loc_7EB898                                         ; +0x64, 0x7eb878\nLDR             X1, [X20]                                              ; +0x68, 0x7eb87c\nMOV             X0, X20                                                ; +0x6c, 0x7eb880\nLDR             X1, [X1,#0x1D8]                                        ; +0x70, 0x7eb884\nBLR             X1                                                     ; +0x74, 0x7eb888\nMOV             X1, X0; cocos2d::CCArray *                             ; +0x78, 0x7eb88c\nMOV             X0, X19; this                                          ; +0x7c, 0x7eb890\nBL              _ZN7cocos2d7CCArray19addObjectsFromArrayEPS0_; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray*) ; +0x80, 0x7eb894\nMOV             X0, X19; this                                          ; +0x84, 0x7eb898\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x88, 0x7eb89c\nCMP             W0, W21                                                ; +0x8c, 0x7eb8a0\nB.EQ            loc_7EB980                                             ; +0x90, 0x7eb8a4\nMOV             X0, X19; this                                          ; +0x94, 0x7eb8a8\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x98, 0x7eb8ac\nCMP             W21, W0                                                ; +0x9c, 0x7eb8b0\nMOV             X0, X19; this                                          ; +0xa0, 0x7eb8b4\nB.LS            loc_7EB9B0                                             ; +0xa4, 0x7eb8b8\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xa8, 0x7eb8bc\nCMP             W21, W0                                                ; +0xac, 0x7eb8c0\nMOV             W27, W0                                                ; +0xb0, 0x7eb8c4\nB.LE            loc_7EB980                                             ; +0xb4, 0x7eb8c8\nADRP            X26, #unk_ED4710@PAGE                                  ; +0xb8, 0x7eb8cc\nADD             X22, X29, #0x70+var_10                                 ; +0xbc, 0x7eb8d0\nADD             X26, X26, #unk_ED4710@PAGEOFF                          ; +0xc0, 0x7eb8d4\nLDR             X1, [X20]                                              ; +0xc4, 0x7eb8d8\nMOV             X0, X20                                                ; +0xc8, 0x7eb8dc\nLDR             X1, [X1,#0x420]                                        ; +0xcc, 0x7eb8e0\nBLR             X1                                                     ; +0xd0, 0x7eb8e4\nBL              _ZN7cocos2d8CCSprite17createWithTextureEPNS_11CCTexture2DE; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0xd4, 0x7eb8e8\nMOV             X19, X0                                                ; +0xd8, 0x7eb8ec\nLDR             X2, [X20]                                              ; +0xdc, 0x7eb8f0\nMOV             X0, X20                                                ; +0xe0, 0x7eb8f4\nMOV             X1, X19                                                ; +0xe4, 0x7eb8f8\nLDR             X2, [X2,#0x1B8]                                        ; +0xe8, 0x7eb8fc\nBLR             X2                                                     ; +0xec, 0x7eb900\nSCVTF           S0, W27                                                ; +0xf0, 0x7eb904\nLDR             X0, [X19]                                              ; +0xf4, 0x7eb908\nLDR             S2, [X19,#0x1B0]                                       ; +0xf8, 0x7eb90c\nFMOV            S1, WZR                                                ; +0xfc, 0x7eb910\nLDR             X28, [X0,#0xB8]                                        ; +0x100, 0x7eb914\nFMUL            S0, S0, S2; float                                      ; +0x104, 0x7eb918\nCBZ             W24, loc_7EB928                                        ; +0x108, 0x7eb91c\nLDR             S1, [X25,#0x1BC]                                       ; +0x10c, 0x7eb920\nFNEG            S1, S1; float                                          ; +0x110, 0x7eb924\nMOV             X0, X22; this                                          ; +0x114, 0x7eb928\nADD             W27, W27, #1                                           ; +0x118, 0x7eb92c\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x11c, 0x7eb930\nMOV             X0, X19                                                ; +0x120, 0x7eb934\nMOV             X1, X22                                                ; +0x124, 0x7eb938\nBLR             X28                                                    ; +0x128, 0x7eb93c\nFMOV            S0, WZR; float                                         ; +0x12c, 0x7eb940\nLDR             X1, [X19]                                              ; +0x130, 0x7eb944\nFMOV            S1, #1.0; float                                        ; +0x134, 0x7eb948\nMOV             X0, X22; this                                          ; +0x138, 0x7eb94c\nLDR             X28, [X1,#0x118]                                       ; +0x13c, 0x7eb950\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x140, 0x7eb954\nMOV             X0, X19                                                ; +0x144, 0x7eb958\nMOV             X1, X22                                                ; +0x148, 0x7eb95c\nBLR             X28                                                    ; +0x14c, 0x7eb960\nLDR             X2, [X19]                                              ; +0x150, 0x7eb964\nMOV             X0, X19                                                ; +0x154, 0x7eb968\nMOV             X1, X26                                                ; +0x158, 0x7eb96c\nLDR             X2, [X2,#0x3B0]                                        ; +0x15c, 0x7eb970\nBLR             X2                                                     ; +0x160, 0x7eb974\nCMP             W27, W21                                               ; +0x164, 0x7eb978\nB.NE            loc_7EB8D8                                             ; +0x168, 0x7eb97c\nLDR             X23, [X23,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x16c, 0x7eb980\nLDR             X1, [X29,#0x70+var_8]                                  ; +0x170, 0x7eb984\nLDR             X0, [X23]                                              ; +0x174, 0x7eb988\nCMP             X1, X0                                                 ; +0x178, 0x7eb98c\nB.NE            loc_7EBA04                                             ; +0x17c, 0x7eb990\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x180, 0x7eb994\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x184, 0x7eb998\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0x188, 0x7eb99c\nLDP             X25, X26, [SP,#0x70+var_30]                            ; +0x18c, 0x7eb9a0\nLDP             X27, X28, [SP,#0x70+var_20]                            ; +0x190, 0x7eb9a4\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x194, 0x7eb9a8\nRET                                                                    ; +0x198, 0x7eb9ac\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x19c, 0x7eb9b0\nSUB             W21, W0, W21                                           ; +0x1a0, 0x7eb9b4\nCMP             W21, WZR                                               ; +0x1a4, 0x7eb9b8\nB.LE            loc_7EB980                                             ; +0x1a8, 0x7eb9bc\nMOV             X0, X19; this                                          ; +0x1ac, 0x7eb9c0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x1b0, 0x7eb9c4\nCBZ             W0, loc_7EB980                                         ; +0x1b4, 0x7eb9c8\nMOV             X0, X19; this                                          ; +0x1b8, 0x7eb9cc\nSUB             W21, W21, #1                                           ; +0x1bc, 0x7eb9d0\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0x1c0, 0x7eb9d4\nMOV             X1, X0                                                 ; +0x1c4, 0x7eb9d8\nLDR             X3, [X20]                                              ; +0x1c8, 0x7eb9dc\nMOV             X0, X20                                                ; +0x1cc, 0x7eb9e0\nMOV             W2, #1                                                 ; +0x1d0, 0x7eb9e4\nLDR             X3, [X3,#0x218]                                        ; +0x1d4, 0x7eb9e8\nBLR             X3                                                     ; +0x1d8, 0x7eb9ec\nMOV             X0, X19; this                                          ; +0x1dc, 0x7eb9f0\nMOV             W1, #1; bool                                           ; +0x1e0, 0x7eb9f4\nBL              _ZN7cocos2d7CCArray16removeLastObjectEb; cocos2d::CCArray::removeLastObject(bool) ; +0x1e4, 0x7eb9f8\nCBNZ            W21, loc_7EB9C0                                        ; +0x1e8, 0x7eb9fc\nB               loc_7EB980                                             ; +0x1ec, 0x7eba00\nBL              .__stack_chk_fail                                      ; +0x1f0, 0x7eba04", "xrefs": ["GJGroundLayer::init @ 0x7ec14c", "GJGroundLayer::init @ 0x7ec21c", "GJGroundLayer::updateGroundWidth @ 0x7ec3f4", "GJGroundLayer::updateGroundWidth @ 0x7ec404", "<???> @ 0x82020"], "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"}