Files
ValueScript/concept-code/modules/linked/main_optimized.vsm
2023-03-08 11:12:53 +11:00

25 lines
442 B
Plaintext

export @main { "main": @main }
@main = function() {
call @f1_default [1, 2, 3] %x
call @f2_f2 [%x] %x
call @util_dist [3, 4] %dist
mov [%x, %dist] %return
}
@f1_default = function(%a, %b, %c) {
op* %b %c %_tmp0
op+ %a %_tmp0 %return
}
@f2_f2 = function(%x) {
op++ %x
mov %x %return
}
@util_dist = function(%x, %y) {
op* %x %x %_tmp0
op* %y %y %_tmp1
op+ %_tmp0 %_tmp1 %_tmp1
subcall $Math "sqrt" [%_tmp1] %return
}