The following MIPS function processes an array and returns two values in $v0 and $v1. Assuming that the array consists of 5000 words indexed 0 through 4999, and its base address is stored in $a0 and its size (5000) in $a1, comment all lines and describe in a sentence or two what this code does. Specifically, what will be returned in $v0 and $v1?
add $a1, $a1, $a1
add $a1, $a1, $a1
add $v0, $zero, $zero
add $t0, $zero, $zero
outer: add $t4, $a0, $t0
lw $t4, 0($t4)
add $t5, $zero, $zero
add $t1, $zero, $zero
inner: add $t3, $a0, $t1
lw $t3, 0($t3)
bne $t3, $t4, skip
addi $t5, $t5, 1
skip: addi $t1, $t1, 4
bne $t1, $a1, inner
slt $t2, $t5, $v0
bne $t2, $zero, next
add $v0, $t5, $zero
add $v1, $t4, $zero
next: addi $t0, $t0, 4
bne $t0, $a1, outer