Which of the following segments of C code best describes what
the following MIPS assembly code does?
(Note: oddly, unlike nearly every programming language,
MIPS add detects integer overflow --
so you really should always use addu as this code does.)
la $t0, x
lw $t1, 0($t0)
la $t2, y
lw $t3, 0($t2)
l1: bne $0, $t3, l2
addu $t1, $t1, $t3
beq $t1, $t1, l1
l2: sw $t1, 0($t0)
x=x+y;
if (y==0) { x=x+y; }
if (y!=0) { x=x+y; }
while (y==0) { x=x+y; }
while (y!=0) { x=x+y; }