{"type": "func", "start": 5371327744, "end": 5371328189, "name": "GJMGLayer::loadGroundSprites", "pseudocode": "// \n// GJMGLayer::loadGroundSprites from 0x14027f500 to 0x14027f6bd (445 bytes)\n// \n// 8 xrefs:\n// > GJBaseGameLayer::updateCameraBGArt @ 0x14023e875\n// > GJBaseGameLayer::updateCameraBGArt @ 0x14023e882\n// > GJMGLayer::init @ 0x14027f265\n// > GJMGLayer::init @ 0x14027f423\n// > <???> @ 0x140687a64\n// > <???> @ 0x140687ae0\n// > <???> @ 0x140687af8\n// > <???> @ 0x1406d12c8\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; // rsi\n  cocos2d::CCArray *v5; // rbx\n  struct cocos2d::CCArray *v6; // rax\n  int i; // r14d\n  struct cocos2d::CCTexture2D *v8; // rax\n  struct cocos2d::CCSprite *v9; // rdi\n  float v10; // xmm0_4\n  cocos2d::CCSprite_vtbl *v11; // rbx\n  __int64 v12; // rax\n  float v13; // xmm0_4\n  cocos2d::CCSprite_vtbl *v14; // rbx\n  const cocos2d::CCPoint *v15; // rax\n  signed int v16; // edi\n  struct cocos2d::CCObject *Object; // rax\n  _BOOL8 v18; // 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    v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(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) >= a2 )\n      {\n        v16 = cocos2d::CCArray::count(v5) - a2;\n        while ( v16 > 0 )\n        {\n          if ( !cocos2d::CCArray::count(v5) )\n            break;\n          --v16;\n          Object = cocos2d::CCArray::lastObject(v5);\n          LOBYTE(v18) = 1;\n          m_ground1Sprite->removeChild(m_ground1Sprite, (cocos2d::CCNode *)Object, v18);\n          cocos2d::CCArray::removeLastObject(v5, 1);\n        }\n      }\n      else\n      {\n        for ( i = cocos2d::CCArray::count(v5); i < a2; ++i )\n        {\n          v8 = m_ground1Sprite->getTexture(&m_ground1Sprite->cocos2d::CCTextureProtocol);\n          v9 = cocos2d::CCSprite::createWithTexture(v8);\n          v10 = ((float (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCSprite *))m_ground1Sprite->addChild_1)(\n                  m_ground1Sprite,\n                  v9);\n          v11 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n          cocos2d::CCPoint::CCPoint(v10, (float)i * v9->m_obRect.size.width);\n          v13 = ((float (__fastcall *)(struct cocos2d::CCSprite *, __int64))v11->setPosition_0)(v9, v12);\n          v14 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n          cocos2d::CCPoint::CCPoint(v13, 0.0);\n          v14->setAnchorPoint(v9, v15);\n          v9->setColor(&v9->cocos2d::CCRGBAProtocol, &stru_140529AC8);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJMGLayer::loadGroundSprites from 0x14027f500 to 0x14027f6bd (445 bytes)\n; \n; 8 xrefs:\n; > GJBaseGameLayer::updateCameraBGArt @ 0x14023e875\n; > GJBaseGameLayer::updateCameraBGArt @ 0x14023e882\n; > GJMGLayer::init @ 0x14027f265\n; > GJMGLayer::init @ 0x14027f423\n; > <???> @ 0x140687a64\n; > <???> @ 0x140687ae0\n; > <???> @ 0x140687af8\n; > <???> @ 0x1406d12c8\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    rbp                                                            ; +0x0, 0x14027f500\npush    rsi                                                            ; +0x2, 0x14027f502\nsub     rsp, 38h                                                       ; +0x3, 0x14027f503\nmov     ebp, edx                                                       ; +0x7, 0x14027f507\ntest    r8b, r8b                                                       ; +0x9, 0x14027f509\njz      short loc_14027F517                                            ; +0xc, 0x14027f50c\nmov     rsi, [rcx+198h]                                                ; +0xe, 0x14027f50e\njmp     short loc_14027F51E                                            ; +0x15, 0x14027f515\nmov     rsi, [rcx+1A0h]                                                ; +0x17, 0x14027f517\ntest    rsi, rsi                                                       ; +0x1e, 0x14027f51e\njz      loc_14027F65D                                                  ; +0x21, 0x14027f521\nmov     [rsp+48h+arg_0], rbx                                           ; +0x27, 0x14027f527\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x2c, 0x14027f52c\nmov     rdx, [rsi]                                                     ; +0x32, 0x14027f532\nmov     rcx, rsi                                                       ; +0x35, 0x14027f535\nmov     rbx, rax                                                       ; +0x38, 0x14027f538\ncall    qword ptr [rdx+1D0h]                                           ; +0x3b, 0x14027f53b\ntest    rax, rax                                                       ; +0x41, 0x14027f541\njz      short loc_14027F55E                                            ; +0x44, 0x14027f544\nmov     rdx, [rsi]                                                     ; +0x46, 0x14027f546\nmov     rcx, rsi                                                       ; +0x49, 0x14027f549\ncall    qword ptr [rdx+1D0h]                                           ; +0x4c, 0x14027f54c\nmov     rdx, rax                                                       ; +0x52, 0x14027f552\nmov     rcx, rbx                                                       ; +0x55, 0x14027f555\ncall    cs:?addObjectsFromArray@CCArray@cocos2d@@QEAAXPEAV12@@Z; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray *) ; +0x58, 0x14027f558\nmov     rcx, rbx                                                       ; +0x5e, 0x14027f55e\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x61, 0x14027f561\ncmp     eax, ebp                                                       ; +0x67, 0x14027f567\njz      loc_14027F658                                                  ; +0x69, 0x14027f569\nmov     rcx, rbx                                                       ; +0x6f, 0x14027f56f\nmov     [rsp+48h+arg_8], rdi                                           ; +0x72, 0x14027f572\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x77, 0x14027f577\nmov     rcx, rbx                                                       ; +0x7d, 0x14027f57d\ncmp     eax, ebp                                                       ; +0x80, 0x14027f580\njnb     loc_14027F664                                                  ; +0x82, 0x14027f582\nmov     [rsp+48h+arg_10], r14                                          ; +0x88, 0x14027f588\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x8d, 0x14027f58d\nmov     r14d, eax                                                      ; +0x93, 0x14027f593\ncmp     eax, ebp                                                       ; +0x96, 0x14027f596\njge     loc_14027F64E                                                  ; +0x98, 0x14027f598\nmov     [rsp+48h+var_18], r15                                          ; +0x9e, 0x14027f59e\nnop     dword ptr [rax+00h]                                            ; +0xa3, 0x14027f5a3\nnop     word ptr [rax+rax+00000000h]                                   ; +0xa7, 0x14027f5a7\nmov     rdx, [rsi+158h]                                                ; +0xb0, 0x14027f5b0\nlea     rcx, [rsi+158h]                                                ; +0xb7, 0x14027f5b7\ncall    qword ptr [rdx+10h]                                            ; +0xbe, 0x14027f5be\nmov     rcx, rax                                                       ; +0xc1, 0x14027f5c1\ncall    cs:?createWithTexture@CCSprite@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0xc4, 0x14027f5c4\nmov     r8, [rsi]                                                      ; +0xca, 0x14027f5ca\nmov     rcx, rsi                                                       ; +0xcd, 0x14027f5cd\nmov     rdx, rax                                                       ; +0xd0, 0x14027f5d0\nmov     rdi, rax                                                       ; +0xd3, 0x14027f5d3\ncall    qword ptr [r8+1C0h]                                            ; +0xd6, 0x14027f5d6\nmov     rbx, [rdi]                                                     ; +0xdd, 0x14027f5dd\nlea     rcx, [rsp+48h+arg_18]                                          ; +0xe0, 0x14027f5e0\nmovd    xmm1, r14d                                                     ; +0xe5, 0x14027f5e5\nxorps   xmm2, xmm2                                                     ; +0xea, 0x14027f5ea\ncvtdq2ps xmm1, xmm1                                                    ; +0xed, 0x14027f5ed\nmulss   xmm1, dword ptr [rdi+1B0h]                                     ; +0xf0, 0x14027f5f0\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0xf8, 0x14027f5f8\nmov     rdx, rax                                                       ; +0xfe, 0x14027f5fe\nmov     rcx, rdi                                                       ; +0x101, 0x14027f601\ncall    qword ptr [rbx+0B8h]                                           ; +0x104, 0x14027f604\nmov     rbx, [rdi]                                                     ; +0x10a, 0x14027f60a\nlea     rcx, [rsp+48h+var_28]                                          ; +0x10d, 0x14027f60d\nxorps   xmm2, xmm2                                                     ; +0x112, 0x14027f612\nxorps   xmm1, xmm1                                                     ; +0x115, 0x14027f615\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x118, 0x14027f618\nmov     rdx, rax                                                       ; +0x11e, 0x14027f61e\nmov     rcx, rdi                                                       ; +0x121, 0x14027f621\ncall    qword ptr [rbx+110h]                                           ; +0x124, 0x14027f624\nlea     rcx, [rdi+140h]                                                ; +0x12a, 0x14027f62a\nmov     rax, [rcx]                                                     ; +0x131, 0x14027f631\nlea     rdx, stru_140529AC8                                            ; +0x134, 0x14027f634\ncall    qword ptr [rax]                                                ; +0x13b, 0x14027f63b\ninc     r14d                                                           ; +0x13d, 0x14027f63d\ncmp     r14d, ebp                                                      ; +0x140, 0x14027f640\njl      loc_14027F5B0                                                  ; +0x143, 0x14027f643\nmov     r15, [rsp+48h+var_18]                                          ; +0x149, 0x14027f649\nmov     r14, [rsp+48h+arg_10]                                          ; +0x14e, 0x14027f64e\nmov     rdi, [rsp+48h+arg_8]                                           ; +0x153, 0x14027f653\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x158, 0x14027f658\nadd     rsp, 38h                                                       ; +0x15d, 0x14027f65d\npop     rsi                                                            ; +0x161, 0x14027f661\npop     rbp                                                            ; +0x162, 0x14027f662\nretn                                                                   ; +0x163, 0x14027f663\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x164, 0x14027f664\nmov     edi, eax                                                       ; +0x16a, 0x14027f66a\nsub     edi, ebp                                                       ; +0x16c, 0x14027f66c\ntest    edi, edi                                                       ; +0x16e, 0x14027f66e\njle     short loc_14027F653                                            ; +0x170, 0x14027f670\nmov     rcx, rbx                                                       ; +0x172, 0x14027f672\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x175, 0x14027f675\ntest    eax, eax                                                       ; +0x17b, 0x14027f67b\njz      short loc_14027F653                                            ; +0x17d, 0x14027f67d\nmov     rcx, rbx                                                       ; +0x17f, 0x14027f67f\ndec     edi                                                            ; +0x182, 0x14027f682\ncall    cs:?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x184, 0x14027f684\nmov     r9, [rsi]                                                      ; +0x18a, 0x14027f68a\nmov     r8b, 1                                                         ; +0x18d, 0x14027f68d\nmov     rdx, rax                                                       ; +0x190, 0x14027f690\nmov     rcx, rsi                                                       ; +0x193, 0x14027f693\ncall    qword ptr [r9+208h]                                            ; +0x196, 0x14027f696\nmov     dl, 1                                                          ; +0x19d, 0x14027f69d\nmov     rcx, rbx                                                       ; +0x19f, 0x14027f69f\ncall    cs:?removeLastObject@CCArray@cocos2d@@QEAAX_N@Z; cocos2d::CCArray::removeLastObject(bool) ; +0x1a2, 0x14027f6a2\ntest    edi, edi                                                       ; +0x1a8, 0x14027f6a8\njg      short loc_14027F672                                            ; +0x1aa, 0x14027f6aa\nmov     rdi, [rsp+48h+arg_8]                                           ; +0x1ac, 0x14027f6ac\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x1b1, 0x14027f6b1\nadd     rsp, 38h                                                       ; +0x1b6, 0x14027f6b6\npop     rsi                                                            ; +0x1ba, 0x14027f6ba\npop     rbp                                                            ; +0x1bb, 0x14027f6bb\nretn                                                                   ; +0x1bc, 0x14027f6bc", "xrefs": ["GJBaseGameLayer::updateCameraBGArt @ 0x14023e875", "GJBaseGameLayer::updateCameraBGArt @ 0x14023e882", "GJMGLayer::init @ 0x14027f265", "GJMGLayer::init @ 0x14027f423", "<???> @ 0x140687a64", "<???> @ 0x140687ae0", "<???> @ 0x140687af8", "<???> @ 0x1406d12c8"], "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"}