

 local analysis of fifo_peek
   scanning: _1 = fifo_10(D)->depth;
    Indirect ref read is not const
  scanning: _2 = _1 > num_11(D);
  scanning: _3 = (long int) _2;
  scanning: _4 = __builtin_expect (_3, 1);
  scanning: if (_4 != 0)
  scanning: _5 = fifo_10(D)->data;
    Indirect ref read is not const
  scanning: _6 = num_11(D) * 4;
  scanning: _7 = _5 + _6;
  scanning: ret_12 = *_7;
    Indirect ref read is not const
  scanning: return ret_8;
Function is locally pure.


 local analysis of fifo_clear
   scanning: if (fifo_3(D) != 0B)
  scanning: fifo_3(D)->read = 0;
    Indirect ref write is not const/pure
  scanning: _1 = fifo_3(D)->depth;
    Indirect ref read is not const
  scanning: fifo_3(D)->write = _1;
    Indirect ref write is not const/pure
  scanning: return;


 local analysis of fifo_destroy
   scanning: memset (fifo_2(D), 0, 64);
  scanning: return;
Function is locally const.


 local analysis of fifo_create
   scanning: if (depth_10(D) == 0)
  scanning: _1 = depth_10(D) + 4294967295;
  scanning: _2 = _1 & depth_10(D);
  scanning: if (_2 != 0)
  scanning: depth.1_3 = (signed int) depth_10(D);
  scanning: if (depth.1_3 < 0)
  scanning: fifo_9(D)->read = 0;
    Indirect ref write is not const/pure
  scanning: fifo_9(D)->write = 0;
    Indirect ref write is not const/pure
  scanning: fifo_9(D)->depth = depth_10(D);
    Indirect ref write is not const/pure
  scanning: fifo_9(D)->depth_mask = _1;
    Indirect ref write is not const/pure
  scanning: fifo_9(D)->data = data_16(D);
    Indirect ref write is not const/pure
  scanning: _4 = data_16(D) == 0B;
  scanning: _5 = (long int) _4;
  scanning: _6 = __builtin_expect (_5, 0);
  scanning: if (_6 != 0)
  scanning: return tmp_fifo_7;


 local analysis of fifo_get_free_space
   scanning: _7 = fifo_4(D)->write;
    Indirect ref read is not const
  scanning: _8 = fifo_4(D)->read;
    Indirect ref read is not const
  scanning: _1 = fifo_4(D)->depth;
    Indirect ref read is not const
  scanning: _9 = _8 - _7;
  scanning: _2 = _1 + _9;
  scanning: *free_space_5(D) = _2;
    Indirect ref write is not const/pure
  scanning: return 0;


 local analysis of fifo_get_fill_level
   scanning: _1 = fifo_5(D)->write;
    Indirect ref read is not const
  scanning: _2 = fifo_5(D)->read;
    Indirect ref read is not const
  scanning: _3 = _1 - _2;
  scanning: *fill_level_6(D) = _3;
    Indirect ref write is not const/pure
  scanning: return 0;
callgraph:

memset/23 (memset) @071a19a0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fifo_destroy/19 (1073741824 (estimated locally),1.00 per call) 
  Calls: 
__builtin_expect/22 (__builtin_expect) @071a17e0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fifo_peek/21 (1073741824 (estimated locally),1.00 per call) fifo_create/18 (421597737 (estimated locally),0.39 per call) 
  Calls: 
fifo_peek/21 (fifo_peek) @071a11c0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @069916a8
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: __builtin_expect/22 (1073741824 (estimated locally),1.00 per call) 
fifo_clear/20 (fifo_clear) @07199ee0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991748
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: 
fifo_destroy/19 (fifo_destroy) @071997e0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991808
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: memset/23 (1073741824 (estimated locally),1.00 per call) 
fifo_create/18 (fifo_create) @07199e00
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @069918a8
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: __builtin_expect/22 (421597737 (estimated locally),0.39 per call) 
fifo_get_free_space/17 (fifo_get_free_space) @071999a0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991648
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 
fifo_get_fill_level/16 (fifo_get_fill_level) @07199700
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991688
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 


 ordered call graph: reduced for nothrow
