pfe_emac_irq_unmask (struct pfe_emac_t * emac)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_emac_irq_mask (struct pfe_emac_t * emac)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_emac_isr (struct pfe_emac_t * emac)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned int _2;
  unsigned int _3;
  oal_mutex_t * _4;
  errno_t _12;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_5 = 0;
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  _1 = &emac_6(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_6(D)->emac_base_va;
  _3 = emac_6(D)->cbus_base_va;
  ret_10 = pfe_emac_cfg_isr (_2, _3);
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  _4 = &emac_6(D)->mutex;
  oal_mutex_unlock (_4);
  # DEBUG BEGIN_STMT
  _12 = ret_10;
  return _12;

}


pfe_emac_get_stat_value (const struct pfe_emac_t * emac, uint32_t stat_id)
{
  uint32_t stat_value;
  unsigned int _1;
  uint32_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  stat_value_6 = pfe_emac_cfg_get_stat_value (_1, stat_id_4(D));
  # DEBUG stat_value => stat_value_6
  # DEBUG BEGIN_STMT
  _7 = stat_value_6;
  return _7;

}


pfe_emac_get_tx_cnt (const struct pfe_emac_t * emac)
{
  uint32_t tx_cnt;
  unsigned int _1;
  uint32_t _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  tx_cnt_5 = pfe_emac_cfg_get_tx_cnt (_1);
  # DEBUG tx_cnt => tx_cnt_5
  # DEBUG BEGIN_STMT
  _6 = tx_cnt_5;
  return _6;

}


pfe_emac_get_rx_cnt (const struct pfe_emac_t * emac)
{
  uint32_t rx_cnt;
  unsigned int _1;
  uint32_t _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  rx_cnt_5 = pfe_emac_cfg_get_rx_cnt (_1);
  # DEBUG rx_cnt => rx_cnt_5
  # DEBUG BEGIN_STMT
  _6 = rx_cnt_5;
  return _6;

}


pfe_emac_mdio_write45 (struct pfe_emac_t * emac, uint8_t pa, uint8_t dev, uint16_t ra, uint16_t val, uint32_t key)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned char _2;
  long unsigned int _3;
  unsigned int _4;
  unsigned int _5;
  oal_mutex_t * _6;
  errno_t _23;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_9(D)->mdio_locked;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = emac_9(D)->mdio_key;
  if (key_18(D) == _3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = emac_9(D)->emac_base_va;
  ret_21 = pfe_emac_cfg_mdio_write45 (_4, pa_12(D), dev_13(D), ra_14(D), val_15(D));
  # DEBUG ret => ret_21
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  ret_19 = 115;
  # DEBUG ret => ret_19
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _5 = emac_9(D)->emac_base_va;
  ret_17 = pfe_emac_cfg_mdio_write45 (_5, pa_12(D), dev_13(D), ra_14(D), val_15(D));
  # DEBUG ret => ret_17

  <bb 7> :
  # ret_7 = PHI <ret_19(5), ret_17(6), ret_21(4)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _6 = &emac_9(D)->mutex;
  oal_mutex_unlock (_6);
  # DEBUG BEGIN_STMT
  _23 = ret_7;
  return _23;

}


pfe_emac_mdio_read45 (struct pfe_emac_t * emac, uint8_t pa, uint8_t dev, uint16_t ra, uint16_t * val, uint32_t key)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned char _2;
  long unsigned int _3;
  unsigned int _4;
  unsigned int _5;
  oal_mutex_t * _6;
  errno_t _23;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_9(D)->mdio_locked;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = emac_9(D)->mdio_key;
  if (key_18(D) == _3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = emac_9(D)->emac_base_va;
  ret_21 = pfe_emac_cfg_mdio_read45 (_4, pa_12(D), dev_13(D), ra_14(D), val_15(D));
  # DEBUG ret => ret_21
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  ret_19 = 115;
  # DEBUG ret => ret_19
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _5 = emac_9(D)->emac_base_va;
  ret_17 = pfe_emac_cfg_mdio_read45 (_5, pa_12(D), dev_13(D), ra_14(D), val_15(D));
  # DEBUG ret => ret_17

  <bb 7> :
  # ret_7 = PHI <ret_19(5), ret_17(6), ret_21(4)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _6 = &emac_9(D)->mutex;
  oal_mutex_unlock (_6);
  # DEBUG BEGIN_STMT
  _23 = ret_7;
  return _23;

}


pfe_emac_mdio_write22 (struct pfe_emac_t * emac, uint8_t pa, uint8_t ra, uint16_t val, uint32_t key)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned char _2;
  long unsigned int _3;
  unsigned int _4;
  unsigned int _5;
  oal_mutex_t * _6;
  errno_t _22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_9(D)->mdio_locked;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = emac_9(D)->mdio_key;
  if (key_17(D) == _3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = emac_9(D)->emac_base_va;
  ret_20 = pfe_emac_cfg_mdio_write22 (_4, pa_12(D), ra_13(D), val_14(D));
  # DEBUG ret => ret_20
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  ret_18 = 115;
  # DEBUG ret => ret_18
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _5 = emac_9(D)->emac_base_va;
  ret_16 = pfe_emac_cfg_mdio_write22 (_5, pa_12(D), ra_13(D), val_14(D));
  # DEBUG ret => ret_16

  <bb 7> :
  # ret_7 = PHI <ret_18(5), ret_16(6), ret_20(4)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _6 = &emac_9(D)->mutex;
  oal_mutex_unlock (_6);
  # DEBUG BEGIN_STMT
  _22 = ret_7;
  return _22;

}


pfe_emac_mdio_read22 (struct pfe_emac_t * emac, uint8_t pa, uint8_t ra, uint16_t * val, uint32_t key)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned char _2;
  long unsigned int _3;
  unsigned int _4;
  unsigned int _5;
  oal_mutex_t * _6;
  errno_t _22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_9(D)->mdio_locked;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = emac_9(D)->mdio_key;
  if (key_17(D) == _3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = emac_9(D)->emac_base_va;
  ret_20 = pfe_emac_cfg_mdio_read22 (_4, pa_12(D), ra_13(D), val_14(D));
  # DEBUG ret => ret_20
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  ret_18 = 115;
  # DEBUG ret => ret_18
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _5 = emac_9(D)->emac_base_va;
  ret_16 = pfe_emac_cfg_mdio_read22 (_5, pa_12(D), ra_13(D), val_14(D));
  # DEBUG ret => ret_16

  <bb 7> :
  # ret_7 = PHI <ret_18(5), ret_16(6), ret_20(4)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _6 = &emac_9(D)->mutex;
  oal_mutex_unlock (_6);
  # DEBUG BEGIN_STMT
  _22 = ret_7;
  return _22;

}


pfe_emac_mdio_unlock (struct pfe_emac_t * emac, uint32_t key)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned char _2;
  long unsigned int _3;
  oal_mutex_t * _4;
  errno_t _16;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_7(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_7(D)->mdio_locked;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = emac_7(D)->mdio_key;
  if (key_11(D) == _3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  emac_7(D)->mdio_locked = 0;
  # DEBUG BEGIN_STMT
  ret_14 = 0;
  # DEBUG ret => ret_14
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  ret_12 = 115;
  # DEBUG ret => ret_12
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret_10 = 120;
  # DEBUG ret => ret_10

  <bb 7> :
  # ret_5 = PHI <ret_12(5), ret_10(6), ret_14(4)>
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  _4 = &emac_7(D)->mutex;
  oal_mutex_unlock (_4);
  # DEBUG BEGIN_STMT
  _16 = ret_5;
  return _16;

}


pfe_emac_mdio_lock (struct pfe_emac_t * emac, uint32_t * key)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned char _2;
  long unsigned int key_seed.3_3;
  long unsigned int key_seed.4_4;
  long unsigned int _5;
  long unsigned int _6;
  oal_mutex_t * _7;
  errno_t _21;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_10(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_10(D)->mdio_locked;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  emac_10(D)->mdio_locked = 1;
  # DEBUG BEGIN_STMT
  key_seed.3_3 = key_seed;
  emac_10(D)->mdio_key = key_seed.3_3;
  # DEBUG BEGIN_STMT
  key_seed.4_4 = key_seed;
  _5 = key_seed.4_4 + 1;
  key_seed = _5;
  # DEBUG BEGIN_STMT
  _6 = emac_10(D)->mdio_key;
  *key_16(D) = _6;
  # DEBUG BEGIN_STMT
  ret_18 = 0;
  # DEBUG ret => ret_18

  <bb 5> :
  # ret_8 = PHI <ret_19(3), ret_18(4)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _7 = &emac_10(D)->mutex;
  oal_mutex_unlock (_7);
  # DEBUG BEGIN_STMT
  _21 = ret_8;
  return _21;

}


pfe_emac_destroy (struct pfe_emac_t * emac)
{
  const struct pfe_mac_addr_db_entry_t * entry;
  struct LLIST_t * tmp_item;
  struct LLIST_t * curItem;
  uint8_t zero_addr[6];
  oal_mutex_t * _1;
  int _2;
  const uint8_t[6] * _3;
  <unnamed type> _4;
  int _5;
  struct LLIST_t * _6;
  unsigned int _7;
  oal_mutex_t * _8;
  oal_mutex_t * _9;
  oal_mutex_t * _10;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  memset (&zero_addr, 0, 6);
  # DEBUG BEGIN_STMT
  if (emac_17(D) != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = &emac_17(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  curItem_19 = emac_17(D)->mac_addr_list.prNext;
  # DEBUG curItem => curItem_19
  tmp_item_20 = curItem_19->prNext;
  # DEBUG tmp_item => tmp_item_20
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = curItem_11 - 14B;
  entry_27 = (const struct pfe_mac_addr_db_entry_t *) _2;
  # DEBUG entry => entry_27
  # DEBUG BEGIN_STMT
  _3 = &entry_27->addr;
  _4 = entry_27->owner;
  _5 = pfe_emac_del_addr_nolock (emac_17(D), _3, _4);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  curItem_29 = tmp_item_12;
  # DEBUG curItem => curItem_29
  tmp_item_30 = tmp_item_12->prNext;
  # DEBUG tmp_item => tmp_item_30

  <bb 5> :
  # curItem_11 = PHI <curItem_19(3), curItem_29(4)>
  # tmp_item_12 = PHI <tmp_item_20(3), tmp_item_30(4)>
  # DEBUG tmp_item => tmp_item_12
  # DEBUG curItem => curItem_11
  # DEBUG BEGIN_STMT
  _6 = &emac_17(D)->mac_addr_list;
  if (curItem_11 != _6)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  pfe_emac_disable (emac_17(D));
  # DEBUG BEGIN_STMT
  _7 = emac_17(D)->emac_base_va;
  pfe_emac_cfg_disable_ts (_7);
  # DEBUG BEGIN_STMT
  pfe_emac_addr_db_drop_all (emac_17(D));
  # DEBUG BEGIN_STMT
  _8 = &emac_17(D)->mutex;
  oal_mutex_unlock (_8);
  # DEBUG BEGIN_STMT
  _9 = &emac_17(D)->mutex;
  oal_mutex_destroy (_9);
  # DEBUG BEGIN_STMT
  _10 = &emac_17(D)->ts_mutex;
  oal_mutex_destroy (_10);

  <bb 7> :
  zero_addr ={v} {CLOBBER};
  return;

}


pfe_emac_get_addr (struct pfe_emac_t * emac, uint8_t * addr)
{
  errno_t ret;
  const struct pfe_mac_addr_db_entry_t * entry;
  oal_mutex_t * _1;
  const uint8_t[6] * _2;
  oal_mutex_t * _3;
  errno_t _20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_8 = 0;
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  entry_13 = pfe_emac_addr_db_find_by_slot (emac_9(D), 0);
  # DEBUG entry => entry_13
  # DEBUG BEGIN_STMT
  if (entry_13 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  entry_15 = pfe_emac_addr_db_get_first (emac_9(D));
  # DEBUG entry => entry_15
  # DEBUG BEGIN_STMT
  if (entry_15 == 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret_16 = 2;
  # DEBUG ret => ret_16

  <bb 5> :
  # entry_4 = PHI <entry_13(2), entry_15(3), entry_15(4)>
  # ret_5 = PHI <ret_8(2), ret_8(3), ret_16(4)>
  # DEBUG ret => ret_5
  # DEBUG entry => entry_4
  # DEBUG BEGIN_STMT
  if (ret_5 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = &entry_4->addr;
  memcpy (addr_17(D), _2, 6);

  <bb 7> :
  # DEBUG BEGIN_STMT
  _3 = &emac_9(D)->mutex;
  oal_mutex_unlock (_3);
  # DEBUG BEGIN_STMT
  _20 = ret_5;
  return _20;

}


pfe_emac_add_addr (struct pfe_emac_t * emac, const uint8_t * addr, pfe_drv_id_t owner)
{
  int32_t hash;
  const struct pfe_mac_addr_db_entry_t * entry;
  errno_t ret;
  uint32_t slot;
  oal_mutex_t * _1;
  unsigned char _2;
  unsigned int _3;
  unsigned int _4;
  unsigned int _5;
  unsigned char _6;
  unsigned int _7;
  long unsigned int _8;
  long unsigned int hash.1_9;
  unsigned int _10;
  long unsigned int hash.2_11;
  unsigned char _12;
  unsigned int _13;
  unsigned char _14;
  unsigned char _15;
  unsigned int _16;
  unsigned char _17;
  oal_mutex_t * _18;
  errno_t _44;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_22(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  entry_28 = pfe_emac_addr_db_find_by_addr (emac_22(D), addr_25(D), owner_26(D));
  # DEBUG entry => entry_28
  # DEBUG BEGIN_STMT
  if (entry_28 != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  ret_42 = 116;
  # DEBUG ret => ret_42
  goto <bb 15>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  slot_29 = 0;
  # DEBUG slot => slot_29
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _2 = emac_22(D)->mac_addr_slots;
  _3 = (unsigned int) _2;
  _4 = _3 >> slot_19;
  _5 = _4 & 1;
  if (_5 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  slot_30 = slot_19 + 1;
  # DEBUG slot => slot_30

  <bb 7> :
  # slot_19 = PHI <slot_29(4), slot_30(6)>
  # DEBUG slot => slot_19
  # DEBUG BEGIN_STMT
  if (slot_19 <= 7)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  if (slot_19 == 8)
    goto <bb 9>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _6 = pfe_emac_is_broad (addr_25(D));
  if (_6 != 0)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  ret_41 = 22;
  # DEBUG ret => ret_41
  goto <bb 15>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _7 = emac_22(D)->emac_base_va;
  _8 = pfe_emac_cfg_get_hash (_7, addr_25(D));
  hash_37 = (int32_t) _8;
  # DEBUG hash => hash_37
  # DEBUG BEGIN_STMT
  hash.1_9 = (long unsigned int) hash_37;
  ret_39 = pfe_emac_addr_db_add (emac_22(D), addr_25(D), 1, hash.1_9, owner_26(D));
  # DEBUG ret => ret_39
  # DEBUG BEGIN_STMT
  if (ret_39 == 0)
    goto <bb 12>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _10 = emac_22(D)->emac_base_va;
  hash.2_11 = (long unsigned int) hash_37;
  pfe_emac_cfg_set_hash_group (_10, hash.2_11, 1);
  goto <bb 15>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  ret_32 = pfe_emac_addr_db_add (emac_22(D), addr_25(D), 0, slot_19, owner_26(D));
  # DEBUG ret => ret_32
  # DEBUG BEGIN_STMT
  if (ret_32 == 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  _12 = emac_22(D)->mac_addr_slots;
  _13 = 1 << slot_19;
  _14 = (unsigned char) _13;
  _15 = _12 | _14;
  emac_22(D)->mac_addr_slots = _15;
  # DEBUG BEGIN_STMT
  _16 = emac_22(D)->emac_base_va;
  _17 = (unsigned char) slot_19;
  pfe_emac_cfg_write_addr_slot (_16, addr_25(D), _17);

  <bb 15> :
  # ret_20 = PHI <ret_42(3), ret_39(11), ret_32(13), ret_32(14), ret_41(10), ret_39(12)>
  # DEBUG ret => ret_20
  # DEBUG BEGIN_STMT
  _18 = &emac_22(D)->mutex;
  oal_mutex_unlock (_18);
  # DEBUG BEGIN_STMT
  _44 = ret_20;
  return _44;

}


pfe_emac_del_addr_nolock (struct pfe_emac_t * emac, const uint8_t * addr, pfe_drv_id_t owner)
{
  uint8_t zero_addr[6];
  errno_t ret;
  struct pfe_mac_addr_db_entry_t local_entry;
  struct pfe_mac_addr_db_entry_t * entry;
  unsigned char _1;
  long unsigned int _2;
  struct pfe_mac_addr_db_entry_t * _3;
  unsigned int _4;
  long unsigned int _5;
  unsigned int _6;
  unsigned char _7;
  unsigned char _8;
  unsigned char _9;
  int _10;
  unsigned int _11;
  unsigned char _12;
  unsigned char _13;
  unsigned char _14;
  errno_t _35;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  entry_22 = pfe_emac_addr_db_find_by_addr (emac_18(D), addr_19(D), owner_20(D));
  # DEBUG entry => entry_22
  # DEBUG BEGIN_STMT
  if (entry_22 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  ret_34 = 2;
  # DEBUG ret => ret_34
  goto <bb 9>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  local_entry = *entry_22;
  # DEBUG BEGIN_STMT
  ret_25 = pfe_emac_addr_db_del_entry (emac_18(D), entry_22);
  # DEBUG ret => ret_25
  # DEBUG BEGIN_STMT
  if (ret_25 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  oal_mm_free (entry_22);
  # DEBUG BEGIN_STMT
  entry_27 = 0B;
  # DEBUG entry => entry_27
  # DEBUG BEGIN_STMT
  _1 = local_entry.in_hash_grp;
  if (_1 == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = local_entry.hash;
  _3 = pfe_emac_addr_db_find_by_hash (emac_18(D), _2);
  if (_3 != 0B)
    goto <bb 9>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _4 = emac_18(D)->emac_base_va;
  _5 = local_entry.hash;
  pfe_emac_cfg_set_hash_group (_4, _5, 0);
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  memset (&zero_addr, 0, 6);
  # DEBUG BEGIN_STMT
  _6 = emac_18(D)->emac_base_va;
  _7 = local_entry.addr_slot_idx;
  pfe_emac_cfg_write_addr_slot (_6, &zero_addr, _7);
  # DEBUG BEGIN_STMT
  _8 = emac_18(D)->mac_addr_slots;
  _9 = local_entry.addr_slot_idx;
  _10 = (int) _9;
  _11 = 1 << _10;
  _12 = (unsigned char) _11;
  _13 = ~_12;
  _14 = _8 & _13;
  emac_18(D)->mac_addr_slots = _14;
  zero_addr ={v} {CLOBBER};

  <bb 9> :
  # ret_15 = PHI <ret_34(3), ret_25(4), ret_25(7), ret_25(8), ret_25(6)>
  # DEBUG ret => ret_15
  # DEBUG BEGIN_STMT
  _35 = ret_15;
  local_entry ={v} {CLOBBER};
  return _35;

}


pfe_emac_del_addr (struct pfe_emac_t * emac, const uint8_t * addr, pfe_drv_id_t owner)
{
  errno_t ret;
  oal_mutex_t * _1;
  oal_mutex_t * _2;
  errno_t _11;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_3(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  ret_9 = pfe_emac_del_addr_nolock (emac_3(D), addr_6(D), owner_7(D));
  # DEBUG ret => ret_9
  # DEBUG BEGIN_STMT
  _2 = &emac_3(D)->mutex;
  oal_mutex_unlock (_2);
  # DEBUG BEGIN_STMT
  _11 = ret_9;
  return _11;

}


pfe_emac_flush_mac_addrs (struct pfe_emac_t * emac, pfe_emac_crit_t crit, pfe_mac_type_t type, pfe_drv_id_t owner)
{
  uint8_t addr[6];
  errno_t ret;
  struct LLIST_t * tmp_item;
  struct LLIST_t * item;
  const struct pfe_mac_addr_db_entry_t * entry;
  oal_mutex_t * _1;
  int _2;
  <unnamed type> _3;
  const uint8_t[6] * _4;
  unsigned char _5;
  const uint8_t[6] * _6;
  <unnamed type> _7;
  struct LLIST_t * _8;
  oal_mutex_t * _9;
  errno_t _36;

  <bb 2> :
  # DEBUG BEGIN_STMT
  entry_18 = 0B;
  # DEBUG entry => entry_18
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_19 = 0;
  # DEBUG ret => ret_19
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_20(D)->mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  item_23 = emac_20(D)->mac_addr_list.prNext;
  # DEBUG item => item_23
  tmp_item_24 = item_23->prNext;
  # DEBUG tmp_item => tmp_item_24
  goto <bb 8>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = item_10 - 14B;
  entry_25 = (const struct pfe_mac_addr_db_entry_t *) _2;
  # DEBUG entry => entry_25
  # DEBUG BEGIN_STMT
  if (entry_25 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  _3 = entry_25->owner;
  if (owner_26(D) == _3)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = &entry_25->addr;
  MEM[(char * {ref-all})&addr] = MEM[(char * {ref-all})_4];
  # DEBUG BEGIN_STMT
  _5 = pfe_emac_flush_criterion_eval (entry_25, crit_28(D), type_29(D), owner_26(D));
  if (_5 == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _6 = &entry_25->addr;
  _7 = entry_25->owner;
  ret_32 = pfe_emac_del_addr_nolock (emac_20(D), _6, _7);
  # DEBUG ret => ret_32
  # DEBUG BEGIN_STMT
  if (ret_32 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # ret_12 = PHI <ret_13(3), ret_13(4), ret_32(6), ret_13(5)>
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  item_33 = tmp_item_11;
  # DEBUG item => item_33
  tmp_item_34 = tmp_item_11->prNext;
  # DEBUG tmp_item => tmp_item_34

  <bb 8> :
  # item_10 = PHI <item_23(2), item_33(7)>
  # tmp_item_11 = PHI <tmp_item_24(2), tmp_item_34(7)>
  # ret_13 = PHI <ret_19(2), ret_12(7)>
  # DEBUG ret => ret_13
  # DEBUG tmp_item => tmp_item_11
  # DEBUG item => item_10
  # DEBUG BEGIN_STMT
  _8 = &emac_20(D)->mac_addr_list;
  if (item_10 != _8)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  # ret_14 = PHI <ret_32(6), ret_13(8)>
  # DEBUG ret => ret_14
  # DEBUG BEGIN_STMT
  _9 = &emac_20(D)->mutex;
  oal_mutex_unlock (_9);
  # DEBUG BEGIN_STMT
  _36 = ret_14;
  addr ={v} {CLOBBER};
  return _36;

}


pfe_emac_set_link_duplex (const struct pfe_emac_t * emac, pfe_emac_duplex_t duplex)
{
  errno_t ret;
  unsigned int _1;
  errno_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  ret_6 = pfe_emac_cfg_set_duplex (_1, duplex_4(D));
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  _7 = ret_6;
  return _7;

}


pfe_emac_set_link_speed (const struct pfe_emac_t * emac, pfe_emac_speed_t link_speed)
{
  errno_t ret;
  unsigned int _1;
  errno_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  ret_6 = pfe_emac_cfg_set_speed (_1, link_speed_4(D));
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  _7 = ret_6;
  return _7;

}


pfe_emac_get_link_status (const struct pfe_emac_t * emac, pfe_emac_link_speed_t * link_speed, pfe_emac_duplex_t * duplex, bool_t * link)
{
  errno_t ret;
  unsigned int _1;
  errno_t _9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  ret_8 = pfe_emac_cfg_get_link_status (_1, link_speed_4(D), duplex_5(D), link_6(D));
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _9 = ret_8;
  return _9;

}


pfe_emac_get_link_config (const struct pfe_emac_t * emac, pfe_emac_speed_t * speed, pfe_emac_duplex_t * duplex)
{
  errno_t ret;
  unsigned int _1;
  errno_t _8;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  ret_7 = pfe_emac_cfg_get_link_config (_1, speed_4(D), duplex_5(D));
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _8 = ret_7;
  return _8;

}


pfe_emac_get_mii_mode (const struct pfe_emac_t * emac)
{
  pfe_emac_mii_mode_t mii_mode;
  pfe_emac_mii_mode_t _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  mii_mode_3 = emac_2(D)->mode;
  # DEBUG mii_mode => mii_mode_3
  # DEBUG BEGIN_STMT
  _4 = mii_mode_3;
  return _4;

}


pfe_emac_set_max_frame_length (const struct pfe_emac_t * emac, uint32_t len)
{
  errno_t ret;
  unsigned int _1;
  errno_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  ret_6 = pfe_emac_cfg_set_max_frame_length (_1, len_4(D));
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = ret_6;
  return _7;

}


pfe_emac_disable_rx_flow_control (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_rx_flow_control (_1, 0);
  return;

}


pfe_emac_enable_rx_flow_control (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_rx_flow_control (_1, 1);
  return;

}


pfe_emac_disable_tx_flow_control (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_tx_flow_control (_1, 0);
  return;

}


pfe_emac_enable_tx_flow_control (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_tx_flow_control (_1, 1);
  return;

}


pfe_emac_get_flow_control (const struct pfe_emac_t * emac, bool_t * tx_enable, bool_t * rx_enable)
{
  unsigned int _1;
  unsigned int _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_4(D)->emac_base_va;
  pfe_emac_cfg_get_tx_flow_control (_1, tx_enable_5(D));
  # DEBUG BEGIN_STMT
  _2 = emac_4(D)->emac_base_va;
  pfe_emac_cfg_get_rx_flow_control (_2, rx_enable_7(D));
  return;

}


pfe_emac_disable_broadcast (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_broadcast (_1, 0);
  return;

}


pfe_emac_enable_broadcast (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_broadcast (_1, 1);
  return;

}


pfe_emac_disable_allmulti_mode (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_allmulti_mode (_1, 0);
  return;

}


pfe_emac_enable_allmulti_mode (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_allmulti_mode (_1, 1);
  return;

}


pfe_emac_disable_promisc_mode (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_promisc_mode (_1, 0);
  return;

}


pfe_emac_enable_promisc_mode (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_promisc_mode (_1, 1);
  return;

}


pfe_emac_disable_loopback (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_loopback (_1, 0);
  return;

}


pfe_emac_enable_loopback (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_loopback (_1, 1);
  return;

}


pfe_emac_set_ts_time (struct pfe_emac_t * emac, uint32_t sec, uint32_t nsec, uint16_t sec_hi)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned int _2;
  oal_mutex_t * _3;
  errno_t _13;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_4(D)->ts_mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_4(D)->emac_base_va;
  ret_11 = pfe_emac_cfg_set_ts_time (_2, sec_7(D), nsec_8(D), sec_hi_9(D));
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  _3 = &emac_4(D)->ts_mutex;
  oal_mutex_unlock (_3);
  # DEBUG BEGIN_STMT
  _13 = ret_11;
  return _13;

}


pfe_emac_adjust_ts_time (struct pfe_emac_t * emac, uint32_t sec, uint32_t nsec, bool_t sgn)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned int _2;
  oal_mutex_t * _3;
  errno_t _13;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_4(D)->ts_mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_4(D)->emac_base_va;
  ret_11 = pfe_emac_cfg_adjust_ts_time (_2, sec_7(D), nsec_8(D), sgn_9(D));
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  _3 = &emac_4(D)->ts_mutex;
  oal_mutex_unlock (_3);
  # DEBUG BEGIN_STMT
  _13 = ret_11;
  return _13;

}


pfe_emac_get_ts_time (struct pfe_emac_t * emac, uint32_t * sec, uint32_t * nsec, uint16_t * sec_hi)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned int _2;
  oal_mutex_t * _3;
  errno_t _16;

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

  <bb 3> :
  if (nsec_7(D) == 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  if (sec_hi_8(D) == 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->ts_mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_9(D)->emac_base_va;
  pfe_emac_cfg_get_ts_time (_2, sec_6(D), nsec_7(D), sec_hi_8(D));
  # DEBUG BEGIN_STMT
  _3 = &emac_9(D)->ts_mutex;
  oal_mutex_unlock (_3);
  # DEBUG BEGIN_STMT
  ret_14 = 0;
  # DEBUG ret => ret_14

  <bb 7> :
  # ret_4 = PHI <ret_15(5), ret_14(6)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  _16 = ret_4;
  return _16;

}


pfe_emac_get_ts_freq_adjustment (struct pfe_emac_t * emac, uint32_t * ppb, bool_t * sgn)
{
  errno_t ret;
  oal_mutex_t * _1;
  long unsigned int _2;
  unsigned char _3;
  oal_mutex_t * _4;
  errno_t _17;

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

  <bb 3> :
  if (sgn_8(D) == 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _1 = &emac_9(D)->ts_mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_9(D)->adj_ppb;
  *ppb_7(D) = _2;
  # DEBUG BEGIN_STMT
  _3 = emac_9(D)->adj_sign;
  *sgn_8(D) = _3;
  # DEBUG BEGIN_STMT
  _4 = &emac_9(D)->ts_mutex;
  oal_mutex_unlock (_4);
  # DEBUG BEGIN_STMT
  ret_15 = 0;
  # DEBUG ret => ret_15

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

}


pfe_emac_set_ts_freq_adjustment (struct pfe_emac_t * emac, uint32_t ppb, bool_t sgn)
{
  errno_t ret;
  oal_mutex_t * _1;
  unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  oal_mutex_t * _5;
  errno_t _16;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_6(D)->ts_mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  emac_6(D)->adj_ppb = ppb_9(D);
  # DEBUG BEGIN_STMT
  emac_6(D)->adj_sign = sgn_11(D);
  # DEBUG BEGIN_STMT
  _2 = emac_6(D)->emac_base_va;
  _3 = emac_6(D)->i_clk_hz;
  _4 = emac_6(D)->o_clk_hz;
  ret_14 = pfe_emac_cfg_adjust_ts_freq (_2, _3, _4, ppb_9(D), sgn_11(D));
  # DEBUG ret => ret_14
  # DEBUG BEGIN_STMT
  _5 = &emac_6(D)->ts_mutex;
  oal_mutex_unlock (_5);
  # DEBUG BEGIN_STMT
  _16 = ret_14;
  return _16;

}


pfe_emac_enable_ts (struct pfe_emac_t * emac, uint32_t i_clk_hz, uint32_t o_clk_hz)
{
  bool_t eclk;
  errno_t ret;
  oal_mutex_t * _1;
  unsigned int _2;
  oal_mutex_t * _3;
  int iftmp.0_5;
  int iftmp.0_9;
  int iftmp.0_10;
  errno_t _21;

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

  <bb 3> :
  if (o_clk_hz_8(D) == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  iftmp.0_10 = 1;
  goto <bb 6>; [INV]

  <bb 5> :
  iftmp.0_9 = 0;

  <bb 6> :
  # iftmp.0_5 = PHI <iftmp.0_10(4), iftmp.0_9(5)>
  eclk_11 = (bool_t) iftmp.0_5;
  # DEBUG eclk => eclk_11
  # DEBUG BEGIN_STMT
  if (eclk_11 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 7> :
  if (i_clk_hz_7(D) <= o_clk_hz_8(D))
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_12 = 22;
  # DEBUG ret => ret_12
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  emac_14(D)->i_clk_hz = i_clk_hz_7(D);
  # DEBUG BEGIN_STMT
  emac_14(D)->o_clk_hz = o_clk_hz_8(D);
  # DEBUG BEGIN_STMT
  _1 = &emac_14(D)->ts_mutex;
  oal_mutex_lock (_1);
  # DEBUG BEGIN_STMT
  _2 = emac_14(D)->emac_base_va;
  ret_19 = pfe_emac_cfg_enable_ts (_2, eclk_11, i_clk_hz_7(D), o_clk_hz_8(D));
  # DEBUG ret => ret_19
  # DEBUG BEGIN_STMT
  _3 = &emac_14(D)->ts_mutex;
  oal_mutex_unlock (_3);

  <bb 10> :
  # ret_4 = PHI <ret_12(8), ret_19(9)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  _21 = ret_4;
  return _21;

}


pfe_emac_disable (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_enable (_1, 0);
  return;

}


pfe_emac_enable (const struct pfe_emac_t * emac)
{
  unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = emac_3(D)->emac_base_va;
  pfe_emac_cfg_set_enable (_1, 1);
  return;

}


pfe_emac_get_gpi (const struct pfe_emac_t * emac)
{
  struct pfe_gpi_t * _3;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _3 = emac_2(D)->gpi;
  return _3;

}


pfe_emac_bind_gpi (struct pfe_emac_t * emac, struct pfe_gpi_t * gpi)
{
  errno_t ret;
  errno_t _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  emac_2(D)->gpi = gpi_3(D);
  # DEBUG BEGIN_STMT
  ret_5 = 0;
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  _6 = ret_5;
  return _6;

}


pfe_emac_get_index (const struct pfe_emac_t * emac)
{
  uint8_t emac_idx;
  unsigned int _1;
  unsigned int _2;
  uint8_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_4(D)->emac_base_va;
  _2 = emac_4(D)->cbus_base_va;
  emac_idx_6 = pfe_emac_cfg_get_index (_1, _2);
  # DEBUG emac_idx => emac_idx_6
  # DEBUG BEGIN_STMT
  _7 = emac_idx_6;
  return _7;

}


pfe_emac_create (addr_t cbus_base_va, addr_t emac_base, pfe_emac_mii_mode_t mode, pfe_emac_speed_t speed, pfe_emac_duplex_t duplex, uint32_t emac_index)
{
  struct pfe_emac_t * emac;
  _Bool _1;
  long int _2;
  long int _3;
  unsigned int _4;
  unsigned int _5;
  unsigned int _6;
  oal_mutex_t * _7;
  oal_mutex_t * _8;
  oal_mutex_t * _9;
  unsigned int _10;
  int _11;
  oal_mutex_t * _12;
  oal_mutex_t * _13;
  struct pfe_emac_t * _55;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_index_17(D) > 2;
  _2 = (long int) _1;
  _3 = __builtin_expect (_2, 0);
  if (_3 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  emac_54 = 0B;
  # DEBUG emac => emac_54
  goto <bb 12>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  emac_18 = &emac_instance[emac_index_17(D)];
  # DEBUG emac => emac_18
  # DEBUG BEGIN_STMT
  memset (emac_18, 0, 56);
  # DEBUG BEGIN_STMT
  emac_18->cbus_base_va = cbus_base_va_21(D);
  # DEBUG BEGIN_STMT
  emac_18->emac_base_offset = emac_base_23(D);
  # DEBUG BEGIN_STMT
  _4 = emac_18->cbus_base_va;
  _5 = emac_18->emac_base_offset;
  _6 = _4 + _5;
  emac_18->emac_base_va = _6;
  # DEBUG BEGIN_STMT
  emac_18->mode = 0;
  # DEBUG BEGIN_STMT
  emac_18->speed = 0;
  # DEBUG BEGIN_STMT
  emac_18->duplex = 0;
  # DEBUG BEGIN_STMT
  if (emac_base_23(D) == 655360)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  emac_18->mutex = 161;
  # DEBUG BEGIN_STMT
  emac_18->ts_mutex = 164;
  goto <bb 9>; [INV]

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  emac_18->mutex = 162;
  # DEBUG BEGIN_STMT
  emac_18->ts_mutex = 165;
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  emac_18->mutex = 163;
  # DEBUG BEGIN_STMT
  emac_18->ts_mutex = 166;

  <bb 9> :
  # DEBUG BEGIN_STMT
  _7 = &emac_18->mutex;
  oal_mutex_init (_7);
  # DEBUG BEGIN_STMT
  _8 = &emac_18->ts_mutex;
  oal_mutex_init (_8);
  # DEBUG BEGIN_STMT
  _9 = &emac_18->mutex;
  oal_mutex_lock (_9);
  # DEBUG BEGIN_STMT
  emac_18->mac_addr_slots = 0;
  # DEBUG BEGIN_STMT
  pfe_emac_addr_db_init (emac_18);
  # DEBUG BEGIN_STMT
  pfe_emac_disable (emac_18);
  # DEBUG BEGIN_STMT
  _10 = emac_18->emac_base_va;
  _11 = pfe_emac_cfg_init (_10, mode_41(D), speed_42(D), duplex_43(D));
  if (_11 != 0)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _12 = &emac_18->mutex;
  oal_mutex_unlock (_12);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  emac_53 = 0B;
  # DEBUG emac => emac_53
  goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  emac_18->mode = mode_41(D);
  # DEBUG BEGIN_STMT
  emac_18->speed = speed_42(D);
  # DEBUG BEGIN_STMT
  emac_18->duplex = duplex_43(D);
  # DEBUG BEGIN_STMT
  pfe_emac_disable_loopback (emac_18);
  # DEBUG BEGIN_STMT
  pfe_emac_disable_promisc_mode (emac_18);
  # DEBUG BEGIN_STMT
  pfe_emac_disable_broadcast (emac_18);
  # DEBUG BEGIN_STMT
  _13 = &emac_18->mutex;
  oal_mutex_unlock (_13);

  <bb 12> :
  # emac_14 = PHI <emac_54(3), emac_53(10), emac_18(11)>
  # DEBUG emac => emac_14
  # DEBUG BEGIN_STMT
  _55 = emac_14;
  return _55;

}


pfe_emac_addr_db_find_by_slot (const struct pfe_emac_t * emac, uint8_t slot)
{
  struct LLIST_t * curItem;
  bool_t match;
  struct pfe_mac_addr_db_entry_t * entry;
  int _1;
  unsigned char _2;
  const struct LLIST_t * _3;
  struct pfe_mac_addr_db_entry_t * _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  entry_9 = 0B;
  # DEBUG entry => entry_9
  # DEBUG BEGIN_STMT
  match_10 = 0;
  # DEBUG match => match_10
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  curItem_13 = emac_12(D)->mac_addr_list.prNext;
  # DEBUG curItem => curItem_13
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = curItem_8 - 14B;
  entry_14 = (struct pfe_mac_addr_db_entry_t *) _1;
  # DEBUG entry => entry_14
  # DEBUG BEGIN_STMT
  _2 = entry_14->addr_slot_idx;
  if (slot_15(D) == _2)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  match_17 = 1;
  # DEBUG match => match_17
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  curItem_16 = curItem_8->prNext;
  # DEBUG curItem => curItem_16

  <bb 6> :
  # entry_4 = PHI <entry_9(2), entry_14(5)>
  # curItem_8 = PHI <curItem_13(2), curItem_16(5)>
  # DEBUG curItem => curItem_8
  # DEBUG entry => entry_4
  # DEBUG BEGIN_STMT
  _3 = &emac_12(D)->mac_addr_list;
  if (curItem_8 != _3)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # entry_5 = PHI <entry_14(4), entry_4(6)>
  # match_7 = PHI <match_17(4), match_10(6)>
  # DEBUG match => match_7
  # DEBUG entry => entry_5
  # DEBUG BEGIN_STMT
  if (match_7 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  entry_18 = 0B;
  # DEBUG entry => entry_18

  <bb 9> :
  # entry_6 = PHI <entry_5(7), entry_18(8)>
  # DEBUG entry => entry_6
  # DEBUG BEGIN_STMT
  _19 = entry_6;
  return _19;

}


pfe_emac_addr_db_find_by_hash (const struct pfe_emac_t * emac, uint32_t hash)
{
  bool_t match;
  struct LLIST_t * curItem;
  struct pfe_mac_addr_db_entry_t * entry;
  int _1;
  long unsigned int _2;
  const struct LLIST_t * _3;
  struct pfe_mac_addr_db_entry_t * _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  entry_9 = 0B;
  # DEBUG entry => entry_9
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match_10 = 0;
  # DEBUG match => match_10
  # DEBUG BEGIN_STMT
  curItem_13 = emac_12(D)->mac_addr_list.prNext;
  # DEBUG curItem => curItem_13
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = curItem_7 - 14B;
  entry_14 = (struct pfe_mac_addr_db_entry_t *) _1;
  # DEBUG entry => entry_14
  # DEBUG BEGIN_STMT
  _2 = entry_14->hash;
  if (hash_15(D) == _2)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  match_17 = 1;
  # DEBUG match => match_17
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  curItem_16 = curItem_7->prNext;
  # DEBUG curItem => curItem_16

  <bb 6> :
  # entry_4 = PHI <entry_9(2), entry_14(5)>
  # curItem_7 = PHI <curItem_13(2), curItem_16(5)>
  # DEBUG curItem => curItem_7
  # DEBUG entry => entry_4
  # DEBUG BEGIN_STMT
  _3 = &emac_12(D)->mac_addr_list;
  if (curItem_7 != _3)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # entry_5 = PHI <entry_14(4), entry_4(6)>
  # match_8 = PHI <match_17(4), match_10(6)>
  # DEBUG match => match_8
  # DEBUG entry => entry_5
  # DEBUG BEGIN_STMT
  if (match_8 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  entry_18 = 0B;
  # DEBUG entry => entry_18

  <bb 9> :
  # entry_6 = PHI <entry_5(7), entry_18(8)>
  # DEBUG entry => entry_6
  # DEBUG BEGIN_STMT
  _19 = entry_6;
  return _19;

}


pfe_emac_addr_db_get_first (const struct pfe_emac_t * emac)
{
  struct pfe_mac_addr_db_entry_t * db_entry;
  struct LLIST_Struct * _1;
  const struct LLIST_t * _2;
  struct LLIST_Struct * _3;
  int _4;
  struct pfe_mac_addr_db_entry_t * _10;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = emac_7(D)->mac_addr_list.prNext;
  _2 = &emac_7(D)->mac_addr_list;
  if (_1 == _2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = emac_7(D)->mac_addr_list.prNext;
  _4 = _3 - 14B;
  db_entry_8 = (struct pfe_mac_addr_db_entry_t *) _4;
  # DEBUG db_entry => db_entry_8

  <bb 5> :
  # db_entry_5 = PHI <db_entry_9(3), db_entry_8(4)>
  # DEBUG db_entry => db_entry_5
  # DEBUG BEGIN_STMT
  _10 = db_entry_5;
  return _10;

}


pfe_emac_addr_db_find_by_addr (const struct pfe_emac_t * emac, const uint8_t * addr, pfe_drv_id_t owner)
{
  bool_t match;
  struct LLIST_t * curItem;
  struct pfe_mac_addr_db_entry_t * entry;
  int _1;
  <unnamed type> _2;
  uint8_t[6] * _3;
  int _4;
  const struct LLIST_t * _5;
  struct pfe_mac_addr_db_entry_t * _22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  entry_11 = 0B;
  # DEBUG entry => entry_11
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match_12 = 0;
  # DEBUG match => match_12
  # DEBUG BEGIN_STMT
  curItem_15 = emac_14(D)->mac_addr_list.prNext;
  # DEBUG curItem => curItem_15
  goto <bb 7>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = curItem_9 - 14B;
  entry_16 = (struct pfe_mac_addr_db_entry_t *) _1;
  # DEBUG entry => entry_16
  # DEBUG BEGIN_STMT
  _2 = entry_16->owner;
  if (owner_17(D) == _2)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 4> :
  _3 = &entry_16->addr;
  _4 = memcmp (addr_18(D), _3, 6);
  if (_4 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  match_19 = 1;
  # DEBUG match => match_19
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  curItem_20 = curItem_9->prNext;
  # DEBUG curItem => curItem_20

  <bb 7> :
  # entry_6 = PHI <entry_11(2), entry_16(6)>
  # curItem_9 = PHI <curItem_15(2), curItem_20(6)>
  # DEBUG curItem => curItem_9
  # DEBUG entry => entry_6
  # DEBUG BEGIN_STMT
  _5 = &emac_14(D)->mac_addr_list;
  if (curItem_9 != _5)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # entry_7 = PHI <entry_16(5), entry_6(7)>
  # match_10 = PHI <match_19(5), match_12(7)>
  # DEBUG match => match_10
  # DEBUG entry => entry_7
  # DEBUG BEGIN_STMT
  if (match_10 == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  entry_21 = 0B;
  # DEBUG entry => entry_21

  <bb 10> :
  # entry_8 = PHI <entry_7(8), entry_21(9)>
  # DEBUG entry => entry_8
  # DEBUG BEGIN_STMT
  _22 = entry_8;
  return _22;

}


pfe_emac_addr_db_drop_all (const struct pfe_emac_t * emac)
{
  struct LLIST_t * tmp_item;
  struct LLIST_t * curItem;
  struct pfe_mac_addr_db_entry_t * entry;
  int _1;
  struct LLIST_Struct * _2;
  struct LLIST_Struct * _3;
  struct LLIST_Struct * _4;
  struct LLIST_Struct * _5;
  const struct LLIST_t * _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  curItem_12 = emac_11(D)->mac_addr_list.prNext;
  # DEBUG curItem => curItem_12
  tmp_item_13 = curItem_12->prNext;
  # DEBUG tmp_item => tmp_item_13
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = curItem_7 - 14B;
  entry_14 = (struct pfe_mac_addr_db_entry_t *) _1;
  # DEBUG entry => entry_14
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = entry_14->iterator.prPrev;
  _3 = entry_14->iterator.prNext;
  _2->prNext = _3;
  # DEBUG BEGIN_STMT
  _4 = entry_14->iterator.prNext;
  _5 = entry_14->iterator.prPrev;
  _4->prPrev = _5;
  # DEBUG BEGIN_STMT
  entry_14->iterator.prPrev = 0B;
  # DEBUG BEGIN_STMT
  entry_14->iterator.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (entry_14);
  # DEBUG BEGIN_STMT
  curItem_20 = tmp_item_8;
  # DEBUG curItem => curItem_20
  tmp_item_21 = tmp_item_8->prNext;
  # DEBUG tmp_item => tmp_item_21

  <bb 4> :
  # curItem_7 = PHI <curItem_12(2), curItem_20(3)>
  # tmp_item_8 = PHI <tmp_item_13(2), tmp_item_21(3)>
  # DEBUG tmp_item => tmp_item_8
  # DEBUG curItem => curItem_7
  # DEBUG BEGIN_STMT
  _6 = &emac_11(D)->mac_addr_list;
  if (curItem_7 != _6)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  return;

}


pfe_emac_addr_db_del_entry (const struct pfe_emac_t * emac, struct pfe_mac_addr_db_entry_t * entry)
{
  errno_t ret;
  struct LLIST_Struct * _1;
  struct LLIST_Struct * _2;
  struct LLIST_Struct * _3;
  struct LLIST_Struct * _4;
  errno_t _12;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = entry_6(D)->iterator.prPrev;
  _2 = entry_6(D)->iterator.prNext;
  _1->prNext = _2;
  # DEBUG BEGIN_STMT
  _3 = entry_6(D)->iterator.prNext;
  _4 = entry_6(D)->iterator.prPrev;
  _3->prPrev = _4;
  # DEBUG BEGIN_STMT
  entry_6(D)->iterator.prPrev = 0B;
  # DEBUG BEGIN_STMT
  entry_6(D)->iterator.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_11 = 0;
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  _12 = ret_11;
  return _12;

}


pfe_emac_addr_db_add (struct pfe_emac_t * emac, const uint8_t * addr, bool_t in_hash_grp, uint32_t data, pfe_drv_id_t owner)
{
  errno_t ret;
  struct pfe_mac_addr_db_entry_t * entry;
  unsigned char _1;
  uint8_t[6] * _2;
  struct LLIST_Struct * _3;
  struct LLIST_t * _4;
  struct LLIST_Struct * _5;
  struct LLIST_t * _6;
  struct LLIST_t * _7;
  errno_t _31;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  entry_13 = oal_mm_malloc (24);
  # DEBUG entry => entry_13
  # DEBUG BEGIN_STMT
  if (entry_13 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  entry_13->hash = data_15(D);
  # DEBUG BEGIN_STMT
  entry_13->in_hash_grp = 1;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _1 = (unsigned char) data_15(D);
  entry_13->addr_slot_idx = _1;
  # DEBUG BEGIN_STMT
  entry_13->in_hash_grp = 0;

  <bb 7> :
  # DEBUG BEGIN_STMT
  entry_13->owner = owner_20(D);
  # DEBUG BEGIN_STMT
  _2 = &entry_13->addr;
  memcpy (_2, addr_22(D), 6);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = emac_24(D)->mac_addr_list.prPrev;
  entry_13->iterator.prPrev = _3;
  # DEBUG BEGIN_STMT
  _4 = &emac_24(D)->mac_addr_list;
  entry_13->iterator.prNext = _4;
  # DEBUG BEGIN_STMT
  _5 = emac_24(D)->mac_addr_list.prPrev;
  _6 = &entry_13->iterator;
  _5->prNext = _6;
  # DEBUG BEGIN_STMT
  _7 = &entry_13->iterator;
  emac_24(D)->mac_addr_list.prPrev = _7;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_29 = 0;
  # DEBUG ret => ret_29

  <bb 8> :
  # ret_8 = PHI <ret_30(3), ret_29(7)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _31 = ret_8;
  return _31;

}


pfe_emac_addr_db_init (struct pfe_emac_t * emac)
{
  struct LLIST_t * _1;
  struct LLIST_t * _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &emac_3(D)->mac_addr_list;
  emac_3(D)->mac_addr_list.prNext = _1;
  # DEBUG BEGIN_STMT
  _2 = &emac_3(D)->mac_addr_list;
  emac_3(D)->mac_addr_list.prPrev = _2;
  # DEBUG BEGIN_STMT
  return;

}


pfe_emac_flush_criterion_eval (const struct pfe_mac_addr_db_entry_t * entry, pfe_emac_crit_t crit, pfe_mac_type_t type, pfe_drv_id_t owner)
{
  bool_t ret;
  <unnamed type> _1;
  const uint8_t[6] * _2;
  <unnamed type> _3;
  const uint8_t[6] * _4;
  bool_t _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_7 = 0;
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  if (crit_8(D) == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = entry_11(D)->owner;
  if (owner_12(D) == _1)
    goto <bb 4>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret_18 = 1;
  # DEBUG ret => ret_18
  goto <bb 12>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = &entry_11(D)->addr;
  ret_17 = pfe_emac_check_crit_by_type (_2, type_13(D));
  # DEBUG ret => ret_17
  goto <bb 12>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  if (crit_8(D) == 2)
    goto <bb 8>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _3 = entry_11(D)->owner;
  if (owner_12(D) == _3)
    goto <bb 9>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _4 = &entry_11(D)->addr;
  ret_15 = pfe_emac_check_crit_by_type (_4, type_13(D));
  # DEBUG ret => ret_15
  goto <bb 12>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  if (crit_8(D) == 3)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  ret_10 = 1;
  # DEBUG ret => ret_10

  <bb 12> :
  # ret_5 = PHI <ret_18(4), ret_17(6), ret_15(9), ret_7(10), ret_10(11), ret_7(3), ret_7(8)>
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _19 = ret_5;
  return _19;

}


pfe_emac_check_crit_by_type (const uint8_t * addr, pfe_mac_type_t type)
{
  bool_t ret;
  unsigned char _1;
  unsigned char _2;
  unsigned char _3;
  bool_t _17;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_9 = 0;
  # DEBUG ret => ret_9
  # DEBUG BEGIN_STMT
  if (type_10(D) == 3)
    goto <bb 9>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  if (type_10(D) == 1)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  _1 = pfe_emac_is_multi (addr_12(D));
  if (_1 == 1)
    goto <bb 9>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  if (type_10(D) == 2)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  _2 = pfe_emac_is_broad (addr_12(D));
  if (_2 == 1)
    goto <bb 9>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  if (type_10(D) == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 8> :
  _3 = pfe_emac_is_multi (addr_12(D));
  if (_3 == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  ret_16 = 1;
  # DEBUG ret => ret_16

  <bb 10> :
  # ret_4 = PHI <ret_9(7), ret_9(8), ret_16(9)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  _17 = ret_4;
  return _17;

}


pfe_emac_is_multi (const uint8_t * addr)
{
  unsigned char _1;
  unsigned char _2;
  unsigned int _3;
  unsigned int _4;
  bool_t _5;
  bool_t _9;
  bool_t _10;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = pfe_emac_is_broad (addr_7(D));
  if (_1 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  _2 = *addr_7(D);
  _3 = (unsigned int) _2;
  _4 = _3 & 1;
  if (_4 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _9 = 1;
  // predicted unlikely by early return (on trees) predictor.
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _10 = 0;
  // predicted unlikely by early return (on trees) predictor.

  <bb 6> :
  # _5 = PHI <_9(4), _10(5)>
  return _5;

}


pfe_emac_is_broad (const uint8_t * addr)
{
  unsigned char _1;
  const uint8_t * _2;
  unsigned char _3;
  unsigned char _4;
  const uint8_t * _5;
  unsigned char _6;
  unsigned char _7;
  const uint8_t * _8;
  unsigned char _9;
  unsigned char _10;
  const uint8_t * _11;
  unsigned char _12;
  unsigned char _13;
  const uint8_t * _14;
  unsigned char _15;
  unsigned char _16;
  bool_t _17;
  bool_t _20;
  bool_t _21;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = *addr_19(D);
  _2 = addr_19(D) + 1;
  _3 = *_2;
  _4 = _1 & _3;
  _5 = addr_19(D) + 2;
  _6 = *_5;
  _7 = _4 & _6;
  _8 = addr_19(D) + 3;
  _9 = *_8;
  _10 = _7 & _9;
  _11 = addr_19(D) + 4;
  _12 = *_11;
  _13 = _10 & _12;
  _14 = addr_19(D) + 5;
  _15 = *_14;
  _16 = _13 & _15;
  if (_16 == 255)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _21 = 1;
  // predicted unlikely by early return (on trees) predictor.
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _20 = 0;
  // predicted unlikely by early return (on trees) predictor.

  <bb 5> :
  # _17 = PHI <_21(3), _20(4)>
  return _17;

}


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 (*<T689>) (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 (*<T689>) (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;

}


