UP | HOME

HW20
COP-3402

Write x86_64 assembly code that has equivalent branching behavior as the following SimpleIR program:

function main
localvars a b x y
a := 5
b := 1
x := 0
head:
if a <= 0 goto a1
x := x + a
a := a - 1
goto head
a1:
x := x + b
return x

Author: Paul Gazzillo

Created: 2024-11-14 Thu 10:17

Validate