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 / tests / opt / x-fib.oir

30 lines · 530 bytes Raw Blame History
1omegair 1
2fn @f0 flags 0 %1:u64 -> u64
3block ^0
4%2 = const u64 2
5%3 = lt bool %1 %2
6cbr %0 %3 ^1 ^2
7block ^1 %4:tok
8retv %4 %1
9block ^2 %5:tok
10br ^3 %5 %1
11block ^3 %6:tok %7:u64
12%8 = const u64 1
13%9 = sub u64 %7 %8
14%10 %11 = call u64 %6 @f0 %9
15%12 = const u64 2
16%13 = sub u64 %7 %12
17%14 %15 = call u64 %10 @f0 %13
18%16 = add u64 %11 %15
19retv %14 %16
20end
21export @f1 flags 0 -> i32
22block ^0
23%1 = const u64 25
24%2 %3 = call u64 %0 @f0 %1
25%4 = const u64 255
26%5 = and u64 %3 %4
27%6 = chk.conv i32 5 %2 %5
28%7 = conv i32 0 %5
29retv %6 %7
30end