fifo_peek/21 (fifo_peek) @071a11c0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @069916a8
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: __builtin_expect/22 (1073741824 (estimated locally),1.00 per call) 
fifo_clear/20 (fifo_clear) @07199ee0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991748
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: 
fifo_destroy/19 (fifo_destroy) @071997e0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991808
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: memset/23 (1073741824 (estimated locally),1.00 per call) 
fifo_create/18 (fifo_create) @07199e00
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @069918a8
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: __builtin_expect/22 (421597737 (estimated locally),0.39 per call) 
fifo_get_free_space/17 (fifo_get_free_space) @071999a0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991648
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 
fifo_get_fill_level/16 (fifo_get_fill_level) @07199700
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991688
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 



MALLOC LATTICE Initial:
fifo_peek: malloc_bottom
fifo_clear: malloc_bottom
fifo_destroy: malloc_bottom
fifo_create: malloc_bottom
fifo_get_free_space: malloc_bottom
fifo_get_fill_level: malloc_bottom


MALLOC LATTICE after propagation:
fifo_peek: malloc_bottom
fifo_clear: malloc_bottom
fifo_destroy: malloc_bottom
fifo_create: malloc_bottom
fifo_get_free_space: malloc_bottom
fifo_get_fill_level: malloc_bottom
callgraph:

memset/23 (memset) @071a19a0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fifo_destroy/19 (1073741824 (estimated locally),1.00 per call) 
  Calls: 
__builtin_expect/22 (__builtin_expect) @071a17e0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fifo_peek/21 (1073741824 (estimated locally),1.00 per call) fifo_create/18 (421597737 (estimated locally),0.39 per call) 
  Calls: 
fifo_peek/21 (fifo_peek) @071a11c0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991808
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: __builtin_expect/22 (1073741824 (estimated locally),1.00 per call) 
fifo_clear/20 (fifo_clear) @07199ee0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991908
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: 
fifo_destroy/19 (fifo_destroy) @071997e0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991648
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: memset/23 (1073741824 (estimated locally),1.00 per call) 
fifo_create/18 (fifo_create) @07199e00
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991528
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: __builtin_expect/22 (421597737 (estimated locally),0.39 per call) 
fifo_get_free_space/17 (fifo_get_free_space) @071999a0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991688
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 
fifo_get_fill_level/16 (fifo_get_fill_level) @07199700
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991888
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 


 ordered call graph: reduced
fifo_peek/21 (fifo_peek) @071a11c0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991808
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: __builtin_expect/22 (1073741824 (estimated locally),1.00 per call) 
fifo_clear/20 (fifo_clear) @07199ee0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991908
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: 
fifo_destroy/19 (fifo_destroy) @071997e0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991648
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: memset/23 (1073741824 (estimated locally),1.00 per call) 
fifo_create/18 (fifo_create) @07199e00
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991528
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body unlikely_executed optimize_size
  Called by: 
  Calls: __builtin_expect/22 (421597737 (estimated locally),0.39 per call) 
fifo_get_free_space/17 (fifo_get_free_space) @071999a0
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991688
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 
fifo_get_fill_level/16 (fifo_get_fill_level) @07199700
  Type: function definition analyzed
  Visibility: externally_visible public
  Aux: @06991888
  References: 
  Referring: 
  Availability: available
  Function flags: count:1073741824 (estimated locally) body hot optimize_size
  Called by: 
  Calls: 

Function found not to call free: fifo_get_fill_level
Function found not to call free: fifo_get_free_space
Function found not to call free: fifo_clear
__attribute__((hot))
fifo_peek (const struct fifo_t * const fifo, uint32_t num)
{
  volatile void * ret;
  long unsigned int _1;
  _Bool _2;
  long int _3;
  long int _4;
  void * * _5;
  long unsigned int _6;
  void * * _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0B
  # DEBUG BEGIN_STMT
  _1 = fifo_10(D)->depth;
  _2 = _1 > num_11(D);
  _3 = (long int) _2;
  _4 = __builtin_expect (_3, 1);
  if (_4 != 0)
    goto <bb 3>; [90.00%]
  else
    goto <bb 4>; [10.00%]

  <bb 3> [local count: 966367642]:
  # DEBUG BEGIN_STMT
  _5 = fifo_10(D)->data;
  _6 = num_11(D) * 4;
  _7 = _5 + _6;
  ret_12 = *_7;
  # DEBUG ret => ret_12

  <bb 4> [local count: 1073741824]:
  # ret_8 = PHI <0B(2), ret_12(3)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  return ret_8;

}


