{"type": "func", "start": 5372412080, "end": 5372412526, "name": "GJMGLayer::loadGroundSprites", "pseudocode": "// \n// GJMGLayer::loadGroundSprites from 0x1403880b0 to 0x14038826e (446 bytes)\n// \n// 8 xrefs:\n// > GJBaseGameLayer::updateCameraBGArt @ 0x140348793\n// > GJBaseGameLayer::updateCameraBGArt @ 0x1403487a0\n// > GJMGLayer::init @ 0x140387df6\n// > GJMGLayer::init @ 0x140387fbb\n// > <???> @ 0x1408bda18\n// > <???> @ 0x1408bda94\n// > <???> @ 0x1408bdaac\n// > <???> @ 0x140922be0\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:31:08 +0000\n// \n\nvoid __fastcall GJMGLayer::loadGroundSprites(__int64 a1, int a2, unsigned __int8 a3)\n{\n  _QWORD *v4; // 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  __int64 v10; // rbx\n  __int64 v11; // rax\n  __int64 v12; // rbx\n  __int64 v13; // rax\n  int v14; // edi\n  struct cocos2d::CCObject *Object; // rax\n  __int64 v16; // r8\n  _BYTE v17[16]; // [rsp+20h] [rbp-28h] BYREF\n  char v18; // [rsp+68h] [rbp+20h] BYREF\n\n  v4 = *(_QWORD **)(a1 + 8 * (a3 ^ 1LL) + 408);\n  if ( v4 )\n  {\n    v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);\n    if ( (*(__int64 (__fastcall **)(_QWORD *))(*v4 + 480LL))(v4) )\n    {\n      v6 = (struct cocos2d::CCArray *)(*(__int64 (__fastcall **)(_QWORD *))(*v4 + 480LL))(v4);\n      cocos2d::CCArray::addObjectsFromArray(v5, v6);\n    }\n    if ( cocos2d::CCArray::count(v5) != a2 )\n    {\n      if ( cocos2d::CCArray::count(v5) >= a2 )\n      {\n        v14 = cocos2d::CCArray::count(v5) - a2;\n        while ( v14 > 0 )\n        {\n          if ( !cocos2d::CCArray::count(v5) )\n            break;\n          --v14;\n          Object = cocos2d::CCArray::lastObject(v5);\n          LOBYTE(v16) = 1;\n          (*(void (__fastcall **)(_QWORD *, struct cocos2d::CCObject *, __int64))(*v4 + 536LL))(v4, Object, v16);\n          cocos2d::CCArray::removeLastObject(v5, 1);\n        }\n      }\n      else\n      {\n        for ( i = cocos2d::CCArray::count(v5); i < a2; ++i )\n        {\n          v8 = (struct cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(_QWORD *))(v4[43] + 16LL))(v4 + 43);\n          v9 = cocos2d::CCSprite::createWithTexture(v8);\n          (*(void (__fastcall **)(_QWORD *, struct cocos2d::CCSprite *))(*v4 + 464LL))(v4, v9);\n          v10 = *(_QWORD *)v9;\n          cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v18, (float)i * *((float *)v9 + 108), 0.0);\n          (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v10 + 184))(v9, v11);\n          v12 = *(_QWORD *)v9;\n          cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v17, 0.0, 0.0);\n          (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v12 + 288))(v9, v13);\n          (**((void (__fastcall ***)(__int64, void *))v9 + 40))((__int64)v9 + 320, &unk_140703478);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJMGLayer::loadGroundSprites from 0x1403880b0 to 0x14038826e (446 bytes)\n; \n; 8 xrefs:\n; > GJBaseGameLayer::updateCameraBGArt @ 0x140348793\n; > GJBaseGameLayer::updateCameraBGArt @ 0x1403487a0\n; > GJMGLayer::init @ 0x140387df6\n; > GJMGLayer::init @ 0x140387fbb\n; > <???> @ 0x1408bda18\n; > <???> @ 0x1408bda94\n; > <???> @ 0x1408bdaac\n; > <???> @ 0x140922be0\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:31:08 +0000\n; \npush    rbp                                                            ; +0x0, 0x1403880b0\npush    rsi                                                            ; +0x2, 0x1403880b2\nsub     rsp, 38h                                                       ; +0x3, 0x1403880b3\nmovzx   eax, r8b                                                       ; +0x7, 0x1403880b7\nmov     ebp, edx                                                       ; +0xb, 0x1403880bb\nxor     rax, 1                                                         ; +0xd, 0x1403880bd\nmov     rsi, [rcx+rax*8+198h]                                          ; +0x11, 0x1403880c1\ntest    rsi, rsi                                                       ; +0x19, 0x1403880c9\njz      loc_140388208                                                  ; +0x1c, 0x1403880cc\nmov     [rsp+48h+arg_0], rbx                                           ; +0x22, 0x1403880d2\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x27, 0x1403880d7\nmov     rcx, [rsi]                                                     ; +0x2d, 0x1403880dd\nmov     rbx, rax                                                       ; +0x30, 0x1403880e0\nmov     r8, [rcx+1E0h]                                                 ; +0x33, 0x1403880e3\nmov     rcx, rsi                                                       ; +0x3a, 0x1403880ea\ncall    r8                                                             ; +0x3d, 0x1403880ed\ntest    rax, rax                                                       ; +0x40, 0x1403880f0\njz      short loc_140388110                                            ; +0x43, 0x1403880f3\nmov     rcx, [rsi]                                                     ; +0x45, 0x1403880f5\nmov     rdx, [rcx+1E0h]                                                ; +0x48, 0x1403880f8\nmov     rcx, rsi                                                       ; +0x4f, 0x1403880ff\ncall    rdx                                                            ; +0x52, 0x140388102\nmov     rdx, rax                                                       ; +0x54, 0x140388104\nmov     rcx, rbx                                                       ; +0x57, 0x140388107\ncall    cs:?addObjectsFromArray@CCArray@cocos2d@@QEAAXPEAV12@@Z; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray *) ; +0x5a, 0x14038810a\nmov     rcx, rbx                                                       ; +0x60, 0x140388110\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x63, 0x140388113\ncmp     eax, ebp                                                       ; +0x69, 0x140388119\njz      loc_140388203                                                  ; +0x6b, 0x14038811b\nmov     rcx, rbx                                                       ; +0x71, 0x140388121\nmov     [rsp+48h+arg_8], rdi                                           ; +0x74, 0x140388124\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x79, 0x140388129\nmov     rcx, rbx                                                       ; +0x7f, 0x14038812f\ncmp     eax, ebp                                                       ; +0x82, 0x140388132\njnb     loc_14038820F                                                  ; +0x84, 0x140388134\nmov     [rsp+48h+arg_10], r14                                          ; +0x8a, 0x14038813a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x8f, 0x14038813f\nmov     r14d, eax                                                      ; +0x95, 0x140388145\ncmp     eax, ebp                                                       ; +0x98, 0x140388148\njge     loc_1403881F9                                                  ; +0x9a, 0x14038814a\nmov     [rsp+48h+var_18], r15                                          ; +0xa0, 0x140388150\nmov     rcx, [rsi+158h]                                                ; +0xa5, 0x140388155\nmov     rdx, [rcx+10h]                                                 ; +0xac, 0x14038815c\nlea     rcx, [rsi+158h]                                                ; +0xb0, 0x140388160\ncall    rdx                                                            ; +0xb7, 0x140388167\nmov     rcx, rax                                                       ; +0xb9, 0x140388169\ncall    cs:?createWithTexture@CCSprite@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0xbc, 0x14038816c\nmov     rcx, [rsi]                                                     ; +0xc2, 0x140388172\nmov     rdx, rax                                                       ; +0xc5, 0x140388175\nmov     rdi, rax                                                       ; +0xc8, 0x140388178\nmov     r8, [rcx+1D0h]                                                 ; +0xcb, 0x14038817b\nmov     rcx, rsi                                                       ; +0xd2, 0x140388182\ncall    r8                                                             ; +0xd5, 0x140388185\nmov     rbx, [rdi]                                                     ; +0xd8, 0x140388188\nlea     rcx, [rsp+48h+arg_18]                                          ; +0xdb, 0x14038818b\nmovd    xmm1, r14d                                                     ; +0xe0, 0x140388190\nxorps   xmm2, xmm2                                                     ; +0xe5, 0x140388195\ncvtdq2ps xmm1, xmm1                                                    ; +0xe8, 0x140388198\nmulss   xmm1, dword ptr [rdi+1B0h]                                     ; +0xeb, 0x14038819b\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0xf3, 0x1403881a3\nmov     rdx, rax                                                       ; +0xf9, 0x1403881a9\nmov     rcx, rdi                                                       ; +0xfc, 0x1403881ac\ncall    qword ptr [rbx+0B8h]                                           ; +0xff, 0x1403881af\nmov     rbx, [rdi]                                                     ; +0x105, 0x1403881b5\nlea     rcx, [rsp+48h+var_28]                                          ; +0x108, 0x1403881b8\nxorps   xmm2, xmm2                                                     ; +0x10d, 0x1403881bd\nxorps   xmm1, xmm1                                                     ; +0x110, 0x1403881c0\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x113, 0x1403881c3\nmov     rdx, rax                                                       ; +0x119, 0x1403881c9\nmov     rcx, rdi                                                       ; +0x11c, 0x1403881cc\ncall    qword ptr [rbx+120h]                                           ; +0x11f, 0x1403881cf\nlea     rcx, [rdi+140h]                                                ; +0x125, 0x1403881d5\nmov     rax, [rcx]                                                     ; +0x12c, 0x1403881dc\nlea     rdx, unk_140703478                                             ; +0x12f, 0x1403881df\ncall    qword ptr [rax]                                                ; +0x136, 0x1403881e6\ninc     r14d                                                           ; +0x138, 0x1403881e8\ncmp     r14d, ebp                                                      ; +0x13b, 0x1403881eb\njl      loc_140388155                                                  ; +0x13e, 0x1403881ee\nmov     r15, [rsp+48h+var_18]                                          ; +0x144, 0x1403881f4\nmov     r14, [rsp+48h+arg_10]                                          ; +0x149, 0x1403881f9\nmov     rdi, [rsp+48h+arg_8]                                           ; +0x14e, 0x1403881fe\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x153, 0x140388203\nadd     rsp, 38h                                                       ; +0x158, 0x140388208\npop     rsi                                                            ; +0x15c, 0x14038820c\npop     rbp                                                            ; +0x15d, 0x14038820d\nretn                                                                   ; +0x15e, 0x14038820e\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x15f, 0x14038820f\nmov     edi, eax                                                       ; +0x165, 0x140388215\nsub     edi, ebp                                                       ; +0x167, 0x140388217\ntest    edi, edi                                                       ; +0x169, 0x140388219\njle     short loc_1403881FE                                            ; +0x16b, 0x14038821b\nnop     dword ptr [rax]                                                ; +0x16d, 0x14038821d\nmov     rcx, rbx                                                       ; +0x170, 0x140388220\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x173, 0x140388223\ntest    eax, eax                                                       ; +0x179, 0x140388229\njz      short loc_1403881FE                                            ; +0x17b, 0x14038822b\nmov     rcx, rbx                                                       ; +0x17d, 0x14038822d\ndec     edi                                                            ; +0x180, 0x140388230\ncall    cs:?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x182, 0x140388232\nmov     rcx, [rsi]                                                     ; +0x188, 0x140388238\nmov     r8b, 1                                                         ; +0x18b, 0x14038823b\nmov     rdx, rax                                                       ; +0x18e, 0x14038823e\nmov     r9, [rcx+218h]                                                 ; +0x191, 0x140388241\nmov     rcx, rsi                                                       ; +0x198, 0x140388248\ncall    r9                                                             ; +0x19b, 0x14038824b\nmov     dl, 1                                                          ; +0x19e, 0x14038824e\nmov     rcx, rbx                                                       ; +0x1a0, 0x140388250\ncall    cs:?removeLastObject@CCArray@cocos2d@@QEAAX_N@Z; cocos2d::CCArray::removeLastObject(bool) ; +0x1a3, 0x140388253\ntest    edi, edi                                                       ; +0x1a9, 0x140388259\njg      short loc_140388220                                            ; +0x1ab, 0x14038825b\nmov     rdi, [rsp+48h+arg_8]                                           ; +0x1ad, 0x14038825d\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x1b2, 0x140388262\nadd     rsp, 38h                                                       ; +0x1b7, 0x140388267\npop     rsi                                                            ; +0x1bb, 0x14038826b\npop     rbp                                                            ; +0x1bc, 0x14038826c\nretn                                                                   ; +0x1bd, 0x14038826d", "xrefs": ["GJBaseGameLayer::updateCameraBGArt @ 0x140348793", "GJBaseGameLayer::updateCameraBGArt @ 0x1403487a0", "GJMGLayer::init @ 0x140387df6", "GJMGLayer::init @ 0x140387fbb", "<???> @ 0x1408bda18", "<???> @ 0x1408bda94", "<???> @ 0x1408bdaac", "<???> @ 0x140922be0"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}