{"type": "func", "start": 13474256, "end": 13474564, "name": "EditorWindowPopup::clampWindowOnScreen", "pseudocode": "// \n// EditorWindowPopup::clampWindowOnScreen from 0xcd99d0 to 0xcd9b04 (308 bytes)\n// \n// 2 xrefs:\n// > EmotePickerPopup::init @ 0xcb9830\n// > <???> @ 0x4ae48\n// \n// This function is hookable on this platform (idp: arm, 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 13:06:32 +0000\n// \n\ncocos2d::CCPoint *__usercall EditorWindowPopup::clampWindowOnScreen@<X0>(\n        __int64 a1@<X0>,\n        float *a2@<X1>,\n        cocos2d::CCPoint *a3@<X8>)\n{\n  __int64 v4; // x2\n  float v5; // s8\n  float v6; // s10\n  float v7; // s9\n  float v8; // s8\n  cocos2d::CCDirector *v9; // x0\n  cocos2d::CCDirector *ScreenLeft; // x0\n  float v11; // s0\n  float v12; // s11\n  cocos2d::CCDirector *v13; // x0\n  cocos2d::CCDirector *ScreenRight; // x0\n  float v15; // s0\n  float v16; // s10\n  cocos2d::CCDirector *v17; // x0\n  cocos2d::CCDirector *ScreenBottom; // x0\n  float v19; // s0\n  float v20; // s8\n  cocos2d::CCDirector *v21; // x0\n  float v22; // s0\n  float v23; // s9\n  float v24; // s0\n\n  v4 = *(_QWORD *)(a1 + 1016);\n  v5 = *(float *)(a1 + 1064);\n  v6 = v5 * *(float *)(a1 + 1056);\n  v7 = v5 * *(float *)(a1 + 1060);\n  if ( v4 )\n    v8 = *(float *)(v4 + 856);\n  else\n    v8 = 0.0;\n  v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)a1);\n  ScreenLeft = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenLeft(v9);\n  v12 = (float)(v11 + 6.0) + (float)(v6 * 0.5);\n  v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenLeft);\n  ScreenRight = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenRight(v13);\n  v16 = (float)(v15 - 6.0) - (float)(v6 * 0.5);\n  v17 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenRight);\n  ScreenBottom = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenBottom(v17);\n  v20 = (float)((float)(v8 + v19) + 6.0) + (float)(v7 * 0.5);\n  v21 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenBottom);\n  cocos2d::CCDirector::getScreenTop(v21);\n  v23 = (float)(v22 - 6.0) - (float)(v7 * 0.5);\n  if ( v12 > v16 )\n  {\n    *a2 = (float)(v12 + v16) * 0.5;\n    goto LABEL_5;\n  }\n  if ( v12 <= *a2 )\n  {\n    if ( v16 < *a2 )\n      *a2 = v16;\nLABEL_5:\n    if ( v20 <= v23 )\n      goto LABEL_6;\nLABEL_12:\n    a2[1] = (float)(v20 + v23) * 0.5;\n    goto LABEL_9;\n  }\n  *a2 = v12;\n  if ( v20 > v23 )\n    goto LABEL_12;\nLABEL_6:\n  v24 = a2[1];\n  if ( v20 > v24 )\n  {\n    a2[1] = v20;\n  }\n  else if ( v23 < v24 )\n  {\n    a2[1] = v23;\n  }\nLABEL_9:\n  cocos2d::CCPoint::CCPoint(a3, (const cocos2d::CCPoint *)a2);\n  return a3;\n}", "assembly": "; \n; EditorWindowPopup::clampWindowOnScreen from 0xcd99d0 to 0xcd9b04 (308 bytes)\n; \n; 2 xrefs:\n; > EmotePickerPopup::init @ 0xcb9830\n; > <???> @ 0x4ae48\n; \n; This function is hookable on this platform (idp: arm, 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 13:06:32 +0000\n; \nSTP             X29, X30, [SP,#var_60]!                                ; +0x0, 0xcd99d0\nMOV             X29, SP                                                ; +0x4, 0xcd99d4\nSTP             D8, D9, [SP,#0x60+var_48]                              ; +0x8, 0xcd99d8\nSTR             X19, [SP,#0x60+var_50]                                 ; +0xc, 0xcd99dc\nSTP             D10, D11, [SP,#0x60+var_38]                            ; +0x10, 0xcd99e0\nMOV             X19, X8                                                ; +0x14, 0xcd99e4\nSTP             D12, D13, [SP,#0x60+var_28]                            ; +0x18, 0xcd99e8\nLDR             X2, [X0,#0x3F8]                                        ; +0x1c, 0xcd99ec\nLDR             S8, [X0,#0x428]                                        ; +0x20, 0xcd99f0\nLDR             S10, [X0,#0x420]                                       ; +0x24, 0xcd99f4\nLDR             S9, [X0,#0x424]                                        ; +0x28, 0xcd99f8\nFMUL            S10, S8, S10                                           ; +0x2c, 0xcd99fc\nFMUL            S9, S8, S9                                             ; +0x30, 0xcd9a00\nCBZ             X2, loc_CD9AFC                                         ; +0x34, 0xcd9a04\nLDR             S8, [X2,#0x358]                                        ; +0x38, 0xcd9a08\nFMOV            S12, #6.0                                              ; +0x3c, 0xcd9a0c\nSTR             X1, [X29,#0x60+var_8]                                  ; +0x40, 0xcd9a10\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x44, 0xcd9a14\nBL              _ZN7cocos2d10CCDirector13getScreenLeftEv; cocos2d::CCDirector::getScreenLeft(void) ; +0x48, 0xcd9a18\nFADD            S0, S0, S12                                            ; +0x4c, 0xcd9a1c\nFMOV            S13, #0.5                                              ; +0x50, 0xcd9a20\nFMADD           S11, S10, S13, S0                                      ; +0x54, 0xcd9a24\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x58, 0xcd9a28\nBL              _ZN7cocos2d10CCDirector14getScreenRightEv; cocos2d::CCDirector::getScreenRight(void) ; +0x5c, 0xcd9a2c\nFSUB            S0, S0, S12                                            ; +0x60, 0xcd9a30\nFMSUB           S10, S10, S13, S0                                      ; +0x64, 0xcd9a34\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x68, 0xcd9a38\nBL              _ZN7cocos2d10CCDirector15getScreenBottomEv; cocos2d::CCDirector::getScreenBottom(void) ; +0x6c, 0xcd9a3c\nFADD            S0, S8, S0                                             ; +0x70, 0xcd9a40\nFADD            S8, S0, S12                                            ; +0x74, 0xcd9a44\nFMADD           S8, S9, S13, S8                                        ; +0x78, 0xcd9a48\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x7c, 0xcd9a4c\nBL              _ZN7cocos2d10CCDirector12getScreenTopEv; cocos2d::CCDirector::getScreenTop(void) ; +0x80, 0xcd9a50\nFSUB            S0, S0, S12                                            ; +0x84, 0xcd9a54\nLDR             X1, [X29,#0x60+var_8]; cocos2d::CCPoint *              ; +0x88, 0xcd9a58\nFCMPE           S11, S10                                               ; +0x8c, 0xcd9a5c\nFMSUB           S9, S9, S13, S0                                        ; +0x90, 0xcd9a60\nB.LE            loc_CD9AB8                                             ; +0x94, 0xcd9a64\nFADD            S11, S11, S10                                          ; +0x98, 0xcd9a68\nFMUL            S11, S11, S13                                          ; +0x9c, 0xcd9a6c\nSTR             S11, [X1]                                              ; +0xa0, 0xcd9a70\nFCMPE           S8, S9                                                 ; +0xa4, 0xcd9a74\nB.GT            loc_CD9AD0                                             ; +0xa8, 0xcd9a78\nLDR             S0, [X1,#4]                                            ; +0xac, 0xcd9a7c\nFCMPE           S8, S0                                                 ; +0xb0, 0xcd9a80\nB.GT            loc_CD9AF4                                             ; +0xb4, 0xcd9a84\nFCMPE           S9, S0                                                 ; +0xb8, 0xcd9a88\nB.PL            loc_CD9A94                                             ; +0xbc, 0xcd9a8c\nSTR             S9, [X1,#4]                                            ; +0xc0, 0xcd9a90\nMOV             X0, X19; this                                          ; +0xc4, 0xcd9a94\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xc8, 0xcd9a98\nMOV             X0, X19                                                ; +0xcc, 0xcd9a9c\nLDP             D8, D9, [SP,#0x60+var_48]                              ; +0xd0, 0xcd9aa0\nLDR             X19, [SP,#0x60+var_50]                                 ; +0xd4, 0xcd9aa4\nLDP             D10, D11, [SP,#0x60+var_38]                            ; +0xd8, 0xcd9aa8\nLDP             D12, D13, [SP,#0x60+var_28]                            ; +0xdc, 0xcd9aac\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0xe0, 0xcd9ab0\nRET                                                                    ; +0xe4, 0xcd9ab4\nLDR             S0, [X1]                                               ; +0xe8, 0xcd9ab8\nFCMPE           S11, S0                                                ; +0xec, 0xcd9abc\nB.LE            loc_CD9AE4                                             ; +0xf0, 0xcd9ac0\nFCMPE           S8, S9                                                 ; +0xf4, 0xcd9ac4\nSTR             S11, [X1]                                              ; +0xf8, 0xcd9ac8\nB.LE            loc_CD9A7C                                             ; +0xfc, 0xcd9acc\nFADD            S8, S8, S9                                             ; +0x100, 0xcd9ad0\nFMOV            S0, #0.5                                               ; +0x104, 0xcd9ad4\nFMUL            S8, S8, S0                                             ; +0x108, 0xcd9ad8\nSTR             S8, [X1,#4]                                            ; +0x10c, 0xcd9adc\nB               loc_CD9A94                                             ; +0x110, 0xcd9ae0\nFCMPE           S10, S0                                                ; +0x114, 0xcd9ae4\nB.PL            loc_CD9A74                                             ; +0x118, 0xcd9ae8\nSTR             S10, [X1]                                              ; +0x11c, 0xcd9aec\nB               loc_CD9A74                                             ; +0x120, 0xcd9af0\nSTR             S8, [X1,#4]                                            ; +0x124, 0xcd9af4\nB               loc_CD9A94                                             ; +0x128, 0xcd9af8\nFMOV            S8, WZR                                                ; +0x12c, 0xcd9afc\nB               loc_CD9A0C                                             ; +0x130, 0xcd9b00", "xrefs": ["EmotePickerPopup::init @ 0xcb9830", "<???> @ 0x4ae48"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "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"}