The following C code has a function with a call by value parameter and two call by reference
parameters. Implement both the caller and the function in MIPS assembly.
#include <stdio.h>
void conditional_swap(int *, int *, int);
int main() {
int num1=33;
int num2=55;
int num3=44;
int p;
P = 0;
conditional_swap(&num1, &num2, p);
P = 1;
conditional_swap(&num2, &num3, p);
return 0;
}
void conditional_swap(int *a, int *b, int c) {
int temp;
if (c) {
temp = *a;
*a = *b;
*b = temp;
}
}