{"type": "func", "start": 4299651524, "end": 4299651684, "name": "EditorUI::getGridSnappedPos", "pseudocode": "// \n// EditorUI::getGridSnappedPos from 0x1004779c4 to 0x100477a64 (160 bytes)\n// \n// 10 xrefs:\n// > SetupSmartBlockLayer::onPasteTemplate @ 0x100078790\n// > EditorUI::applySpecialOffset @ 0x10015fa74\n// > EditorUI::swipeToPosition @ 0x100160fb8\n// > EditorUI::ccTouchEnded @ 0x1001620fc\n// > EditorUI::doPasteObjects @ 0x10018ac60\n// > EditorUI::onCreateObject @ 0x1004770d8\n// > sub_1004796B4 @ 0x100479774\n// > EditorUI::createGradientFromSelection @ 0x10047b46c\n// > EditorUI::findSnapObject_1 @ 0x10047d0d0\n// > EditorUI::findSnapObject_1 @ 0x10047d1d8\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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:05:41 +0000\n// \n\nvoid __usercall EditorUI::getGridSnappedPos(__int64 a1@<X0>, float *a2@<X1>, _QWORD *a3@<X8>)\n{\n  float v6; // s8\n  float v7; // s0\n  float32x2_t v8; // [xsp+8h] [xbp-38h] BYREF\n\n  v6 = *(float *)(*(_QWORD *)(*(_QWORD *)(a1 + 1440) + 14288LL) + 604LL);\n  v7 = fmodf(90.0, v6);\n  sub_1000262BC(\n    (float *)&v8,\n    v6 * (float)(floorf(*a2 / v6) + 0.5),\n    v7 + (float)((float)(floorf((float)(a2[1] - v7) / v6) + 0.5) * v6));\n  EditorUI::getLimitedPosition(a1, &v8, a3);\n}", "assembly": "; \n; EditorUI::getGridSnappedPos from 0x1004779c4 to 0x100477a64 (160 bytes)\n; \n; 10 xrefs:\n; > SetupSmartBlockLayer::onPasteTemplate @ 0x100078790\n; > EditorUI::applySpecialOffset @ 0x10015fa74\n; > EditorUI::swipeToPosition @ 0x100160fb8\n; > EditorUI::ccTouchEnded @ 0x1001620fc\n; > EditorUI::doPasteObjects @ 0x10018ac60\n; > EditorUI::onCreateObject @ 0x1004770d8\n; > sub_1004796B4 @ 0x100479774\n; > EditorUI::createGradientFromSelection @ 0x10047b46c\n; > EditorUI::findSnapObject_1 @ 0x10047d0d0\n; > EditorUI::findSnapObject_1 @ 0x10047d1d8\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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:05:41 +0000\n; \nSUB             SP, SP, #0x50                                          ; +0x0, 0x1004779c4\nSTP             D9, D8, [SP,#0x40+var_30]                              ; +0x4, 0x1004779c8\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x8, 0x1004779cc\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0xc, 0x1004779d0\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0x10, 0x1004779d4\nADD             X29, SP, #0x40                                         ; +0x14, 0x1004779d8\nMOV             X19, X1                                                ; +0x18, 0x1004779dc\nMOV             X20, X0                                                ; +0x1c, 0x1004779e0\nMOV             X21, X8                                                ; +0x20, 0x1004779e4\nLDR             X8, [X0,#0x5A0]                                        ; +0x24, 0x1004779e8\nLDR             X8, [X8,#0x37D0]                                       ; +0x28, 0x1004779ec\nLDR             S8, [X8,#0x25C]                                        ; +0x2c, 0x1004779f0\nMOV             W8, #0x42B40000                                        ; +0x30, 0x1004779f4\nFMOV            S0, W8; float                                          ; +0x34, 0x1004779f8\nFMOV            S1, S8; float                                          ; +0x38, 0x1004779fc\nBL              _fmodf                                                 ; +0x3c, 0x100477a00\nLDP             S1, S2, [X19]                                          ; +0x40, 0x100477a04\nFDIV            S1, S1, S8                                             ; +0x44, 0x100477a08\nFSUB            S2, S2, S0                                             ; +0x48, 0x100477a0c\nFDIV            S3, S2, S8                                             ; +0x4c, 0x100477a10\nFRINTM          S1, S1                                                 ; +0x50, 0x100477a14\nFMOV            S4, #0.5                                               ; +0x54, 0x100477a18\nFADD            S1, S1, S4                                             ; +0x58, 0x100477a1c\nFMUL            S2, S8, S1                                             ; +0x5c, 0x100477a20\nFRINTM          S1, S3                                                 ; +0x60, 0x100477a24\nFADD            S1, S1, S4                                             ; +0x64, 0x100477a28\nFMADD           S1, S1, S8, S0                                         ; +0x68, 0x100477a2c\nADD             X0, SP, #0x40+var_38                                   ; +0x6c, 0x100477a30\nFMOV            S0, S2                                                 ; +0x70, 0x100477a34\nBL              sub_1000262BC                                          ; +0x74, 0x100477a38\nADD             X1, SP, #0x40+var_38                                   ; +0x78, 0x100477a3c\nMOV             X8, X21                                                ; +0x7c, 0x100477a40\nMOV             X0, X20                                                ; +0x80, 0x100477a44\nBL              EditorUI__getLimitedPosition                           ; +0x84, 0x100477a48\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x88, 0x100477a4c\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x8c, 0x100477a50\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x90, 0x100477a54\nLDP             D9, D8, [SP,#0x40+var_30]                              ; +0x94, 0x100477a58\nADD             SP, SP, #0x50 ; 'P'                                    ; +0x98, 0x100477a5c\nRET                                                                    ; +0x9c, 0x100477a60", "xrefs": ["SetupSmartBlockLayer::onPasteTemplate @ 0x100078790", "EditorUI::applySpecialOffset @ 0x10015fa74", "EditorUI::swipeToPosition @ 0x100160fb8", "EditorUI::ccTouchEnded @ 0x1001620fc", "EditorUI::doPasteObjects @ 0x10018ac60", "EditorUI::onCreateObject @ 0x1004770d8", "sub_1004796B4 @ 0x100479774", "EditorUI::createGradientFromSelection @ 0x10047b46c", "EditorUI::findSnapObject_1 @ 0x10047d0d0", "EditorUI::findSnapObject_1 @ 0x10047d1d8"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}