{"type": "func", "start": 4301178352, "end": 4301178570, "name": "GJMGLayer::updateGroundWidth", "pseudocode": "// \n// GJMGLayer::updateGroundWidth from 0x1005ec5f0 to 0x1005ec6ca (218 bytes)\n// \n// 1 xrefs:\n// > GJMGLayer::scaleGround @ 0x1005ec5ca\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 __fastcall GJMGLayer::updateGroundWidth(GJMGLayer *a1, bool a2)\n{\n  GJMGLayer *v2; // rbx\n  cocos2d::CCDirector *v3; // rsi\n  __int64 v4; // rax\n  GJMGLayer_vtbl *v5; // rcx\n  float (__cdecl **p_getScaleX)(cocos2d::CCNode *__hidden); // rcx\n  float v7; // xmm0_4\n  __m128 v8; // xmm1\n  int v9; // r14d\n  float v10; // [rsp+8h] [rbp-18h] BYREF\n  double v11; // 0:xmm0_8.8\n\n  v2 = a1;\n  if ( ((__int64 (__fastcall *)(GJMGLayer *, bool))a1->getParent)(a1, a2) )\n  {\n    v3 = cocos2d::CCDirector::sharedDirector();\n    *(cocos2d::CCSize *)&v11 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v10);\n    v4 = ((__int64 (__fastcall *)(GJMGLayer *, cocos2d::CCDirector *, double))a1->getParent)(a1, v3, v11);\n    v5 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    if ( v4 )\n    {\n      p_getScaleX = &v5->getScaleX;\n    }\n    else\n    {\n      a1 = (GJMGLayer *)((__int64 (__fastcall *)(GJMGLayer *))v5->getParent)(a1);\n      p_getScaleX = &a1->getScale;\n    }\n    ((void (__fastcall *)(GJMGLayer *))*p_getScaleX)(a1);\n    v7 = ((float (__fastcall *)(GJMGLayer *))v2->getScaleX)(v2);\n    v8 = (__m128)LODWORD(v10);\n    v8.f32[0] = (float)(v10 / v7) + 10.0;\n    LODWORD(v2->m_groundWidth) = v8.i32[0];\n    v8.f32[0] = v8.f32[0] / v2->m_textureWidth;\n    v9 = (int)(float)(_mm_round_ss((__m128)0LL, v8, 10).f32[0] + 1.0) + v2->m_cameraRotated;\n    GJMGLayer::loadGroundSprites(v2, v9, 1);\n    GJMGLayer::loadGroundSprites(v2, v9, 0);\n  }\n}", "assembly": "; \n; GJMGLayer::updateGroundWidth from 0x1005ec5f0 to 0x1005ec6ca (218 bytes)\n; \n; 1 xrefs:\n; > GJMGLayer::scaleGround @ 0x1005ec5ca\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, 0x1005ec5f0\nmov     rbp, rsp                                                       ; +0x1, 0x1005ec5f1\npush    r14                                                            ; +0x4, 0x1005ec5f4\npush    rbx                                                            ; +0x6, 0x1005ec5f6\nsub     rsp, 10h                                                       ; +0x7, 0x1005ec5f7\nmov     rbx, rdi                                                       ; +0xb, 0x1005ec5fb\nmov     rax, [rdi]                                                     ; +0xe, 0x1005ec5fe\ncall    qword ptr [rax+1F0h]                                           ; +0x11, 0x1005ec601\ntest    rax, rax                                                       ; +0x17, 0x1005ec607\njz      loc_1005EC6C1                                                  ; +0x1a, 0x1005ec60a\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x20, 0x1005ec610\nlea     rdi, [rbp+var_18]                                              ; +0x25, 0x1005ec615\nmov     rsi, rax                                                       ; +0x29, 0x1005ec619\ncall    cocos2d__CCDirector__getWinSize                                ; +0x2c, 0x1005ec61c\nmov     rax, [rbx]                                                     ; +0x31, 0x1005ec621\nmov     rdi, rbx                                                       ; +0x34, 0x1005ec624\ncall    qword ptr [rax+1F0h]                                           ; +0x37, 0x1005ec627\nmov     rcx, [rbx]                                                     ; +0x3d, 0x1005ec62d\ntest    rax, rax                                                       ; +0x40, 0x1005ec630\njz      short loc_1005EC641                                            ; +0x43, 0x1005ec633\nadd     rcx, 88h                                                       ; +0x45, 0x1005ec635\nmov     rdi, rbx                                                       ; +0x4c, 0x1005ec63c\njmp     short loc_1005EC655                                            ; +0x4f, 0x1005ec63f\nmov     rdi, rbx                                                       ; +0x51, 0x1005ec641\ncall    qword ptr [rcx+1F0h]                                           ; +0x54, 0x1005ec644\nmov     rdi, rax                                                       ; +0x5a, 0x1005ec64a\nmov     ecx, 0A8h                                                      ; +0x5d, 0x1005ec64d\nadd     rcx, [rax]                                                     ; +0x62, 0x1005ec652\ncall    qword ptr [rcx]                                                ; +0x65, 0x1005ec655\nmov     rax, [rbx]                                                     ; +0x67, 0x1005ec657\nmov     rdi, rbx                                                       ; +0x6a, 0x1005ec65a\ncall    qword ptr [rax+88h]                                            ; +0x6d, 0x1005ec65d\nmovss   xmm1, [rbp+var_18]                                             ; +0x73, 0x1005ec663\ndivss   xmm1, xmm0                                                     ; +0x78, 0x1005ec668\naddss   xmm1, cs:dword_100814FEC                                       ; +0x7c, 0x1005ec66c\nmovss   dword ptr [rbx+1BCh], xmm1                                     ; +0x84, 0x1005ec674\ndivss   xmm1, dword ptr [rbx+1A8h]                                     ; +0x8c, 0x1005ec67c\nxorps   xmm0, xmm0                                                     ; +0x94, 0x1005ec684\nroundss xmm0, xmm1, 0Ah                                                ; +0x97, 0x1005ec687\naddss   xmm0, cs:alpha                                                 ; +0x9d, 0x1005ec68d\ncvttss2si eax, xmm0                                                    ; +0xa5, 0x1005ec695\nmovzx   r14d, byte ptr [rbx+1C8h]                                      ; +0xa9, 0x1005ec699\nadd     r14d, eax                                                      ; +0xb1, 0x1005ec6a1\nmov     rdi, rbx                                                       ; +0xb4, 0x1005ec6a4\nmov     esi, r14d                                                      ; +0xb7, 0x1005ec6a7\nmov     edx, 1                                                         ; +0xba, 0x1005ec6aa\ncall    GJMGLayer__loadGroundSprites                                   ; +0xbf, 0x1005ec6af\nmov     rdi, rbx                                                       ; +0xc4, 0x1005ec6b4\nmov     esi, r14d                                                      ; +0xc7, 0x1005ec6b7\nxor     edx, edx                                                       ; +0xca, 0x1005ec6ba\ncall    GJMGLayer__loadGroundSprites                                   ; +0xcc, 0x1005ec6bc\nadd     rsp, 10h                                                       ; +0xd1, 0x1005ec6c1\npop     rbx                                                            ; +0xd5, 0x1005ec6c5\npop     r14                                                            ; +0xd6, 0x1005ec6c6\npop     rbp                                                            ; +0xd8, 0x1005ec6c8\nretn                                                                   ; +0xd9, 0x1005ec6c9", "xrefs": ["GJMGLayer::scaleGround @ 0x1005ec5ca"], "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"}