Translate the functions main and func into MIPS assembly lan…
Translate the functions main and func into MIPS assembly language. If you need to use registers $t0 through $t9, use the lower-numbered registers first. for main and for max. Assume the function definition for a leaf function max is int max(int a, int b) { if (a>b) return a; else return b; } The code for the function main is as follows:int main() { int p=5; int q = 23; int result = max(p,q) ; } main: j End max: jr $ra End: All the parameters use registers $a0 through $a3 and the result should be returned using $v0. The variables p and q are represented by $s0 and $s1. The variable is represented by $s2. Also, before using any s (s0 – s7) registers from the procedure max (in case you plan to use) make sure to push the content of the registers to the stack and pop the content once you are done using the register i.e. just before calling jr $ra from the max procedure. The best way to avoid using a stack is to use any t-registers in the procedure max and s-registers inside the main.