pfe_hif_chnl_get_lmem_hdr_size (const struct pfe_hif_chnl_t * chnl)
{
  uint16_t lmem_header_size;
  uint16_t _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  lmem_header_size_1 = 0;
  # DEBUG lmem_header_size => lmem_header_size_1
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = lmem_header_size_1;
  return _2;

}


pfe_hif_chnl_set_lmem_hdr_size (struct pfe_hif_chnl_t * chnl, uint16_t lmem_header_size)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return;

}


pfe_hif_chnl_tx_fifo_is_below_wm (const struct pfe_hif_chnl_t * chnl)
{
  bool_t is_below_wm;
  struct pfe_hif_ring_t * _1;
  bool_t _5;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_3(D)->tx_ring;
  is_below_wm_4 = pfe_hif_ring_is_below_wm (_1);
  # DEBUG is_below_wm => is_below_wm_4
  # DEBUG BEGIN_STMT
  _5 = is_below_wm_4;
  return _5;

}


pfe_hif_chnl_get_rx_cnt (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t rx_cnt;
  unsigned int _1;
  long unsigned int _2;
  uint32_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->cbus_base_va;
  _2 = chnl_4(D)->id;
  rx_cnt_6 = pfe_hif_chnl_cfg_get_rx_cnt (_1, _2);
  # DEBUG rx_cnt => rx_cnt_6
  # DEBUG BEGIN_STMT
  _7 = rx_cnt_6;
  return _7;

}


pfe_hif_chnl_get_tx_cnt (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t tx_cnt;
  unsigned int _1;
  long unsigned int _2;
  uint32_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->cbus_base_va;
  _2 = chnl_4(D)->id;
  tx_cnt_6 = pfe_hif_chnl_cfg_get_tx_cnt (_1, _2);
  # DEBUG tx_cnt => tx_cnt_6
  # DEBUG BEGIN_STMT
  _7 = tx_cnt_6;
  return _7;

}


