diff options
Diffstat (limited to 'synth.zig')
| -rw-r--r-- | synth.zig | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/synth.zig b/synth.zig new file mode 100644 index 0000000..2914b6c --- /dev/null +++ b/synth.zig @@ -0,0 +1,49 @@ +//! Patch's predicate synthesizer +// Copyright (C) 2025 Nguyễn Gia Phong +// +// This file is part of taosc. +// +// Taosc is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Taosc is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with taosc. If not, see <https://www.gnu.org/licenses/>. + +const assert = std.debug.assert; +const std = @import("std"); + +const State = extern struct { + flags: u16, + stack_size: u32, + r15: i64, + r14: i64, + r13: i64, + r12: i64, + r11: i64, + r10: i64, + r9: i64, + r8: i64, + rdi: i64, + rsi: i64, + rbp: i64, + rbx: i64, + rdx: i64, + rcx: i64, + rax: i64, + rsp: i64, + rip: i64, +}; + +pub fn main() !void { + var reader = std.fs.File.stdin().reader(&.{}); + var state: State = undefined; + assert(try reader.read(@ptrCast(&state)) == @sizeOf(State)); + std.debug.print("{}\n", .{ state }); +} |
