/* begin assembly stub */
.globl Fib
.type Fib,@function
Fib:
/* prolog */
pushl %ebp # save base pointer
movl %esp, %ebp # set new base pointer to current stack pointer
subl $16, %esp # allocate 16 bytes on stack for local vars
movl global_var, %eax # load globalar into eax
movl %eax, -4(%ebp)
cmpl $0, -4(%ebp) # compare localvar and 0
je return # jump to return if localvar is 0
cmpl $1, -4(%ebp) # compare localvar and 1
je return # jump to return if localvar is 1
movl -4(%ebp), %eax
decl %eax 
movl %eax, global_var
call Fib # recursive call to Fib
movl global_var, %eax
movl %eax, -8(%ebp)
movl -4(%ebp), %eax # move local_var into eax again
subl $2, %eax # subtract 2 from eax
movl %eax, global_var # store new value in globalvar
call Fib # recursive call to Fib
movl -8(%ebp), %eax 
addl %eax, global_var # add globalvar to eax
movl global_var, %eax
return:
/* epilog */
movl %ebp, %esp # restore stack pointer
popl %ebp # restore old base pointer
ret 

/* end assembly stub */