RTEMS-6
Annotated Report
libbspcmdline
Sun Feb 28 12:33:20 2021

400037d0 <rtems_bsp_cmdline_get_param>:                                                   
  size_t      length                                                                      
)                                                                                         
{                                                                                         
  const char *p;                                                                          
                                                                                          
  if ( !name )                                                                            
400037d0:   0c050863            beqz    a0,400038a0 <rtems_bsp_cmdline_get_param+0xd0>    
{                                                                                         
400037d4:   ff010113            addi    sp,sp,-16                                         
400037d8:   00912223            sw  s1,4(sp)                                              
400037dc:   00112623            sw  ra,12(sp)                                             
400037e0:   00812423            sw  s0,8(sp)                                              
400037e4:   00058493            mv  s1,a1                                                 
    return NULL;                                                                          
                                                                                          
  if ( !value )                                                                           
400037e8:   0a058063            beqz    a1,40003888 <rtems_bsp_cmdline_get_param+0xb8>    
400037ec:   00060413            mv  s0,a2                                                 
    return NULL;                                                                          
                                                                                          
  if ( !length )                                                                          
400037f0:   08060c63            beqz    a2,40003888 <rtems_bsp_cmdline_get_param+0xb8>    
    return NULL;                                                                          
                                                                                          
  value[0] = '\0';                                                                        
400037f4:   00058023            sb  zero,0(a1)                                            
                                                                                          
  p = rtems_bsp_cmdline_get_param_raw( name );                                            
400037f8:   0b0000ef            jal ra,400038a8 <rtems_bsp_cmdline_get_param_raw>         
                                                                                          
  if ( !p )                                                                               
400037fc:   08050663            beqz    a0,40003888 <rtems_bsp_cmdline_get_param+0xb8>    
  for (i=0 ; *p && i<length-1; ) {                                                        
40003800:   00054783            lbu a5,0(a0)                                              
40003804:   06078663            beqz    a5,40003870 <rtems_bsp_cmdline_get_param+0xa0>    <== NEVER TAKEN
40003808:   fff40693            addi    a3,s0,-1                                          
4000380c:   06068263            beqz    a3,40003870 <rtems_bsp_cmdline_get_param+0xa0>    <== NEVER TAKEN
40003810:   00048713            mv  a4,s1                                                 
40003814:   00d506b3            add a3,a0,a3                                              
  quotes=0;                                                                               
40003818:   00000613            li  a2,0                                                  
    if ( *p == '\"' ) {                                                                   
4000381c:   02200593            li  a1,34                                                 
    } else if ( ((quotes % 2) == 0) && *p == ' ' )                                        
40003820:   02000893            li  a7,32                                                 
40003824:   0280006f            j   4000384c <rtems_bsp_cmdline_get_param+0x7c>           
40003828:   00081463            bnez    a6,40003830 <rtems_bsp_cmdline_get_param+0x60>    
4000382c:   05178263            beq a5,a7,40003870 <rtems_bsp_cmdline_get_param+0xa0>     
    value[i++] = *p++;                                                                    
40003830:   00f70023            sb  a5,0(a4)                                              
    value[i] = '\0';                                                                      
40003834:   000700a3            sb  zero,1(a4)                                            
  for (i=0 ; *p && i<length-1; ) {                                                        
40003838:   00154783            lbu a5,1(a0)                                              
4000383c:   00170713            addi    a4,a4,1                                           
    value[i++] = *p++;                                                                    
40003840:   00150513            addi    a0,a0,1                                           
  for (i=0 ; *p && i<length-1; ) {                                                        
40003844:   02078663            beqz    a5,40003870 <rtems_bsp_cmdline_get_param+0xa0>    
40003848:   02a68463            beq a3,a0,40003870 <rtems_bsp_cmdline_get_param+0xa0>     
    } else if ( ((quotes % 2) == 0) && *p == ' ' )                                        
4000384c:   00167813            andi    a6,a2,1                                           
    if ( *p == '\"' ) {                                                                   
40003850:   fcb79ce3            bne a5,a1,40003828 <rtems_bsp_cmdline_get_param+0x58>     
    value[i++] = *p++;                                                                    
40003854:   00f70023            sb  a5,0(a4)                                              
    value[i] = '\0';                                                                      
40003858:   000700a3            sb  zero,1(a4)                                            
  for (i=0 ; *p && i<length-1; ) {                                                        
4000385c:   00154783            lbu a5,1(a0)                                              
      quotes++;                                                                           
40003860:   00160613            addi    a2,a2,1                                           
    value[i++] = *p++;                                                                    
40003864:   00150513            addi    a0,a0,1                                           
  for (i=0 ; *p && i<length-1; ) {                                                        
40003868:   00170713            addi    a4,a4,1                                           
4000386c:   fc079ee3            bnez    a5,40003848 <rtems_bsp_cmdline_get_param+0x78>    <== ALWAYS TAKEN
    return NULL;                                                                          
                                                                                          
  copy_string( p, value, length );                                                        
                                                                                          
  return value;                                                                           
}                                                                                         
40003870:   00c12083            lw  ra,12(sp)                                             
40003874:   00812403            lw  s0,8(sp)                                              
  quotes=0;                                                                               
40003878:   00048513            mv  a0,s1                                                 
}                                                                                         
4000387c:   00412483            lw  s1,4(sp)                                              
40003880:   01010113            addi    sp,sp,16                                          
40003884:   00008067            ret                                                       
40003888:   00c12083            lw  ra,12(sp)                                             
4000388c:   00812403            lw  s0,8(sp)                                              
40003890:   00412483            lw  s1,4(sp)                                              
    return NULL;                                                                          
40003894:   00000513            li  a0,0                                                  
}                                                                                         
40003898:   01010113            addi    sp,sp,16                                          
4000389c:   00008067            ret                                                       
    return NULL;                                                                          
400038a0:   00000513            li  a0,0                                                  
}                                                                                         
400038a4:   00008067            ret