program VariantEnumResult {
section module {
std
}
section data {
int rax = 0
int rbx = 0
int rcx = 0
int rdx = 0
int rsi = 0
int rdi = 0
int r8 = 0
int r9 = 0
ptr _tmpptr0 = null
ptr arg0 = null
string str_0 = "Red = "
string str_1 = "Blue = "
string str_2 = "Ord(Green) = "
string str_3 = "Succ(Red) = "
string str_4 = "Pred(Blue) = "
string str_5 = "After inc(Red): "
string str_6 = "After dec back: "
string str_7 = "DoubleIt(21) = "
string str_8 = "ColorName(2) = "
string str_9 = "Circle at ("
string str_10 = ","
string str_11 = ") radius="
string str_12 = "Rect at ("
string str_13 = ") "
string str_14 = "x"
string str_15 = "Red"
string str_16 = "Green"
string str_17 = "Blue"
string str_18 = "Yellow"
string str_19 = "Unknown"
string fmt_int = "%lld "
string fmt_str = "%s "
string newline = "\n"
int c = 0
ptr s = null
int DoubleIt_n = 0
int __funcret_DoubleIt = 0
int ColorName_c = 0
ptr __funcret_ColorName = null
}
section code {
start:
alloc s, 40, 1
mov c, 0
print fmt_str, str_0
print fmt_int, c
print newline
mov c, 2
print fmt_str, str_1
print fmt_int, c
print newline
print fmt_str, str_2
print fmt_int, 1
print newline
print fmt_str, str_3
mov rbx, 0
add rbx, 1
print fmt_int, rbx
print newline
print fmt_str, str_4
mov rcx, 2
sub rcx, 1
print fmt_int, rcx
print newline
mov c, 0
add c, 1
print fmt_str, str_5
print fmt_int, c
print newline
sub c, 1
print fmt_str, str_6
print fmt_int, c
print newline
print fmt_str, str_7
push rbx
push rcx
mov rbx, 21
call FUNC_DoubleIt
pop rcx
pop rbx
mov rdx, rax
print fmt_int, rdx
print newline
print fmt_str, str_8
push rbx
push rcx
push rdx
mov rbx, 2
call FUNC_ColorName
pop rdx
pop rcx
pop rbx
mov _tmpptr0, arg0
print fmt_str, _tmpptr0
print newline
store 10, s, 0, 1
store 20, s, 8, 1
store 0, s, 16, 1
store 5, s, 24, 1
print fmt_str, str_9
load rsi, s, 0, 1
print fmt_int, rsi
print fmt_str, str_10
load rdi, s, 8, 1
print fmt_int, rdi
print fmt_str, str_11
load r8, s, 24, 1
print fmt_int, r8
print newline
store 1, s, 16, 1
store 30, s, 24, 1
store 40, s, 32, 1
print fmt_str, str_12
load r9, s, 0, 1
print fmt_int, r9
print fmt_str, str_10
load r9, s, 8, 1
print fmt_int, r9
print fmt_str, str_13
load r9, s, 24, 1
print fmt_int, r9
print fmt_str, str_14
load r9, s, 32, 1
print fmt_int, r9
print newline
free s
done
function FUNC_DoubleIt:
mov DoubleIt_n, rbx
mul rbx, 2
mov __funcret_DoubleIt, rbx
FUNC_END_DoubleIt:
mov rax, __funcret_DoubleIt
ret
function FUNC_ColorName:
mov ColorName_c, rbx
cmp ColorName_c, 0
je CASE_0_1
cmp ColorName_c, 1
je CASE_1_2
cmp ColorName_c, 2
je CASE_2_3
cmp ColorName_c, 3
je CASE_3_4
jmp CASE_ELSE_5
CASE_0_1:
mov __funcret_ColorName, str_15
jmp CASE_END_0
CASE_1_2:
mov __funcret_ColorName, str_16
jmp CASE_END_0
CASE_2_3:
mov __funcret_ColorName, str_17
jmp CASE_END_0
CASE_3_4:
mov __funcret_ColorName, str_18
jmp CASE_END_0
CASE_ELSE_5:
mov __funcret_ColorName, str_19
CASE_END_0:
FUNC_END_ColorName:
mov arg0, __funcret_ColorName
ret
}
}