{"type": "func", "start": 3675800, "end": 3675934, "name": "EditorUI::valueFromXPos", "pseudocode": "// \n// EditorUI::valueFromXPos from 0x381698 to 0x38171e (134 bytes)\n// \n// 1 xrefs:\n// > EditorUI::updateSlider @ 0x381740\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nfloat EditorUI::valueFromXPos(EditorUI *a1, float a2)\n{\n  float XMin; // s17\n  int SectionCount; // r4\n  float v6; // r0\n  float v7; // s15\n\n  XMin = EditorUI::getXMin(a1, 0);\n  SectionCount = LevelEditorLayer::getSectionCount(a1->m_editorLayer);\n  v6 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getScale)(a1->m_editorLayer->m_objectLayer));\n  if ( SectionCount < 100 )\n    SectionCount = 100;\n  v7 = (float)-(float)(a2 - XMin) / (float)((float)((float)SectionCount * 100.0) * v6);\n  if ( v7 <= 0.0 )\n    return 0.0;\n  if ( v7 >= 1.0 )\n    return 1.0;\n  return v7;\n}", "assembly": "; \n; EditorUI::valueFromXPos from 0x381698 to 0x38171e (134 bytes)\n; \n; 1 xrefs:\n; > EditorUI::updateSlider @ 0x381740\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nPUSH            {R3-R5,LR}                                             ; +0x0, 0x381698\nMOV             R5, R0                                                 ; +0x2, 0x38169a\nVPUSH           {D8}                                                   ; +0x4, 0x38169c\nVMOV            S16, R1                                                ; +0x8, 0x3816a0\nMOVS            R1, #0; int                                            ; +0xc, 0x3816a4\nBL              _ZN8EditorUI7getXMinEi; EditorUI::getXMin(int)         ; +0xe, 0x3816a6\nVMOV            S17, R0                                                ; +0x12, 0x3816aa\nLDR.W           R0, [R5,#0x340]; this                                  ; +0x16, 0x3816ae\nBL              _ZN16LevelEditorLayer15getSectionCountEv; LevelEditorLayer::getSectionCount(void) ; +0x1a, 0x3816b2\nLDR.W           R3, [R5,#0x340]                                        ; +0x1e, 0x3816b6\nMOV             R4, R0                                                 ; +0x22, 0x3816ba\nLDR.W           R0, [R3,#0x9F0]                                        ; +0x24, 0x3816bc\nLDR             R3, [R0]                                               ; +0x28, 0x3816c0\nLDR             R3, [R3,#0x54]                                         ; +0x2a, 0x3816c2\nBLX             R3                                                     ; +0x2c, 0x3816c4\nCMP             R4, #0x64 ; 'd'                                        ; +0x2e, 0x3816c6\nVLDR            S14, =100.0                                            ; +0x30, 0x3816c8\nIT LT                                                                  ; +0x34, 0x3816cc\nMOVLT           R4, #0x64 ; 'd'                                        ; +0x36, 0x3816ce\nVMOV            S15, R4                                                ; +0x38, 0x3816d0\nVSUB.F32        S16, S16, S17                                          ; +0x3c, 0x3816d4\nVCVT.F32.S32    S15, S15                                               ; +0x40, 0x3816d8\nVMUL.F32        S15, S15, S14                                          ; +0x44, 0x3816dc\nVMOV            S14, R0                                                ; +0x48, 0x3816e0\nVMUL.F32        S15, S15, S14                                          ; +0x4c, 0x3816e4\nVNEG.F32        S16, S16                                               ; +0x50, 0x3816e8\nVDIV.F32        S15, S16, S15                                          ; +0x54, 0x3816ec\nVCMPE.F32       S15, #0.0                                              ; +0x58, 0x3816f0\nVMRS            APSR_nzcv, FPSCR                                       ; +0x5c, 0x3816f4\nBLE             loc_38170E                                             ; +0x60, 0x3816f8\nVMOV.F32        S14, #1.0                                              ; +0x62, 0x3816fa\nVCMPE.F32       S15, S14                                               ; +0x66, 0x3816fe\nVMRS            APSR_nzcv, FPSCR                                       ; +0x6a, 0x381702\nIT PL                                                                  ; +0x6e, 0x381706\nVMOVPL.F32      S15, S14                                               ; +0x70, 0x381708\nB               loc_381714                                             ; +0x74, 0x38170c\nIT LE                                                                  ; +0x76, 0x38170e\nVLDRLE          S15, =0.0                                              ; +0x78, 0x381710\nVPOP            {D8}                                                   ; +0x7c, 0x381714\nVMOV            R0, S15                                                ; +0x80, 0x381718\nPOP             {R3-R5,PC}                                             ; +0x84, 0x38171c", "xrefs": ["EditorUI::updateSlider @ 0x381740"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}