{"type": "func", "start": 3677748, "end": 3677894, "name": "EditorUI::getGridSnappedPos", "pseudocode": "// \n// EditorUI::getGridSnappedPos from 0x381e34 to 0x381ec6 (146 bytes)\n// \n// 9 xrefs:\n// > EditorUI::applySpecialOffset @ 0x385d2e\n// > EditorUI::findSnapObject @ 0x385ec0\n// > EditorUI::findSnapObject @ 0x385f96\n// > EditorUI::onCreateObject @ 0x3a3b32\n// > EditorUI::createPrefab @ 0x3a4166\n// > EditorUI::ccTouchMoved @ 0x3a4dd0\n// > EditorUI::ccTouchEnded @ 0x3a55c4\n// > EditorUI::doPasteObjects @ 0x3a5f28\n// > SetupSmartBlockLayer::onPasteTemplate @ 0x53d476\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\ncocos2d::CCPoint *EditorUI::getGridSnappedPos(cocos2d::CCPoint *__return_ptr retstr, EditorUI *a2, cocos2d::CCPoint a3)\n{\n  float x; // r5\n  float m_gridSize; // s16\n  float v7; // s17\n  float v8; // r0\n  cocos2d::CCPoint v9; // r2\n  cocos2d::CCPoint v11; // [sp+4h] [bp-10h] BYREF\n\n  x = a3.x;\n  m_gridSize = a2->m_editorLayer->m_drawGridLayer->m_gridSize;\n  v7 = floorf(*(float *)LODWORD(a3.x) / m_gridSize);\n  v8 = floorf(*(float *)(LODWORD(x) + 4) / m_gridSize);\n  cocos2d::CCPoint::CCPoint(&v11, (float)(v7 + 0.5) * m_gridSize, (float)(v8 + 0.5) * m_gridSize);\n  LODWORD(v9.x) = &v11;\n  EditorUI::getLimitedPosition(retstr, a2, v9);\n  return retstr;\n}", "assembly": "; \n; EditorUI::getGridSnappedPos from 0x381e34 to 0x381ec6 (146 bytes)\n; \n; 9 xrefs:\n; > EditorUI::applySpecialOffset @ 0x385d2e\n; > EditorUI::findSnapObject @ 0x385ec0\n; > EditorUI::findSnapObject @ 0x385f96\n; > EditorUI::onCreateObject @ 0x3a3b32\n; > EditorUI::createPrefab @ 0x3a4166\n; > EditorUI::ccTouchMoved @ 0x3a4dd0\n; > EditorUI::ccTouchEnded @ 0x3a55c4\n; > EditorUI::doPasteObjects @ 0x3a5f28\n; > SetupSmartBlockLayer::onPasteTemplate @ 0x53d476\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            {R4-R7,LR}                                             ; +0x0, 0x381e34\nMOV             R5, R2                                                 ; +0x2, 0x381e36\nLDR             R4, =(__stack_chk_guard_ptr - 0x381E46)                ; +0x4, 0x381e38\nMOV             R6, R0                                                 ; +0x6, 0x381e3a\nVPUSH           {D8}                                                   ; +0x8, 0x381e3c\nMOV             R7, R1                                                 ; +0xc, 0x381e40\nADD             R4, PC; __stack_chk_guard_ptr                          ; +0xe, 0x381e42\nLDR             R4, [R4]; __stack_chk_guard                            ; +0x10, 0x381e44\nLDR.W           R2, [R1,#0x340]                                        ; +0x12, 0x381e46\nLDR             R3, [R4]                                               ; +0x16, 0x381e4a\nSUB             SP, SP, #0x14                                          ; +0x18, 0x381e4c\nVLDR            S15, [R5]                                              ; +0x1a, 0x381e4e\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x1e, 0x381e52\nMOVW            R3, #0x2EAC                                            ; +0x20, 0x381e54\nLDR             R3, [R2,R3]                                            ; +0x24, 0x381e58\nVLDR            S16, [R3,#0x1BC]                                       ; +0x26, 0x381e5a\nVDIV.F32        S15, S15, S16                                          ; +0x2a, 0x381e5e\nVMOV            R0, S15; x                                             ; +0x2e, 0x381e62\nBLX             floorf                                                 ; +0x32, 0x381e66\nVLDR            S15, [R5,#4]                                           ; +0x36, 0x381e6a\nADD             R5, SP, #0x14+var_10                                   ; +0x3a, 0x381e6e\nVDIV.F32        S15, S15, S16                                          ; +0x3c, 0x381e70\nVMOV            S17, R0                                                ; +0x40, 0x381e74\nVMOV            R0, S15; x                                             ; +0x44, 0x381e78\nBLX             floorf                                                 ; +0x48, 0x381e7c\nVMOV.F32        S15, #0.5                                              ; +0x4c, 0x381e80\nVADD.F32        S17, S17, S15                                          ; +0x50, 0x381e84\nVMOV            S14, R0                                                ; +0x54, 0x381e88\nMOV             R0, R5; this                                           ; +0x58, 0x381e8c\nVADD.F32        S15, S14, S15                                          ; +0x5a, 0x381e8e\nVMUL.F32        S14, S17, S16                                          ; +0x5e, 0x381e92\nVMUL.F32        S15, S15, S16                                          ; +0x62, 0x381e96\nVMOV            R1, S14; float                                         ; +0x66, 0x381e9a\nVMOV            R2, S15; float                                         ; +0x6a, 0x381e9e\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x6e, 0x381ea2\nMOV             R0, R6                                                 ; +0x72, 0x381ea6\nMOV             R2, R5                                                 ; +0x74, 0x381ea8\nMOV             R1, R7                                                 ; +0x76, 0x381eaa\nBL              _ZN8EditorUI18getLimitedPositionEN7cocos2d7CCPointE; EditorUI::getLimitedPosition(cocos2d::CCPoint) ; +0x78, 0x381eac\nLDR             R2, [SP,#0x14+var_8]                                   ; +0x7c, 0x381eb0\nLDR             R3, [R4]                                               ; +0x7e, 0x381eb2\nMOV             R0, R6                                                 ; +0x80, 0x381eb4\nCMP             R2, R3                                                 ; +0x82, 0x381eb6\nBEQ             loc_381EBE                                             ; +0x84, 0x381eb8\nBLX             __stack_chk_fail                                       ; +0x86, 0x381eba\nADD             SP, SP, #0x14                                          ; +0x8a, 0x381ebe\nVPOP            {D8}                                                   ; +0x8c, 0x381ec0\nPOP             {R4-R7,PC}                                             ; +0x90, 0x381ec4", "xrefs": ["EditorUI::applySpecialOffset @ 0x385d2e", "EditorUI::findSnapObject @ 0x385ec0", "EditorUI::findSnapObject @ 0x385f96", "EditorUI::onCreateObject @ 0x3a3b32", "EditorUI::createPrefab @ 0x3a4166", "EditorUI::ccTouchMoved @ 0x3a4dd0", "EditorUI::ccTouchEnded @ 0x3a55c4", "EditorUI::doPasteObjects @ 0x3a5f28", "SetupSmartBlockLayer::onPasteTemplate @ 0x53d476"], "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"}