CS360: Exam 1: 10/22/97. Question 3 (12 points)

Behold the following piece of assembly code:
a:
  push #4                             

  st %g1 -> [sp]--;                   
  st %fp -> [sp]--;                   
  jsr c                               
  pop #8                              

  st [fp] -> [sp]--;                  
  jsr b                               
  pop #4                              
  ld [fp+12] -> %r1                   
  add %r0, %r1 -> %r0                 
  ret                                 

main:
  push #8                             

  mv #10 -> %r0                       
  st %r0 -> [fp]                      

  ld [fp] -> %r0                      
  mv #3 -> %r1                        
  add %r0, %r1 -> %r0                 
  st %r0 -> [sp]--;                   
  jsr a                               
  pop #4                              
  mv #5 -> %r1                        
  add %r0, %r1 -> %r0                 
  st %r0 -> [fp-4];                   

  ld [fp-4] -> %r0                    
  ret                                 
Write a C program that generates this assembly code.