| 1 | module Listing; |
| 2 | (* raz -S: each line of source, and the instructions made for it *) |
| 3 | import SYSTEM; |
| 4 | |
| 5 | var total: I64; |
| 6 | |
| 7 | proc twice(x: I64): I64; |
| 8 | code |
| 9 | lea rax, [rdi + rdi]; |
| 10 | ret; |
| 11 | end twice; |
| 12 | |
| 13 | proc add(a, b: I64): I64; |
| 14 | begin |
| 15 | return a + b * 2; |
| 16 | end add; |
| 17 | |
| 18 | proc main*; |
| 19 | var i: I64; |
| 20 | begin |
| 21 | for i := 1 to 3 do |
| 22 | if i # 2 then total := add(total, twice(i)); end; |
| 23 | end; |
| 24 | end main; |
| 25 | |
| 26 | end Listing. |