interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / ng / a64 / tests / oir / c-bounds-n.oir

52 lines · 1038 bytes Raw Blame History
1omegair 1
2type %t32 = array u8 8
3type %t33 = ref edit host %t32
4type %t34 = array i64 4
5type %t35 = ref edit host %t34
6global @g0 %t32 zero
7global @g1 %t34 zero
8fn @f0 flags 0 %1:u64 -> void
9block ^0
10%2 = gaddr %t33 @g0
11%3 = const u64 0
12br ^1 %0 %3 %1
13block ^1 %4:tok %5:u64 %6:u64
14%7 = const u64 8
15%8 = lt bool %5 %7
16cbr %4 %8 ^2 ^3
17block ^2 %9:tok
18%10 = const u64 1
19%11 = chk.bounds 3 %9 %2 %5 %10
20%12 = conv u8 0 %6
21%13 = store %11 %2 %5 %12
22%14 = const u64 8
23%15 = shr u64 %6 %14
24%16 = add u64 %5 %10
25br ^1 %13 %16 %15
26block ^3 %17:tok
27%18 = const i32 1
28%19 = const u64 0
29%20 = chk.slice 3 %17 %2 %19 %7
30%21 %22 = host i64 54 %20 %18 %2 %19 %7
31ret %21
32end
33fn @f1 flags 0 %1:u64 %2:u64 -> u64
34block ^0
35%3 = gaddr %t35 @g1
36%4 = chk.bounds 3 %0 %3 %1 %2
37%5 = add u64 %1 %2
38retv %4 %5
39end
40export @f2 flags 0 -> i32
41block ^0
42%1 = const u64 1
43%2 = const u64 3
44%3 %4 = call u64 %0 @f1 %1 %2
45%5 = call void %3 @f0 %4
46%6 = const u64 2
47%7 = const u64 3
48%8 %9 = call u64 %5 @f1 %6 %7
49%10 = call void %8 @f0 %9
50%11 = const i32 0
51retv %10 %11
52end