{"type": "func", "start": 5371324304, "end": 5371324997, "name": "GJGroundLayer::loadGroundSprites", "pseudocode": "// \n// GJGroundLayer::loadGroundSprites from 0x14027e790 to 0x14027ea45 (693 bytes)\n// \n// 9 xrefs:\n// > GJGroundLayer::init @ 0x14027e5be\n// > GJGroundLayer::init @ 0x14027e6f8\n// > GJGroundLayer::scaleGround @ 0x14027ed1e\n// > GJGroundLayer::scaleGround @ 0x14027ed2b\n// > <???> @ 0x1406878c0\n// > <???> @ 0x140687940\n// > <???> @ 0x14068795c\n// > <???> @ 0x140687970\n// > <???> @ 0x1406d11cc\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  cocos2d::CCSprite *m_ground1Sprite; // rsi\n  cocos2d::CCArray *v6; // rbx\n  struct cocos2d::CCArray *v7; // rax\n  int v8; // ebp\n  struct cocos2d::CCTexture2D *v9; // rax\n  struct cocos2d::CCSprite *v10; // rdi\n  float v11; // xmm0_4\n  cocos2d::CCSprite_vtbl *v12; // rbx\n  __int64 v13; // rax\n  float v14; // xmm0_4\n  cocos2d::CCSprite_vtbl *v15; // rbx\n  const cocos2d::CCPoint *v16; // rax\n  struct cocos2d::CCTexture2D *v17; // rax\n  struct cocos2d::CCSprite *v18; // rdi\n  float v19; // xmm0_4\n  cocos2d::CCSprite_vtbl *v20; // rbx\n  __int64 v21; // rax\n  float v22; // xmm0_4\n  cocos2d::CCSprite_vtbl *v23; // rbx\n  const cocos2d::CCPoint *v24; // rax\n  signed int v25; // edi\n  struct cocos2d::CCObject *Object; // rax\n  _BOOL8 v27; // r8\n\n  if ( a3 )\n    m_ground1Sprite = a1->m_ground1Sprite;\n  else\n    m_ground1Sprite = a1->m_ground2Sprite;\n  if ( m_ground1Sprite )\n  {\n    v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);\n    if ( m_ground1Sprite->getChildren(m_ground1Sprite) )\n    {\n      v7 = m_ground1Sprite->getChildren(m_ground1Sprite);\n      cocos2d::CCArray::addObjectsFromArray(v6, v7);\n    }\n    if ( cocos2d::CCArray::count(v6) != a2 )\n    {\n      if ( cocos2d::CCArray::count(v6) >= a2 )\n      {\n        v25 = cocos2d::CCArray::count(v6) - a2;\n        while ( v25 > 0 )\n        {\n          if ( !cocos2d::CCArray::count(v6) )\n            break;\n          --v25;\n          Object = cocos2d::CCArray::lastObject(v6);\n          LOBYTE(v27) = 1;\n          m_ground1Sprite->removeChild(m_ground1Sprite, (cocos2d::CCNode *)Object, v27);\n          cocos2d::CCArray::removeLastObject(v6, 1);\n        }\n      }\n      else\n      {\n        v8 = cocos2d::CCArray::count(v6);\n        if ( v8 < a2 )\n        {\n          if ( a3 )\n          {\n            do\n            {\n              v9 = m_ground1Sprite->getTexture(&m_ground1Sprite->cocos2d::CCTextureProtocol);\n              v10 = cocos2d::CCSprite::createWithTexture(v9);\n              v11 = ((float (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCSprite *))m_ground1Sprite->addChild_1)(\n                      m_ground1Sprite,\n                      v10);\n              v12 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n              cocos2d::CCPoint::CCPoint(v11, (float)v8 * v10->m_obRect.size.width);\n              v14 = ((float (__fastcall *)(struct cocos2d::CCSprite *, __int64))v12->setPosition_0)(v10, v13);\n              v15 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n              cocos2d::CCPoint::CCPoint(v14, 0.0);\n              v15->setAnchorPoint(v10, v16);\n              v10->setColor(&v10->cocos2d::CCRGBAProtocol, &stru_140529AC8);\n              ++v8;\n            }\n            while ( v8 < a2 );\n          }\n          else\n          {\n            do\n            {\n              v17 = m_ground1Sprite->getTexture(&m_ground1Sprite->cocos2d::CCTextureProtocol);\n              v18 = cocos2d::CCSprite::createWithTexture(v17);\n              v19 = ((float (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCSprite *))m_ground1Sprite->addChild_1)(\n                      m_ground1Sprite,\n                      v18);\n              v20 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n              cocos2d::CCPoint::CCPoint(v19, (float)v8 * v18->m_obRect.size.width);\n              v22 = ((float (__fastcall *)(struct cocos2d::CCSprite *, __int64))v20->setPosition_0)(v18, v21);\n              v23 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n              cocos2d::CCPoint::CCPoint(v22, 0.0);\n              v23->setAnchorPoint(v18, v24);\n              v18->setColor(&v18->cocos2d::CCRGBAProtocol, &stru_140529AC8);\n              ++v8;\n            }\n            while ( v8 < a2 );\n          }\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJGroundLayer::loadGroundSprites from 0x14027e790 to 0x14027ea45 (693 bytes)\n; \n; 9 xrefs:\n; > GJGroundLayer::init @ 0x14027e5be\n; > GJGroundLayer::init @ 0x14027e6f8\n; > GJGroundLayer::scaleGround @ 0x14027ed1e\n; > GJGroundLayer::scaleGround @ 0x14027ed2b\n; > <???> @ 0x1406878c0\n; > <???> @ 0x140687940\n; > <???> @ 0x14068795c\n; > <???> @ 0x140687970\n; > <???> @ 0x1406d11cc\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\npush    rsi                                                            ; +0x0, 0x14027e790\npush    rdi                                                            ; +0x2, 0x14027e792\npush    r14                                                            ; +0x3, 0x14027e793\npush    r15                                                            ; +0x5, 0x14027e795\nsub     rsp, 58h                                                       ; +0x7, 0x14027e797\nmovzx   edi, r8b                                                       ; +0xb, 0x14027e79b\nmov     r14d, edx                                                      ; +0xf, 0x14027e79f\nmov     r15, rcx                                                       ; +0x12, 0x14027e7a2\ntest    r8b, r8b                                                       ; +0x15, 0x14027e7a5\njz      short loc_14027E7B3                                            ; +0x18, 0x14027e7a8\nmov     rsi, [rcx+198h]                                                ; +0x1a, 0x14027e7aa\njmp     short loc_14027E7BA                                            ; +0x21, 0x14027e7b1\nmov     rsi, [rcx+1A0h]                                                ; +0x23, 0x14027e7b3\ntest    rsi, rsi                                                       ; +0x2a, 0x14027e7ba\njz      loc_14027E932                                                  ; +0x2d, 0x14027e7bd\nmov     [rsp+78h+arg_0], rbx                                           ; +0x33, 0x14027e7c3\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x3b, 0x14027e7cb\nmov     rdx, [rsi]                                                     ; +0x41, 0x14027e7d1\nmov     rcx, rsi                                                       ; +0x44, 0x14027e7d4\nmov     rbx, rax                                                       ; +0x47, 0x14027e7d7\ncall    qword ptr [rdx+1D0h]                                           ; +0x4a, 0x14027e7da\ntest    rax, rax                                                       ; +0x50, 0x14027e7e0\njz      short loc_14027E7FD                                            ; +0x53, 0x14027e7e3\nmov     rdx, [rsi]                                                     ; +0x55, 0x14027e7e5\nmov     rcx, rsi                                                       ; +0x58, 0x14027e7e8\ncall    qword ptr [rdx+1D0h]                                           ; +0x5b, 0x14027e7eb\nmov     rdx, rax                                                       ; +0x61, 0x14027e7f1\nmov     rcx, rbx                                                       ; +0x64, 0x14027e7f4\ncall    cs:?addObjectsFromArray@CCArray@cocos2d@@QEAAXPEAV12@@Z; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray *) ; +0x67, 0x14027e7f7\nmov     rcx, rbx                                                       ; +0x6d, 0x14027e7fd\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x70, 0x14027e800\ncmp     eax, r14d                                                      ; +0x76, 0x14027e806\njz      loc_14027E92A                                                  ; +0x79, 0x14027e809\nmov     rcx, rbx                                                       ; +0x7f, 0x14027e80f\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x82, 0x14027e812\nmov     rcx, rbx                                                       ; +0x88, 0x14027e818\ncmp     eax, r14d                                                      ; +0x8b, 0x14027e81b\njnb     loc_14027E9EF                                                  ; +0x8e, 0x14027e81e\nmov     [rsp+78h+arg_8], rbp                                           ; +0x94, 0x14027e824\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x9c, 0x14027e82c\nmov     ebp, eax                                                       ; +0xa2, 0x14027e832\ncmp     eax, r14d                                                      ; +0xa4, 0x14027e834\njge     loc_14027E922                                                  ; +0xa7, 0x14027e837\nmovaps  [rsp+78h+var_38], xmm6                                         ; +0xad, 0x14027e83d\ntest    dil, dil                                                       ; +0xb2, 0x14027e842\njz      loc_14027E93D                                                  ; +0xb5, 0x14027e845\nmovss   xmm6, dword ptr cs:xmmword_1406243F0                           ; +0xbb, 0x14027e84b\nmov     [rsp+78h+var_28], r12                                          ; +0xc3, 0x14027e853\nmovaps  [rsp+78h+var_48], xmm7                                         ; +0xc8, 0x14027e858\nmovss   xmm7, cs:flt_140622C24                                         ; +0xcd, 0x14027e85d\nnop     word ptr [rax+rax+00000000h]                                   ; +0xd5, 0x14027e865\nmov     rax, [rsi+158h]                                                ; +0xe0, 0x14027e870\nlea     rcx, [rsi+158h]                                                ; +0xe7, 0x14027e877\ncall    qword ptr [rax+10h]                                            ; +0xee, 0x14027e87e\nmov     rcx, rax                                                       ; +0xf1, 0x14027e881\ncall    cs:?createWithTexture@CCSprite@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0xf4, 0x14027e884\nmov     r8, [rsi]                                                      ; +0xfa, 0x14027e88a\nmov     rcx, rsi                                                       ; +0xfd, 0x14027e88d\nmov     rdx, rax                                                       ; +0x100, 0x14027e890\nmov     rdi, rax                                                       ; +0x103, 0x14027e893\ncall    qword ptr [r8+1C0h]                                            ; +0x106, 0x14027e896\nmovss   xmm2, dword ptr [r15+1BCh]                                     ; +0x10d, 0x14027e89d\nlea     rcx, [rsp+78h+arg_18]                                          ; +0x116, 0x14027e8a6\nmov     rbx, [rdi]                                                     ; +0x11e, 0x14027e8ae\nxorps   xmm2, xmm6                                                     ; +0x121, 0x14027e8b1\nmovd    xmm1, ebp                                                      ; +0x124, 0x14027e8b4\ncvtdq2ps xmm1, xmm1                                                    ; +0x128, 0x14027e8b8\nmulss   xmm1, dword ptr [rdi+1B0h]                                     ; +0x12b, 0x14027e8bb\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x133, 0x14027e8c3\nmov     rdx, rax                                                       ; +0x139, 0x14027e8c9\nmov     rcx, rdi                                                       ; +0x13c, 0x14027e8cc\ncall    qword ptr [rbx+0B8h]                                           ; +0x13f, 0x14027e8cf\nmov     rbx, [rdi]                                                     ; +0x145, 0x14027e8d5\nlea     rcx, [rsp+78h+var_58]                                          ; +0x148, 0x14027e8d8\nmovaps  xmm2, xmm7                                                     ; +0x14d, 0x14027e8dd\nxorps   xmm1, xmm1                                                     ; +0x150, 0x14027e8e0\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x153, 0x14027e8e3\nmov     rdx, rax                                                       ; +0x159, 0x14027e8e9\nmov     rcx, rdi                                                       ; +0x15c, 0x14027e8ec\ncall    qword ptr [rbx+110h]                                           ; +0x15f, 0x14027e8ef\nlea     rcx, [rdi+140h]                                                ; +0x165, 0x14027e8f5\nmov     rax, [rcx]                                                     ; +0x16c, 0x14027e8fc\nlea     rdx, stru_140529AC8                                            ; +0x16f, 0x14027e8ff\ncall    qword ptr [rax]                                                ; +0x176, 0x14027e906\ninc     ebp                                                            ; +0x178, 0x14027e908\ncmp     ebp, r14d                                                      ; +0x17a, 0x14027e90a\njl      loc_14027E870                                                  ; +0x17d, 0x14027e90d\nmovaps  xmm7, [rsp+78h+var_48]                                         ; +0x183, 0x14027e913\nmov     r12, [rsp+78h+var_28]                                          ; +0x188, 0x14027e918\nmovaps  xmm6, [rsp+78h+var_38]                                         ; +0x18d, 0x14027e91d\nmov     rbp, [rsp+78h+arg_8]                                           ; +0x192, 0x14027e922\nmov     rbx, [rsp+78h+arg_0]                                           ; +0x19a, 0x14027e92a\nadd     rsp, 58h                                                       ; +0x1a2, 0x14027e932\npop     r15                                                            ; +0x1a6, 0x14027e936\npop     r14                                                            ; +0x1a8, 0x14027e938\npop     rdi                                                            ; +0x1aa, 0x14027e93a\npop     rsi                                                            ; +0x1ab, 0x14027e93b\nretn                                                                   ; +0x1ac, 0x14027e93c\nmovss   xmm6, cs:flt_140622C24                                         ; +0x1ad, 0x14027e93d\nnop     word ptr [rax+rax+00000000h]                                   ; +0x1b5, 0x14027e945\nmov     rax, [rsi+158h]                                                ; +0x1c0, 0x14027e950\nlea     rcx, [rsi+158h]                                                ; +0x1c7, 0x14027e957\ncall    qword ptr [rax+10h]                                            ; +0x1ce, 0x14027e95e\nmov     rcx, rax                                                       ; +0x1d1, 0x14027e961\ncall    cs:?createWithTexture@CCSprite@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0x1d4, 0x14027e964\nmov     r8, [rsi]                                                      ; +0x1da, 0x14027e96a\nmov     rcx, rsi                                                       ; +0x1dd, 0x14027e96d\nmov     rdx, rax                                                       ; +0x1e0, 0x14027e970\nmov     rdi, rax                                                       ; +0x1e3, 0x14027e973\ncall    qword ptr [r8+1C0h]                                            ; +0x1e6, 0x14027e976\nmov     rbx, [rdi]                                                     ; +0x1ed, 0x14027e97d\nlea     rcx, [rsp+78h+arg_18]                                          ; +0x1f0, 0x14027e980\nmovd    xmm1, ebp                                                      ; +0x1f8, 0x14027e988\nxorps   xmm2, xmm2                                                     ; +0x1fc, 0x14027e98c\ncvtdq2ps xmm1, xmm1                                                    ; +0x1ff, 0x14027e98f\nmulss   xmm1, dword ptr [rdi+1B0h]                                     ; +0x202, 0x14027e992\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x20a, 0x14027e99a\nmov     rdx, rax                                                       ; +0x210, 0x14027e9a0\nmov     rcx, rdi                                                       ; +0x213, 0x14027e9a3\ncall    qword ptr [rbx+0B8h]                                           ; +0x216, 0x14027e9a6\nmov     rbx, [rdi]                                                     ; +0x21c, 0x14027e9ac\nlea     rcx, [rsp+78h+var_58]                                          ; +0x21f, 0x14027e9af\nmovaps  xmm2, xmm6                                                     ; +0x224, 0x14027e9b4\nxorps   xmm1, xmm1                                                     ; +0x227, 0x14027e9b7\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x22a, 0x14027e9ba\nmov     rdx, rax                                                       ; +0x230, 0x14027e9c0\nmov     rcx, rdi                                                       ; +0x233, 0x14027e9c3\ncall    qword ptr [rbx+110h]                                           ; +0x236, 0x14027e9c6\nlea     rcx, [rdi+140h]                                                ; +0x23c, 0x14027e9cc\nmov     rax, [rcx]                                                     ; +0x243, 0x14027e9d3\nlea     rdx, stru_140529AC8                                            ; +0x246, 0x14027e9d6\ncall    qword ptr [rax]                                                ; +0x24d, 0x14027e9dd\ninc     ebp                                                            ; +0x24f, 0x14027e9df\ncmp     ebp, r14d                                                      ; +0x251, 0x14027e9e1\njl      loc_14027E950                                                  ; +0x254, 0x14027e9e4\njmp     loc_14027E91D                                                  ; +0x25a, 0x14027e9ea\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x25f, 0x14027e9ef\nmov     edi, eax                                                       ; +0x265, 0x14027e9f5\nsub     edi, r14d                                                      ; +0x267, 0x14027e9f7\ntest    edi, edi                                                       ; +0x26a, 0x14027e9fa\njle     loc_14027E92A                                                  ; +0x26c, 0x14027e9fc\nmov     rcx, rbx                                                       ; +0x272, 0x14027ea02\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x275, 0x14027ea05\ntest    eax, eax                                                       ; +0x27b, 0x14027ea0b\njz      loc_14027E92A                                                  ; +0x27d, 0x14027ea0d\nmov     rcx, rbx                                                       ; +0x283, 0x14027ea13\ndec     edi                                                            ; +0x286, 0x14027ea16\ncall    cs:?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x288, 0x14027ea18\nmov     r9, [rsi]                                                      ; +0x28e, 0x14027ea1e\nmov     r8b, 1                                                         ; +0x291, 0x14027ea21\nmov     rdx, rax                                                       ; +0x294, 0x14027ea24\nmov     rcx, rsi                                                       ; +0x297, 0x14027ea27\ncall    qword ptr [r9+208h]                                            ; +0x29a, 0x14027ea2a\nmov     dl, 1                                                          ; +0x2a1, 0x14027ea31\nmov     rcx, rbx                                                       ; +0x2a3, 0x14027ea33\ncall    cs:?removeLastObject@CCArray@cocos2d@@QEAAX_N@Z; cocos2d::CCArray::removeLastObject(bool) ; +0x2a6, 0x14027ea36\ntest    edi, edi                                                       ; +0x2ac, 0x14027ea3c\njg      short loc_14027EA02                                            ; +0x2ae, 0x14027ea3e\njmp     loc_14027E92A                                                  ; +0x2b0, 0x14027ea40", "xrefs": ["GJGroundLayer::init @ 0x14027e5be", "GJGroundLayer::init @ 0x14027e6f8", "GJGroundLayer::scaleGround @ 0x14027ed1e", "GJGroundLayer::scaleGround @ 0x14027ed2b", "<???> @ 0x1406878c0", "<???> @ 0x140687940", "<???> @ 0x14068795c", "<???> @ 0x140687970", "<???> @ 0x1406d11cc"], "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"}