{"type": "func", "start": 4299078112, "end": 4299078228, "name": "EditorUI::getGridSnappedPos", "pseudocode": "// \n// EditorUI::getGridSnappedPos from 0x1003eb9e0 to 0x1003eba54 (116 bytes)\n// \n// 9 xrefs:\n// > SetupSmartBlockLayer::onPasteTemplate @ 0x100070000\n// > EditorUI::onCreateObject @ 0x1003eb30c\n// > EditorUI::doPasteObjects @ 0x1003eed2c\n// > EditorUI::createPrefab @ 0x1003f22f4\n// > EditorUI::applySpecialOffset @ 0x1003f7f58\n// > EditorUI::findSnapObject_1 @ 0x1003f8430\n// > EditorUI::findSnapObject_1 @ 0x1003f8534\n// > EditorUI::ccTouchMoved @ 0x1003f8f5c\n// > EditorUI::ccTouchEnded @ 0x1003f92b0\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\n// local variable allocation has failed, the output may be wrong!\ncocos2d::CCPoint __fastcall EditorUI::getGridSnappedPos(EditorUI *a1, cocos2d::CCPoint a2)\n{\n  float *v2; // x1\n  int v6; // [xsp+8h] [xbp-18h] BYREF\n  cocos2d::CCPoint LimitedPosition; // 0:kr00_8.8\n  cocos2d::CCPoint v8; // 0:s0.4,4:s1.4\n  cocos2d::CCPoint result; // 0:s0.4,4:s1.4\n\n  a2.y = a1->m_editorLayer->m_drawGridLayer->m_gridSize;\n  a2.x = a2.y * (float)(floorf(*v2 / a2.y) + 0.5);\n  a2.y = a2.y * (float)(floorf(v2[1] / a2.y) + 0.5);\n  sub_100022980(*(__n128 *)&a2.x, *(__n128 *)&a2.y, &v6);\n  LimitedPosition = EditorUI::getLimitedPosition(a1, v8);\n  result.x = LimitedPosition.x;\n  result.y = LimitedPosition.y;\n  return result;\n}", "assembly": "; \n; EditorUI::getGridSnappedPos from 0x1003eb9e0 to 0x1003eba54 (116 bytes)\n; \n; 9 xrefs:\n; > SetupSmartBlockLayer::onPasteTemplate @ 0x100070000\n; > EditorUI::onCreateObject @ 0x1003eb30c\n; > EditorUI::doPasteObjects @ 0x1003eed2c\n; > EditorUI::createPrefab @ 0x1003f22f4\n; > EditorUI::applySpecialOffset @ 0x1003f7f58\n; > EditorUI::findSnapObject_1 @ 0x1003f8430\n; > EditorUI::findSnapObject_1 @ 0x1003f8534\n; > EditorUI::ccTouchMoved @ 0x1003f8f5c\n; > EditorUI::ccTouchEnded @ 0x1003f92b0\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\nSUB             SP, SP, #0x30                                          ; +0x0, 0x1003eb9e0\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0x4, 0x1003eb9e4\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0x8, 0x1003eb9e8\nADD             X29, SP, #0x20                                         ; +0xc, 0x1003eb9ec\nMOV             X19, X0                                                ; +0x10, 0x1003eb9f0\nMOV             X20, X8                                                ; +0x14, 0x1003eb9f4\nLDR             X8, [X0,#0x4E8]                                        ; +0x18, 0x1003eb9f8\nLDR             X8, [X8,#0x36C8]                                       ; +0x1c, 0x1003eb9fc\nLDR             S1, [X8,#0x25C]                                        ; +0x20, 0x1003eba00\nLDP             S0, S2, [X1]                                           ; +0x24, 0x1003eba04\nFDIV            S0, S0, S1                                             ; +0x28, 0x1003eba08\nFDIV            S2, S2, S1                                             ; +0x2c, 0x1003eba0c\nFRINTM          S0, S0                                                 ; +0x30, 0x1003eba10\nFMOV            S3, #0.5                                               ; +0x34, 0x1003eba14\nFADD            S0, S0, S3                                             ; +0x38, 0x1003eba18\nFMUL            S0, S1, S0                                             ; +0x3c, 0x1003eba1c\nFRINTM          S2, S2                                                 ; +0x40, 0x1003eba20\nFADD            S2, S2, S3                                             ; +0x44, 0x1003eba24\nFMUL            S1, S1, S2                                             ; +0x48, 0x1003eba28\nADD             X0, SP, #0x20+var_18                                   ; +0x4c, 0x1003eba2c\nBL              sub_100022980                                          ; +0x50, 0x1003eba30\nADD             X1, SP, #0x20+var_18                                   ; +0x54, 0x1003eba34\nMOV             X8, X20                                                ; +0x58, 0x1003eba38\nMOV             X0, X19                                                ; +0x5c, 0x1003eba3c\nBL              EditorUI__getLimitedPosition                           ; +0x60, 0x1003eba40\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x64, 0x1003eba44\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0x68, 0x1003eba48\nADD             SP, SP, #0x30 ; '0'                                    ; +0x6c, 0x1003eba4c\nRET                                                                    ; +0x70, 0x1003eba50", "xrefs": ["SetupSmartBlockLayer::onPasteTemplate @ 0x100070000", "EditorUI::onCreateObject @ 0x1003eb30c", "EditorUI::doPasteObjects @ 0x1003eed2c", "EditorUI::createPrefab @ 0x1003f22f4", "EditorUI::applySpecialOffset @ 0x1003f7f58", "EditorUI::findSnapObject_1 @ 0x1003f8430", "EditorUI::findSnapObject_1 @ 0x1003f8534", "EditorUI::ccTouchMoved @ 0x1003f8f5c", "EditorUI::ccTouchEnded @ 0x1003f92b0"], "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"}