{"type": "func", "start": 5372408608, "end": 5372409302, "name": "GJGroundLayer::loadGroundSprites", "pseudocode": "// \n// GJGroundLayer::loadGroundSprites from 0x140387320 to 0x1403875d6 (694 bytes)\n// \n// 9 xrefs:\n// > GJGroundLayer::init @ 0x14038713b\n// > GJGroundLayer::init @ 0x14038727f\n// > GJGroundLayer::scaleGround @ 0x1403878a3\n// > GJGroundLayer::scaleGround @ 0x1403878b0\n// > <???> @ 0x1408bd85c\n// > <???> @ 0x1408bd8dc\n// > <???> @ 0x1408bd8f8\n// > <???> @ 0x1408bd90c\n// > <???> @ 0x140922ae4\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 GJGroundLayer::loadGroundSprites(__int64 a1, int a2, unsigned __int8 a3)\n{\n  _QWORD *v6; // rsi\n  cocos2d::CCArray *v7; // rbx\n  struct cocos2d::CCArray *v8; // rax\n  int v9; // ebp\n  struct cocos2d::CCTexture2D *v10; // rax\n  struct cocos2d::CCSprite *v11; // rdi\n  __int64 v12; // rbx\n  __int64 v13; // rax\n  __int64 v14; // rbx\n  __int64 v15; // rax\n  struct cocos2d::CCTexture2D *v16; // rax\n  struct cocos2d::CCSprite *v17; // rdi\n  void (__fastcall *v18)(struct cocos2d::CCSprite *, __int64); // rbx\n  __int64 v19; // rax\n  __int64 v20; // rbx\n  __int64 v21; // rax\n  int v22; // edi\n  struct cocos2d::CCObject *Object; // rax\n  __int64 v24; // r8\n  _BYTE v25[16]; // [rsp+20h] [rbp-58h] BYREF\n  char v26; // [rsp+98h] [rbp+20h] BYREF\n\n  v6 = *(_QWORD **)(a1 + 8 * (a3 ^ 1LL) + 408);\n  if ( v6 )\n  {\n    v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);\n    if ( (*(__int64 (__fastcall **)(_QWORD *))(*v6 + 480LL))(v6) )\n    {\n      v8 = (struct cocos2d::CCArray *)(*(__int64 (__fastcall **)(_QWORD *))(*v6 + 480LL))(v6);\n      cocos2d::CCArray::addObjectsFromArray(v7, v8);\n    }\n    if ( cocos2d::CCArray::count(v7) != a2 )\n    {\n      if ( cocos2d::CCArray::count(v7) >= a2 )\n      {\n        v22 = cocos2d::CCArray::count(v7) - a2;\n        while ( v22 > 0 )\n        {\n          if ( !cocos2d::CCArray::count(v7) )\n            break;\n          --v22;\n          Object = cocos2d::CCArray::lastObject(v7);\n          LOBYTE(v24) = 1;\n          (*(void (__fastcall **)(_QWORD *, struct cocos2d::CCObject *, __int64))(*v6 + 536LL))(v6, Object, v24);\n          cocos2d::CCArray::removeLastObject(v7, 1);\n        }\n      }\n      else\n      {\n        v9 = cocos2d::CCArray::count(v7);\n        if ( v9 < a2 )\n        {\n          if ( a3 )\n          {\n            do\n            {\n              v10 = (struct cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(_QWORD *))(v6[43] + 16LL))(v6 + 43);\n              v11 = cocos2d::CCSprite::createWithTexture(v10);\n              (*(void (__fastcall **)(_QWORD *, struct cocos2d::CCSprite *))(*v6 + 464LL))(v6, v11);\n              v12 = *(_QWORD *)v11;\n              cocos2d::CCPoint::CCPoint(\n                (cocos2d::CCPoint *)&v26,\n                (float)v9 * *((float *)v11 + 108),\n                -*(float *)(a1 + 444));\n              (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v12 + 184))(v11, v13);\n              v14 = *(_QWORD *)v11;\n              cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, 0.0, 1.0);\n              (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v14 + 288))(v11, v15);\n              (**((void (__fastcall ***)(__int64, void *))v11 + 40))((__int64)v11 + 320, &unk_140703478);\n              ++v9;\n            }\n            while ( v9 < a2 );\n          }\n          else\n          {\n            do\n            {\n              v16 = (struct cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(_QWORD *))(v6[43] + 16LL))(v6 + 43);\n              v17 = cocos2d::CCSprite::createWithTexture(v16);\n              (*(void (__fastcall **)(_QWORD *, struct cocos2d::CCSprite *))(*v6 + 464LL))(v6, v17);\n              v18 = *(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v17 + 184LL);\n              cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, (float)v9 * *((float *)v17 + 108), 0.0);\n              v18(v17, v19);\n              v20 = *(_QWORD *)v17;\n              cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, 0.0, 1.0);\n              (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v20 + 288))(v17, v21);\n              (**((void (__fastcall ***)(__int64, void *))v17 + 40))((__int64)v17 + 320, &unk_140703478);\n              ++v9;\n            }\n            while ( v9 < a2 );\n          }\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJGroundLayer::loadGroundSprites from 0x140387320 to 0x1403875d6 (694 bytes)\n; \n; 9 xrefs:\n; > GJGroundLayer::init @ 0x14038713b\n; > GJGroundLayer::init @ 0x14038727f\n; > GJGroundLayer::scaleGround @ 0x1403878a3\n; > GJGroundLayer::scaleGround @ 0x1403878b0\n; > <???> @ 0x1408bd85c\n; > <???> @ 0x1408bd8dc\n; > <???> @ 0x1408bd8f8\n; > <???> @ 0x1408bd90c\n; > <???> @ 0x140922ae4\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    rsi                                                            ; +0x0, 0x140387320\npush    rdi                                                            ; +0x2, 0x140387322\npush    r14                                                            ; +0x3, 0x140387323\npush    r15                                                            ; +0x5, 0x140387325\nsub     rsp, 58h                                                       ; +0x7, 0x140387327\nmovzx   edi, r8b                                                       ; +0xb, 0x14038732b\nmov     r14d, edx                                                      ; +0xf, 0x14038732f\nmov     eax, edi                                                       ; +0x12, 0x140387332\nmov     r15, rcx                                                       ; +0x14, 0x140387334\nxor     rax, 1                                                         ; +0x17, 0x140387337\nmov     rsi, [rcx+rax*8+198h]                                          ; +0x1b, 0x14038733b\ntest    rsi, rsi                                                       ; +0x23, 0x140387343\njz      loc_1403874B7                                                  ; +0x26, 0x140387346\nmov     [rsp+78h+arg_0], rbx                                           ; +0x2c, 0x14038734c\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x34, 0x140387354\nmov     r9, [rsi]                                                      ; +0x3a, 0x14038735a\nmov     rcx, rsi                                                       ; +0x3d, 0x14038735d\nmov     rbx, rax                                                       ; +0x40, 0x140387360\ncall    qword ptr [r9+1E0h]                                            ; +0x43, 0x140387363\ntest    rax, rax                                                       ; +0x4a, 0x14038736a\njz      short loc_14038738A                                            ; +0x4d, 0x14038736d\nmov     rcx, [rsi]                                                     ; +0x4f, 0x14038736f\nmov     rdx, [rcx+1E0h]                                                ; +0x52, 0x140387372\nmov     rcx, rsi                                                       ; +0x59, 0x140387379\ncall    rdx                                                            ; +0x5c, 0x14038737c\nmov     rdx, rax                                                       ; +0x5e, 0x14038737e\nmov     rcx, rbx                                                       ; +0x61, 0x140387381\ncall    cs:?addObjectsFromArray@CCArray@cocos2d@@QEAAXPEAV12@@Z; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray *) ; +0x64, 0x140387384\nmov     rcx, rbx                                                       ; +0x6a, 0x14038738a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x6d, 0x14038738d\ncmp     eax, r14d                                                      ; +0x73, 0x140387393\njz      loc_1403874AF                                                  ; +0x76, 0x140387396\nmov     rcx, rbx                                                       ; +0x7c, 0x14038739c\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x7f, 0x14038739f\nmov     rcx, rbx                                                       ; +0x85, 0x1403873a5\ncmp     eax, r14d                                                      ; +0x88, 0x1403873a8\njnb     loc_140387575                                                  ; +0x8b, 0x1403873ab\nmov     [rsp+78h+arg_8], rbp                                           ; +0x91, 0x1403873b1\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x99, 0x1403873b9\nmov     ebp, eax                                                       ; +0x9f, 0x1403873bf\ncmp     eax, r14d                                                      ; +0xa1, 0x1403873c1\njge     loc_1403874A7                                                  ; +0xa4, 0x1403873c4\nmovaps  [rsp+78h+var_38], xmm6                                         ; +0xaa, 0x1403873ca\ntest    dil, dil                                                       ; +0xaf, 0x1403873cf\njz      loc_1403874C2                                                  ; +0xb2, 0x1403873d2\nmovss   xmm6, dword ptr cs:xmmword_140836CC0                           ; +0xb8, 0x1403873d8\nmov     [rsp+78h+var_28], r12                                          ; +0xc0, 0x1403873e0\nmovaps  [rsp+78h+var_48], xmm7                                         ; +0xc5, 0x1403873e5\nmovss   xmm7, cs:flt_140835080                                         ; +0xca, 0x1403873ea\nmov     rax, [rsi+158h]                                                ; +0xd2, 0x1403873f2\nlea     rcx, [rsi+158h]                                                ; +0xd9, 0x1403873f9\ncall    qword ptr [rax+10h]                                            ; +0xe0, 0x140387400\nmov     rcx, rax                                                       ; +0xe3, 0x140387403\ncall    cs:?createWithTexture@CCSprite@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0xe6, 0x140387406\nmov     rcx, [rsi]                                                     ; +0xec, 0x14038740c\nmov     rdx, rax                                                       ; +0xef, 0x14038740f\nmov     rdi, rax                                                       ; +0xf2, 0x140387412\nmov     r8, [rcx+1D0h]                                                 ; +0xf5, 0x140387415\nmov     rcx, rsi                                                       ; +0xfc, 0x14038741c\ncall    r8                                                             ; +0xff, 0x14038741f\nmovss   xmm2, dword ptr [r15+1BCh]                                     ; +0x102, 0x140387422\nlea     rcx, [rsp+78h+arg_18]                                          ; +0x10b, 0x14038742b\nmov     rbx, [rdi]                                                     ; +0x113, 0x140387433\nxorps   xmm2, xmm6                                                     ; +0x116, 0x140387436\nmovd    xmm1, ebp                                                      ; +0x119, 0x140387439\ncvtdq2ps xmm1, xmm1                                                    ; +0x11d, 0x14038743d\nmulss   xmm1, dword ptr [rdi+1B0h]                                     ; +0x120, 0x140387440\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x128, 0x140387448\nmov     rdx, rax                                                       ; +0x12e, 0x14038744e\nmov     rcx, rdi                                                       ; +0x131, 0x140387451\ncall    qword ptr [rbx+0B8h]                                           ; +0x134, 0x140387454\nmov     rbx, [rdi]                                                     ; +0x13a, 0x14038745a\nlea     rcx, [rsp+78h+var_58]                                          ; +0x13d, 0x14038745d\nmovaps  xmm2, xmm7                                                     ; +0x142, 0x140387462\nxorps   xmm1, xmm1                                                     ; +0x145, 0x140387465\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x148, 0x140387468\nmov     rdx, rax                                                       ; +0x14e, 0x14038746e\nmov     rcx, rdi                                                       ; +0x151, 0x140387471\ncall    qword ptr [rbx+120h]                                           ; +0x154, 0x140387474\nlea     rcx, [rdi+140h]                                                ; +0x15a, 0x14038747a\nmov     rax, [rcx]                                                     ; +0x161, 0x140387481\nlea     rdx, unk_140703478                                             ; +0x164, 0x140387484\ncall    qword ptr [rax]                                                ; +0x16b, 0x14038748b\ninc     ebp                                                            ; +0x16d, 0x14038748d\ncmp     ebp, r14d                                                      ; +0x16f, 0x14038748f\njl      loc_1403873F2                                                  ; +0x172, 0x140387492\nmovaps  xmm7, [rsp+78h+var_48]                                         ; +0x178, 0x140387498\nmov     r12, [rsp+78h+var_28]                                          ; +0x17d, 0x14038749d\nmovaps  xmm6, [rsp+78h+var_38]                                         ; +0x182, 0x1403874a2\nmov     rbp, [rsp+78h+arg_8]                                           ; +0x187, 0x1403874a7\nmov     rbx, [rsp+78h+arg_0]                                           ; +0x18f, 0x1403874af\nadd     rsp, 58h                                                       ; +0x197, 0x1403874b7\npop     r15                                                            ; +0x19b, 0x1403874bb\npop     r14                                                            ; +0x19d, 0x1403874bd\npop     rdi                                                            ; +0x19f, 0x1403874bf\npop     rsi                                                            ; +0x1a0, 0x1403874c0\nretn                                                                   ; +0x1a1, 0x1403874c1\nmovss   xmm6, cs:flt_140835080                                         ; +0x1a2, 0x1403874c2\nnop     word ptr [rax+rax+00h]                                         ; +0x1aa, 0x1403874ca\nmov     rax, [rsi+158h]                                                ; +0x1b0, 0x1403874d0\nlea     rcx, [rsi+158h]                                                ; +0x1b7, 0x1403874d7\ncall    qword ptr [rax+10h]                                            ; +0x1be, 0x1403874de\nmov     rcx, rax                                                       ; +0x1c1, 0x1403874e1\ncall    cs:?createWithTexture@CCSprite@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSprite::createWithTexture(cocos2d::CCTexture2D *) ; +0x1c4, 0x1403874e4\nmov     rcx, [rsi]                                                     ; +0x1ca, 0x1403874ea\nmov     rdx, rax                                                       ; +0x1cd, 0x1403874ed\nmov     rdi, rax                                                       ; +0x1d0, 0x1403874f0\nmov     r8, [rcx+1D0h]                                                 ; +0x1d3, 0x1403874f3\nmov     rcx, rsi                                                       ; +0x1da, 0x1403874fa\ncall    r8                                                             ; +0x1dd, 0x1403874fd\nmov     rcx, [rdi]                                                     ; +0x1e0, 0x140387500\nxorps   xmm2, xmm2                                                     ; +0x1e3, 0x140387503\nmovd    xmm1, ebp                                                      ; +0x1e6, 0x140387506\ncvtdq2ps xmm1, xmm1                                                    ; +0x1ea, 0x14038750a\nmov     rbx, [rcx+0B8h]                                                ; +0x1ed, 0x14038750d\nlea     rcx, [rsp+78h+arg_18]                                          ; +0x1f4, 0x140387514\nmulss   xmm1, dword ptr [rdi+1B0h]                                     ; +0x1fc, 0x14038751c\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x204, 0x140387524\nmov     rdx, rax                                                       ; +0x20a, 0x14038752a\nmov     rcx, rdi                                                       ; +0x20d, 0x14038752d\ncall    rbx                                                            ; +0x210, 0x140387530\nmov     rbx, [rdi]                                                     ; +0x212, 0x140387532\nlea     rcx, [rsp+78h+var_58]                                          ; +0x215, 0x140387535\nmovaps  xmm2, xmm6                                                     ; +0x21a, 0x14038753a\nxorps   xmm1, xmm1                                                     ; +0x21d, 0x14038753d\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x220, 0x140387540\nmov     rdx, rax                                                       ; +0x226, 0x140387546\nmov     rcx, rdi                                                       ; +0x229, 0x140387549\ncall    qword ptr [rbx+120h]                                           ; +0x22c, 0x14038754c\nlea     rcx, [rdi+140h]                                                ; +0x232, 0x140387552\nmov     rax, [rcx]                                                     ; +0x239, 0x140387559\nlea     rdx, unk_140703478                                             ; +0x23c, 0x14038755c\ncall    qword ptr [rax]                                                ; +0x243, 0x140387563\ninc     ebp                                                            ; +0x245, 0x140387565\ncmp     ebp, r14d                                                      ; +0x247, 0x140387567\njl      loc_1403874D0                                                  ; +0x24a, 0x14038756a\njmp     loc_1403874A2                                                  ; +0x250, 0x140387570\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x255, 0x140387575\nmov     edi, eax                                                       ; +0x25b, 0x14038757b\nsub     edi, r14d                                                      ; +0x25d, 0x14038757d\ntest    edi, edi                                                       ; +0x260, 0x140387580\njle     loc_1403874AF                                                  ; +0x262, 0x140387582\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x268, 0x140387588\nmov     rcx, rbx                                                       ; +0x270, 0x140387590\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x273, 0x140387593\ntest    eax, eax                                                       ; +0x279, 0x140387599\njz      loc_1403874AF                                                  ; +0x27b, 0x14038759b\nmov     rcx, rbx                                                       ; +0x281, 0x1403875a1\ndec     edi                                                            ; +0x284, 0x1403875a4\ncall    cs:?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x286, 0x1403875a6\nmov     rcx, [rsi]                                                     ; +0x28c, 0x1403875ac\nmov     r8b, 1                                                         ; +0x28f, 0x1403875af\nmov     rdx, rax                                                       ; +0x292, 0x1403875b2\nmov     r9, [rcx+218h]                                                 ; +0x295, 0x1403875b5\nmov     rcx, rsi                                                       ; +0x29c, 0x1403875bc\ncall    r9                                                             ; +0x29f, 0x1403875bf\nmov     dl, 1                                                          ; +0x2a2, 0x1403875c2\nmov     rcx, rbx                                                       ; +0x2a4, 0x1403875c4\ncall    cs:?removeLastObject@CCArray@cocos2d@@QEAAX_N@Z; cocos2d::CCArray::removeLastObject(bool) ; +0x2a7, 0x1403875c7\ntest    edi, edi                                                       ; +0x2ad, 0x1403875cd\njg      short loc_140387590                                            ; +0x2af, 0x1403875cf\njmp     loc_1403874AF                                                  ; +0x2b1, 0x1403875d1", "xrefs": ["GJGroundLayer::init @ 0x14038713b", "GJGroundLayer::init @ 0x14038727f", "GJGroundLayer::scaleGround @ 0x1403878a3", "GJGroundLayer::scaleGround @ 0x1403878b0", "<???> @ 0x1408bd85c", "<???> @ 0x1408bd8dc", "<???> @ 0x1408bd8f8", "<???> @ 0x1408bd90c", "<???> @ 0x140922ae4"], "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"}