;; 1 loops found
;;
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1

Symbols to be put in SSA form
{ D.9783 }
Incremental SSA update started at block: 0
Number of blocks in CFG: 4
Number of blocks to update: 3 ( 75%)


oal_mm_cache_inval.constprop ()
{
  const void * vaddr;
  const void * paddr;
  const addr_t len;

  <bb 3> [local count: 1073741824]:
  # DEBUG D#6 s=> vaddr
  # DEBUG vaddr => D#6
  # DEBUG D#5 s=> paddr
  # DEBUG paddr => D#5
  # DEBUG D#4 s=> len
  # DEBUG len => D#4

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return;

}


oal_mm_shutdown ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  blalloc_fini (&heap_allocator);
  return;

}


oal_mm_init (const void * dev)
{
  errno_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  blalloc_init (&heap_allocator);
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_4 = blalloc_init (&bd_mem_heap_allocator);
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return ret_4;

}


oal_mm_cache_get_line_size ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return 64;

}


oal_mm_cache_flush (const void * vaddr, const void * paddr, const addr_t len)
{
  <bb 2> [local count: 1073741824]:
  oal_mm_cache_inval (vaddr_1(D), paddr_2(D), len_3(D)); [tail call]
  return;

}


oal_mm_cache_inval (const void * vaddr, const void * paddr, const addr_t len)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return;

}


oal_mm_dev_unmap (void * paddr, const addr_t len)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return 0;

}


oal_mm_dev_map_cache (void * paddr, const addr_t len)
{
  void * retval.40;

  <bb 2> [local count: 1073741824]:
  retval.40_3 = oal_mm_dev_map (paddr_1(D), len_2(D)); [tail call]
  return retval.40_3;

}


oal_mm_dev_map (void * paddr, const addr_t len)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return paddr_1(D);

}


oal_mm_phys_to_virt (void * paddr)
{
  void * retval.39;

  <bb 2> [local count: 1073741824]:
  retval.39_2 = oal_mm_virt_to_phys_contig (paddr_1(D)); [tail call]
  return retval.39_2;

}


oal_mm_virt_to_phys (void * vaddr)
{
  void * retval.38;

  <bb 2> [local count: 1073741824]:
  retval.38_2 = oal_mm_virt_to_phys_contig (vaddr_1(D)); [tail call]
  return retval.38_2;

}


oal_mm_free (const void * vaddr)
{
  unsigned int vaddr.14_1;
  unsigned int heap.15_2;
  unsigned int _3;
  unsigned int _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  vaddr.14_1 = (unsigned int) vaddr_6(D);
  heap.15_2 = (unsigned int) &heap;
  if (vaddr.14_1 >= heap.15_2)
    goto <bb 3>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 3> [local count: 536870913]:
  _3 = heap.15_2 + 98304;
  if (vaddr.14_1 < _3)
    goto <bb 4>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 4> [local count: 177167401]:
  # DEBUG BEGIN_STMT
  _4 = vaddr.14_1 - heap.15_2;
  blalloc_free_offs (&heap_allocator, _4);

  <bb 5> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return;

}


oal_mm_free_contig (const void * vaddr)
{
  unsigned int vaddr.8_1;
  unsigned int bd_mem_heap.9_2;
  unsigned int _3;
  unsigned int _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  vaddr.8_1 = (unsigned int) vaddr_6(D);
  bd_mem_heap.9_2 = (unsigned int) &bd_mem_heap;
  if (vaddr.8_1 >= bd_mem_heap.9_2)
    goto <bb 3>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 3> [local count: 536870913]:
  _3 = bd_mem_heap.9_2 + 432;
  if (vaddr.8_1 < _3)
    goto <bb 4>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 4> [local count: 177167401]:
  # DEBUG BEGIN_STMT
  _4 = vaddr.8_1 - bd_mem_heap.9_2;
  blalloc_free_offs (&bd_mem_heap_allocator, _4);

  <bb 5> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return;

}


oal_mm_virt_to_phys_contig (void * vaddr)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return vaddr_1(D);

}


oal_mm_malloc_contig_named_aligned_cache (const char_t * pool, const addr_t size, const uint32_t align)
{
  void * _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _6 = oal_mm_malloc_contig_named_aligned_nocache (pool_2(D), size_3(D), align_4(D));
  return _6;

}


