Consider the following C++ program fragment:
int a[1000];
int b = 0;
for (int i = 0; i != 1000; i++) {
b = b + a[i];
}
(a) Write a MIPS assembly program which corresponds to this program fragment.
(b) Unroll the loop in the program 4 times in software. Transform the program by register renaming such that the number of stalls is minimized.