aboutsummaryrefslogblamecommitdiff
path: root/lib.s
blob: 8a428986bbd55d36ab559b90df39d72a693e0dc3 (plain) (tree)
1
2
3
4
5
6
7
8
9
             

                               
            
                            
            
           
                           
          


                            
                 
                          
                

                            



                 
                 
                       
                        
                       
                   

                            
                 

                           
                  
                  
                       
                       
                      
               
                      
         
                             

                             



                 
                 
                       
                       
                      
                
                      
          
                             

                              



                   
                  
                       
                         
                       
                
                      
          
                             

                                



                

                          
                
                
                        
                         
                       

                

                            




                

                            



                
                 

                          
                    

                            

                     
                       


                   

                            







                              
                   
                

                            

                       
                       
                
                      
          
                             

                             
                   

                            

                   

                            



               
                            

                              

                   

                            

                 

                           
                     
                     
            

                          




















                     
_func_printf:
	addiu $sp, $sp, -64
	sw $31, 60($sp) #printf
# load fmt_0
	lw $8, 64($sp)	#fmt
# load arg_0
# load ch_0
	lb $9, 12($sp)	#ch
# load x_0
	lw $10, 4($sp)	#x
# load len_0
	lw $11, 8($sp)	#len
# t0 = addr fmt_0
	addiu $12, $sp, 64
# arg_1 = t0 + 4
	addiu $12, $12, 4
	sw $12, 16($sp)	#arg
# goto __L2
	j __L2
__L1:
# t3 = ch_2 == 37
	li $3, 37
	seq $13, $9, $3
# if not (t3) goto __L20
	beqz $13, __L20
# fmt_4 = fmt_1 + 1
	addiu $8, $8, 1
	sw $8, 64($sp)	#fmt
# ch_4 = fmt_4[0]
	lb $9, 0($8)
	sb $9, 12($sp)	#ch
# t5 = ch_4 == 100
	li $3, 100
	seq $13, $9, $3
# if not (t5) goto __L6
	beqz $13, __L6
# t7 = arg_2[0]
	lw $13, 0($12)
# push t7
	sw $13, 0($sp) # push
# t6 = call __print_int
	jal _func___print_int
# goto __L19
	j __L19
__L6:
# t8 = ch_4 == 99
	li $3, 99
	seq $13, $9, $3
# if not (t8) goto __L8
	beqz $13, __L8
# t10 = arg_2[0]
	lw $13, 0($12)
# push t10
	sw $13, 0($sp) # push
# t9 = call __print_char
	jal _func___print_char
# goto __L19
	j __L19
__L8:
# t11 = ch_4 == 115
	li $3, 115
	seq $13, $9, $3
# if not (t11) goto __L10
	beqz $13, __L10
# t13 = arg_2[0]
	lw $13, 0($12)
# push t13
	sw $13, 0($sp) # push
# t12 = call __print_string
	jal _func___print_string
# goto __L19
	j __L19
__L10:
# x_4 = arg_2[0]
	lw $10, 0($12)
	sw $10, 4($sp)	#x
# t15 = x_4 == 0
	li $3, 0
	seq $11, $10, $3
# if not (t15) goto __L12
	beqz $11, __L12
# len_11 = 1
	li $2, 1
	move $11 $2
	sw $11, 8($sp)	#len
# goto __L15
	j __L15
__L12:
# len_8 = 0
	li