__attribute__((cold))
pfe_hif_chnl_dump_ring (const struct pfe_hif_chnl_t * chnl, bool_t dump_rx, bool_t dump_tx)
{
  struct pfe_hif_ring_t * _1;
  struct pfe_hif_ring_t * _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  if (dump_rx_5(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = chnl_7(D)->rx_ring;
  pfe_hif_ring_dump (_1, "RX");

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (dump_tx_9(D) != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _2 = chnl_7(D)->tx_ring;
  pfe_hif_ring_dump (_2, "TX");

  <bb 6> :
  return;

}


__attribute__((cold))
pfe_hif_chnl_destroy (struct pfe_hif_chnl_t * chnl)
{
  struct pfe_hif_ring_t * _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  if (chnl_4(D) != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_irq_mask (chnl_4(D));
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_rx_irq_mask (chnl_4(D));
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_tx_irq_mask (chnl_4(D));
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_rx_disable (chnl_4(D));
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_tx_disable (chnl_4(D));
  # DEBUG BEGIN_STMT
  chnl_4(D)->rx_cbk.cbk = 0B;
  # DEBUG BEGIN_STMT
  chnl_4(D)->tx_cbk.cbk = 0B;
  # DEBUG BEGIN_STMT
  chnl_4(D)->rx_oob_cbk.cbk = 0B;
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->rx_ring;
  if (_1 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_destroy_inval_rx_ring (chnl_4(D));

  <bb 5> :
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_destroy_rings (chnl_4(D));

  <bb 6> :
  return;

}


__attribute__((cold))
pfe_hif_chnl_destroy_inval_rx_ring (struct pfe_hif_chnl_t * chnl)
{
  void * buf_pa;
  struct pfe_hif_ring_t * _1;
  int _2;
  struct pfe_hif_ring_t * _3;
  int _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  buf_pa = 0B;
  # DEBUG BEGIN_STMT

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_8(D)->rx_ring;
  _2 = pfe_hif_ring_drain_buf (_1, &buf_pa);
  if (_2 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = chnl_8(D)->rx_ring;
  pfe_hif_ring_invalidate (_3);
  # DEBUG BEGIN_STMT
  _4 = pfe_hif_chnl_flush_rx_bd_fifo (chnl_8(D));
  # DEBUG BEGIN_STMT
  buf_pa ={v} {CLOBBER};
  return;

}


__attribute__((cold))
pfe_hif_chnl_destroy_rings (struct pfe_hif_chnl_t * chnl)
{
  struct pfe_hif_ring_t * _1;
  struct pfe_hif_ring_t * _2;
  struct pfe_hif_ring_t * _3;
  unsigned int _4;
  long unsigned int _5;
  unsigned char _6;
  struct pfe_hif_ring_t * _7;
  oal_spinlock_t * _8;
  int _9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_rx_disable (chnl_13(D));
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_tx_disable (chnl_13(D));
  # DEBUG BEGIN_STMT
  _1 = chnl_13(D)->rx_ring;
  if (_1 != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = chnl_13(D)->rx_ring;
  pfe_hif_ring_destroy (_2);
  # DEBUG BEGIN_STMT
  chnl_13(D)->rx_ring = 0B;

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = chnl_13(D)->tx_ring;
  if (_3 != 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = chnl_13(D)->cbus_base_va;
  _5 = chnl_13(D)->id;
  _6 = pfe_hif_chnl_cfg_is_tx_bdp_fifo_empty (_4, _5);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = chnl_13(D)->tx_ring;
  pfe_hif_ring_destroy (_7);
  # DEBUG BEGIN_STMT
  chnl_13(D)->tx_ring = 0B;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _8 = &chnl_13(D)->lock;
  _9 = oal_spinlock_lock (_8);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_destroy_chnl (chnl_13(D));
  return;

}


__attribute__((cold))
pfe_hif_chnl_destroy_chnl (struct pfe_hif_chnl_t * chnl)
{
  unsigned int _1;
  long unsigned int _2;
  oal_spinlock_t * _3;
  int _4;
  oal_spinlock_t * _5;
  int _6;
  oal_spinlock_t * _7;
  int _8;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = chnl_10(D)->cbus_base_va;
  _2 = chnl_10(D)->id;
  pfe_hif_chnl_cfg_fini (_1, _2);
  # DEBUG BEGIN_STMT
  _3 = &chnl_10(D)->lock;
  _4 = oal_spinlock_unlock (_3);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = &chnl_10(D)->lock;
  _6 = oal_spinlock_destroy (_5);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = &chnl_10(D)->rx_lock;
  _8 = oal_spinlock_destroy (_7);
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((cold))
pfe_hif_chnl_flush_rx_bd_fifo (struct pfe_hif_chnl_t * chnl)
{
  errno_t ret;
  uint32_t ii;
  struct pfe_ct_hif_tx_hdr_t * tx_hdr;
  void * tx_buf_va;
  long unsigned int _1;
  unsigned char _2;
  int _3;
  int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  unsigned char _8;
  int _9;
  int _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  unsigned char _16;
  int _17;
  int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  unsigned char _24;
  int _25;
  int _26;
  long unsigned int _27;
  long unsigned int _28;
  long unsigned int _29;
  long unsigned int _30;
  unsigned char _31;
  struct pfe_hif_ring_t * _32;
  errno_t _47;

  <bb 2> :
  # DEBUG BEGIN_STMT
  tx_buf_va = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_35 = 0;
  # DEBUG ret => ret_35
  # DEBUG BEGIN_STMT
  tx_buf_va = &dummy_tx_buf;
  # DEBUG BEGIN_STMT
  tx_hdr_37 = tx_buf_va;
  # DEBUG tx_hdr => tx_hdr_37
  # DEBUG BEGIN_STMT
  _1 = chnl_38(D)->id;
  _2 = (unsigned char) _1;
  _3 = (int) _2;
  _4 = _3 + 6;
  _5 = 1 << _4;
  _6 = _5 >> 24;
  _7 = chnl_38(D)->id;
  _8 = (unsigned char) _7;
  _9 = (int) _8;
  _10 = _9 + 6;
  _11 = 1 << _10;
  _12 = _11 >> 8;
  _13 = _12 & 65280;
  _14 = _6 | _13;
  _15 = chnl_38(D)->id;
  _16 = (unsigned char) _15;
  _17 = (int) _16;
  _18 = _17 + 6;
  _19 = 1 << _18;
  _20 = _19 << 8;
  _21 = _20 & 16711680;
  _22 = _14 | _21;
  _23 = chnl_38(D)->id;
  _24 = (unsigned char) _23;
  _25 = (int) _24;
  _26 = _25 + 6;
  _27 = 1 << _26;
  _28 = _27 << 24;
  _29 = _22 | _28;
  tx_hdr_37->e_phy_ifs = _29;
  # DEBUG BEGIN_STMT
  tx_hdr_37->flags = 192;
  # DEBUG BEGIN_STMT
  _30 = chnl_38(D)->id;
  _31 = (unsigned char) _30;
  tx_hdr_37->chid = _31;
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_rx_enable (chnl_38(D));
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_tx_enable (chnl_38(D));
  # DEBUG BEGIN_STMT
  _32 = chnl_38(D)->rx_ring;
  ii_44 = pfe_hif_ring_get_len (_32);
  # DEBUG ii => ii_44
  # DEBUG BEGIN_STMT
  ret_46 = pfe_hif_chnl_flush_rx_bd_fifo_send_pkt (chnl_38(D), ii_44, &tx_buf_va);
  # DEBUG ret => ret_46
  # DEBUG BEGIN_STMT
  _47 = ret_46;
  tx_buf_va ={v} {CLOBBER};
  return _47;

}


__attribute__((cold))
pfe_hif_chnl_flush_rx_bd_fifo_send_pkt (struct pfe_hif_chnl_t * chnl, uint32_t ii, void * * tx_buf_va)
{
  uint32_t count;
  const void * rx_buf_pa;
  const void * tx_buf_pa;
  bool_t lifm;
  uint32_t len;
  void * buf_pa;
  void * rx_buf_va;
  errno_t ret;
  struct pfe_hif_ring_t * _1;
  long unsigned int _2;
  int _3;
  void * _4;
  int _5;
  int _6;
  struct pfe_hif_ring_t * _7;
  int _8;
  struct pfe_hif_ring_t * _9;
  int _10;
  unsigned int _11;
  long unsigned int _12;
  unsigned char _13;
  errno_t _43;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_22 = 0;
  # DEBUG ret => ret_22
  # DEBUG BEGIN_STMT
  rx_buf_va_23 = 0B;
  # DEBUG rx_buf_va => rx_buf_va_23
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  count_25 = ii_24(D);
  # DEBUG count => count_25
  # DEBUG BEGIN_STMT
  tx_buf_pa_28 = *tx_buf_va_27(D);
  # DEBUG tx_buf_pa => tx_buf_pa_28
  # DEBUG BEGIN_STMT
  rx_buf_va_29 = &dummy_rx_buf;
  # DEBUG rx_buf_va => rx_buf_va_29
  # DEBUG BEGIN_STMT
  rx_buf_pa_30 = rx_buf_va_29;
  # DEBUG rx_buf_pa => rx_buf_pa_30
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = chnl_31(D)->rx_ring;
  _2 = pfe_hif_ring_get_fill_level (_1);
  if (_2 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = pfe_hif_chnl_supply_rx_buf (chnl_31(D), rx_buf_pa_30, 1544);

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = *tx_buf_va_27(D);
  _5 = pfe_hif_chnl_tx (chnl_31(D), tx_buf_pa_28, _4, 80, 1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_time_usleep (500);
  # DEBUG BEGIN_STMT

  <bb 6> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = pfe_hif_chnl_get_tx_conf (chnl_31(D));
  if (_6 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = chnl_31(D)->rx_ring;
  _8 = pfe_hif_ring_dequeue_buf (_7, &buf_pa, &len, &lifm);
  if (_8 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  if (count_15 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  count_42 = count_15 + 4294967295;
  # DEBUG count => count_42
  goto <bb 13>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_38 = 110;
  # DEBUG ret => ret_38
  # DEBUG BEGIN_STMT

  <bb 11> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = chnl_31(D)->rx_ring;
  _10 = pfe_hif_ring_drain_buf (_9, &buf_pa);
  if (_10 == 0)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  *tx_buf_va_27(D) = 0B;
  # DEBUG BEGIN_STMT
  rx_buf_va_41 = 0B;
  # DEBUG rx_buf_va => rx_buf_va_41
  # DEBUG BEGIN_STMT
  goto <bb 14>; [INV]

  <bb 13> :
  # count_15 = PHI <count_25(2), count_42(9)>
  # DEBUG count => count_15
  # DEBUG BEGIN_STMT
  _11 = chnl_31(D)->cbus_base_va;
  _12 = chnl_31(D)->id;
  _13 = pfe_hif_chnl_cfg_is_rx_bdp_fifo_empty (_11, _12);
  if (_13 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 14> :
  # ret_14 = PHI <ret_38(12), ret_22(13)>
  # DEBUG ret => ret_14
  # DEBUG BEGIN_STMT
  _43 = ret_14;
  buf_pa ={v} {CLOBBER};
  len ={v} {CLOBBER};
  lifm ={v} {CLOBBER};
  return _43;

}


__attribute__((hot))
pfe_hif_chnl_is_tx_dma_active (const struct pfe_hif_chnl_t * chnl)
{
  bool_t is_tx_active;
  unsigned int _1;
  long unsigned int _2;
  bool_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->cbus_base_va;
  _2 = chnl_4(D)->id;
  is_tx_active_6 = pfe_hif_chnl_cfg_is_tx_dma_active (_1, _2);
  # DEBUG is_tx_active => is_tx_active_6
  # DEBUG BEGIN_STMT
  _7 = is_tx_active_6;
  return _7;

}


__attribute__((hot))
pfe_hif_chnl_is_rx_dma_active (const struct pfe_hif_chnl_t * chnl)
{
  bool_t is_rx_active;
  unsigned int _1;
  long unsigned int _2;
  bool_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->cbus_base_va;
  _2 = chnl_4(D)->id;
  is_rx_active_6 = pfe_hif_chnl_cfg_is_rx_dma_active (_1, _2);
  # DEBUG is_rx_active => is_rx_active_6
  # DEBUG BEGIN_STMT
  _7 = is_rx_active_6;
  return _7;

}


__attribute__((cold))
pfe_hif_chnl_init (struct pfe_hif_chnl_t * chnl, bool_t minihif)
{
  struct pfe_hif_ring_t * rx_ring;
  struct pfe_hif_ring_t * tx_ring;
  errno_t ret;
  long unsigned int _1;
  struct pfe_hif_ring_t * _2;
  long unsigned int _3;
  struct pfe_hif_ring_t * _4;
  struct rx_pool_t * _5;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.17_6;
  const struct Eth_43_PFE_HifCfgType * _7;
  short unsigned int _8;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.18_9;
  const struct Eth_43_PFE_HifCfgType * _10;
  short unsigned int _11;
  errno_t _26;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_14 = 0;
  # DEBUG ret => ret_14
  # DEBUG BEGIN_STMT
  tx_ring = 0B;
  rx_ring = 0B;
  # DEBUG BEGIN_STMT
  if (minihif_18(D) == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = chnl_19(D)->id;
  _2 = &tx_rings_memory[_1];
  tx_ring = _2;
  # DEBUG BEGIN_STMT
  _3 = chnl_19(D)->id;
  _4 = &rx_rings_memory[_3];
  rx_ring = _4;
  # DEBUG BEGIN_STMT
  ret_23 = pfe_hif_chnl_init_tx_rx_ring (chnl_19(D), &tx_ring, &rx_ring);
  # DEBUG ret => ret_23
  # DEBUG BEGIN_STMT
  if (ret_23 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = &chnl_19(D)->rx_pool;
  Eth_43_PFE_InternalCfgPtr.17_6 = Eth_43_PFE_InternalCfgPtr;
  _7 = Eth_43_PFE_InternalCfgPtr.17_6->pHif;
  _8 = _7->u16RxBufSize;
  Eth_43_PFE_InternalCfgPtr.18_9 = Eth_43_PFE_InternalCfgPtr;
  _10 = Eth_43_PFE_InternalCfgPtr.18_9->pHif;
  _11 = _10->u16RxBufNum;
  rx_pool_init (_5, &rx_buf_mem[0], &rx_meta_buf_mem[0], _8, _11);
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_refill_rx_buffers (chnl_19(D));

  <bb 5> :
  # ret_12 = PHI <ret_14(2), ret_23(3), ret_23(4)>
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  _26 = ret_12;
  tx_ring ={v} {CLOBBER};
  rx_ring ={v} {CLOBBER};
  return _26;

}


pfe_hif_chnl_init_tx_rx_ring (struct pfe_hif_chnl_t * chnl, struct pfe_hif_ring_t * * tx_ring, struct pfe_hif_ring_t * * rx_ring)
{
  bool_t bNocpy;
  errno_t ret;
  struct pfe_hif_ring_t * _1;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.19_2;
  const struct Eth_43_PFE_HifCfgType * _3;
  short unsigned int _4;
  long unsigned int _5;
  struct pfe_hif_ring_t * _6;
  struct pfe_hif_ring_t * _7;
  int _8;
  struct pfe_hif_ring_t * _9;
  struct pfe_hif_ring_t * _10;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.20_11;
  const struct Eth_43_PFE_HifCfgType * _12;
  short unsigned int _13;
  long unsigned int _14;
  struct pfe_hif_ring_t * _15;
  struct pfe_hif_ring_t * _16;
  struct pfe_hif_ring_t * _17;
  int _18;
  struct pfe_hif_ring_t * _19;
  struct pfe_hif_ring_t * _20;
  errno_t _45;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_23 = 0;
  # DEBUG ret => ret_23
  # DEBUG BEGIN_STMT
  bNocpy_24 = 0;
  # DEBUG bNocpy => bNocpy_24
  # DEBUG BEGIN_STMT
  _1 = *rx_ring_26(D);
  Eth_43_PFE_InternalCfgPtr.19_2 = Eth_43_PFE_InternalCfgPtr;
  _3 = Eth_43_PFE_InternalCfgPtr.19_2->pHif;
  _4 = _3->u16RxBDNum;
  _5 = (long unsigned int) _4;
  ret_28 = pfe_hif_ring_create (_1, _5, 1, bNocpy_24);
  # DEBUG ret => ret_28
  # DEBUG BEGIN_STMT
  if (ret_28 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = *rx_ring_26(D);
  pfe_hif_ring_destroy (_6);
  # DEBUG BEGIN_STMT
  ret_44 = 117;
  # DEBUG ret => ret_44
  goto <bb 10>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _7 = *rx_ring_26(D);
  _8 = pfe_hif_chnl_set_rx_ring (chnl_29(D), _7);
  if (_8 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _9 = *rx_ring_26(D);
  pfe_hif_ring_destroy (_9);
  # DEBUG BEGIN_STMT
  ret_42 = 117;
  # DEBUG ret => ret_42
  goto <bb 10>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _10 = *tx_ring_31(D);
  Eth_43_PFE_InternalCfgPtr.20_11 = Eth_43_PFE_InternalCfgPtr;
  _12 = Eth_43_PFE_InternalCfgPtr.20_11->pHif;
  _13 = _12->u16TxBDNum;
  _14 = (long unsigned int) _13;
  ret_33 = pfe_hif_ring_create (_10, _14, 0, bNocpy_24);
  # DEBUG ret => ret_33
  # DEBUG BEGIN_STMT
  if (ret_33 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _15 = *rx_ring_26(D);
  pfe_hif_ring_destroy (_15);
  # DEBUG BEGIN_STMT
  _16 = *tx_ring_31(D);
  pfe_hif_ring_destroy (_16);
  # DEBUG BEGIN_STMT
  ret_40 = 117;
  # DEBUG ret => ret_40
  goto <bb 10>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _17 = *tx_ring_31(D);
  _18 = pfe_hif_chnl_set_tx_ring (chnl_29(D), _17);
  if (_18 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _19 = *rx_ring_26(D);
  pfe_hif_ring_destroy (_19);
  # DEBUG BEGIN_STMT
  _20 = *tx_ring_31(D);
  pfe_hif_ring_destroy (_20);
  # DEBUG BEGIN_STMT
  ret_37 = 117;
  # DEBUG ret => ret_37

  <bb 10> :
  # ret_21 = PHI <ret_44(3), ret_42(5), ret_40(7), ret_33(8), ret_37(9)>
  # DEBUG ret => ret_21
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _45 = ret_21;
  return _45;

}


__attribute__((cold))
pfe_hif_chnl_set_tx_ring (struct pfe_hif_chnl_t * chnl, struct pfe_hif_ring_t * ring)
{
  uint32_t wb_tbl_len;
  errno_t ret;
  const void * wb_tbl_pa;
  const void * tx_ring_pa;
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  unsigned int _4;
  long unsigned int _5;
  unsigned int _6;
  long unsigned int _7;
  oal_spinlock_t * _8;
  int _9;
  errno_t _27;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  wb_tbl_len_13 = 0;
  # DEBUG wb_tbl_len => wb_tbl_len_13
  # DEBUG BEGIN_STMT
  tx_ring_pa_16 = pfe_hif_ring_get_base_pa (ring_15(D));
  # DEBUG tx_ring_pa => tx_ring_pa_16
  # DEBUG BEGIN_STMT
  wb_tbl_pa_17 = pfe_hif_ring_get_wb_tbl_pa (ring_15(D));
  # DEBUG wb_tbl_pa => wb_tbl_pa_17
  # DEBUG BEGIN_STMT
  if (tx_ring_pa_16 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_26 = 117;
  # DEBUG ret => ret_26
  goto <bb 8>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_18(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_18(D)->cbus_base_va;
  if (_3 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = chnl_18(D)->cbus_base_va;
  _5 = chnl_18(D)->id;
  pfe_hif_chnl_cfg_set_tx_bd_ring_addr (_4, _5, tx_ring_pa_16);
  # DEBUG BEGIN_STMT
  if (wb_tbl_pa_17 != 0B)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  wb_tbl_len_21 = pfe_hif_ring_get_wb_tbl_len (ring_15(D));
  # DEBUG wb_tbl_len => wb_tbl_len_21
  # DEBUG BEGIN_STMT
  _6 = chnl_18(D)->cbus_base_va;
  _7 = chnl_18(D)->id;
  pfe_hif_chnl_cfg_set_tx_wb_table (_6, _7, wb_tbl_pa_17, wb_tbl_len_21);

  <bb 7> :
  # DEBUG BEGIN_STMT
  chnl_18(D)->tx_ring = ring_15(D);
  # DEBUG BEGIN_STMT
  _8 = &chnl_18(D)->lock;
  _9 = oal_spinlock_unlock (_8);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_25 = 0;
  # DEBUG ret => ret_25

  <bb 8> :
  # ret_10 = PHI <ret_26(3), ret_25(7)>
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  _27 = ret_10;
  return _27;

}


__attribute__((cold))
pfe_hif_chnl_set_rx_ring (struct pfe_hif_chnl_t * chnl, struct pfe_hif_ring_t * ring)
{
  uint32_t wb_tbl_len;
  errno_t ret;
  const void * wb_tbl_pa;
  const void * rx_ring_pa;
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  unsigned int _4;
  long unsigned int _5;
  unsigned int _6;
  long unsigned int _7;
  oal_spinlock_t * _8;
  int _9;
  errno_t _27;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  wb_tbl_len_13 = 0;
  # DEBUG wb_tbl_len => wb_tbl_len_13
  # DEBUG BEGIN_STMT
  rx_ring_pa_16 = pfe_hif_ring_get_base_pa (ring_15(D));
  # DEBUG rx_ring_pa => rx_ring_pa_16
  # DEBUG BEGIN_STMT
  wb_tbl_pa_17 = pfe_hif_ring_get_wb_tbl_pa (ring_15(D));
  # DEBUG wb_tbl_pa => wb_tbl_pa_17
  # DEBUG BEGIN_STMT
  if (rx_ring_pa_16 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_26 = 117;
  # DEBUG ret => ret_26
  goto <bb 8>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_18(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_18(D)->cbus_base_va;
  if (_3 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = chnl_18(D)->cbus_base_va;
  _5 = chnl_18(D)->id;
  pfe_hif_chnl_cfg_set_rx_bd_ring_addr (_4, _5, rx_ring_pa_16);
  # DEBUG BEGIN_STMT
  if (wb_tbl_pa_17 != 0B)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  wb_tbl_len_21 = pfe_hif_ring_get_wb_tbl_len (ring_15(D));
  # DEBUG wb_tbl_len => wb_tbl_len_21
  # DEBUG BEGIN_STMT
  _6 = chnl_18(D)->cbus_base_va;
  _7 = chnl_18(D)->id;
  pfe_hif_chnl_cfg_set_rx_wb_table (_6, _7, wb_tbl_pa_17, wb_tbl_len_21);

  <bb 7> :
  # DEBUG BEGIN_STMT
  chnl_18(D)->rx_ring = ring_15(D);
  # DEBUG BEGIN_STMT
  _8 = &chnl_18(D)->lock;
  _9 = oal_spinlock_unlock (_8);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_25 = 0;
  # DEBUG ret => ret_25

  <bb 8> :
  # ret_10 = PHI <ret_26(3), ret_25(7)>
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  _27 = ret_10;
  return _27;

}


__attribute__((hot))
pfe_hif_chnl_supply_rx_buf (const struct pfe_hif_chnl_t * chnl, const void * buf_pa, uint32_t size)
{
  errno_t ret;
  struct pfe_hif_ring_t * _1;
  _Bool _2;
  long int _3;
  long int _4;
  errno_t _12;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_5 = 0;
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  _1 = chnl_7(D)->rx_ring;
  ret_11 = pfe_hif_ring_enqueue_buf (_1, buf_pa_8(D), size_9(D), 0, 1);
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  _2 = ret_11 != 0;
  _3 = (long int) _2;
  _4 = __builtin_expect (_3, 0);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = ret_11;
  return _12;

}


__attribute__((hot))
pfe_hif_chnl_release_buf (struct pfe_hif_chnl_t * chnl, const void * buf_va)
{
  errno_t ret;
  addr_t buf_pa;
  _Bool _1;
  long int _2;
  long int _3;
  oal_spinlock_t * _4;
  int _5;
  _Bool _6;
  long int _7;
  long int _8;
  struct pfe_hif_ring_t * _9;
  const void * buf_pa.15_10;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.16_11;
  const struct Eth_43_PFE_HifCfgType * _12;
  short unsigned int _13;
  long unsigned int _14;
  oal_spinlock_t * _15;
  int _16;
  _Bool _17;
  long int _18;
  long int _19;
  errno_t _28;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  buf_pa_21 = (addr_t) buf_va_20(D);
  # DEBUG buf_pa => buf_pa_21
  # DEBUG BEGIN_STMT
  _1 = buf_pa_21 == 0;
  _2 = (long int) _1;
  _3 = __builtin_expect (_2, 0);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = &chnl_22(D)->rx_lock;
  _5 = oal_spinlock_lock (_4);
  _6 = _5 != 0;
  _7 = (long int) _6;
  _8 = __builtin_expect (_7, 0);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = chnl_22(D)->rx_ring;
  buf_pa.15_10 = (const void *) buf_pa_21;
  Eth_43_PFE_InternalCfgPtr.16_11 = Eth_43_PFE_InternalCfgPtr;
  _12 = Eth_43_PFE_InternalCfgPtr.16_11->pHif;
  _13 = _12->u16RxBufSize;
  _14 = (long unsigned int) _13;
  ret_26 = pfe_hif_ring_enqueue_buf (_9, buf_pa.15_10, _14, 0, 1);
  # DEBUG ret => ret_26
  # DEBUG BEGIN_STMT
  _15 = &chnl_22(D)->rx_lock;
  _16 = oal_spinlock_unlock (_15);
  _17 = _16 != 0;
  _18 = (long int) _17;
  _19 = __builtin_expect (_18, 0);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _28 = ret_26;
  return _28;

}


__attribute__((cold))
pfe_hif_chnl_get_meta_size (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t meta_size;
  uint32_t _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  meta_size_1 = 32;
  # DEBUG meta_size => meta_size_1
  # DEBUG BEGIN_STMT
  _2 = meta_size_1;
  return _2;

}


__attribute__((hot))
pfe_hif_chnl_rx_va (struct pfe_hif_chnl_t * chnl, void * * buf_va, uint32_t * len, bool_t * lifm, void * * meta)
{
  uint32_t flags_map[4];
  uint32_t vlan_header;
  struct pfe_ct_hif_rx_hdr_t * hif_hdr_ptr;
  void * buf_pa;
  errno_t ret;
  struct pfe_hif_ring_t * _1;
  void * buf_pa.13_2;
  <unnamed type> _3;
  long unsigned int _4;
  long unsigned int _5;
  <unnamed type> _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  <unnamed type> _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  <unnamed type> _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  void * _24;
  void * _25;
  void * _26;
  const void * _27;
  void * _28;
  void * _29;
  struct rx_pool_t * _30;
  void * _31;
  void * _32;
  struct pfe_hif_ring_t * _33;
  long unsigned int _34;
  void (*<Te3>) (void *) _35;
  void (*<Te3>) (void *) _36;
  void * _37;
  unsigned int _54;
  errno_t _60;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  hif_hdr_ptr_41 = 0B;
  # DEBUG hif_hdr_ptr => hif_hdr_ptr_41
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  flags_map = *.LC0;
  # DEBUG BEGIN_STMT
  _1 = chnl_44(D)->rx_ring;
  ret_48 = pfe_hif_ring_dequeue_buf (_1, &buf_pa, len_45(D), lifm_46(D));
  # DEBUG ret => ret_48
  # DEBUG BEGIN_STMT
  if (ret_48 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  buf_pa.13_2 = buf_pa;
  *buf_va_49(D) = buf_pa.13_2;
  # DEBUG BEGIN_STMT
  hif_hdr_ptr_51 = *buf_va_49(D);
  # DEBUG hif_hdr_ptr => hif_hdr_ptr_51
  # DEBUG BEGIN_STMT
  _3 = hif_hdr_ptr_51->flags;
  _4 = (long unsigned int) _3;
  _5 = _4 >> 24;
  _6 = hif_hdr_ptr_51->flags;
  _7 = (long unsigned int) _6;
  _8 = _7 >> 8;
  _9 = _8 & 65280;
  _10 = _5 | _9;
  _11 = hif_hdr_ptr_51->flags;
  _12 = (long unsigned int) _11;
  _13 = _12 << 8;
  _14 = _13 & 16711680;
  _15 = _10 | _14;
  _16 = hif_hdr_ptr_51->flags;
  _17 = (long unsigned int) _16;
  _18 = _17 << 24;
  _19 = _15 | _18;
  _20 = chnl_44(D)->id;
  _21 = flags_map[_20];
  _22 = _19 & _21;
  if (_22 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _23 = hif_hdr_ptr_51->rx_timestamp_s;
  vlan_header = _23;
  # DEBUG BEGIN_STMT
  _24 = *buf_va_49(D);
  _25 = _24 + 12;
  _26 = *buf_va_49(D);
  _27 = _26 + 16;
  memmove (_25, _27, 16);
  # DEBUG BEGIN_STMT
  _28 = *buf_va_49(D);
  _29 = _28 + 28;
  _54 = MEM[(char * {ref-all})&vlan_header];
  MEM[(char * {ref-all})_29] = _54;

  <bb 5> :
  # DEBUG BEGIN_STMT
  _30 = &chnl_44(D)->rx_pool;
  _31 = *buf_va_49(D);
  _32 = rx_pool_get_meta_buf (_30, _31);
  *meta_57(D) = _32;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _33 = chnl_44(D)->rx_ring;
  _34 = pfe_hif_ring_get_fill_level (_33);
  if (_34 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _35 = chnl_44(D)->rx_oob_cbk.cbk;
  if (_35 != 0B)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _36 = chnl_44(D)->rx_oob_cbk.cbk;
  _37 = chnl_44(D)->rx_oob_cbk.arg;
  _36 (_37);

  <bb 9> :
  # DEBUG BEGIN_STMT
  _60 = ret_48;
  buf_pa ={v} {CLOBBER};
  vlan_header ={v} {CLOBBER};
  flags_map ={v} {CLOBBER};
  return _60;

}


__attribute__((hot))
pfe_hif_chnl_get_tx_conf (struct pfe_hif_chnl_t * chnl)
{
  errno_t ret;
  bool_t lifm;
  unsigned char lifm.12_1;
  struct pfe_hif_ring_t * _2;
  int _3;
  errno_t _11;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_6 = 118;
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  lifm.12_1 = lifm;
  if (lifm.12_1 == 1)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret_10 = 0;
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _2 = chnl_8(D)->tx_ring;
  _3 = pfe_hif_ring_dequeue_plain (_2, &lifm);
  if (_3 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # ret_4 = PHI <ret_10(4), ret_6(5)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  _11 = ret_4;
  lifm ={v} {CLOBBER};
  return _11;

}


__attribute__((hot))
pfe_hif_chnl_tx (const struct pfe_hif_chnl_t * chnl, const void * buf_pa, const void * buf_va, uint32_t len, bool_t lifm)
{
  uint32_t lmem_header_size;
  errno_t ret;
  short unsigned int _1;
  struct pfe_hif_ring_t * _2;
  errno_t _15;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_4 = 0;
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_hif_chnl_get_lmem_hdr_size (chnl_6(D));
  lmem_header_size_8 = (uint32_t) _1;
  # DEBUG lmem_header_size => lmem_header_size_8
  # DEBUG BEGIN_STMT
  _2 = chnl_6(D)->tx_ring;
  ret_13 = pfe_hif_ring_enqueue_buf (_2, buf_pa_9(D), len_10(D), lmem_header_size_8, lifm_11(D));
  # DEBUG ret => ret_13
  # DEBUG BEGIN_STMT
  if (lifm_11(D) == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  pfe_hif_chnl_tx_dma_start (chnl_6(D));

  <bb 4> :
  # DEBUG BEGIN_STMT
  _15 = ret_13;
  return _15;

}


__attribute__((cold, pure))
pfe_hif_chnl_get_tx_fifo_depth (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t tx_fifo_depth;
  struct pfe_hif_ring_t * _1;
  uint32_t _5;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_3(D)->tx_ring;
  tx_fifo_depth_4 = pfe_hif_ring_get_len (_1);
  # DEBUG tx_fifo_depth => tx_fifo_depth_4
  # DEBUG BEGIN_STMT
  _5 = tx_fifo_depth_4;
  return _5;

}


__attribute__((cold, pure))
pfe_hif_chnl_get_rx_fifo_depth (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t rx_fifo_depth;
  struct pfe_hif_ring_t * _1;
  uint32_t _5;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_3(D)->rx_ring;
  rx_fifo_depth_4 = pfe_hif_ring_get_len (_1);
  # DEBUG rx_fifo_depth => rx_fifo_depth_4
  # DEBUG BEGIN_STMT
  _5 = rx_fifo_depth_4;
  return _5;

}


__attribute__((hot, pure))
pfe_hif_chnl_tx_fifo_empty (const struct pfe_hif_chnl_t * chnl)
{
  bool_t is_empty;
  struct pfe_hif_ring_t * _1;
  long unsigned int _2;
  _Bool _3;
  bool_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_5(D)->tx_ring;
  _2 = pfe_hif_ring_get_fill_level (_1);
  _3 = _2 == 0;
  is_empty_6 = (bool_t) _3;
  # DEBUG is_empty => is_empty_6
  # DEBUG BEGIN_STMT
  _7 = is_empty_6;
  return _7;

}


__attribute__((hot, pure))
pfe_hif_chnl_can_accept_tx_num (const struct pfe_hif_chnl_t * chnl, uint16_t num)
{
  uint32_t ring_len;
  uint32_t fill_level;
  bool_t accept_tx;
  struct pfe_hif_ring_t * _1;
  struct pfe_hif_ring_t * _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  _Bool _6;
  bool_t _13;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_8(D)->tx_ring;
  fill_level_9 = pfe_hif_ring_get_fill_level (_1);
  # DEBUG fill_level => fill_level_9
  # DEBUG BEGIN_STMT
  _2 = chnl_8(D)->tx_ring;
  ring_len_10 = pfe_hif_ring_get_len (_2);
  # DEBUG ring_len => ring_len_10
  # DEBUG BEGIN_STMT
  _3 = ring_len_10 - fill_level_9;
  _4 = _3 + 4294967295;
  _5 = (long unsigned int) num_11(D);
  _6 = _4 >= _5;
  accept_tx_12 = (bool_t) _6;
  # DEBUG accept_tx => accept_tx_12
  # DEBUG BEGIN_STMT
  _13 = accept_tx_12;
  return _13;

}


__attribute__((hot, pure))
pfe_hif_chnl_can_accept_rx_buf (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t ring_len;
  uint32_t fill_level;
  bool_t accept_rx;
  struct pfe_hif_ring_t * _1;
  struct pfe_hif_ring_t * _2;
  long unsigned int _3;
  _Bool _4;
  bool_t _10;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_6(D)->rx_ring;
  fill_level_7 = pfe_hif_ring_get_fill_level (_1);
  # DEBUG fill_level => fill_level_7
  # DEBUG BEGIN_STMT
  _2 = chnl_6(D)->rx_ring;
  ring_len_8 = pfe_hif_ring_get_len (_2);
  # DEBUG ring_len => ring_len_8
  # DEBUG BEGIN_STMT
  _3 = ring_len_8 + 4294967295;
  _4 = fill_level_7 < _3;
  accept_rx_9 = (bool_t) _4;
  # DEBUG accept_rx => accept_rx_9
  # DEBUG BEGIN_STMT
  _10 = accept_rx_9;
  return _10;

}


__attribute__((hot, pure))
pfe_hif_chnl_has_tx_conf (const struct pfe_hif_chnl_t * chnl)
{
  bool_t has_tx_conf;
  struct pfe_hif_ring_t * _1;
  long unsigned int _2;
  _Bool _3;
  bool_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_5(D)->tx_ring;
  _2 = pfe_hif_ring_get_fill_level (_1);
  _3 = _2 != 0;
  has_tx_conf_6 = (bool_t) _3;
  # DEBUG has_tx_conf => has_tx_conf_6
  # DEBUG BEGIN_STMT
  _7 = has_tx_conf_6;
  return _7;

}


__attribute__((hot))
pfe_hif_chnl_tx_irq_unmask (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  long unsigned int _4;
  oal_spinlock_t * _5;
  int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_7(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_7(D)->cbus_base_va;
  _4 = chnl_7(D)->id;
  pfe_hif_chnl_cfg_tx_irq_unmask (_3, _4);
  # DEBUG BEGIN_STMT
  _5 = &chnl_7(D)->lock;
  _6 = oal_spinlock_unlock (_5);
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((hot))
pfe_hif_chnl_tx_irq_mask (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  long unsigned int _4;
  oal_spinlock_t * _5;
  int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_7(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_7(D)->cbus_base_va;
  _4 = chnl_7(D)->id;
  pfe_hif_chnl_cfg_tx_irq_mask (_3, _4);
  # DEBUG BEGIN_STMT
  _5 = &chnl_7(D)->lock;
  _6 = oal_spinlock_unlock (_5);
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((hot))
pfe_hif_chnl_rx_irq_unmask (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  long unsigned int _4;
  oal_spinlock_t * _5;
  int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_7(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_7(D)->cbus_base_va;
  _4 = chnl_7(D)->id;
  pfe_hif_chnl_cfg_rx_irq_unmask (_3, _4);
  # DEBUG BEGIN_STMT
  _5 = &chnl_7(D)->lock;
  _6 = oal_spinlock_unlock (_5);
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((hot))
pfe_hif_chnl_rx_irq_mask (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  long unsigned int _4;
  oal_spinlock_t * _5;
  int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_7(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_7(D)->cbus_base_va;
  _4 = chnl_7(D)->id;
  pfe_hif_chnl_cfg_rx_irq_mask (_3, _4);
  # DEBUG BEGIN_STMT
  _5 = &chnl_7(D)->lock;
  _6 = oal_spinlock_unlock (_5);
  # DEBUG BEGIN_STMT
  return;

}


pfe_hif_chnl_set_event_cbk (struct pfe_hif_chnl_t * chnl, pfe_hif_chnl_event_t event, void (*pfe_hif_chnl_cbk_t) (void *) cbk, void * arg)
{
  errno_t ret;
  oal_spinlock_t * _1;
  int _2;
  oal_spinlock_t * _3;
  int _4;
  errno_t _22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_7 = 0;
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _1 = &chnl_8(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (event_11(D) == 2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  chnl_8(D)->tx_cbk.arg = arg_13(D);
  # DEBUG BEGIN_STMT
  chnl_8(D)->tx_cbk.cbk = cbk_15(D);
  goto <bb 9>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (event_11(D) == 1)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  chnl_8(D)->rx_cbk.arg = arg_13(D);
  # DEBUG BEGIN_STMT
  chnl_8(D)->rx_cbk.cbk = cbk_15(D);
  goto <bb 9>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  if (event_11(D) == 4)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  chnl_8(D)->rx_oob_cbk.arg = arg_13(D);
  # DEBUG BEGIN_STMT
  chnl_8(D)->rx_oob_cbk.cbk = cbk_15(D);
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  ret_12 = 22;
  # DEBUG ret => ret_12

  <bb 9> :
  # ret_5 = PHI <ret_7(3), ret_7(5), ret_7(7), ret_12(8)>
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  _3 = &chnl_8(D)->lock;
  _4 = oal_spinlock_unlock (_3);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _22 = ret_5;
  return _22;

}


__attribute__((hot))
pfe_hif_chnl_tx_dma_start (const struct pfe_hif_chnl_t * chnl)
{
  unsigned int _1;
  long unsigned int _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->cbus_base_va;
  _2 = chnl_4(D)->id;
  pfe_hif_chnl_cfg_tx_dma_start (_1, _2);
  return;

}


__attribute__((hot))
pfe_hif_chnl_rx_dma_start (const struct pfe_hif_chnl_t * chnl)
{
  unsigned int _1;
  long unsigned int _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = chnl_4(D)->cbus_base_va;
  _2 = chnl_4(D)->id;
  pfe_hif_chnl_cfg_rx_dma_start (_1, _2);
  return;

}


__attribute__((cold))
pfe_hif_chnl_rx_disable (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  long unsigned int _4;
  oal_spinlock_t * _5;
  int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_7(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_7(D)->cbus_base_va;
  _4 = chnl_7(D)->id;
  pfe_hif_chnl_cfg_rx_disable (_3, _4);
  # DEBUG BEGIN_STMT
  _5 = &chnl_7(D)->lock;
  _6 = oal_spinlock_unlock (_5);
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((cold))
pfe_hif_chnl_rx_enable (struct pfe_hif_chnl_t * chnl)
{
  errno_t ret;
  struct pfe_hif_ring_t * _1;
  oal_spinlock_t * _2;
  int _3;
  unsigned int _4;
  long unsigned int _5;
  oal_spinlock_t * _6;
  int _7;
  errno_t _17;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_11(D)->rx_ring;
  if (_1 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_16 = 117;
  # DEBUG ret => ret_16
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = &chnl_11(D)->lock;
  _3 = oal_spinlock_lock (_2);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = chnl_11(D)->cbus_base_va;
  _5 = chnl_11(D)->id;
  pfe_hif_chnl_cfg_rx_enable (_4, _5);
  # DEBUG BEGIN_STMT
  _6 = &chnl_11(D)->lock;
  _7 = oal_spinlock_unlock (_6);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_15 = 0;
  # DEBUG ret => ret_15

  <bb 5> :
  # ret_8 = PHI <ret_16(3), ret_15(4)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _17 = ret_8;
  return _17;

}


__attribute__((cold))
pfe_hif_chnl_tx_disable (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  int _2;
  unsigned int _3;
  long unsigned int _4;
  oal_spinlock_t * _5;
  int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_7(D)->lock;
  _2 = oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = chnl_7(D)->cbus_base_va;
  _4 = chnl_7(D)->id;
  pfe_hif_chnl_cfg_tx_disable (_3, _4);
  # DEBUG BEGIN_STMT
  _5 = &chnl_7(D)->lock;
  _6 = oal_spinlock_unlock (_5);
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((cold))
pfe_hif_chnl_tx_enable (struct pfe_hif_chnl_t * chnl)
{
  errno_t ret;
  struct pfe_hif_ring_t * _1;
  oal_spinlock_t * _2;
  int _3;
  unsigned int _4;
  long unsigned int _5;
  oal_spinlock_t * _6;
  int _7;
  errno_t _17;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = chnl_11(D)->tx_ring;
  if (_1 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_16 = 117;
  # DEBUG ret => ret_16
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = &chnl_11(D)->lock;
  _3 = oal_spinlock_lock (_2);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = chnl_11(D)->cbus_base_va;
  _5 = chnl_11(D)->id;
  pfe_hif_chnl_cfg_tx_enable (_4, _5);
  # DEBUG BEGIN_STMT
  _6 = &chnl_11(D)->lock;
  _7 = oal_spinlock_unlock (_6);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_15 = 0;
  # DEBUG ret => ret_15

  <bb 5> :
  # ret_8 = PHI <ret_16(3), ret_15(4)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _17 = ret_8;
  return _17;

}


__attribute__((cold, pure))
pfe_hif_chnl_get_id (const struct pfe_hif_chnl_t * chnl)
{
  uint32_t chnl_id;
  uint32_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  chnl_id_3 = chnl_2(D)->id;
  # DEBUG chnl_id => chnl_id_3
  # DEBUG BEGIN_STMT
  _4 = chnl_id_3;
  return _4;

}


__attribute__((cold))
pfe_hif_chnl_create (struct pfe_hif_chnl_t * chnl, addr_t cbus_base_va, uint32_t id, const struct pfe_bmu_t * bmu, bool_t minihif)
{
  errno_t ret;
  struct pfe_hif_chnl_t * chnl.2_1;
  struct pfe_hif_chnl_t * chnl.3_2;
  struct pfe_hif_chnl_t * chnl.4_3;
  struct pfe_hif_chnl_t * chnl.5_4;
  struct pfe_hif_chnl_t * chnl.6_5;
  struct pfe_hif_chnl_t * chnl.7_6;
  struct pfe_hif_chnl_t * chnl.8_7;
  oal_spinlock_t * _8;
  int _9;
  struct pfe_hif_chnl_t * chnl.9_10;
  struct pfe_hif_chnl_t * chnl.10_11;
  oal_spinlock_t * _12;
  int _13;
  struct pfe_hif_chnl_t * chnl.11_14;
  oal_spinlock_t * _15;
  errno_t _39;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_18(D) > 999)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_38 = 19;
  # DEBUG ret => ret_38
  goto <bb 13>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (id_18(D) > 3)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_37 = 19;
  # DEBUG ret => ret_37
  goto <bb 13>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  chnl.2_1 = chnl;
  if (chnl.2_1 == 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ret_36 = 22;
  # DEBUG ret => ret_36
  goto <bb 13>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  chnl.3_2 = chnl;
  chnl.3_2->cbus_base_va = cbus_base_va_20(D);
  # DEBUG BEGIN_STMT
  chnl.4_3 = chnl;
  chnl.4_3->id = id_18(D);
  # DEBUG BEGIN_STMT
  chnl.5_4 = chnl;
  chnl.5_4->tx_ring = 0B;
  # DEBUG BEGIN_STMT
  chnl.6_5 = chnl;
  chnl.6_5->rx_ring = 0B;
  # DEBUG BEGIN_STMT
  chnl.7_6 = chnl;
  chnl.7_6->lock = 8;
  # DEBUG BEGIN_STMT
  chnl.8_7 = chnl;
  _8 = &chnl.8_7->lock;
  _9 = oal_spinlock_init (_8);
  if (_9 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_35 = 120;
  # DEBUG ret => ret_35
  goto <bb 13>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  chnl.9_10 = chnl;
  chnl.9_10->rx_lock = 9;
  # DEBUG BEGIN_STMT
  chnl.10_11 = chnl;
  _12 = &chnl.10_11->rx_lock;
  _13 = oal_spinlock_init (_12);
  if (_13 != 0)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  chnl.11_14 = chnl;
  _15 = &chnl.11_14->lock;
  oal_spinlock_destroy (_15);
  # DEBUG BEGIN_STMT
  ret_34 = 120;
  # DEBUG ret => ret_34
  goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  ret_32 = pfe_hif_chnl_create_cfg (&chnl, bmu_29(D), minihif_30(D));
  # DEBUG ret => ret_32

  <bb 13> :
  # ret_16 = PHI <ret_38(3), ret_37(5), ret_36(7), ret_35(9), ret_34(11), ret_32(12)>
  # DEBUG ret => ret_16
  # DEBUG BEGIN_STMT
  _39 = ret_16;
  return _39;

}


__attribute__((cold))
pfe_hif_chnl_create_cfg (struct pfe_hif_chnl_t * * chnl, const struct pfe_bmu_t * bmu, bool_t minihif)
{
  errno_t ret;
  struct pfe_hif_chnl_t * _1;
  oal_spinlock_t * _2;
  int _3;
  struct pfe_hif_chnl_t * _4;
  unsigned int _5;
  struct pfe_hif_chnl_t * _6;
  long unsigned int _7;
  struct pfe_hif_chnl_t * _8;
  struct pfe_hif_chnl_t * _9;
  oal_spinlock_t * _10;
  struct pfe_hif_chnl_t * _11;
  oal_spinlock_t * _12;
  struct pfe_hif_chnl_t * _13;
  oal_spinlock_t * _14;
  int _15;
  errno_t _30;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_18 = 0;
  # DEBUG ret => ret_18
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = *chnl_20(D);
  _2 = &_1->lock;
  _3 = oal_spinlock_lock (_2);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = *chnl_20(D);
  _5 = _4->cbus_base_va;
  _6 = *chnl_20(D);
  _7 = _6->id;
  ret_23 = pfe_hif_chnl_cfg_init (_5, _7);
  # DEBUG ret => ret_23
  # DEBUG BEGIN_STMT
  if (ret_23 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _8 = *chnl_20(D);
  ret_26 = pfe_hif_chnl_init (_8, minihif_24(D));
  # DEBUG ret => ret_26
  # DEBUG BEGIN_STMT
  if (ret_26 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = *chnl_20(D);
  _10 = &_9->lock;
  oal_spinlock_destroy (_10);
  # DEBUG BEGIN_STMT
  _11 = *chnl_20(D);
  _12 = &_11->rx_lock;
  oal_spinlock_destroy (_12);
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _13 = *chnl_20(D);
  _14 = &_13->lock;
  _15 = oal_spinlock_unlock (_14);

  <bb 6> :
  # ret_16 = PHI <ret_23(2), ret_26(4), ret_26(5)>
  # DEBUG ret => ret_16
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _30 = ret_16;
  return _30;

}


__attribute__((hot))
pfe_hif_chnl_refill_rx_buffers (struct pfe_hif_chnl_t * chnl)
{
  bool_t flags;
  errno_t ret;
  const void * new_buffer_pa;
  const void * new_buffer_va;
  struct rx_pool_t * _1;
  _Bool _2;
  long int _3;
  long int _4;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.23_5;
  const struct Eth_43_PFE_HifCfgType * _6;
  short unsigned int _7;
  long unsigned int _8;
  _Bool _9;
  long int _10;
  long int _11;
  unsigned char _12;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  flags_18 = 0;
  # DEBUG flags => flags_18
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_20(D)->rx_pool;
  new_buffer_va_22 = rx_pool_get (_1);
  # DEBUG new_buffer_va => new_buffer_va_22
  # DEBUG BEGIN_STMT
  _2 = new_buffer_va_22 != 0B;
  _3 = (long int) _2;
  _4 = __builtin_expect (_3, 1);
  if (_4 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  new_buffer_pa_24 = new_buffer_va_22;
  # DEBUG new_buffer_pa => new_buffer_pa_24
  # DEBUG BEGIN_STMT
  Eth_43_PFE_InternalCfgPtr.23_5 = Eth_43_PFE_InternalCfgPtr;
  _6 = Eth_43_PFE_InternalCfgPtr.23_5->pHif;
  _7 = _6->u16RxBufSize;
  _8 = (long unsigned int) _7;
  ret_26 = pfe_hif_chnl_supply_rx_buf (chnl_20(D), new_buffer_pa_24, _8);
  # DEBUG ret => ret_26
  # DEBUG BEGIN_STMT
  _9 = ret_26 != 0;
  _10 = (long int) _9;
  _11 = __builtin_expect (_10, 0);
  if (_11 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  flags_27 = 1;
  # DEBUG flags => flags_27
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  flags_23 = 1;
  # DEBUG flags => flags_23

  <bb 7> :
  # flags_13 = PHI <flags_27(5), flags_23(6), flags_14(4)>
  # DEBUG flags => flags_13
  # DEBUG BEGIN_STMT
  if (flags_13 == 1)
    goto <bb 9>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # flags_14 = PHI <flags_18(2), flags_13(7)>
  # DEBUG flags => flags_14
  # DEBUG BEGIN_STMT
  _12 = pfe_hif_chnl_can_accept_rx_buf (chnl_20(D));
  if (_12 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  return;

}


pfe_hif_chnl_irq_unmask (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  unsigned int _2;
  long unsigned int _3;
  oal_spinlock_t * _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_5(D)->lock;
  oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = chnl_5(D)->cbus_base_va;
  _3 = chnl_5(D)->id;
  pfe_hif_chnl_cfg_irq_unmask (_2, _3);
  # DEBUG BEGIN_STMT
  _4 = &chnl_5(D)->lock;
  oal_spinlock_unlock (_4);
  return;

}


pfe_hif_chnl_irq_mask (struct pfe_hif_chnl_t * chnl)
{
  oal_spinlock_t * _1;
  unsigned int _2;
  long unsigned int _3;
  oal_spinlock_t * _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = &chnl_5(D)->lock;
  oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = chnl_5(D)->cbus_base_va;
  _3 = chnl_5(D)->id;
  pfe_hif_chnl_cfg_irq_mask (_2, _3);
  # DEBUG BEGIN_STMT
  _4 = &chnl_5(D)->lock;
  oal_spinlock_unlock (_4);
  return;

}


__attribute__((hot))
pfe_hif_chnl_isr (struct pfe_hif_chnl_t * chnl)
{
  pfe_hif_chnl_event_t events;
  errno_t ret;
  oal_spinlock_t * _1;
  unsigned int _2;
  long unsigned int _3;
  oal_spinlock_t * _4;
  <unnamed type> events.0_5;
  long unsigned int _6;
  long unsigned int _7;
  void (*<Te3>) (void *) _8;
  void (*<Te3>) (void *) _9;
  void * _10;
  <unnamed type> events.1_11;
  long unsigned int _12;
  long unsigned int _13;
  void (*<Te3>) (void *) _14;
  void (*<Te3>) (void *) _15;
  void * _16;
  errno_t _27;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &chnl_19(D)->lock;
  oal_spinlock_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = chnl_19(D)->cbus_base_va;
  _3 = chnl_19(D)->id;
  ret_23 = pfe_hif_chnl_cfg_isr (_2, _3, &events);
  # DEBUG ret => ret_23
  # DEBUG BEGIN_STMT
  _4 = &chnl_19(D)->lock;
  oal_spinlock_unlock (_4);
  # DEBUG BEGIN_STMT
  events.0_5 = events;
  _6 = (long unsigned int) events.0_5;
  _7 = _6 & 1;
  if (_7 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _8 = chnl_19(D)->rx_cbk.cbk;
  if (_8 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _9 = chnl_19(D)->rx_cbk.cbk;
  _10 = chnl_19(D)->rx_cbk.arg;
  _9 (_10);

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  events.1_11 = events;
  _12 = (long unsigned int) events.1_11;
  _13 = _12 & 2;
  if (_13 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _14 = chnl_19(D)->tx_cbk.cbk;
  if (_14 != 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _15 = chnl_19(D)->tx_cbk.cbk;
  _16 = chnl_19(D)->tx_cbk.arg;
  _15 (_16);

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _27 = ret_23;
  events ={v} {CLOBBER};
  return _27;

}


rx_pool_get_meta_buf (const struct rx_pool_t * pool, const void * buf_va)
{
  uint32_t index;
  unsigned int buf_va.14_1;
  unsigned int _2;
  unsigned int _3;
  short unsigned int _4;
  unsigned int _5;
  unsigned int _6;
  short unsigned int _7;
  unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  void * _15;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  buf_va.14_1 = (unsigned int) buf_va_11(D);
  _2 = pool_13(D)->base_addr;
  _3 = buf_va.14_1 - _2;
  _4 = pool_13(D)->buf_size;
  _5 = (unsigned int) _4;
  _6 = _3 / _5;
  _7 = (short unsigned int) _6;
  index_14 = (uint32_t) _7;
  # DEBUG index => index_14
  # DEBUG BEGIN_STMT
  _8 = pool_13(D)->meta_base_addr;
  _9 = index_14 * 32;
  _10 = _8 + _9;
  _15 = (void *) _10;
  return _15;

}


rx_pool_get (struct rx_pool_t * pool)
{
  void * pvBuffer;
  short unsigned int _1;
  short unsigned int _2;
  unsigned int _3;
  short unsigned int _4;
  unsigned int _5;
  short unsigned int _6;
  unsigned int _7;
  unsigned int _8;
  unsigned int _9;
  short unsigned int _10;
  short unsigned int _11;
  short unsigned int _12;
  void * _20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  pvBuffer_15 = 0B;
  # DEBUG pvBuffer => pvBuffer_15
  # DEBUG BEGIN_STMT
  _1 = pool_17(D)->get_idx;
  _2 = pool_17(D)->buf_number;
  if (_1 < _2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = pool_17(D)->base_addr;
  _4 = pool_17(D)->get_idx;
  _5 = (unsigned int) _4;
  _6 = pool_17(D)->buf_size;
  _7 = (unsigned int) _6;
  _8 = _5 * _7;
  _9 = _3 + _8;
  pvBuffer_18 = (void *) _9;
  # DEBUG pvBuffer => pvBuffer_18
  # DEBUG BEGIN_STMT
  _10 = pool_17(D)->get_idx;
  _11 = _10;
  _12 = _11 + 1;
  pool_17(D)->get_idx = _12;

  <bb 4> :
  # pvBuffer_13 = PHI <pvBuffer_15(2), pvBuffer_18(3)>
  # DEBUG pvBuffer => pvBuffer_13
  # DEBUG BEGIN_STMT
  _20 = pvBuffer_13;
  return _20;

}


rx_pool_init (struct rx_pool_t * pool, const void * memory, const void * meta_memory, uint16_t buf_size, uint16_t buf_num)
{
  unsigned int memory.21_1;
  unsigned int meta_memory.22_2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  memory.21_1 = (unsigned int) memory_3(D);
  pool_5(D)->base_addr = memory.21_1;
  # DEBUG BEGIN_STMT
  meta_memory.22_2 = (unsigned int) meta_memory_7(D);
  pool_5(D)->meta_base_addr = meta_memory.22_2;
  # DEBUG BEGIN_STMT
  pool_5(D)->buf_size = buf_size_9(D);
  # DEBUG BEGIN_STMT
  pool_5(D)->buf_number = buf_num_11(D);
  # DEBUG BEGIN_STMT
  pool_5(D)->get_idx = 0;
  return;

}


oal_spinlock_unlock (oal_spinlock_t * spinlock)
{
  errno_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_unlock (spinlock_2(D));
  return _4;

}


oal_spinlock_lock (oal_spinlock_t * spinlock)
{
  errno_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_lock (spinlock_2(D));
  return _4;

}


oal_spinlock_destroy (oal_spinlock_t * spinlock)
{
  errno_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_destroy (spinlock_2(D));
  return _4;

}


oal_spinlock_init (oal_spinlock_t * spinlock)
{
  errno_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_init (spinlock_2(D));
  return _4;

}


oal_mutex_unlock (const oal_mutex_t * mutex)
{
  errno_t retval;
  short unsigned int _1;
  short unsigned int _2;
  int _3;
  unsigned char _4;
  short unsigned int _5;
  int _6;
  void (*<T4e5>) (void) _7;
  errno_t _15;

  <bb 2> :
  # DEBUG BEGIN_STMT
  retval_10 = 22;
  # DEBUG retval => retval_10
  # DEBUG BEGIN_STMT
  _1 = *mutex_12(D);
  if (_1 <= 255)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = *mutex_12(D);
  _3 = (int) _2;
  _4 = mutex_alloc[_3];
  if (_4 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _5 = *mutex_12(D);
  _6 = (int) _5;
  _7 = SchM_Exit_Eth_43_PFE_ETH_EXCLUSIVE_AREA_ID[_6];
  _7 ();
  # DEBUG BEGIN_STMT
  retval_14 = 0;
  # DEBUG retval => retval_14

  <bb 5> :
  # retval_8 = PHI <retval_10(2), retval_10(3), retval_14(4)>
  # DEBUG retval => retval_8
  # DEBUG BEGIN_STMT
  _15 = retval_8;
  return _15;

}


oal_mutex_lock (const oal_mutex_t * mutex)
{
  errno_t retval;
  short unsigned int _1;
  short unsigned int _2;
  int _3;
  unsigned char _4;
  short unsigned int _5;
  int _6;
  void (*<T4e5>) (void) _7;
  errno_t _15;

  <bb 2> :
  # DEBUG BEGIN_STMT
  retval_10 = 22;
  # DEBUG retval => retval_10
  # DEBUG BEGIN_STMT
  _1 = *mutex_12(D);
  if (_1 <= 255)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = *mutex_12(D);
  _3 = (int) _2;
  _4 = mutex_alloc[_3];
  if (_4 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _5 = *mutex_12(D);
  _6 = (int) _5;
  _7 = SchM_Enter_Eth_43_PFE_ETH_EXCLUSIVE_AREA_ID[_6];
  _7 ();
  # DEBUG BEGIN_STMT
  retval_14 = 0;
  # DEBUG retval => retval_14

  <bb 5> :
  # retval_8 = PHI <retval_10(2), retval_10(3), retval_14(4)>
  # DEBUG retval => retval_8
  # DEBUG BEGIN_STMT
  _15 = retval_8;
  return _15;

}


oal_mutex_destroy (oal_mutex_t * mutex)
{
  errno_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_destroy_internal (mutex_2(D));
  return _4;

}


oal_mutex_init (oal_mutex_t * mutex)
{
  errno_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_init_internal (mutex_2(D));
  return _4;

}


