# a0 * a1 in a2
li a0, 20
li a1, 21
li t6, 1


# a0 = a0 / 2 (no remain) and a1 = 1 if a0 was even
li t0, 0
li t1, 0
addi t0, t0, 1
addi t1, t1, 2
beq t1, a0, 16
blt t1, a0, -12
# end of division
# if a0 was odd, add (previous) a1
add a2, a2, a1
addi t0, t0, -1
mv a0, t0
# a1 = a1 * 2
add a1, a1, a1
bne t6, a0, -40
# also need the last one
add a2, a2, a1




# EXPECTED
# sp: 16384
# t6: 1
# a0: 1
# a1: 336
# a2: 420
# t0: 1
# t1: 2
