{"type": "func", "start": 4300054060, "end": 4300054364, "name": "EditorWindowPopup::clampWindowOnScreen", "pseudocode": "// \n// EditorWindowPopup::clampWindowOnScreen from 0x1004d9e2c to 0x1004d9f5c (304 bytes)\n// \n// 1 xrefs:\n// > EmotePickerPopup::init @ 0x1004daff4\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 11:06:33 +0000\n// \n\ndouble __usercall EditorWindowPopup::clampWindowOnScreen@<D0>(__int64 a1@<X0>, __int64 a2@<X1>, _QWORD *a3@<X8>)\n{\n  float v5; // s1\n  float v6; // s8\n  float v7; // s9\n  __int64 v8; // x8\n  float v9; // s11\n  __int64 v10; // x0\n  float v11; // s12\n  float v12; // s8\n  __int64 v13; // x0\n  float v14; // s12\n  __int64 v15; // x0\n  float v16; // s0\n  float v17; // s11\n  float v18; // s9\n  __int64 v19; // x0\n  float v20; // s0\n  float v21; // s1\n\n  v5 = *(float *)(a1 + 1064);\n  v6 = *(float *)(a1 + 1056) * v5;\n  v7 = v5 * *(float *)(a1 + 1060);\n  v8 = *(_QWORD *)(a1 + 1016);\n  if ( v8 )\n    v9 = *(float *)(v8 + 856);\n  else\n    v9 = 0.0;\n  v10 = cocos2d::CCDirector::sharedDirector();\n  v11 = v6 * 0.5;\n  v12 = (float)(v6 * 0.5) + (float)(sub_100207EA8(v10) + 6.0);\n  v13 = cocos2d::CCDirector::sharedDirector();\n  v14 = (float)(sub_100207EB0(v13) + -6.0) - v11;\n  v15 = cocos2d::CCDirector::sharedDirector();\n  v16 = (float)(v9 + sub_100207EA0(v15)) + 6.0;\n  v17 = v7 * 0.5;\n  v18 = (float)(v7 * 0.5) + v16;\n  v19 = cocos2d::CCDirector::sharedDirector();\n  v20 = (float)(sub_100207E98(v19) + -6.0) - v17;\n  if ( v12 > v14 )\n  {\n    v12 = (float)(v12 + v14) * 0.5;\nLABEL_8:\n    *(float *)a2 = v12;\n    goto LABEL_9;\n  }\n  if ( *(float *)a2 < v12 )\n    goto LABEL_8;\n  v12 = v14;\n  if ( *(float *)a2 > v14 )\n    goto LABEL_8;\nLABEL_9:\n  if ( v18 <= v20 )\n  {\n    v21 = *(float *)(a2 + 4);\n    if ( v21 < v18 )\n    {\n      *(float *)(a2 + 4) = v18;\n      return sub_1000262F4(a3, (double *)a2);\n    }\n    if ( v21 <= v20 )\n      return sub_1000262F4(a3, (double *)a2);\n  }\n  else\n  {\n    v20 = (float)(v18 + v20) * 0.5;\n  }\n  *(float *)(a2 + 4) = v20;\n  return sub_1000262F4(a3, (double *)a2);\n}", "assembly": "; \n; EditorWindowPopup::clampWindowOnScreen from 0x1004d9e2c to 0x1004d9f5c (304 bytes)\n; \n; 1 xrefs:\n; > EmotePickerPopup::init @ 0x1004daff4\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 11:06:33 +0000\n; \nSTP             D15, D14, [SP,#-0x10+var_50]!                          ; +0x0, 0x1004d9e2c\nSTP             D13, D12, [SP,#0x50+var_40]                            ; +0x4, 0x1004d9e30\nSTP             D11, D10, [SP,#0x50+var_30]                            ; +0x8, 0x1004d9e34\nSTP             D9, D8, [SP,#0x50+var_20]                              ; +0xc, 0x1004d9e38\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0x10, 0x1004d9e3c\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0x14, 0x1004d9e40\nADD             X29, SP, #0x50                                         ; +0x18, 0x1004d9e44\nMOV             X19, X1                                                ; +0x1c, 0x1004d9e48\nMOV             X20, X8                                                ; +0x20, 0x1004d9e4c\nLDR             S0, [X0,#0x420]                                        ; +0x24, 0x1004d9e50\nLDR             S1, [X0,#0x428]                                        ; +0x28, 0x1004d9e54\nFMUL            S8, S0, S1                                             ; +0x2c, 0x1004d9e58\nLDR             S0, [X0,#0x424]                                        ; +0x30, 0x1004d9e5c\nFMUL            S9, S1, S0                                             ; +0x34, 0x1004d9e60\nLDR             X8, [X0,#0x3F8]                                        ; +0x38, 0x1004d9e64\nCBZ             X8, loc_1004D9E74                                      ; +0x3c, 0x1004d9e68\nLDR             S11, [X8,#0x358]                                       ; +0x40, 0x1004d9e6c\nB               loc_1004D9E78                                          ; +0x44, 0x1004d9e70\nFMOV            S11, WZR                                               ; +0x48, 0x1004d9e74\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x4c, 0x1004d9e78\nBL              sub_100207EA8                                          ; +0x50, 0x1004d9e7c\nFMOV            S13, #6.0                                              ; +0x54, 0x1004d9e80\nFADD            S0, S0, S13                                            ; +0x58, 0x1004d9e84\nFMOV            S10, #0.5                                              ; +0x5c, 0x1004d9e88\nFMUL            S12, S8, S10                                           ; +0x60, 0x1004d9e8c\nFADD            S8, S12, S0                                            ; +0x64, 0x1004d9e90\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x68, 0x1004d9e94\nBL              sub_100207EB0                                          ; +0x6c, 0x1004d9e98\nFMOV            S14, #-6.0                                             ; +0x70, 0x1004d9e9c\nFADD            S0, S0, S14                                            ; +0x74, 0x1004d9ea0\nFSUB            S12, S0, S12                                           ; +0x78, 0x1004d9ea4\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x7c, 0x1004d9ea8\nBL              sub_100207EA0                                          ; +0x80, 0x1004d9eac\nFADD            S0, S11, S0                                            ; +0x84, 0x1004d9eb0\nFADD            S0, S0, S13                                            ; +0x88, 0x1004d9eb4\nFMUL            S11, S9, S10                                           ; +0x8c, 0x1004d9eb8\nFADD            S9, S11, S0                                            ; +0x90, 0x1004d9ebc\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x94, 0x1004d9ec0\nBL              sub_100207E98                                          ; +0x98, 0x1004d9ec4\nFADD            S0, S0, S14                                            ; +0x9c, 0x1004d9ec8\nFSUB            S0, S0, S11                                            ; +0xa0, 0x1004d9ecc\nFCMP            S8, S12                                                ; +0xa4, 0x1004d9ed0\nB.LE            loc_1004D9EE4                                          ; +0xa8, 0x1004d9ed4\nFADD            S1, S8, S12                                            ; +0xac, 0x1004d9ed8\nFMUL            S8, S1, S10                                            ; +0xb0, 0x1004d9edc\nB               loc_1004D9EFC                                          ; +0xb4, 0x1004d9ee0\nLDR             S1, [X19]                                              ; +0xb8, 0x1004d9ee4\nFCMP            S1, S8                                                 ; +0xbc, 0x1004d9ee8\nB.MI            loc_1004D9EFC                                          ; +0xc0, 0x1004d9eec\nFCMP            S1, S12                                                ; +0xc4, 0x1004d9ef0\nFMOV            S8, S12                                                ; +0xc8, 0x1004d9ef4\nB.LE            loc_1004D9F00                                          ; +0xcc, 0x1004d9ef8\nSTR             S8, [X19]                                              ; +0xd0, 0x1004d9efc\nFCMP            S9, S0                                                 ; +0xd4, 0x1004d9f00\nB.LE            loc_1004D9F1C                                          ; +0xd8, 0x1004d9f04\nFADD            S0, S9, S0                                             ; +0xdc, 0x1004d9f08\nFMOV            S1, #0.5                                               ; +0xe0, 0x1004d9f0c\nFMUL            S0, S0, S1                                             ; +0xe4, 0x1004d9f10\nSTR             S0, [X19,#4]                                           ; +0xe8, 0x1004d9f14\nB               loc_1004D9F38                                          ; +0xec, 0x1004d9f18\nLDR             S1, [X19,#4]                                           ; +0xf0, 0x1004d9f1c\nFCMP            S1, S9                                                 ; +0xf4, 0x1004d9f20\nB.PL            loc_1004D9F30                                          ; +0xf8, 0x1004d9f24\nSTR             S9, [X19,#4]                                           ; +0xfc, 0x1004d9f28\nB               loc_1004D9F38                                          ; +0x100, 0x1004d9f2c\nFCMP            S1, S0                                                 ; +0x104, 0x1004d9f30\nB.GT            loc_1004D9F14                                          ; +0x108, 0x1004d9f34\nMOV             X0, X20                                                ; +0x10c, 0x1004d9f38\nMOV             X1, X19                                                ; +0x110, 0x1004d9f3c\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0x114, 0x1004d9f40\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0x118, 0x1004d9f44\nLDP             D9, D8, [SP,#0x50+var_20]                              ; +0x11c, 0x1004d9f48\nLDP             D11, D10, [SP,#0x50+var_30]                            ; +0x120, 0x1004d9f4c\nLDP             D13, D12, [SP,#0x50+var_40]                            ; +0x124, 0x1004d9f50\nLDP             D15, D14, [SP+0x50+var_50],#0x60                       ; +0x128, 0x1004d9f54\nB               sub_1000262F4                                          ; +0x12c, 0x1004d9f58", "xrefs": ["EmotePickerPopup::init @ 0x1004daff4"], "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"}