__attribute__((cold))
fifo_clear (struct fifo_t * const fifo)
{
  long unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  if (fifo_3(D) != 0B)
    goto <bb 3>; [70.00%]
  else
    goto <bb 4>; [30.00%]

  <bb 3> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  fifo_3(D)->read = 0;
  # DEBUG BEGIN_STMT
  _1 = fifo_3(D)->depth;
  fifo_3(D)->write = _1;

  <bb 4> [local count: 1073741824]:
  return;

}


__attribute__((cold))
fifo_destroy (struct fifo_t * fifo)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  memset (fifo_2(D), 0, 64);
  return;

}


__attribute__((cold))
fifo_create (const uint32_t depth, struct fifo_t * fifo, void * * data)
{
  struct fifo_t * tmp_fifo;
  long unsigned int _1;
  long unsigned int _2;
  signed int depth.1_3;
  _Bool _4;
  long int _5;
  long int _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG tmp_fifo => fifo_9(D)
  # DEBUG BEGIN_STMT
  if (depth_10(D) == 0)
    goto <bb 7>; [29.00%]
  else
    goto <bb 3>; [71.00%]

  <bb 3> [local count: 762356696]:
  _1 = depth_10(D) + 4294967295;
  _2 = _1 & depth_10(D);
  if (_2 != 0)
    goto <bb 7>; [29.00%]
  else
    goto <bb 4>; [71.00%]

  <bb 4> [local count: 541273254]:
  depth.1_3 = (signed int) depth_10(D);
  if (depth.1_3 < 0)
    goto <bb 7>; [22.11%]
  else
    goto <bb 5>; [77.89%]

  <bb 5> [local count: 421597737]:
  # DEBUG BEGIN_STMT
  fifo_9(D)->read = 0;
  # DEBUG BEGIN_STMT
  fifo_9(D)->write = 0;
  # DEBUG BEGIN_STMT
  fifo_9(D)->depth = depth_10(D);
  # DEBUG BEGIN_STMT
  fifo_9(D)->depth_mask = _1;
  # DEBUG BEGIN_STMT
  fifo_9(D)->data = data_16(D);
  # DEBUG BEGIN_STMT
  _4 = data_16(D) == 0B;
  _5 = (long int) _4;
  _6 = __builtin_expect (_5, 0);
  if (_6 != 0)
    goto <bb 6>; [10.00%]
  else
    goto <bb 7>; [90.00%]

  <bb 6> [local count: 42159774]:
  # DEBUG BEGIN_STMT
  # DEBUG tmp_fifo => 0B

  <bb 7> [local count: 1073741824]:
  # tmp_fifo_7 = PHI <0B(3), fifo_9(D)(5), 0B(6), 0B(2), 0B(4)>
  # DEBUG tmp_fifo => tmp_fifo_7
  # DEBUG BEGIN_STMT
  return tmp_fifo_7;

}


__attribute__((hot))
fifo_get_free_space (const struct fifo_t * const fifo, uint32_t * free_space)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG fifo => fifo_4(D)
  # DEBUG fill_level => &ret
  # DEBUG INLINE_ENTRY fifo_get_fill_level
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = fifo_4(D)->write;
  _8 = fifo_4(D)->read;
  # DEBUG ret => _7 - _8
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG fifo => NULL
  # DEBUG fill_level => NULL
  # DEBUG err => 0
  # DEBUG BEGIN_STMT
  _1 = fifo_4(D)->depth;
  _9 = _8 - _7;
  _2 = _1 + _9;
  *free_space_5(D) = _2;
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => {CLOBBER}
  # DEBUG ret => D#1
  return 0;

}


__attribute__((hot))
fifo_get_fill_level (const struct fifo_t * const fifo, uint32_t * fill_level)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = fifo_5(D)->write;
  _2 = fifo_5(D)->read;
  _3 = _1 - _2;
  *fill_level_6(D) = _3;
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  return 0;

}


