	.text
	.p2align	2
	.globl	multiply
sum_numbers:
        # don't forget the labels and the  .text and .global things at the top of the program

        # multiply without using a multiply instruction
        
        # a0 is a 2c number
        # a1 is a 2c number
        slti	t0, a1, 0  # bool is_neg = a1 < 0;
        beq	t0, x0, .LOOP
        not	a1, a1
        addi	a1, a1, 1  # this and prev instr negates a1

        addi	t1, x0, 0  # int prod = 0
.LOOP:
        beq	a1, x0, .AFTER_LOOP
        add	t1, t1, a0 # sum += a0	
        addi	a1, a1, -1  # a1 -= 1
        j	.LOOP
.AFTER_LOOP:
	# if a1 was neg, negate result
        beq	t0, x0, .AFTER_SIGN
        not	t1, t1
        addi	t1, t1, 1  # this and prev instr negates t1
.AFTER_SIGN:
	addi	a0, t1, 0
.END:

