pfe_hif_nocpy_destroy (struct pfe_hif_nocpy_t * hif)
{
  struct pfe_hif_chnl_t * _1;
  struct pfe_hif_chnl_t * _2;
  struct pfe_hif_chnl_t * _3;
  struct pfe_hif_chnl_t * _4;
  unsigned int _5;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = hif_8(D)->channel;
  if (_1 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = hif_8(D)->channel;
  pfe_hif_chnl_rx_disable (_2);
  # DEBUG BEGIN_STMT
  _3 = hif_8(D)->channel;
  pfe_hif_chnl_tx_disable (_3);
  # DEBUG BEGIN_STMT
  _4 = hif_8(D)->channel;
  pfe_hif_chnl_destroy (_4);
  # DEBUG BEGIN_STMT
  hif_8(D)->channel = 0B;

  <bb 5> :
  # DEBUG BEGIN_STMT
  _5 = hif_8(D)->base_va;
  pfe_hif_nocpy_cfg_fini (_5);

  <bb 6> :
  return;

}


pfe_hif_nocpy_get_channel (const struct pfe_hif_nocpy_t * hif, uint32_t channel_id)
{
  struct pfe_hif_chnl_t * hif_nocpy_chnl;
  struct pfe_hif_chnl_t * _7;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  hif_nocpy_chnl_6 = 0B;
  # DEBUG hif_nocpy_chnl => hif_nocpy_chnl_6
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  hif_nocpy_chnl_5 = hif_4(D)->channel;
  # DEBUG hif_nocpy_chnl => hif_nocpy_chnl_5

  <bb 5> :
  # hif_nocpy_chnl_1 = PHI <hif_nocpy_chnl_6(3), hif_nocpy_chnl_5(4)>
  # DEBUG hif_nocpy_chnl => hif_nocpy_chnl_1
  # DEBUG BEGIN_STMT
  _7 = hif_nocpy_chnl_1;
  return _7;

}


pfe_hif_nocpy_create (addr_t base_va, const struct pfe_bmu_t * bmu, uint16_t lmem_header_size)
{
  errno_t ret;
  struct pfe_hif_nocpy_t * hif;
  unsigned int _1;
  struct pfe_hif_nocpy_t * _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_4 = 0;
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  hif_5 = &hif_nocpy_instance;
  # DEBUG hif => hif_5
  # DEBUG BEGIN_STMT
  memset (hif_5, 0, 8);
  # DEBUG BEGIN_STMT
  hif_5->base_va = base_va_8(D);
  # DEBUG BEGIN_STMT
  _1 = hif_5->base_va;
  ret_11 = pfe_hif_nocpy_cfg_init (_1);
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  if (ret_11 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_hif_nocpy_free (hif_5);
  # DEBUG BEGIN_STMT
  hif_18 = 0B;
  # DEBUG hif => hif_18
  goto <bb 6>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret_15 = pfe_hif_nocpy_create_chnl (hif_5, bmu_12(D), lmem_header_size_13(D));
  # DEBUG ret => ret_15
  # DEBUG BEGIN_STMT
  if (ret_15 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  hif_16 = 0B;
  # DEBUG hif => hif_16

  <bb 6> :
  # hif_2 = PHI <hif_18(3), hif_5(4), hif_16(5)>
  # DEBUG hif => hif_2
  # DEBUG BEGIN_STMT
  _19 = hif_2;
  return _19;

}


pfe_hif_nocpy_create_chnl (struct pfe_hif_nocpy_t * hif, const struct pfe_bmu_t * bmu, uint16_t lmem_header_size)
{
  errno_t ret;
  unsigned int _1;
  struct pfe_hif_chnl_t * _2;
  struct pfe_hif_chnl_t * _3;
  struct pfe_hif_chnl_t * _4;
  struct pfe_hif_chnl_t * _5;
  errno_t _22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = hif_9(D)->base_va;
  ret_12 = pfe_hif_chnl_create (&hif_chnl_memory, _1, 1000, bmu_10(D), 0);
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  if (ret_12 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_hif_nocpy_free (hif_9(D));
  goto <bb 7>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  hif_9(D)->channel = &hif_chnl_memory;
  # DEBUG BEGIN_STMT
  _2 = hif_9(D)->channel;
  pfe_hif_chnl_set_lmem_hdr_size (_2, lmem_header_size_14(D));
  # DEBUG BEGIN_STMT
  _3 = hif_9(D)->channel;
  ret_17 = pfe_hif_chnl_init (_3, 0);
  # DEBUG ret => ret_17
  # DEBUG BEGIN_STMT
  if (ret_17 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  pfe_hif_nocpy_free (hif_9(D));
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _4 = hif_9(D)->channel;
  pfe_hif_chnl_rx_disable (_4);
  # DEBUG BEGIN_STMT
  _5 = hif_9(D)->channel;
  pfe_hif_chnl_tx_disable (_5);

  <bb 7> :
  # ret_6 = PHI <ret_12(3), ret_17(5), ret_17(6)>
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  _22 = ret_6;
  return _22;

}


pfe_hif_nocpy_free (struct pfe_hif_nocpy_t * hif)
{
  struct pfe_hif_chnl_t * _1;
  struct pfe_hif_chnl_t * _2;
  unsigned int _3;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = hif_6(D)->channel;
  pfe_hif_chnl_destroy (_2);
  # DEBUG BEGIN_STMT
  hif_6(D)->channel = 0B;

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = hif_6(D)->base_va;
  pfe_hif_nocpy_cfg_fini (_3);
  return;

}


