Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/ng/tests/opt/arith.oir # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / ng / tests / opt / arith.oir` 103 lines ยท 2320 bytes Raw Blame History 1 omegair 1 2 type %t32 = array u8 32 3 type %t33 = ref edit host %t32 4 global @g0 %t32 zero 5 fn @f0 flags 0 %1:i32 %2:u64 -> void 6 block ^0 7 %3 = gaddr %t33 @g0 8 %4 = const u64 31 9 %5 = const u8 10 10 %6 = const u64 1 11 %7 = chk.bounds 3 %0 %3 %4 %6 12 %8 = store %7 %3 %4 %5 13 %9 = const u64 31 14 %10 = const u64 0 15 br ^1 %8 %1 %2 %9 %2 %10 16 block ^1 %11:tok %12:i32 %13:u64 %14:u64 %15:u64 %16:u64 17 %17 = const u64 9 18 %18 = gt bool %15 %17 19 cbr %11 %18 ^2 ^3 20 block ^2 %19:tok 21 %20 = const u64 `1000000` 22 %21 = chk.fuel 4 %19 %16 %20 23 %22 = const u64 1 24 %23 = add u64 %16 %22 25 %24 = const u64 1 26 %25 = sub u64 %14 %24 27 %26 = gaddr %t33 @g0 28 %27 = const u64 10 29 %28 = chk.divz 2 %21 %27 30 %29 = rem u64 %15 %27 31 %30 = const u64 48 32 %31 = add u64 %29 %30 33 %32 = chk.conv u8 5 %28 %31 34 %33 = conv u8 0 %31 35 %34 = const u64 1 36 %35 = chk.bounds 3 %32 %26 %25 %34 37 %36 = store %35 %26 %25 %33 38 %37 = const u64 10 39 %38 = chk.divz 2 %36 %37 40 %39 = div u64 %15 %37 41 br ^1 %38 %12 %13 %25 %39 %23 42 block ^3 %40:tok 43 %41 = const u64 1 44 %42 = sub u64 %14 %41 45 %43 = gaddr %t33 @g0 46 %44 = const u64 48 47 %45 = add u64 %15 %44 48 %46 = chk.conv u8 5 %40 %45 49 %47 = conv u8 0 %45 50 %48 = const u64 1 51 %49 = chk.bounds 3 %46 %43 %42 %48 52 %50 = store %49 %43 %42 %47 53 %51 = gaddr %t33 @g0 54 %52 = const u64 32 55 %53 = sub u64 %52 %42 56 %54 = chk.slice 3 %50 %51 %42 %53 57 %55 %56 = host i64 54 %54 %12 %51 %42 %53 58 ret %55 59 end 60 export @f1 flags 0 -> i32 61 block ^0 62 %1 %2 = host i64 109 %0 63 %3 = const u64 0 64 %4 = const u64 0 65 %5 = const u64 0 66 br ^1 %1 %2 %3 %4 %5 67 block ^1 %6:tok %7:i64 %8:u64 %9:u64 %10:u64 68 %11 = const u64 `40000000` 69 %12 = lt bool %10 %11 70 cbr %6 %12 ^2 ^3 71 block ^2 %13:tok 72 %14 = const u64 31 73 %15 = mul u64 %8 %14 74 %16 = add u64 %15 %10 75 %17 = mul u64 %10 %10 76 %18 = const u64 3 77 %19 = chk.shift 7 %13 %18 78 %20 = shr u64 %10 %18 79 %21 = xor u64 %17 %20 80 %22 = const u64 `1000003` 81 %23 = chk.divz 2 %19 %22 82 %24 = rem u64 %21 %22 83 %25 = add u64 %9 %24 84 br ^4 %23 %7 %16 %25 %10 85 block ^3 %26:tok 86 %27 %28 = host i64 109 %26 87 %29 = const i32 2 88 %30 = chk.sub 1 %27 %28 %7 89 %31 = sub i64 %28 %7 90 %32 = chk.conv u64 5 %30 %31 91 %33 = conv u64 0 %31 92 %34 = call void %32 @f0 %29 %33 93 %35 = const i32 1 94 %36 = call void %34 @f0 %35 %8 95 %37 = const i32 1 96 %38 = call void %36 @f0 %37 %9 97 %39 = const i32 0 98 retv %38 %39 99 block ^4 %40:tok %41:i64 %42:u64 %43:u64 %44:u64 100 %45 = const u64 1 101 %46 = add u64 %44 %45 102 br ^1 %40 %41 %42 %43 %46 103 end