The example is the fib function given at the beginning of Lecture 15. For reference, here is the function again: fib(x) = if x = 1 then 0 else if x = 2 then 1 else fib(x-1) + fib(x-2) And here is the code for cgen(fib(x) = if....) fib_entry: move $fp $sp | start of code for fib(x) = if....then...else sw $ra 0($sp) addiu $sp $sp -4 | start of code for if...then...else lw $a0 4($fp) | code for x sw $a0 0($sp) addiu $sp $sp -4 li $a0 1 | code for 1 lw $t1 4($sp) addiu $sp $sp 4 beq $a0 $t1 true_branch1 false_branch1: | start of code for if x = 2 then 1 else ... lw $a0 4($fp) | code for x sw $a0 0($sp) addiu $sp $sp -4 li $a0 2 | code for 2 lw $t1 4($sp) addiu $sp $sp 4 beq $a0 $t1 true_branch2 false_branch2: | start of code for fib(x-1) + fib(x-2) sw $fp 0($sp) | start of code for fib(x-1) addiu $sp $sp -4 | start of code for x-1 lw $a0 4($fp) | code for x sw $a0 0($sp) addiu $sp $sp -4 li $a0 1 | code for 1 lw $t1 4($sp) sub $a0 $t1 $a0 addiu $sp $sp 4 | end of code for x-1 sw $a0 0($sp) addiu $sp $sp -4 jal fib_entry | end of code for fib(x-1) sw $a0 0($sp) addiu $sp $sp -4 sw $fp 0($sp) | start of code for fib(x-1) addiu $sp $sp -4 | start of code for x-2 lw $a0 4($fp) | code for x sw $a0 0($sp) addiu $sp $sp -4 li $a0 2 | code for 2 lw $t1 4($sp) sub $a0 $t1 $a0 addiu $sp $sp 4 | end of code for x-2 sw $a0 0($sp) addiu $sp $sp -4 jal fib_entry | end of code for fib(x-2) lw $t1 4($sp) add $a0 $a0 $t1 addiu $sp $sp 4 | end of code for fib(x-1)+fib(x-2) b end_if2 true_branch2: li $a0 1 | code for 1 end_if2: | end of code for if x = 2 then 1 else ... b end_if1 true_branch1: li $a0 0 | code for 0 end_if1: | end of code for if x = 1 then 0 else ... lw $ra 4($sp) addiu $sp $sp 12 lw $fp 0($sp) jr $ra | end of code for def fib(x) = ...