{"type": "func", "start": 4736520, "end": 4736966, "name": "EditorUI::constrainGameLayerPosition", "pseudocode": "// \n// EditorUI::constrainGameLayerPosition from 0x484608 to 0x4847c6 (446 bytes)\n// \n// 2 xrefs:\n// > EditorUI::constrainGameLayerPosition @ 0x4847dc\n// > EditorUI::init @ 0x48b2a8\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:49:24 +0000\n// \n\nint __fastcall EditorUI::constrainGameLayerPosition(EditorUI *this, float a2, float a3)\n{\n  const cocos2d::CCPoint *v6; // r0\n  cocos2d::CCDirector *v7; // r0\n  cocos2d::CCDirector *v8; // r0\n  float v9; // r0\n  const cocos2d::CCPoint *v10; // r9\n  cocos2d::CCDirector *v11; // r0\n  cocos2d::CCDirector *v12; // r0\n  cocos2d::CCDirector *ScreenRight; // r7\n  cocos2d::CCDirector *v14; // r0\n  float v15; // r0\n  int v16; // r3\n  const cocos2d::CCPoint *v17; // r9\n  int v18; // r2\n  int v19; // r0\n  float v20; // s15\n  float v21; // s14\n  float v22; // s15\n  float v23; // s14\n  float v25; // [sp+4h] [bp-10h] BYREF\n  float v26; // [sp+8h] [bp-Ch]\n  float v27; // [sp+Ch] [bp-8h] BYREF\n  float v28; // [sp+10h] [bp-4h]\n  float v29; // [sp+14h] [bp+0h] BYREF\n  float v30; // [sp+18h] [bp+4h]\n  float v31; // [sp+1Ch] [bp+8h] BYREF\n  float v32; // [sp+20h] [bp+Ch]\n  float v33; // [sp+24h] [bp+10h] BYREF\n  float v34; // [sp+28h] [bp+14h]\n  _BYTE v35[8]; // [sp+2Ch] [bp+18h] BYREF\n\n  v6 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD, _DWORD, _DWORD))(**(_DWORD **)(*((_DWORD *)this + 236)\n                                                                                             + 2436)\n                                                                               + 96))(\n                                   *(_DWORD *)(*((_DWORD *)this + 236) + 2436),\n                                   LODWORD(a2),\n                                   LODWORD(a3));\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v25, v6);\n  v7 = (cocos2d::CCDirector *)(*(int (__fastcall **)(_DWORD, float *))(**(_DWORD **)(*((_DWORD *)this + 236) + 2436) + 92))(\n                                *(_DWORD *)(*((_DWORD *)this + 236) + 2436),\n                                &flt_D2B938);\n  v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);\n  v9 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v8));\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, v9, *((float *)this + 157));\n  v10 = *(const cocos2d::CCPoint **)(*((_DWORD *)this + 236) + 2436);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, (float)(a2 * 30.0) - 30.0, (float)(a3 * 30.0) + 90.0);\n  cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v29, v10);\n  cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v35, *((const cocos2d::CCPoint **)this + 236));\n  v11 = (cocos2d::CCDirector *)cocos2d::CCPoint::operator=(&v29, v35);\n  v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);\n  ScreenRight = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenRight(v12);\n  v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenRight);\n  v15 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v14));\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, *(float *)&ScreenRight, v15);\n  v16 = *((_DWORD *)this + 236);\n  v17 = *(const cocos2d::CCPoint **)(v16 + 2436);\n  if ( *(_BYTE *)(*(_DWORD *)(v16 + 2084) + 373) )\n    v18 = 1000;\n  else\n    v18 = 80;\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, 240030.0, (float)((float)((float)v18 * 30.0) + 90.0) + 30.0);\n  cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v33, v17);\n  cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v35, *((const cocos2d::CCPoint **)this + 236));\n  cocos2d::CCPoint::operator=(&v33, v35);\n  v19 = *(_DWORD *)(*((_DWORD *)this + 236) + 2436);\n  v20 = v27 - v29;\n  if ( v25 <= (float)(v27 - v29) )\n    v20 = v25;\n  v21 = v31 - v33;\n  if ( v20 >= (float)(v31 - v33) )\n    v21 = v20;\n  v25 = v21;\n  v22 = v28 - v30;\n  if ( v26 <= (float)(v28 - v30) )\n    v22 = v26;\n  v23 = v32 - v34;\n  if ( v22 >= (float)(v32 - v34) )\n    v23 = v22;\n  v26 = v23;\n  return (*(int (__fastcall **)(int, float *))(*(_DWORD *)v19 + 92))(v19, &v25);\n}", "assembly": "; \n; EditorUI::constrainGameLayerPosition from 0x484608 to 0x4847c6 (446 bytes)\n; \n; 2 xrefs:\n; > EditorUI::constrainGameLayerPosition @ 0x4847dc\n; > EditorUI::init @ 0x48b2a8\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:49:24 +0000\n; \nPUSH.W          {R4-R9,LR}                                             ; +0x0, 0x484608\nMOV             R5, R0                                                 ; +0x4, 0x48460c\nVPUSH           {D8-D9}                                                ; +0x6, 0x48460e\nLDR             R6, =(__stack_chk_guard_ptr - 0x484618)                ; +0xa, 0x484612\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xc, 0x484614\nLDR             R6, [R6]; __stack_chk_guard                            ; +0xe, 0x484616\nVMOV            S18, R2                                                ; +0x10, 0x484618\nSUB             SP, SP, #0x3C                                          ; +0x14, 0x48461c\nVMOV            S19, R1                                                ; +0x16, 0x48461e\nLDR             R3, [R6]                                               ; +0x1a, 0x484622\nADD.W           R8, SP, #0x3C+var_38                                   ; +0x1c, 0x484624\nVMOV.F32        S16, #30.0                                             ; +0x20, 0x484628\nADD             R4, SP, #0x3C+var_10                                   ; +0x24, 0x48462c\nVLDR            S17, =90.0                                             ; +0x26, 0x48462e\nADD             R7, SP, #0x14                                          ; +0x2a, 0x484632\nSTR             R3, [SP,#0x3C+var_8]                                   ; +0x2c, 0x484634\nLDR.W           R3, [R0,#0x3B0]                                        ; +0x2e, 0x484636\nLDR.W           R0, [R3,#0x984]                                        ; +0x32, 0x48463a\nLDR             R3, [R0]                                               ; +0x36, 0x48463e\nLDR             R3, [R3,#0x60]                                         ; +0x38, 0x484640\nBLX             R3                                                     ; +0x3a, 0x484642\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x3c, 0x484644\nMOV             R0, R8; this                                           ; +0x3e, 0x484646\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x40, 0x484648\nLDR.W           R3, [R5,#0x3B0]                                        ; +0x44, 0x48464c\nLDR             R1, =(flt_D2B938 - 0x48465A)                           ; +0x48, 0x484650\nLDR.W           R0, [R3,#0x984]                                        ; +0x4a, 0x484652\nADD             R1, PC; flt_D2B938                                     ; +0x4e, 0x484656\nLDR             R3, [R0]                                               ; +0x50, 0x484658\nLDR             R3, [R3,#0x5C]                                         ; +0x52, 0x48465a\nBLX             R3                                                     ; +0x54, 0x48465c\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x56, 0x48465e\nBL              _ZN7cocos2d10CCDirector13getScreenLeftEv; cocos2d::CCDirector::getScreenLeft(void) ; +0x5a, 0x484662\nLDR.W           R2, [R5,#0x274]; float                                 ; +0x5e, 0x484666\nMOV             R1, R0; float                                          ; +0x62, 0x48466a\nADD             R0, SP, #0x3C+var_30; this                             ; +0x64, 0x48466c\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x66, 0x48466e\nVMOV.F32        S15, S16                                               ; +0x6a, 0x484672\nLDR.W           R3, [R5,#0x3B0]                                        ; +0x6e, 0x484676\nMOV             R0, R4; this                                           ; +0x72, 0x48467a\nVNMLS.F32       S15, S19, S16                                          ; +0x74, 0x48467c\nLDR.W           R9, [R3,#0x984]                                        ; +0x78, 0x484680\nVMOV            R1, S15; float                                         ; +0x7c, 0x484684\nVMOV.F32        S15, S17                                               ; +0x80, 0x484688\nVMLA.F32        S15, S18, S16                                          ; +0x84, 0x48468c\nVMOV            R2, S15; float                                         ; +0x88, 0x484690\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x8c, 0x484694\nMOV             R0, R7; this                                           ; +0x90, 0x484698\nMOV             R1, R9; cocos2d::CCPoint *                             ; +0x92, 0x48469a\nMOV             R2, R4                                                 ; +0x94, 0x48469c\nBL              _ZN7cocos2d6CCNode19convertToWorldSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const&) ; +0x96, 0x48469e\nMOV             R2, R7                                                 ; +0x9a, 0x4846a2\nMOV             R0, R4; this                                           ; +0x9c, 0x4846a4\nLDR.W           R1, [R5,#0x3B0]; cocos2d::CCPoint *                    ; +0x9e, 0x4846a6\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0xa2, 0x4846aa\nMOV             R1, R4                                                 ; +0xa6, 0x4846ae\nMOV             R0, R7                                                 ; +0xa8, 0x4846b0\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0xaa, 0x4846b2\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0xae, 0x4846b6\nBL              _ZN7cocos2d10CCDirector14getScreenRightEv; cocos2d::CCDirector::getScreenRight(void) ; +0xb2, 0x4846ba\nMOV             R7, R0                                                 ; +0xb6, 0x4846be\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0xb8, 0x4846c0\nBL              _ZN7cocos2d10CCDirector12getScreenTopEv; cocos2d::CCDirector::getScreenTop(void) ; +0xbc, 0x4846c4\nMOV             R1, R7; float                                          ; +0xc0, 0x4846c8\nADD             R7, SP, #0x24 ; '$'                                    ; +0xc2, 0x4846ca\nMOV             R2, R0; float                                          ; +0xc4, 0x4846cc\nADD             R0, SP, #0x3C+var_20; this                             ; +0xc6, 0x4846ce\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xc8, 0x4846d0\nLDR.W           R3, [R5,#0x3B0]                                        ; +0xcc, 0x4846d4\nLDR             R1, flt_4847CC; float                                  ; +0xd0, 0x4846d8\nMOV             R0, R4; this                                           ; +0xd2, 0x4846da\nLDR.W           R2, [R3,#0x824]                                        ; +0xd4, 0x4846dc\nLDR.W           R9, [R3,#0x984]                                        ; +0xd8, 0x4846e0\nLDRB.W          R2, [R2,#0x175]                                        ; +0xdc, 0x4846e4\nCMP             R2, #0                                                 ; +0xe0, 0x4846e8\nITE NE                                                                 ; +0xe2, 0x4846ea\nMOVNE.W         R2, #0x3E8                                             ; +0xe4, 0x4846ec\nMOVEQ           R2, #0x50 ; 'P'                                        ; +0xe8, 0x4846f0\nVMOV            S15, R2                                                ; +0xea, 0x4846f2\nVCVT.F32.S32    S15, S15                                               ; +0xee, 0x4846f6\nVMLA.F32        S17, S15, S16                                          ; +0xf2, 0x4846fa\nVADD.F32        S15, S17, S16                                          ; +0xf6, 0x4846fe\nVMOV            R2, S15; float                                         ; +0xfa, 0x484702\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xfe, 0x484706\nMOV             R0, R7; this                                           ; +0x102, 0x48470a\nMOV             R1, R9; cocos2d::CCPoint *                             ; +0x104, 0x48470c\nMOV             R2, R4                                                 ; +0x106, 0x48470e\nBL              _ZN7cocos2d6CCNode19convertToWorldSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const&) ; +0x108, 0x484710\nMOV             R2, R7                                                 ; +0x10c, 0x484714\nMOV             R0, R4; this                                           ; +0x10e, 0x484716\nLDR.W           R1, [R5,#0x3B0]; cocos2d::CCPoint *                    ; +0x110, 0x484718\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x114, 0x48471c\nMOV             R1, R4                                                 ; +0x118, 0x484720\nMOV             R0, R7                                                 ; +0x11a, 0x484722\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x11c, 0x484724\nVLDR            S13, [SP,#0x3C+var_28]                                 ; +0x120, 0x484728\nLDR.W           R3, [R5,#0x3B0]                                        ; +0x124, 0x48472c\nMOV             R1, R8                                                 ; +0x128, 0x484730\nVLDR            S15, [SP,#0x3C+var_30]                                 ; +0x12a, 0x484732\nLDR.W           R0, [R3,#0x984]                                        ; +0x12e, 0x484736\nVLDR            S14, [SP,#0x3C+var_38]                                 ; +0x132, 0x48473a\nVSUB.F32        S15, S15, S13                                          ; +0x136, 0x48473e\nVLDR            S13, [SP,#0x3C+var_18]                                 ; +0x13a, 0x484742\nVCMPE.F32       S14, S15                                               ; +0x13e, 0x484746\nVMRS            APSR_nzcv, FPSCR                                       ; +0x142, 0x48474a\nIT LE                                                                  ; +0x146, 0x48474e\nVMOVLE.F32      S15, S14                                               ; +0x148, 0x484750\nVLDR            S14, [SP,#0x3C+var_20]                                 ; +0x14c, 0x484754\nVSUB.F32        S14, S14, S13                                          ; +0x150, 0x484758\nVLDR            S13, [SP,#0x3C+var_24]                                 ; +0x154, 0x48475c\nVCMPE.F32       S15, S14                                               ; +0x158, 0x484760\nVMRS            APSR_nzcv, FPSCR                                       ; +0x15c, 0x484764\nIT PL                                                                  ; +0x160, 0x484768\nVMOVPL.F32      S14, S15                                               ; +0x162, 0x48476a\nVLDR            S15, [SP,#0x3C+var_2C]                                 ; +0x166, 0x48476e\nVSTR            S14, [SP,#0x3C+var_38]                                 ; +0x16a, 0x484772\nVSUB.F32        S15, S15, S13                                          ; +0x16e, 0x484776\nVLDR            S14, [SP,#0x3C+var_34]                                 ; +0x172, 0x48477a\nVLDR            S13, [SP,#0x3C+var_14]                                 ; +0x176, 0x48477e\nVCMPE.F32       S14, S15                                               ; +0x17a, 0x484782\nVMRS            APSR_nzcv, FPSCR                                       ; +0x17e, 0x484786\nIT LE                                                                  ; +0x182, 0x48478a\nVMOVLE.F32      S15, S14                                               ; +0x184, 0x48478c\nVLDR            S14, [SP,#0x3C+var_1C]                                 ; +0x188, 0x484790\nVSUB.F32        S14, S14, S13                                          ; +0x18c, 0x484794\nVCMPE.F32       S15, S14                                               ; +0x190, 0x484798\nVMRS            APSR_nzcv, FPSCR                                       ; +0x194, 0x48479c\nIT PL                                                                  ; +0x198, 0x4847a0\nVMOVPL.F32      S14, S15                                               ; +0x19a, 0x4847a2\nVSTR            S14, [SP,#0x3C+var_34]                                 ; +0x19e, 0x4847a6\nLDR             R3, [R0]                                               ; +0x1a2, 0x4847aa\nLDR             R3, [R3,#0x5C]                                         ; +0x1a4, 0x4847ac\nBLX             R3                                                     ; +0x1a6, 0x4847ae\nLDR             R2, [SP,#0x3C+var_8]                                   ; +0x1a8, 0x4847b0\nLDR             R3, [R6]                                               ; +0x1aa, 0x4847b2\nCMP             R2, R3                                                 ; +0x1ac, 0x4847b4\nBEQ             loc_4847BC                                             ; +0x1ae, 0x4847b6\nBLX             __stack_chk_fail                                       ; +0x1b0, 0x4847b8\nADD             SP, SP, #0x3C ; '<'                                    ; +0x1b4, 0x4847bc\nVPOP            {D8-D9}                                                ; +0x1b6, 0x4847be\nPOP.W           {R4-R9,PC}                                             ; +0x1ba, 0x4847c2", "xrefs": ["EditorUI::constrainGameLayerPosition @ 0x4847dc", "EditorUI::init @ 0x48b2a8"], "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"}