{"type": "func", "start": 7916728, "end": 7916998, "name": "EditorWindowPopup::clampWindowOnScreen", "pseudocode": "// \n// EditorWindowPopup::clampWindowOnScreen from 0x78ccb8 to 0x78cdc6 (270 bytes)\n// \n// 2 xrefs:\n// > EmotePickerPopup::init @ 0x77929a\n// > EmotePickerPopup::init @ 0x7792fe\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:59:37 +0000\n// \n\ncocos2d::CCDirector *__fastcall EditorWindowPopup::clampWindowOnScreen(cocos2d::CCDirector *a1, int a2, float *a3)\n{\n  float v5; // s18\n  int v6; // r3\n  float v7; // s21\n  float v8; // s19\n  float v9; // s16\n  cocos2d::CCDirector *v10; // r0\n  float v11; // r0\n  float v12; // s21\n  float v13; // s18\n  cocos2d::CCDirector *v14; // r0\n  float v15; // r0\n  float v16; // s18\n  float v17; // s21\n  cocos2d::CCDirector *v18; // r0\n  float v19; // r0\n  float v20; // s19\n  float v21; // s16\n  cocos2d::CCDirector *v22; // r0\n  float v23; // s16\n  float v24; // s17\n  float v25; // s15\n\n  v5 = *(float *)(a2 + 740);\n  v6 = *(_DWORD *)(a2 + 712);\n  v7 = v5 * *(float *)(a2 + 732);\n  v8 = v5 * *(float *)(a2 + 736);\n  if ( v6 )\n    v9 = *(float *)(v6 + 632);\n  else\n    v9 = 0.0;\n  v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);\n  v11 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v10));\n  v12 = v7 * 0.5;\n  v13 = v11 + 6.0;\n  v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v11));\n  v15 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v14));\n  v16 = v13 + v12;\n  v17 = (float)(v15 - 6.0) - v12;\n  v18 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v15));\n  v19 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v18));\n  v20 = v8 * 0.5;\n  v21 = v19 + v9;\n  v22 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v19));\n  v23 = (float)(v21 + 6.0) + v20;\n  v24 = (float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v22)) - 6.0) - v20;\n  if ( v16 > v17 )\n  {\n    v16 = (float)(v16 + v17) * 0.5;\nLABEL_7:\n    *a3 = v16;\n    goto LABEL_10;\n  }\n  if ( *a3 < v16 )\n    goto LABEL_7;\n  if ( *a3 > v17 )\n    *a3 = v17;\nLABEL_10:\n  if ( v23 > v24 )\n  {\n    v23 = (float)(v23 + v24) * 0.5;\nLABEL_13:\n    a3[1] = v23;\n    goto LABEL_16;\n  }\n  v25 = a3[1];\n  if ( v25 < v23 )\n    goto LABEL_13;\n  if ( v25 > v24 )\n    a3[1] = v24;\nLABEL_16:\n  cocos2d::CCPoint::CCPoint(a1, (const cocos2d::CCPoint *)a3);\n  return a1;\n}", "assembly": "; \n; EditorWindowPopup::clampWindowOnScreen from 0x78ccb8 to 0x78cdc6 (270 bytes)\n; \n; 2 xrefs:\n; > EmotePickerPopup::init @ 0x77929a\n; > EmotePickerPopup::init @ 0x7792fe\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:59:37 +0000\n; \nPUSH            {R3-R5,LR}                                             ; +0x0, 0x78ccb8\nMOV             R5, R0                                                 ; +0x2, 0x78ccba\nVPUSH           {D8-D10}                                               ; +0x4, 0x78ccbc\nMOV             R4, R2                                                 ; +0x8, 0x78ccc0\nVLDR            S18, [R1,#0x2E4]                                       ; +0xa, 0x78ccc2\nLDR.W           R3, [R1,#0x2C8]                                        ; +0xe, 0x78ccc6\nVLDR            S21, [R1,#0x2DC]                                       ; +0x12, 0x78ccca\nVLDR            S19, [R1,#0x2E0]                                       ; +0x16, 0x78ccce\nVMUL.F32        S21, S18, S21                                          ; +0x1a, 0x78ccd2\nVMUL.F32        S19, S18, S19                                          ; +0x1e, 0x78ccd6\nCBZ             R3, loc_78CCE2                                         ; +0x22, 0x78ccda\nVLDR            S16, [R3,#0x278]                                       ; +0x24, 0x78ccdc\nB               loc_78CCE6                                             ; +0x28, 0x78cce0\nVLDR            S16, =0.0                                              ; +0x2a, 0x78cce2\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x2e, 0x78cce6\nBL              _ZN7cocos2d10CCDirector13getScreenLeftEv; cocos2d::CCDirector::getScreenLeft(void) ; +0x32, 0x78ccea\nVMOV.F32        S17, #6.0                                              ; +0x36, 0x78ccee\nVMOV.F32        S20, #0.5                                              ; +0x3a, 0x78ccf2\nVMUL.F32        S21, S21, S20                                          ; +0x3e, 0x78ccf6\nVMOV            S15, R0; this                                          ; +0x42, 0x78ccfa\nVADD.F32        S18, S15, S17                                          ; +0x46, 0x78ccfe\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x4a, 0x78cd02\nBL              _ZN7cocos2d10CCDirector14getScreenRightEv; cocos2d::CCDirector::getScreenRight(void) ; +0x4e, 0x78cd06\nVADD.F32        S18, S18, S21                                          ; +0x52, 0x78cd0a\nVMOV            S15, R0; this                                          ; +0x56, 0x78cd0e\nVSUB.F32        S15, S15, S17                                          ; +0x5a, 0x78cd12\nVSUB.F32        S21, S15, S21                                          ; +0x5e, 0x78cd16\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x62, 0x78cd1a\nBL              _ZN7cocos2d10CCDirector15getScreenBottomEv; cocos2d::CCDirector::getScreenBottom(void) ; +0x66, 0x78cd1e\nVMUL.F32        S19, S19, S20                                          ; +0x6a, 0x78cd22\nVMOV            S15, R0; this                                          ; +0x6e, 0x78cd26\nVADD.F32        S16, S15, S16                                          ; +0x72, 0x78cd2a\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x76, 0x78cd2e\nBL              _ZN7cocos2d10CCDirector12getScreenTopEv; cocos2d::CCDirector::getScreenTop(void) ; +0x7a, 0x78cd32\nVADD.F32        S16, S16, S17                                          ; +0x7e, 0x78cd36\nVCMPE.F32       S18, S21                                               ; +0x82, 0x78cd3a\nVADD.F32        S16, S16, S19                                          ; +0x86, 0x78cd3e\nVMRS            APSR_nzcv, FPSCR                                       ; +0x8a, 0x78cd42\nVMOV            S15, R0                                                ; +0x8e, 0x78cd46\nVSUB.F32        S17, S15, S17                                          ; +0x92, 0x78cd4a\nVSUB.F32        S17, S17, S19                                          ; +0x96, 0x78cd4e\nBLE             loc_78CD5E                                             ; +0x9a, 0x78cd52\nVADD.F32        S18, S18, S21                                          ; +0x9c, 0x78cd54\nVMUL.F32        S18, S18, S20                                          ; +0xa0, 0x78cd58\nB               loc_78CD6C                                             ; +0xa4, 0x78cd5c\nVLDR            S15, [R4]                                              ; +0xa6, 0x78cd5e\nVCMPE.F32       S15, S18                                               ; +0xaa, 0x78cd62\nVMRS            APSR_nzcv, FPSCR                                       ; +0xae, 0x78cd66\nBPL             loc_78CD72                                             ; +0xb2, 0x78cd6a\nVSTR            S18, [R4]                                              ; +0xb4, 0x78cd6c\nB               loc_78CD80                                             ; +0xb8, 0x78cd70\nVCMPE.F32       S15, S21                                               ; +0xba, 0x78cd72\nVMRS            APSR_nzcv, FPSCR                                       ; +0xbe, 0x78cd76\nIT GT                                                                  ; +0xc2, 0x78cd7a\nVSTRGT          S21, [R4]                                              ; +0xc4, 0x78cd7c\nVCMPE.F32       S16, S17                                               ; +0xc8, 0x78cd80\nVMRS            APSR_nzcv, FPSCR                                       ; +0xcc, 0x78cd84\nBLE             loc_78CD94                                             ; +0xd0, 0x78cd88\nVADD.F32        S16, S16, S17                                          ; +0xd2, 0x78cd8a\nVMUL.F32        S16, S16, S20                                          ; +0xd6, 0x78cd8e\nB               loc_78CDA2                                             ; +0xda, 0x78cd92\nVLDR            S15, [R4,#4]                                           ; +0xdc, 0x78cd94\nVCMPE.F32       S15, S16                                               ; +0xe0, 0x78cd98\nVMRS            APSR_nzcv, FPSCR                                       ; +0xe4, 0x78cd9c\nBPL             loc_78CDA8                                             ; +0xe8, 0x78cda0\nVSTR            S16, [R4,#4]                                           ; +0xea, 0x78cda2\nB               loc_78CDB6                                             ; +0xee, 0x78cda6\nVCMPE.F32       S15, S17                                               ; +0xf0, 0x78cda8\nVMRS            APSR_nzcv, FPSCR                                       ; +0xf4, 0x78cdac\nIT GT                                                                  ; +0xf8, 0x78cdb0\nVSTRGT          S17, [R4,#4]                                           ; +0xfa, 0x78cdb2\nMOV             R0, R5; this                                           ; +0xfe, 0x78cdb6\nMOV             R1, R4; cocos2d::CCPoint *                             ; +0x100, 0x78cdb8\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x102, 0x78cdba\nVPOP            {D8-D10}                                               ; +0x106, 0x78cdbe\nMOV             R0, R5                                                 ; +0x10a, 0x78cdc2\nPOP             {R3-R5,PC}                                             ; +0x10c, 0x78cdc4", "xrefs": ["EmotePickerPopup::init @ 0x77929a", "EmotePickerPopup::init @ 0x7792fe"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "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"}