{"type": "func", "start": 5370276512, "end": 5370276923, "name": "EditorWindowPopup::clampWindowOnScreen", "pseudocode": "// \n// EditorWindowPopup::clampWindowOnScreen from 0x14017eaa0 to 0x14017ec3b (411 bytes)\n// \n// 2 xrefs:\n// > EmotePickerPopup::init @ 0x140123bea\n// > <???> @ 0x140918a4c\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:27:36 +0000\n// \n\ncocos2d::CCPoint *__fastcall EditorWindowPopup::clampWindowOnScreen(__int64 a1, cocos2d::CCPoint *a2, float *a3)\n{\n  float v5; // xmm9_4\n  __int64 v6; // rax\n  float v7; // xmm11_4\n  float v8; // xmm8_4\n  cocos2d::CCDirector *v9; // rax\n  float v10; // xmm10_4\n  __int64 v11; // rcx\n  cocos2d::CCDirector *v12; // rax\n  float v13; // xmm9_4\n  float v14; // xmm7_4\n  __int64 v15; // rcx\n  cocos2d::CCDirector *v16; // rax\n  float v17; // xmm8_4\n  __int64 v18; // rcx\n  cocos2d::CCDirector *v19; // rax\n  float v20; // xmm0_4\n  float v21; // xmm1_4\n\n  v5 = *(float *)(a1 + 1048) * *(float *)(a1 + 1044);\n  v6 = *(_QWORD *)(a1 + 1000);\n  if ( v6 )\n    v7 = *(float *)(v6 + 904);\n  else\n    v7 = 0.0;\n  v8 = (float)(*(float *)(a1 + 1048) * *(float *)(a1 + 1040)) * 0.5;\n  v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);\n  v10 = (float)(cocos2d::CCDirector::getScreenLeft(v9) + 6.0) + v8;\n  v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);\n  v13 = v5 * 0.5;\n  v14 = (float)(cocos2d::CCDirector::getScreenRight(v12) - 6.0) - v8;\n  v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v15);\n  v17 = (float)((float)(cocos2d::CCDirector::getScreenBottom(v16) + v7) + 6.0) + v13;\n  v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v18);\n  v20 = (float)(cocos2d::CCDirector::getScreenTop(v19) - 6.0) - v13;\n  if ( v10 > v14 )\n  {\n    v14 = (float)(v14 + v10) * 0.5;\nLABEL_9:\n    *a3 = v14;\n    goto LABEL_10;\n  }\n  if ( v10 > *a3 )\n  {\n    *a3 = v10;\n    goto LABEL_10;\n  }\n  if ( *a3 > v14 )\n    goto LABEL_9;\nLABEL_10:\n  if ( v17 > v20 )\n  {\n    v20 = (float)(v20 + v17) * 0.5;\nLABEL_15:\n    a3[1] = v20;\n    goto LABEL_16;\n  }\n  v21 = a3[1];\n  if ( v17 <= v21 )\n  {\n    if ( v21 > v20 )\n      goto LABEL_15;\n  }\n  else\n  {\n    a3[1] = v17;\n  }\nLABEL_16:\n  cocos2d::CCPoint::CCPoint(a2, (const struct cocos2d::CCPoint *)a3);\n  return a2;\n}", "assembly": "; \n; EditorWindowPopup::clampWindowOnScreen from 0x14017eaa0 to 0x14017ec3b (411 bytes)\n; \n; 2 xrefs:\n; > EmotePickerPopup::init @ 0x140123bea\n; > <???> @ 0x140918a4c\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:27:36 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x14017eaa0\nmov     [rax+8], rbx                                                   ; +0x3, 0x14017eaa3\npush    rdi                                                            ; +0x7, 0x14017eaa7\nsub     rsp, 90h                                                       ; +0x8, 0x14017eaa8\nmovaps  xmmword ptr [rax-18h], xmm6                                    ; +0xf, 0x14017eaaf\nmov     rbx, r8                                                        ; +0x13, 0x14017eab3\nmovaps  xmmword ptr [rax-28h], xmm7                                    ; +0x16, 0x14017eab6\nmov     rdi, rdx                                                       ; +0x1a, 0x14017eaba\nmovaps  xmmword ptr [rax-38h], xmm8                                    ; +0x1d, 0x14017eabd\nmovaps  xmmword ptr [rax-48h], xmm9                                    ; +0x22, 0x14017eac2\nmovss   xmm9, dword ptr [rcx+418h]                                     ; +0x27, 0x14017eac7\nmovaps  xmmword ptr [rax-58h], xmm10                                   ; +0x30, 0x14017ead0\nmovaps  xmm8, xmm9                                                     ; +0x35, 0x14017ead5\nmulss   xmm8, dword ptr [rcx+410h]                                     ; +0x39, 0x14017ead9\nmulss   xmm9, dword ptr [rcx+414h]                                     ; +0x42, 0x14017eae2\nmovaps  xmmword ptr [rax-68h], xmm11                                   ; +0x4b, 0x14017eaeb\nmovaps  xmmword ptr [rax-78h], xmm12                                   ; +0x50, 0x14017eaf0\nmov     rax, [rcx+3E8h]                                                ; +0x55, 0x14017eaf5\ntest    rax, rax                                                       ; +0x5c, 0x14017eafc\njz      short loc_14017EB0C                                            ; +0x5f, 0x14017eaff\nmovss   xmm11, dword ptr [rax+388h]                                    ; +0x61, 0x14017eb01\njmp     short loc_14017EB10                                            ; +0x6a, 0x14017eb0a\nxorps   xmm11, xmm11                                                   ; +0x6c, 0x14017eb0c\nmovss   xmm12, cs:dword_140834F20                                      ; +0x70, 0x14017eb10\nmulss   xmm8, xmm12                                                    ; +0x79, 0x14017eb19\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x7e, 0x14017eb1e\nmov     rcx, rax                                                       ; +0x84, 0x14017eb24\ncall    cs:?getScreenLeft@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenLeft(void) ; +0x87, 0x14017eb27\nmovss   xmm6, cs:flt_140835490                                         ; +0x8d, 0x14017eb2d\nmovaps  xmm10, xmm0                                                    ; +0x95, 0x14017eb35\naddss   xmm10, xmm6                                                    ; +0x99, 0x14017eb39\naddss   xmm10, xmm8                                                    ; +0x9e, 0x14017eb3e\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xa3, 0x14017eb43\nmov     rcx, rax                                                       ; +0xa9, 0x14017eb49\ncall    cs:?getScreenRight@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenRight(void) ; +0xac, 0x14017eb4c\nmovaps  xmm7, xmm0                                                     ; +0xb2, 0x14017eb52\nmulss   xmm9, xmm12                                                    ; +0xb5, 0x14017eb55\nsubss   xmm7, xmm6                                                     ; +0xba, 0x14017eb5a\nsubss   xmm7, xmm8                                                     ; +0xbe, 0x14017eb5e\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xc3, 0x14017eb63\nmov     rcx, rax                                                       ; +0xc9, 0x14017eb69\ncall    cs:?getScreenBottom@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenBottom(void) ; +0xcc, 0x14017eb6c\nmovaps  xmm8, xmm0                                                     ; +0xd2, 0x14017eb72\naddss   xmm8, xmm11                                                    ; +0xd6, 0x14017eb76\naddss   xmm8, xmm6                                                     ; +0xdb, 0x14017eb7b\naddss   xmm8, xmm9                                                     ; +0xe0, 0x14017eb80\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xe5, 0x14017eb85\nmov     rcx, rax                                                       ; +0xeb, 0x14017eb8b\ncall    cs:?getScreenTop@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenTop(void) ; +0xee, 0x14017eb8e\ncomiss  xmm10, xmm7                                                    ; +0xf4, 0x14017eb94\nsubss   xmm0, xmm6                                                     ; +0xf8, 0x14017eb98\nsubss   xmm0, xmm9                                                     ; +0xfc, 0x14017eb9c\njbe     short loc_14017EBAF                                            ; +0x101, 0x14017eba1\naddss   xmm7, xmm10                                                    ; +0x103, 0x14017eba3\nmulss   xmm7, xmm12                                                    ; +0x108, 0x14017eba8\njmp     short loc_14017EBC5                                            ; +0x10d, 0x14017ebad\nmovss   xmm1, dword ptr [rbx]                                          ; +0x10f, 0x14017ebaf\ncomiss  xmm10, xmm1                                                    ; +0x113, 0x14017ebb3\njbe     short loc_14017EBC0                                            ; +0x117, 0x14017ebb7\nmovss   dword ptr [rbx], xmm10                                         ; +0x119, 0x14017ebb9\njmp     short loc_14017EBC9                                            ; +0x11e, 0x14017ebbe\ncomiss  xmm1, xmm7                                                     ; +0x120, 0x14017ebc0\njbe     short loc_14017EBC9                                            ; +0x123, 0x14017ebc3\nmovss   dword ptr [rbx], xmm7                                          ; +0x125, 0x14017ebc5\ncomiss  xmm8, xmm0                                                     ; +0x129, 0x14017ebc9\njbe     short loc_14017EBDB                                            ; +0x12d, 0x14017ebcd\naddss   xmm0, xmm8                                                     ; +0x12f, 0x14017ebcf\nmulss   xmm0, xmm12                                                    ; +0x134, 0x14017ebd4\njmp     short loc_14017EBF3                                            ; +0x139, 0x14017ebd9\nmovss   xmm1, dword ptr [rbx+4]                                        ; +0x13b, 0x14017ebdb\ncomiss  xmm8, xmm1                                                     ; +0x140, 0x14017ebe0\njbe     short loc_14017EBEE                                            ; +0x144, 0x14017ebe4\nmovss   dword ptr [rbx+4], xmm8                                        ; +0x146, 0x14017ebe6\njmp     short loc_14017EBF8                                            ; +0x14c, 0x14017ebec\ncomiss  xmm1, xmm0                                                     ; +0x14e, 0x14017ebee\njbe     short loc_14017EBF8                                            ; +0x151, 0x14017ebf1\nmovss   dword ptr [rbx+4], xmm0                                        ; +0x153, 0x14017ebf3\nmov     rdx, rbx                                                       ; +0x158, 0x14017ebf8\nmov     rcx, rdi                                                       ; +0x15b, 0x14017ebfb\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x15e, 0x14017ebfe\nmovaps  xmm7, [rsp+98h+var_28]                                         ; +0x164, 0x14017ec04\nlea     r11, [rsp+98h+var_8]                                           ; +0x169, 0x14017ec09\nmov     rbx, [r11+10h]                                                 ; +0x171, 0x14017ec11\nmov     rax, rdi                                                       ; +0x175, 0x14017ec15\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x178, 0x14017ec18\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x17d, 0x14017ec1d\nmovaps  xmm9, xmmword ptr [r11-40h]                                    ; +0x182, 0x14017ec22\nmovaps  xmm10, xmmword ptr [r11-50h]                                   ; +0x187, 0x14017ec27\nmovaps  xmm11, xmmword ptr [r11-60h]                                   ; +0x18c, 0x14017ec2c\nmovaps  xmm12, xmmword ptr [r11-70h]                                   ; +0x191, 0x14017ec31\nmov     rsp, r11                                                       ; +0x196, 0x14017ec36\npop     rdi                                                            ; +0x199, 0x14017ec39\nretn                                                                   ; +0x19a, 0x14017ec3a", "xrefs": ["EmotePickerPopup::init @ 0x140123bea", "<???> @ 0x140918a4c"], "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"}