{"type": "func", "start": 4738792, "end": 4738956, "name": "EditorUI::getGridSnappedPos", "pseudocode": "// \n// EditorUI::getGridSnappedPos from 0x484ee8 to 0x484f8c (164 bytes)\n// \n// 10 xrefs:\n// > EditorUI::findSnapObject @ 0x4850b0\n// > EditorUI::findSnapObject @ 0x485186\n// > EditorUI::createPrefab @ 0x487062\n// > EditorUI::onCreateObject @ 0x487282\n// > EditorUI::createGradientFromSelection @ 0x487b16\n// > SetupSmartBlockLayer::onPasteTemplate @ 0x673aa4\n// > EditorUI::swipeToPosition @ 0x6f005a\n// > EditorUI::ccTouchEnded @ 0x6f0f04\n// > EditorUI::doPasteObjects @ 0x6f3326\n// > EditorUI::applySpecialOffset @ 0x70d5ac\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::getGridSnappedPos(int a1, int a2, float *a3)\n{\n  float v6; // s16\n  float v7; // s18\n  float v8; // s17\n  float v9; // r0\n  _BYTE v11[8]; // [sp+4h] [bp-10h] BYREF\n\n  v6 = *(float *)(*(_DWORD *)(*(_DWORD *)(a2 + 944) + 11880) + 444);\n  v7 = fmodf(90.0, v6);\n  v8 = floorf(*a3 / v6);\n  v9 = floorf((float)(a3[1] - v7) / v6);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v11, (float)(v8 + 0.5) * v6, v7 + (float)((float)(v9 + 0.5) * v6));\n  EditorUI::getLimitedPosition(a1, a2, v11);\n  return a1;\n}", "assembly": "; \n; EditorUI::getGridSnappedPos from 0x484ee8 to 0x484f8c (164 bytes)\n; \n; 10 xrefs:\n; > EditorUI::findSnapObject @ 0x4850b0\n; > EditorUI::findSnapObject @ 0x485186\n; > EditorUI::createPrefab @ 0x487062\n; > EditorUI::onCreateObject @ 0x487282\n; > EditorUI::createGradientFromSelection @ 0x487b16\n; > SetupSmartBlockLayer::onPasteTemplate @ 0x673aa4\n; > EditorUI::swipeToPosition @ 0x6f005a\n; > EditorUI::ccTouchEnded @ 0x6f0f04\n; > EditorUI::doPasteObjects @ 0x6f3326\n; > EditorUI::applySpecialOffset @ 0x70d5ac\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            {R4-R7,LR}                                             ; +0x0, 0x484ee8\nMOV             R5, R2                                                 ; +0x2, 0x484eea\nVPUSH           {D8-D9}                                                ; +0x4, 0x484eec\nMOV             R6, R0                                                 ; +0x8, 0x484ef0\nLDR             R4, =(__stack_chk_guard_ptr - 0x484EFC)                ; +0xa, 0x484ef2\nMOV             R7, R1                                                 ; +0xc, 0x484ef4\nLDR             R0, flt_484F8C; x                                      ; +0xe, 0x484ef6\nADD             R4, PC; __stack_chk_guard_ptr                          ; +0x10, 0x484ef8\nLDR             R4, [R4]; __stack_chk_guard                            ; +0x12, 0x484efa\nSUB             SP, SP, #0x14                                          ; +0x14, 0x484efc\nLDR.W           R2, [R1,#0x3B0]                                        ; +0x16, 0x484efe\nLDR             R3, [R4]                                               ; +0x1a, 0x484f02\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x1c, 0x484f04\nMOVW            R3, #0x2E68                                            ; +0x1e, 0x484f06\nLDR             R3, [R2,R3]                                            ; +0x22, 0x484f0a\nVLDR            S16, [R3,#0x1BC]                                       ; +0x24, 0x484f0c\nVMOV            R1, S16; y                                             ; +0x28, 0x484f10\nBLX             fmodf                                                  ; +0x2c, 0x484f14\nVLDR            S15, [R5]                                              ; +0x30, 0x484f18\nVDIV.F32        S15, S15, S16                                          ; +0x34, 0x484f1c\nVMOV            S18, R0                                                ; +0x38, 0x484f20\nVMOV            R0, S15; x                                             ; +0x3c, 0x484f24\nBLX             floorf                                                 ; +0x40, 0x484f28\nVLDR            S15, [R5,#4]                                           ; +0x44, 0x484f2c\nADD             R5, SP, #0x14+var_10                                   ; +0x48, 0x484f30\nVSUB.F32        S15, S15, S18                                          ; +0x4a, 0x484f32\nVDIV.F32        S15, S15, S16                                          ; +0x4e, 0x484f36\nVMOV            S17, R0                                                ; +0x52, 0x484f3a\nVMOV            R0, S15; x                                             ; +0x56, 0x484f3e\nBLX             floorf                                                 ; +0x5a, 0x484f42\nVMOV.F32        S15, #0.5                                              ; +0x5e, 0x484f46\nVADD.F32        S17, S17, S15                                          ; +0x62, 0x484f4a\nVMOV            S14, R0                                                ; +0x66, 0x484f4e\nMOV             R0, R5; this                                           ; +0x6a, 0x484f52\nVADD.F32        S15, S14, S15                                          ; +0x6c, 0x484f54\nVMLA.F32        S18, S15, S16                                          ; +0x70, 0x484f58\nVMUL.F32        S14, S17, S16                                          ; +0x74, 0x484f5c\nVMOV            R2, S18; float                                         ; +0x78, 0x484f60\nVMOV            R1, S14; float                                         ; +0x7c, 0x484f64\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x80, 0x484f68\nMOV             R0, R6                                                 ; +0x84, 0x484f6c\nMOV             R2, R5                                                 ; +0x86, 0x484f6e\nMOV             R1, R7                                                 ; +0x88, 0x484f70\nBL              _ZN8EditorUI18getLimitedPositionEN7cocos2d7CCPointE; EditorUI::getLimitedPosition(cocos2d::CCPoint) ; +0x8a, 0x484f72\nLDR             R2, [SP,#0x14+var_8]                                   ; +0x8e, 0x484f76\nLDR             R3, [R4]                                               ; +0x90, 0x484f78\nMOV             R0, R6                                                 ; +0x92, 0x484f7a\nCMP             R2, R3                                                 ; +0x94, 0x484f7c\nBEQ             loc_484F84                                             ; +0x96, 0x484f7e\nBLX             __stack_chk_fail                                       ; +0x98, 0x484f80\nADD             SP, SP, #0x14                                          ; +0x9c, 0x484f84\nVPOP            {D8-D9}                                                ; +0x9e, 0x484f86\nPOP             {R4-R7,PC}                                             ; +0xa2, 0x484f8a", "xrefs": ["EditorUI::findSnapObject @ 0x4850b0", "EditorUI::findSnapObject @ 0x485186", "EditorUI::createPrefab @ 0x487062", "EditorUI::onCreateObject @ 0x487282", "EditorUI::createGradientFromSelection @ 0x487b16", "SetupSmartBlockLayer::onPasteTemplate @ 0x673aa4", "EditorUI::swipeToPosition @ 0x6f005a", "EditorUI::ccTouchEnded @ 0x6f0f04", "EditorUI::doPasteObjects @ 0x6f3326", "EditorUI::applySpecialOffset @ 0x70d5ac"], "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"}