{"type": "func", "start": 4410988, "end": 4411280, "name": "GJMGLayer::loadGroundSprites", "pseudocode": "// \n// GJMGLayer::loadGroundSprites from 0x434e6c to 0x434f90 (292 bytes)\n// \n// 4 xrefs:\n// > GJMGLayer::init @ 0x43513c\n// > GJMGLayer::init @ 0x435220\n// > GJMGLayer::updateGroundWidth @ 0x435406\n// > GJMGLayer::updateGroundWidth @ 0x435410\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; // r4\n  cocos2d::CCArray *v5; // r5\n  cocos2d::CCArray *v6; // r0\n  int v7; // r7\n  __int64 v8; // r0\n  float *v9; // r5\n  float v10; // s14\n  void (__fastcall *v11)(float *, cocos2d::CCPoint *); // r11\n  void (__fastcall *v12)(float *, cocos2d::CCPoint *); // r11\n  int v13; // r6\n  cocos2d::CCNode *Object; // r0\n  cocos2d::CCPoint v15; // [sp+4h] [bp-10h] BYREF\n\n  m_ground1Sprite = a1->m_ground1Sprite;\n  if ( !a3 )\n    m_ground1Sprite = a1->m_ground2Sprite;\n  if ( m_ground1Sprite )\n  {\n    v5 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);\n    if ( m_ground1Sprite->getChildren(m_ground1Sprite) )\n    {\n      v6 = m_ground1Sprite->getChildren(m_ground1Sprite);\n      cocos2d::CCArray::addObjectsFromArray(v5, v6);\n    }\n    if ( cocos2d::CCArray::count(v5) != a2 )\n    {\n      if ( cocos2d::CCArray::count(v5) >= (unsigned int)a2 )\n      {\n        v13 = cocos2d::CCArray::count(v5) - a2;\n        while ( v13 > 0 && cocos2d::CCArray::count(v5) )\n        {\n          --v13;\n          Object = (cocos2d::CCNode *)cocos2d::CCArray::lastObject(v5);\n          m_ground1Sprite->removeChild_0(m_ground1Sprite, Object, 1);\n          cocos2d::CCArray::removeLastObject(v5, 1);\n        }\n      }\n      else\n      {\n        v7 = cocos2d::CCArray::count(v5);\n        while ( v7 < a2 )\n        {\n          v8 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))m_ground1Sprite->getTexture)(m_ground1Sprite);\n          v9 = (float *)cocos2d::CCSprite::createWithTexture(\n                          (cocos2d::CCSprite *)v8,\n                          (cocos2d::CCTexture2D *)HIDWORD(v8));\n          m_ground1Sprite->addChild(m_ground1Sprite, (cocos2d::CCNode *)v9);\n          v10 = (float)v7++;\n          v11 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_DWORD *)v9 + 92);\n          cocos2d::CCPoint::CCPoint(&v15, v10 * v9[86], 0.0);\n          v11(v9, &v15);\n          v12 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_DWORD *)v9 + 140);\n          cocos2d::CCPoint::CCPoint(&v15, 0.0, 0.0);\n          v12(v9, &v15);\n          (*(void (__fastcall **)(float *, _UNKNOWN **))(*(_DWORD *)v9 + 472))(v9, &off_9AB688);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJMGLayer::loadGroundSprites from 0x434e6c to 0x434f90 (292 bytes)\n; \n; 4 xrefs:\n; > GJMGLayer::init @ 0x43513c\n; > GJMGLayer::init @ 0x435220\n; > GJMGLayer::updateGroundWidth @ 0x435406\n; > GJMGLayer::updateGroundWidth @ 0x435410\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x434E76)                ; +0x0, 0x434e6c\nPUSH.W          {R4-R11,LR}                                            ; +0x2, 0x434e6e\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x434e72\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x434e74\nMOV             R6, R1                                                 ; +0xa, 0x434e76\nSUB             SP, SP, #0x14                                          ; +0xc, 0x434e78\nLDR             R1, [R3]                                               ; +0xe, 0x434e7a\nMOV             R9, R3                                                 ; +0x10, 0x434e7c\nLDR.W           R4, [R0,#0x13C]                                        ; +0x12, 0x434e7e\nSTR             R1, [SP,#0x14+var_8]                                   ; +0x16, 0x434e82\nLDR.W           R1, [R0,#0x140]                                        ; +0x18, 0x434e84\nCMP             R2, #0                                                 ; +0x1c, 0x434e88\nIT EQ                                                                  ; +0x1e, 0x434e8a\nMOVEQ           R4, R1                                                 ; +0x20, 0x434e8c\nCMP             R4, #0                                                 ; +0x22, 0x434e8e\nBEQ             loc_434F7C                                             ; +0x24, 0x434e90\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x26, 0x434e92\nLDR             R3, [R4]                                               ; +0x2a, 0x434e96\nLDR.W           R3, [R3,#0xEC]                                         ; +0x2c, 0x434e98\nMOV             R5, R0                                                 ; +0x30, 0x434e9c\nMOV             R0, R4                                                 ; +0x32, 0x434e9e\nBLX             R3                                                     ; +0x34, 0x434ea0\nCBZ             R0, loc_434EB6                                         ; +0x36, 0x434ea2\nLDR             R3, [R4]                                               ; +0x38, 0x434ea4\nMOV             R0, R4                                                 ; +0x3a, 0x434ea6\nLDR.W           R3, [R3,#0xEC]                                         ; +0x3c, 0x434ea8\nBLX             R3                                                     ; +0x40, 0x434eac\nMOV             R1, R0; cocos2d::CCArray *                             ; +0x42, 0x434eae\nMOV             R0, R5; this                                           ; +0x44, 0x434eb0\nBL              _ZN7cocos2d7CCArray19addObjectsFromArrayEPS0_; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray*) ; +0x46, 0x434eb2\nMOV             R0, R5; this                                           ; +0x4a, 0x434eb6\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x4c, 0x434eb8\nCMP             R0, R6                                                 ; +0x50, 0x434ebc\nBEQ             loc_434F7C                                             ; +0x52, 0x434ebe\nMOV             R0, R5; this                                           ; +0x54, 0x434ec0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x56, 0x434ec2\nCMP             R0, R6                                                 ; +0x5a, 0x434ec6\nMOV             R0, R5; this                                           ; +0x5c, 0x434ec8\nBCS             loc_434F4A                                             ; +0x5e, 0x434eca\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x60, 0x434ecc\nLDR.W           R10, =(off_9AB688 - 0x434EDC)                          ; +0x64, 0x434ed0\nADD.W           R8, SP, #0x14+var_10                                   ; +0x68, 0x434ed4\nADD             R10, PC; off_9AB688                                    ; +0x6c, 0x434ed8\nMOV             R7, R0                                                 ; +0x6e, 0x434eda\nCMP             R7, R6                                                 ; +0x70, 0x434edc\nBGE             loc_434F7C                                             ; +0x72, 0x434ede\nLDR             R3, [R4]                                               ; +0x74, 0x434ee0\nMOV             R0, R4                                                 ; +0x76, 0x434ee2\nLDR.W           R3, [R3,#0x210]                                        ; +0x78, 0x434ee4\nBLX             R3                                                     ; +0x7c, 0x434ee8\nBL              _ZN7cocos2d8CCSprite17createWithTextureEPNS_11CCTexture2DE; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0x7e, 0x434eea\nLDR             R3, [R4]                                               ; +0x82, 0x434eee\nLDR.W           R3, [R3,#0xDC]                                         ; +0x84, 0x434ef0\nMOV             R5, R0                                                 ; +0x88, 0x434ef4\nMOV             R0, R4                                                 ; +0x8a, 0x434ef6\nMOV             R1, R5                                                 ; +0x8c, 0x434ef8\nBLX             R3                                                     ; +0x8e, 0x434efa\nVMOV            S15, R7                                                ; +0x90, 0x434efc\nLDR             R3, [R5]                                               ; +0x94, 0x434f00\nMOVS            R2, #0; float                                          ; +0x96, 0x434f02\nVCVT.F32.S32    S14, S15                                               ; +0x98, 0x434f04\nMOV             R0, R8; this                                           ; +0x9c, 0x434f08\nVLDR            S15, [R5,#0x158]                                       ; +0x9e, 0x434f0a\nADDS            R7, #1                                                 ; +0xa2, 0x434f0e\nLDR.W           R11, [R3,#0x5C]                                        ; +0xa4, 0x434f10\nVMUL.F32        S15, S14, S15                                          ; +0xa8, 0x434f14\nVMOV            R1, S15; float                                         ; +0xac, 0x434f18\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xb0, 0x434f1c\nMOV             R0, R5                                                 ; +0xb4, 0x434f20\nMOV             R1, R8                                                 ; +0xb6, 0x434f22\nBLX             R11                                                    ; +0xb8, 0x434f24\nLDR             R3, [R5]                                               ; +0xba, 0x434f26\nMOVS            R1, #0; float                                          ; +0xbc, 0x434f28\nMOV             R0, R8; this                                           ; +0xbe, 0x434f2a\nMOV             R2, R1; float                                          ; +0xc0, 0x434f2c\nLDR.W           R11, [R3,#0x8C]                                        ; +0xc2, 0x434f2e\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xc6, 0x434f32\nMOV             R0, R5                                                 ; +0xca, 0x434f36\nMOV             R1, R8                                                 ; +0xcc, 0x434f38\nBLX             R11                                                    ; +0xce, 0x434f3a\nLDR             R3, [R5]                                               ; +0xd0, 0x434f3c\nMOV             R0, R5                                                 ; +0xd2, 0x434f3e\nMOV             R1, R10                                                ; +0xd4, 0x434f40\nLDR.W           R3, [R3,#0x1D8]                                        ; +0xd6, 0x434f42\nBLX             R3                                                     ; +0xda, 0x434f46\nB               loc_434EDC                                             ; +0xdc, 0x434f48\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xde, 0x434f4a\nSUBS            R6, R0, R6                                             ; +0xe2, 0x434f4e\nCMP             R6, #0                                                 ; +0xe4, 0x434f50\nBLE             loc_434F7C                                             ; +0xe6, 0x434f52\nMOV             R0, R5; this                                           ; +0xe8, 0x434f54\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xea, 0x434f56\nCBZ             R0, loc_434F7C                                         ; +0xee, 0x434f5a\nMOV             R0, R5; this                                           ; +0xf0, 0x434f5c\nSUBS            R6, #1                                                 ; +0xf2, 0x434f5e\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0xf4, 0x434f60\nLDR             R3, [R4]                                               ; +0xf8, 0x434f64\nMOVS            R2, #1                                                 ; +0xfa, 0x434f66\nLDR.W           R3, [R3,#0x10C]                                        ; +0xfc, 0x434f68\nMOV             R1, R0                                                 ; +0x100, 0x434f6c\nMOV             R0, R4                                                 ; +0x102, 0x434f6e\nBLX             R3                                                     ; +0x104, 0x434f70\nMOV             R0, R5; this                                           ; +0x106, 0x434f72\nMOVS            R1, #1; bool                                           ; +0x108, 0x434f74\nBL              _ZN7cocos2d7CCArray16removeLastObjectEb; cocos2d::CCArray::removeLastObject(bool) ; +0x10a, 0x434f76\nB               loc_434F50                                             ; +0x10e, 0x434f7a\nLDR             R2, [SP,#0x14+var_8]                                   ; +0x110, 0x434f7c\nLDR.W           R3, [R9]                                               ; +0x112, 0x434f7e\nCMP             R2, R3                                                 ; +0x116, 0x434f82\nBEQ             loc_434F8A                                             ; +0x118, 0x434f84\nBLX             __stack_chk_fail                                       ; +0x11a, 0x434f86\nADD             SP, SP, #0x14                                          ; +0x11e, 0x434f8a\nPOP.W           {R4-R11,PC}                                            ; +0x120, 0x434f8c", "xrefs": ["GJMGLayer::init @ 0x43513c", "GJMGLayer::init @ 0x435220", "GJMGLayer::updateGroundWidth @ 0x435406", "GJMGLayer::updateGroundWidth @ 0x435410"], "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"}