oal_mm_malloc_contig_named_aligned_nocache (const char_t * pool, const addr_t size, const uint32_t align)
{
  int _1;
  int _2;
  void * _3;
  void * _8;
  void * _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = strcmp (pool_6(D), "bd_mem");
  if (_1 == 0)
    goto <bb 3>; [20.24%]
  else
    goto <bb 4>; [79.76%]

  <bb 3> [local count: 217325345]:
  # DEBUG BEGIN_STMT
  _11 = oal_mm_malloc_bd_mem (size_9(D), align_7(D));
  goto <bb 6>; [100.00%]

  <bb 4> [local count: 856416480]:
  # DEBUG BEGIN_STMT
  _2 = strcmp (pool_6(D), "tx_buf_mem");
  if (_2 == 0)
    goto <bb 5>; [71.00%]
  else
    goto <bb 6>; [29.00%]

  <bb 5> [local count: 608055701]:
  # DEBUG BEGIN_STMT
  _8 = oal_mm_malloc_tx_buf (align_7(D));

  <bb 6> [local count: 1073741824]:
  # _3 = PHI <_11(3), _8(5), 0B(4)>
  return _3;

}


oal_mm_malloc (const addr_t size)
{
  addr_t addr;
  int _1;
  unsigned int addr.0_2;
  unsigned int heap.1_3;
  unsigned int _4;
  void * _5;
  void * _9;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = blalloc_alloc_offs (&heap_allocator, size_7(D), 0, &addr);
  if (_1 != 0)
    goto <bb 4>; [29.00%]
  else
    goto <bb 3>; [71.00%]

  <bb 3> [local count: 762356696]:
  # DEBUG BEGIN_STMT
  addr.0_2 = addr;
  heap.1_3 = (unsigned int) &heap;
  _4 = addr.0_2 + heap.1_3;
  _9 = (void *) _4;

  <bb 4> [local count: 1073741824]:
  # _5 = PHI <0B(2), _9(3)>
  addr ={v} {CLOBBER};
  return _5;

}


oal_mm_malloc_tx_buf (const uint32_t align)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int tx_buf_mem_heap.7_3;
  long unsigned int _4;
  void * _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  if (align_6(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _1 = align_6(D) + 4294967295;
  _2 = _1 & align_6(D);
  if (_2 == 0)
    goto <bb 4>; [82.62%]
  else
    goto <bb 6>; [17.38%]

  <bb 4> [local count: 443562748]:
  # DEBUG BEGIN_STMT
  tx_buf_mem_heap.7_3 = (long unsigned int) &tx_buf_mem_heap;
  _4 = _1 & tx_buf_mem_heap.7_3;
  if (_4 != 0)
    goto <bb 5>; [17.38%]
  else
    goto <bb 6>; [82.62%]

  <bb 5> [local count: 77091206]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT

  <bb 6> [local count: 1073741824]:
  # _5 = PHI <0B(3), 0B(5), &tx_buf_mem_heap[0](4), &tx_buf_mem_heap[0](2)>
  return _5;

}


oal_mm_malloc_bd_mem (const addr_t size, const uint32_t align)
{
  addr_t addr;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int bd_mem_heap.3_3;
  long unsigned int _4;
  int _5;
  unsigned int addr.4_6;
  unsigned int bd_mem_heap.5_7;
  unsigned int _8;
  void * _9;
  void * _15;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (align_11(D) != 0)
    goto <bb 3>; [67.00%]
  else
    goto <bb 5>; [33.00%]

  <bb 3> [local count: 719407022]:
  # DEBUG BEGIN_STMT
  _1 = align_11(D) + 4294967295;
  _2 = _1 & align_11(D);
  if (_2 == 0)
    goto <bb 4>; [82.62%]
  else
    goto <bb 7>; [17.38%]

  <bb 4> [local count: 594374082]:
  # DEBUG BEGIN_STMT
  bd_mem_heap.3_3 = (long unsigned int) &bd_mem_heap;
  _4 = _1 & bd_mem_heap.3_3;
  if (_4 != 0)
    goto <bb 7>; [17.38%]
  else
    goto <bb 5>; [82.62%]

  <bb 5> [local count: 845406668]:
  # DEBUG BEGIN_STMT
  _5 = blalloc_alloc_offs (&bd_mem_heap_allocator, size_13(D), align_11(D), &addr);
  if (_5 != 0)
    goto <bb 7>; [29.00%]
  else
    goto <bb 6>; [71.00%]

  <bb 6> [local count: 600238735]:
  # DEBUG BEGIN_STMT
  addr.4_6 = addr;
  bd_mem_heap.5_7 = (unsigned int) &bd_mem_heap;
  _8 = addr.4_6 + bd_mem_heap.5_7;
  _15 = (void *) _8;

  <bb 7> [local count: 1073741824]:
  # _9 = PHI <0B(3), 0B(4), 0B(5), _15(6)>
  addr ={v} {CLOBBER};
  return _9;

}


