{"type": "func", "start": 4295186064, "end": 4295186265, "name": "EditorUI::getGridSnappedPos", "pseudocode": "// \n// EditorUI::getGridSnappedPos from 0x100035690 to 0x100035759 (201 bytes)\n// \n// 3 xrefs:\n// > EditorUI::ccTouchMoved @ 0x10004f8c4\n// > EditorUI::ccTouchEnded @ 0x10004fcaf\n// > SetupSmartBlockLayer::onPasteTemplate @ 0x1004e7068\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\ncocos2d::CCPoint __fastcall EditorUI::getGridSnappedPos(EditorUI *a1, cocos2d::CCPoint a2)\n{\n  double v2; // rax\n  unsigned int *v3; // rdx\n  __int64 v4; // rsi\n  float v5; // xmm2_4\n  __m128 v6; // xmm0\n  __m128 v7; // xmm1\n  __m128 v8; // xmm0\n  double v10[4]; // [rsp+0h] [rbp-20h] BYREF\n  cocos2d::CCPoint result; // 0:xmm0_8.8\n\n  v10[0] = v2;\n  v5 = *(float *)(*(_QWORD *)(*(_QWORD *)(v4 + 1256) + 13976LL) + 604LL);\n  v6 = (__m128)*v3;\n  v7 = (__m128)v3[1];\n  v6.f32[0] = v6.f32[0] / v5;\n  v7.f32[0] = v7.f32[0] / v5;\n  sub_10028CBE0(\n    v10,\n    (float)(_mm_round_ss(v6, v6, 9).f32[0] + 0.5) * v5,\n    (float)(_mm_round_ss(v7, v7, 9).f32[0] + 0.5) * v5);\n  if ( *(_BYTE *)(*(_QWORD *)(*(_QWORD *)(v4 + 1256) + 3248LL) + 453LL) )\n    v8 = (__m128)0x46EB1400u;\n  else\n    v8 = (__m128)0x451BA000u;\n  _mm_storel_ps(\n    v10,\n    _mm_min_ps(\n      _mm_max_ps((__m128)*(unsigned __int64 *)&v10[0], (__m128)xmmword_100815470),\n      _mm_insert_ps((__m128)xmmword_100815490, v8, 16)));\n  *(double *)&result = sub_10028CC60(a1, v10);\n  return result;\n}", "assembly": "; \n; EditorUI::getGridSnappedPos from 0x100035690 to 0x100035759 (201 bytes)\n; \n; 3 xrefs:\n; > EditorUI::ccTouchMoved @ 0x10004f8c4\n; > EditorUI::ccTouchEnded @ 0x10004fcaf\n; > SetupSmartBlockLayer::onPasteTemplate @ 0x1004e7068\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, 0x100035690\nmov     rbp, rsp                                                       ; +0x1, 0x100035691\npush    r15                                                            ; +0x4, 0x100035694\npush    r14                                                            ; +0x6, 0x100035696\npush    rbx                                                            ; +0x8, 0x100035698\npush    rax                                                            ; +0x9, 0x100035699\nmov     r14, rsi                                                       ; +0xa, 0x10003569a\nmov     rbx, rdi                                                       ; +0xd, 0x10003569d\nmov     rax, [rsi+4E8h]                                                ; +0x10, 0x1000356a0\nmov     rax, [rax+3698h]                                               ; +0x17, 0x1000356a7\nmovss   xmm2, dword ptr [rax+25Ch]                                     ; +0x1e, 0x1000356ae\nmovss   xmm0, dword ptr [rdx]                                          ; +0x26, 0x1000356b6\nmovss   xmm1, dword ptr [rdx+4]                                        ; +0x2a, 0x1000356ba\ndivss   xmm0, xmm2                                                     ; +0x2f, 0x1000356bf\ndivss   xmm1, xmm2                                                     ; +0x33, 0x1000356c3\nroundss xmm0, xmm0, 9                                                  ; +0x37, 0x1000356c7\nmovss   xmm3, cs:dword_100814FA8                                       ; +0x3d, 0x1000356cd\naddss   xmm0, xmm3                                                     ; +0x45, 0x1000356d5\nmulss   xmm0, xmm2                                                     ; +0x49, 0x1000356d9\nroundss xmm1, xmm1, 9                                                  ; +0x4d, 0x1000356dd\naddss   xmm1, xmm3                                                     ; +0x53, 0x1000356e3\nmulss   xmm1, xmm2                                                     ; +0x57, 0x1000356e7\nlea     r15, [rbp+var_20]                                              ; +0x5b, 0x1000356eb\nmov     rdi, r15                                                       ; +0x5f, 0x1000356ef\ncall    sub_10028CBE0                                                  ; +0x62, 0x1000356f2\nmov     rax, [r14+4E8h]                                                ; +0x67, 0x1000356f7\nmov     rax, [rax+0CB0h]                                               ; +0x6e, 0x1000356fe\ncmp     byte ptr [rax+1C5h], 0                                         ; +0x75, 0x100035705\njnz     short loc_100035718                                            ; +0x7c, 0x10003570c\nmovss   xmm0, cs:dword_1008152C4                                       ; +0x7e, 0x10003570e\njmp     short loc_100035720                                            ; +0x86, 0x100035716\nmovss   xmm0, cs:dword_1008152C0                                       ; +0x88, 0x100035718\nmovsd   xmm1, [rbp+var_20]                                             ; +0x90, 0x100035720\nmaxps   xmm1, cs:xmmword_100815470                                     ; +0x95, 0x100035725\nmovaps  xmm2, cs:xmmword_100815490                                     ; +0x9c, 0x10003572c\ninsertps xmm2, xmm0, 10h                                               ; +0xa3, 0x100035733\nminps   xmm1, xmm2                                                     ; +0xa9, 0x100035739\nmovlps  [rbp+var_20], xmm1                                             ; +0xac, 0x10003573c\nmov     rdi, rbx                                                       ; +0xb0, 0x100035740\nmov     rsi, r15                                                       ; +0xb3, 0x100035743\ncall    sub_10028CC60                                                  ; +0xb6, 0x100035746\nmov     rax, rbx                                                       ; +0xbb, 0x10003574b\nadd     rsp, 8                                                         ; +0xbe, 0x10003574e\npop     rbx                                                            ; +0xc2, 0x100035752\npop     r14                                                            ; +0xc3, 0x100035753\npop     r15                                                            ; +0xc5, 0x100035755\npop     rbp                                                            ; +0xc7, 0x100035757\nretn                                                                   ; +0xc8, 0x100035758", "xrefs": ["EditorUI::ccTouchMoved @ 0x10004f8c4", "EditorUI::ccTouchEnded @ 0x10004fcaf", "SetupSmartBlockLayer::onPasteTemplate @ 0x1004e7068"], "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"}