{"type": "func", "start": 5370814544, "end": 5370814875, "name": "EditorUI::applySpecialOffset", "pseudocode": "// \n// EditorUI::applySpecialOffset from 0x140202050 to 0x14020219b (331 bytes)\n// \n// 7 xrefs:\n// > EditorUI::findSnapObject_1 @ 0x1401bf608\n// > EditorUI::findSnapObject_1 @ 0x1401bf790\n// > EditorUI::ccTouchEnded @ 0x1401c10e4\n// > <???> @ 0x1408a3e20\n// > <???> @ 0x1408a3e30\n// > <???> @ 0x14091ae58\n// > <???> @ 0x14091ae64\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:28:13 +0000\n// \n\ncocos2d::CCPoint *__fastcall EditorUI::applySpecialOffset(\n        __int64 a1,\n        cocos2d::CCPoint *a2,\n        float *a3,\n        int *a4,\n        cocos2d::CCPoint *a5)\n{\n  __int64 v9; // r9\n  const struct cocos2d::CCPoint *v10; // rax\n  float *v11; // rax\n  cocos2d::CCPoint *v12; // rbp\n  const struct cocos2d::CCPoint *v13; // rax\n  __int32 v14; // xmm4_4\n  float v15; // xmm3_4\n  float v16; // xmm3_4\n  _BYTE v18[16]; // [rsp+20h] [rbp-38h] BYREF\n  float v19; // [rsp+68h] [rbp+10h] BYREF\n  float v20; // [rsp+6Ch] [rbp+14h]\n  float v21; // [rsp+78h] [rbp+20h] BYREF\n  float v22; // [rsp+7Ch] [rbp+24h]\n\n  if ( isSpecialSnapObject(a4[259]) )\n  {\n    v10 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 200LL))(v9);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, v10);\n    EditorUI::getGridSnappedPos(a1, (__int64)&v19, v11);\n    v12 = a5;\n    if ( !cocos2d::CCPoint::equals(a5, (const struct cocos2d::CCPoint *)&unk_14090A7A8) )\n      cocos2d::CCPoint::operator=(&v19, v12);\n    v13 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(int *))(*(_QWORD *)a4 + 200LL))(a4);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, v13);\n    v14 = _mm_load_si128((const __m128i *)&xmmword_140836C90).m128i_i32[0];\n    LODWORD(v15) = *(_DWORD *)a3 & v14;\n    if ( v15 > 0.0 )\n    {\n      if ( COERCE_FLOAT(COERCE_UNSIGNED_INT((float)(v15 + v21) - v19) & v14) < COERCE_FLOAT(\n                                                                                 COERCE_UNSIGNED_INT((float)(v21 - v15) - v19)\n                                                                               & v14) )\n        v15 = -v15;\n      *a3 = v15;\n    }\n    LODWORD(v16) = (_DWORD)a3[1] & v14;\n    if ( v16 > 0.0 )\n    {\n      if ( COERCE_FLOAT(COERCE_UNSIGNED_INT((float)(v16 + v22) - v20) & v14) < COERCE_FLOAT(\n                                                                                 COERCE_UNSIGNED_INT((float)(v22 - v16) - v20)\n                                                                               & v14) )\n        v16 = -v16;\n      a3[1] = v16;\n    }\n  }\n  cocos2d::CCPoint::CCPoint(a2, (const struct cocos2d::CCPoint *)a3);\n  return a2;\n}", "assembly": "; \n; EditorUI::applySpecialOffset from 0x140202050 to 0x14020219b (331 bytes)\n; \n; 7 xrefs:\n; > EditorUI::findSnapObject_1 @ 0x1401bf608\n; > EditorUI::findSnapObject_1 @ 0x1401bf790\n; > EditorUI::ccTouchEnded @ 0x1401c10e4\n; > <???> @ 0x1408a3e20\n; > <???> @ 0x1408a3e30\n; > <???> @ 0x14091ae58\n; > <???> @ 0x14091ae64\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:28:13 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x140202050\npush    rbp                                                            ; +0x5, 0x140202055\npush    rsi                                                            ; +0x6, 0x140202056\npush    rdi                                                            ; +0x7, 0x140202057\nsub     rsp, 40h                                                       ; +0x8, 0x140202058\nmov     rbp, rcx                                                       ; +0xc, 0x14020205c\nmov     rdi, r9                                                        ; +0xf, 0x14020205f\nmov     ecx, [r9+40Ch]                                                 ; +0x12, 0x140202062\nmov     rbx, r8                                                        ; +0x19, 0x140202069\nmov     rsi, rdx                                                       ; +0x1c, 0x14020206c\ncall    isSpecialSnapObject                                            ; +0x1f, 0x14020206f\ntest    al, al                                                         ; +0x24, 0x140202074\njz      loc_14020217F                                                  ; +0x26, 0x140202076\nmov     rax, [r9]                                                      ; +0x2c, 0x14020207c\nmov     rcx, r9                                                        ; +0x2f, 0x14020207f\nmovaps  [rsp+58h+var_28], xmm6                                         ; +0x32, 0x140202082\ncall    qword ptr [rax+0C8h]                                           ; +0x37, 0x140202087\nmov     rdx, rax                                                       ; +0x3d, 0x14020208d\nlea     rcx, [rsp+58h+var_38]                                          ; +0x40, 0x140202090\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x45, 0x140202095\nlea     rdx, [rsp+58h+arg_8]                                           ; +0x4b, 0x14020209b\nmov     rcx, rbp                                                       ; +0x50, 0x1402020a0\nmov     r8, rax                                                        ; +0x53, 0x1402020a3\ncall    EditorUI__getGridSnappedPos                                    ; +0x56, 0x1402020a6\nmov     rbp, [rsp+58h+arg_20]                                          ; +0x5b, 0x1402020ab\nlea     rdx, unk_14090A7A8                                             ; +0x63, 0x1402020b3\nmov     rcx, rbp                                                       ; +0x6a, 0x1402020ba\ncall    cs:?equals@CCPoint@cocos2d@@QEBA_NAEBV12@@Z; cocos2d::CCPoint::equals(cocos2d::CCPoint const &) ; +0x6d, 0x1402020bd\ntest    al, al                                                         ; +0x73, 0x1402020c3\njnz     short loc_1402020D5                                            ; +0x75, 0x1402020c5\nmov     rdx, rbp                                                       ; +0x77, 0x1402020c7\nlea     rcx, [rsp+58h+arg_8]                                           ; +0x7a, 0x1402020ca\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x7f, 0x1402020cf\nmov     rax, [rdi]                                                     ; +0x85, 0x1402020d5\nmov     rcx, rdi                                                       ; +0x88, 0x1402020d8\ncall    qword ptr [rax+0C8h]                                           ; +0x8b, 0x1402020db\nmov     rdx, rax                                                       ; +0x91, 0x1402020e1\nlea     rcx, [rsp+58h+arg_18]                                          ; +0x94, 0x1402020e4\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x99, 0x1402020e9\nmovss   xmm3, dword ptr [rbx]                                          ; +0x9f, 0x1402020ef\nxorps   xmm6, xmm6                                                     ; +0xa3, 0x1402020f3\nmovdqa  xmm4, cs:xmmword_140836C90                                     ; +0xa6, 0x1402020f6\nmovss   xmm5, dword ptr cs:xmmword_140836CC0                           ; +0xae, 0x1402020fe\nandps   xmm3, xmm4                                                     ; +0xb6, 0x140202106\ncomiss  xmm3, xmm6                                                     ; +0xb9, 0x140202109\njbe     short loc_14020213D                                            ; +0xbc, 0x14020210c\nmovss   xmm1, [rsp+58h+arg_18]                                         ; +0xbe, 0x14020210e\nmovaps  xmm2, xmm3                                                     ; +0xc4, 0x140202114\naddss   xmm2, xmm1                                                     ; +0xc7, 0x140202117\nsubss   xmm1, xmm3                                                     ; +0xcb, 0x14020211b\nsubss   xmm2, [rsp+58h+arg_8]                                          ; +0xcf, 0x14020211f\nsubss   xmm1, [rsp+58h+arg_8]                                          ; +0xd5, 0x140202125\nandps   xmm2, xmm4                                                     ; +0xdb, 0x14020212b\nandps   xmm1, xmm4                                                     ; +0xde, 0x14020212e\ncomiss  xmm2, xmm1                                                     ; +0xe1, 0x140202131\njnb     short loc_140202139                                            ; +0xe4, 0x140202134\nxorps   xmm3, xmm5                                                     ; +0xe6, 0x140202136\nmovss   dword ptr [rbx], xmm3                                          ; +0xe9, 0x140202139\nmovss   xmm3, dword ptr [rbx+4]                                        ; +0xed, 0x14020213d\nandps   xmm3, xmm4                                                     ; +0xf2, 0x140202142\ncomiss  xmm3, xmm6                                                     ; +0xf5, 0x140202145\nmovaps  xmm6, [rsp+58h+var_28]                                         ; +0xf8, 0x140202148\njbe     short loc_14020217F                                            ; +0xfd, 0x14020214d\nmovss   xmm1, [rsp+58h+arg_1C]                                         ; +0xff, 0x14020214f\nmovaps  xmm2, xmm3                                                     ; +0x105, 0x140202155\naddss   xmm2, xmm1                                                     ; +0x108, 0x140202158\nsubss   xmm1, xmm3                                                     ; +0x10c, 0x14020215c\nsubss   xmm2, [rsp+58h+arg_C]                                          ; +0x110, 0x140202160\nsubss   xmm1, [rsp+58h+arg_C]                                          ; +0x116, 0x140202166\nandps   xmm2, xmm4                                                     ; +0x11c, 0x14020216c\nandps   xmm1, xmm4                                                     ; +0x11f, 0x14020216f\ncomiss  xmm2, xmm1                                                     ; +0x122, 0x140202172\njnb     short loc_14020217A                                            ; +0x125, 0x140202175\nxorps   xmm3, xmm5                                                     ; +0x127, 0x140202177\nmovss   dword ptr [rbx+4], xmm3                                        ; +0x12a, 0x14020217a\nmov     rdx, rbx                                                       ; +0x12f, 0x14020217f\nmov     rcx, rsi                                                       ; +0x132, 0x140202182\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x135, 0x140202185\nmov     rbx, [rsp+58h+arg_0]                                           ; +0x13b, 0x14020218b\nmov     rax, rsi                                                       ; +0x140, 0x140202190\nadd     rsp, 40h                                                       ; +0x143, 0x140202193\npop     rdi                                                            ; +0x147, 0x140202197\npop     rsi                                                            ; +0x148, 0x140202198\npop     rbp                                                            ; +0x149, 0x140202199\nretn                                                                   ; +0x14a, 0x14020219a", "xrefs": ["EditorUI::findSnapObject_1 @ 0x1401bf608", "EditorUI::findSnapObject_1 @ 0x1401bf790", "EditorUI::ccTouchEnded @ 0x1401c10e4", "<???> @ 0x1408a3e20", "<???> @ 0x1408a3e30", "<???> @ 0x14091ae58", "<???> @ 0x14091ae64"], "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"}