omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / gpu / nvidia / om / consumer.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Read-only consumer guard: existing one-line commit lock then observed git HEAD. |
| 3 | global data uchar 83 |
| 4 | fn main to int |
| 5 | n = ulong 0 |
| 6 | while lt n 83 |
| 7 | r = read 0 data n sub ulong 83 n |
| 8 | if lt r 0 |
| 9 | ret 3 |
| 10 | end |
| 11 | if eq r 0 |
| 12 | break |
| 13 | end |
| 14 | n = add n ulong r |
| 15 | end |
| 16 | if ne n 82 |
| 17 | ret 3 |
| 18 | end |
| 19 | if ne get data 40 10 |
| 20 | ret 3 |
| 21 | end |
| 22 | if ne get data 81 10 |
| 23 | ret 3 |
| 24 | end |
| 25 | nonzero = false |
| 26 | for i ulong 40 |
| 27 | c = get data i |
| 28 | if lt c 48 |
| 29 | ret 3 |
| 30 | end |
| 31 | if gt c 57 |
| 32 | if lt c 97 |
| 33 | ret 3 |
| 34 | end |
| 35 | if gt c 102 |
| 36 | ret 3 |
| 37 | end |
| 38 | end |
| 39 | if ne c 48 |
| 40 | nonzero = true |
| 41 | end |
| 42 | if ne c get data add i 41 |
| 43 | ret 3 |
| 44 | end |
| 45 | end |
| 46 | if not nonzero |
| 47 | ret 3 |
| 48 | end |
| 49 | ret 0 |
| 50 | end |