{"type": "func", "start": 4301177328, "end": 4301177735, "name": "GJMGLayer::loadGroundSprites", "pseudocode": "// \n// GJMGLayer::loadGroundSprites from 0x1005ec1f0 to 0x1005ec387 (407 bytes)\n// \n// 4 xrefs:\n// > GJMGLayer::init @ 0x1005ebf81\n// > GJMGLayer::init @ 0x1005ec12b\n// > GJMGLayer::updateGroundWidth @ 0x1005ec6af\n// > GJMGLayer::updateGroundWidth @ 0x1005ec6bc\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\n// local variable allocation has failed, the output may be wrong!\nvoid __fastcall GJMGLayer::loadGroundSprites(GJMGLayer *a1, int a2, bool a3)\n{\n  __int64 v3; // rax\n  __int64 v4; // rbx\n  __int64 v6; // r12\n  __int64 v7; // rsi\n  unsigned int v8; // r13d\n  int v9; // r15d\n  cocos2d::CCTexture2D *v10; // rax\n  cocos2d::CCSprite *v11; // r13\n  int v12; // r15d\n  int v13; // r15d\n  __int64 v14; // rax\n  float v15[12]; // [rsp+0h] [rbp-30h] BYREF\n\n  *(_QWORD *)v15 = v3;\n  v4 = *((_QWORD *)&a1->m_ground1Sprite + !a3);\n  if ( v4 )\n  {\n    v6 = sub_10071F9E0(a1, *(_QWORD *)&a2);\n    if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 472LL))(v4) )\n    {\n      v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 472LL))(v4);\n      sub_100720050(v6, v7);\n    }\n    if ( (unsigned int)sub_100720070(v6) != a2 )\n    {\n      v8 = sub_100720070(v6);\n      v9 = sub_100720070(v6);\n      if ( v8 >= a2 )\n      {\n        v12 = v9 - a2;\n        if ( v12 > 0 )\n        {\n          v13 = v12 + 1;\n          do\n          {\n            if ( !(unsigned int)sub_100720070(v6) )\n              break;\n            v14 = sub_1007200E0(v6);\n            (*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v4 + 536LL))(v4, v14, 1);\n            sub_100720200(v6, 1);\n            --v13;\n          }\n          while ( v13 > 1 );\n        }\n      }\n      else if ( v9 < a2 )\n      {\n        do\n        {\n          v10 = (cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);\n          v11 = cocos2d::CCSprite::createWithTexture_1(v10);\n          (*(void (__fastcall **)(__int64, cocos2d::CCSprite *))(*(_QWORD *)v4 + 440LL))(v4, v11);\n          sub_10028CBE0(v15, (float)v9 * v11->m_obRect.size.width, 0.0);\n          ((void (__fastcall *)(cocos2d::CCSprite *, float *))v11->setPosition)(v11, v15);\n          sub_10028CBE0(v15, 0.0, 0.0);\n          ((void (__fastcall *)(cocos2d::CCSprite *, float *))v11->setAnchorPoint)(v11, v15);\n          ((void (__fastcall *)(cocos2d::CCSprite *, void *))v11->setColor)(v11, &unk_1008219C8);\n          ++v9;\n        }\n        while ( a2 != v9 );\n      }\n    }\n  }\n}", "assembly": "; \n; GJMGLayer::loadGroundSprites from 0x1005ec1f0 to 0x1005ec387 (407 bytes)\n; \n; 4 xrefs:\n; > GJMGLayer::init @ 0x1005ebf81\n; > GJMGLayer::init @ 0x1005ec12b\n; > GJMGLayer::updateGroundWidth @ 0x1005ec6af\n; > GJMGLayer::updateGroundWidth @ 0x1005ec6bc\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, 0x1005ec1f0\nmov     rbp, rsp                                                       ; +0x1, 0x1005ec1f1\npush    r15                                                            ; +0x4, 0x1005ec1f4\npush    r14                                                            ; +0x6, 0x1005ec1f6\npush    r13                                                            ; +0x8, 0x1005ec1f8\npush    r12                                                            ; +0xa, 0x1005ec1fa\npush    rbx                                                            ; +0xc, 0x1005ec1fc\npush    rax                                                            ; +0xd, 0x1005ec1fd\nxor     dl, 1                                                          ; +0xe, 0x1005ec1fe\nmovzx   eax, dl                                                        ; +0x11, 0x1005ec201\nmov     rbx, [rdi+rax*8+198h]                                          ; +0x14, 0x1005ec204\ntest    rbx, rbx                                                       ; +0x1c, 0x1005ec20c\njz      short loc_1005EC251                                            ; +0x1f, 0x1005ec20f\nmov     r14d, esi                                                      ; +0x21, 0x1005ec211\ncall    sub_10071F9E0                                                  ; +0x24, 0x1005ec214\nmov     r12, rax                                                       ; +0x29, 0x1005ec219\nmov     rax, [rbx]                                                     ; +0x2c, 0x1005ec21c\nmov     rdi, rbx                                                       ; +0x2f, 0x1005ec21f\ncall    qword ptr [rax+1D8h]                                           ; +0x32, 0x1005ec222\ntest    rax, rax                                                       ; +0x38, 0x1005ec228\njz      short loc_1005EC244                                            ; +0x3b, 0x1005ec22b\nmov     rax, [rbx]                                                     ; +0x3d, 0x1005ec22d\nmov     rdi, rbx                                                       ; +0x40, 0x1005ec230\ncall    qword ptr [rax+1D8h]                                           ; +0x43, 0x1005ec233\nmov     rdi, r12                                                       ; +0x49, 0x1005ec239\nmov     rsi, rax                                                       ; +0x4c, 0x1005ec23c\ncall    sub_100720050                                                  ; +0x4f, 0x1005ec23f\nmov     rdi, r12                                                       ; +0x54, 0x1005ec244\ncall    sub_100720070                                                  ; +0x57, 0x1005ec247\ncmp     eax, r14d                                                      ; +0x5c, 0x1005ec24c\njnz     short loc_1005EC260                                            ; +0x5f, 0x1005ec24f\nadd     rsp, 8                                                         ; +0x61, 0x1005ec251\npop     rbx                                                            ; +0x65, 0x1005ec255\npop     r12                                                            ; +0x66, 0x1005ec256\npop     r13                                                            ; +0x68, 0x1005ec258\npop     r14                                                            ; +0x6a, 0x1005ec25a\npop     r15                                                            ; +0x6c, 0x1005ec25c\npop     rbp                                                            ; +0x6e, 0x1005ec25e\nretn                                                                   ; +0x6f, 0x1005ec25f\nmov     rdi, r12                                                       ; +0x70, 0x1005ec260\ncall    sub_100720070                                                  ; +0x73, 0x1005ec263\nmov     r13d, eax                                                      ; +0x78, 0x1005ec268\nmov     rdi, r12                                                       ; +0x7b, 0x1005ec26b\ncall    sub_100720070                                                  ; +0x7e, 0x1005ec26e\nmov     r15d, eax                                                      ; +0x83, 0x1005ec273\ncmp     r13d, r14d                                                     ; +0x86, 0x1005ec276\njnb     loc_1005EC325                                                  ; +0x89, 0x1005ec279\ncmp     r15d, r14d                                                     ; +0x8f, 0x1005ec27f\njge     short loc_1005EC251                                            ; +0x92, 0x1005ec282\nlea     r12, [rbp+var_30]                                              ; +0x94, 0x1005ec284\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x98, 0x1005ec288\nmov     rax, [rbx]                                                     ; +0xa0, 0x1005ec290\nmov     rdi, rbx                                                       ; +0xa3, 0x1005ec293\ncall    qword ptr [rax+420h]                                           ; +0xa6, 0x1005ec296\nmov     rdi, rax                                                       ; +0xac, 0x1005ec29c\ncall    cocos2d__CCSprite__createWithTexture_1                         ; +0xaf, 0x1005ec29f\nmov     r13, rax                                                       ; +0xb4, 0x1005ec2a4\nmov     rax, [rbx]                                                     ; +0xb7, 0x1005ec2a7\nmov     rdi, rbx                                                       ; +0xba, 0x1005ec2aa\nmov     rsi, r13                                                       ; +0xbd, 0x1005ec2ad\ncall    qword ptr [rax+1B8h]                                           ; +0xc0, 0x1005ec2b0\nxorps   xmm0, xmm0                                                     ; +0xc6, 0x1005ec2b6\ncvtsi2ss xmm0, r15d                                                    ; +0xc9, 0x1005ec2b9\nmulss   xmm0, dword ptr [r13+1B0h]                                     ; +0xce, 0x1005ec2be\nxorps   xmm1, xmm1                                                     ; +0xd7, 0x1005ec2c7\nmov     rdi, r12                                                       ; +0xda, 0x1005ec2ca\ncall    sub_10028CBE0                                                  ; +0xdd, 0x1005ec2cd\nmov     rax, [r13+0]                                                   ; +0xe2, 0x1005ec2d2\nmov     rdi, r13                                                       ; +0xe6, 0x1005ec2d6\nmov     rsi, r12                                                       ; +0xe9, 0x1005ec2d9\ncall    qword ptr [rax+0B8h]                                           ; +0xec, 0x1005ec2dc\nxorps   xmm0, xmm0                                                     ; +0xf2, 0x1005ec2e2\nxorps   xmm1, xmm1                                                     ; +0xf5, 0x1005ec2e5\nmov     rdi, r12                                                       ; +0xf8, 0x1005ec2e8\ncall    sub_10028CBE0                                                  ; +0xfb, 0x1005ec2eb\nmov     rax, [r13+0]                                                   ; +0x100, 0x1005ec2f0\nmov     rdi, r13                                                       ; +0x104, 0x1005ec2f4\nmov     rsi, r12                                                       ; +0x107, 0x1005ec2f7\ncall    qword ptr [rax+118h]                                           ; +0x10a, 0x1005ec2fa\nmov     rax, [r13+0]                                                   ; +0x110, 0x1005ec300\nmov     rdi, r13                                                       ; +0x114, 0x1005ec304\nlea     rsi, unk_1008219C8                                             ; +0x117, 0x1005ec307\ncall    qword ptr [rax+3B0h]                                           ; +0x11e, 0x1005ec30e\ninc     r15d                                                           ; +0x124, 0x1005ec314\ncmp     r14d, r15d                                                     ; +0x127, 0x1005ec317\njnz     loc_1005EC290                                                  ; +0x12a, 0x1005ec31a\njmp     loc_1005EC251                                                  ; +0x130, 0x1005ec320\nsub     r15d, r14d                                                     ; +0x135, 0x1005ec325\ntest    r15d, r15d                                                     ; +0x138, 0x1005ec328\njle     loc_1005EC251                                                  ; +0x13b, 0x1005ec32b\ninc     r15d                                                           ; +0x141, 0x1005ec331\nnop     word ptr [rax+rax+00000000h]                                   ; +0x144, 0x1005ec334\nmov     rdi, r12                                                       ; +0x150, 0x1005ec340\ncall    sub_100720070                                                  ; +0x153, 0x1005ec343\ntest    eax, eax                                                       ; +0x158, 0x1005ec348\njz      loc_1005EC251                                                  ; +0x15a, 0x1005ec34a\nmov     rdi, r12                                                       ; +0x160, 0x1005ec350\ncall    sub_1007200E0                                                  ; +0x163, 0x1005ec353\nmov     rcx, [rbx]                                                     ; +0x168, 0x1005ec358\nmov     rdi, rbx                                                       ; +0x16b, 0x1005ec35b\nmov     rsi, rax                                                       ; +0x16e, 0x1005ec35e\nmov     edx, 1                                                         ; +0x171, 0x1005ec361\ncall    qword ptr [rcx+218h]                                           ; +0x176, 0x1005ec366\nmov     rdi, r12                                                       ; +0x17c, 0x1005ec36c\nmov     esi, 1                                                         ; +0x17f, 0x1005ec36f\ncall    sub_100720200                                                  ; +0x184, 0x1005ec374\ndec     r15d                                                           ; +0x189, 0x1005ec379\ncmp     r15d, 1                                                        ; +0x18c, 0x1005ec37c\njg      short loc_1005EC340                                            ; +0x190, 0x1005ec380\njmp     loc_1005EC251                                                  ; +0x192, 0x1005ec382", "xrefs": ["GJMGLayer::init @ 0x1005ebf81", "GJMGLayer::init @ 0x1005ec12b", "GJMGLayer::updateGroundWidth @ 0x1005ec6af", "GJMGLayer::updateGroundWidth @ 0x1005ec6bc"], "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"}