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

Symbols to be put in SSA form
{ D.11848 }
Incremental SSA update started at block: 0
Number of blocks in CFG: 9
Number of blocks to update: 8 ( 89%)


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

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


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

Symbols to be put in SSA form
{ D.11864 }
Incremental SSA update started at block: 0
Number of blocks in CFG: 7
Number of blocks to update: 6 ( 86%)


is_hif_by_id.constprop (pfe_ct_phy_if_id_t id, uint8_t * err051211_hif_idx)
{
  bool_t ret;
  uint8_t hif_idx;
  unsigned char _2;
  unsigned char _6;

  <bb 8> [local count: 1073741824]:

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = id_1(D) + 250;
  if (_2 <= 3)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:
<L0>:
  ret_3 = 0;
  hif_idx_4 = 0;
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870913]:
<L1>:
  ret_5 = 1;
  _6 = id_1(D) + 250;
  hif_idx_7 = _6;

  <bb 5> [local count: 1073741824]:
  # ret_10 = PHI <ret_3(3), ret_5(4)>
  # hif_idx_9 = PHI <hif_idx_4(3), hif_idx_7(4)>
<L2>:
<L3>:
  # DEBUG hif_idx => hif_idx_9
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  if (err051211_hif_idx_8(D) != 0B)
    goto <bb 6>; [70.00%]
  else
    goto <bb 7>; [30.00%]

  <bb 6> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  *err051211_hif_idx_8(D) = hif_idx_9;

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

}


pfe_tmu_init.constprop (const struct pfe_tmu_cfg_t * cfg)
{
  const struct pfe_tmu_t * tmu;
  unsigned int _1;

  <bb 3> [local count: 1073741824]:
  # DEBUG tmu => &tmu_instance

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  pfe_tmu_disable (&tmu_instance);
  # DEBUG BEGIN_STMT
  _1 = tmu_instance.cbus_base_va;
  pfe_tmu_cfg_init (_1, cfg_2(D));
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_check_scheduler.constprop (pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  const struct pfe_tmu_phy_cfg_t * pcfg;
  errno_t ret;
  const struct pfe_tmu_t * tmu;
  unsigned char _3;

  <bb 6> [local count: 1073741824]:
  # DEBUG D#2 s=> tmu
  # DEBUG tmu => D#2

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pcfg_2 = pfe_tmu_cfg_get_phy_config (phy_1(D));
  # DEBUG pcfg => pcfg_2
  # DEBUG BEGIN_STMT
  if (pcfg_2 == 0B)
    goto <bb 5>; [18.75%]
  else
    goto <bb 3>; [81.25%]

  <bb 3> [local count: 872415233]:
  # DEBUG BEGIN_STMT
  _3 = pcfg_2->sch_cnt;
  if (_3 <= sch_4(D))
    goto <bb 5>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 567069902]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0

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

}


pfe_tmu_queue_get_wred_zones.part.0 (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue)
{
  uint8_t ret;
  unsigned int _2;

  <bb 4> [local count: 1073741824]:

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _2 = tmu_1(D)->cbus_base_va;
  ret_5 = pfe_tmu_q_get_wred_zones (_2, phy_3(D), queue_4(D));
  # DEBUG ret => ret_5

  <bb 3> [local count: 1073741824]:
  # ret_6 = PHI <ret_5(2)>
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  return ret_6;

}


pfe_tmu_queue_get_mode.part.0 (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * min, uint32_t * max)
{
  pfe_tmu_queue_mode_t ret;
  unsigned int _2;

  <bb 4> [local count: 1073741824]:

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _2 = tmu_1(D)->cbus_base_va;
  ret_7 = pfe_tmu_q_get_mode (_2, phy_3(D), queue_4(D), min_5(D), max_6(D));
  # DEBUG ret => ret_7

  <bb 3> [local count: 1073741824]:
  # ret_8 = PHI <ret_7(2)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  return ret_8;

}


pfe_tmu_sch_get_bound_queue (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input)
{
  uint8_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_sch_cfg_get_bound_queue (_2, phy_7(D), sch_8(D), input_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_sch_bind_queue (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input, uint8_t queue)
{
  errno_t ret;
  int _1;
  int _2;
  unsigned int _3;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_7(D), phy_8(D), sch_9(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 6>; [52.23%]

  <bb 3> [local count: 512926468]:
  _2 = pfe_tmu_check_queue (tmu_7(D), phy_8(D), queue_11(D));
  if (_2 == 0)
    goto <bb 4>; [47.77%]
  else
    goto <bb 6>; [52.23%]

  <bb 4> [local count: 245024974]:
  # DEBUG BEGIN_STMT
  _3 = tmu_7(D)->cbus_base_va;
  ret_15 = pfe_tmu_sch_cfg_bind_queue (_3, phy_8(D), sch_9(D), input_13(D), queue_11(D));
  # DEBUG ret => ret_15

  <bb 6> [local count: 1073741824]:
  # ret_4 = PHI <ret_15(4), 22(3), 22(2)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


pfe_tmu_sch_get_bound_sch_output (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input)
{
  uint8_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_sch_cfg_get_bound_sched_output (_2, phy_7(D), sch_8(D), input_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_sch_bind_sch_output (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t src_sch, uint8_t dst_sch, uint8_t input)
{
  errno_t ret;
  int _1;
  int _2;
  unsigned int _3;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_7(D), phy_8(D), src_sch_9(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 6>; [52.23%]

  <bb 3> [local count: 512926468]:
  _2 = pfe_tmu_check_scheduler (tmu_7(D), phy_8(D), dst_sch_11(D));
  if (_2 == 0)
    goto <bb 4>; [47.77%]
  else
    goto <bb 6>; [52.23%]

  <bb 4> [local count: 245024974]:
  # DEBUG BEGIN_STMT
  _3 = tmu_7(D)->cbus_base_va;
  ret_15 = pfe_tmu_sch_cfg_bind_sched_output (_3, phy_8(D), src_sch_9(D), dst_sch_11(D), input_13(D));
  # DEBUG ret => ret_15

  <bb 6> [local count: 1073741824]:
  # ret_4 = PHI <ret_15(4), 22(3), 22(2)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


pfe_tmu_sch_get_input_weight (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input)
{
  uint32_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_sch_cfg_get_input_weight (_2, phy_7(D), sch_8(D), input_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_sch_set_input_weight (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input, uint32_t weight)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_13 = pfe_tmu_sch_cfg_set_input_weight (_2, phy_7(D), sch_8(D), input_10(D), weight_11(D));
  # DEBUG ret => ret_13

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_13(3), 22(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_sch_get_input_cnt (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  uint8_t ret;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_5(D), phy_6(D), sch_7(D));
  if (_1 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  ret_10 = pfe_tmu_queue_get_cnt (tmu_5(D), phy_6(D));
  # DEBUG ret => ret_10

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

}


pfe_tmu_sch_get_algo (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  pfe_tmu_sched_algo_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_11 = pfe_tmu_sch_cfg_get_algo (_2, phy_7(D), sch_8(D));
  # DEBUG ret => ret_11

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_11(3), 4(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_sch_set_algo (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, pfe_tmu_sched_algo_t algo)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_sch_cfg_set_algo (_2, phy_7(D), sch_8(D), algo_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_sch_get_rate_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  pfe_tmu_rate_mode_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_11 = pfe_tmu_sch_cfg_get_rate_mode (_2, phy_7(D), sch_8(D));
  # DEBUG ret => ret_11

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_11(3), 2(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_sch_set_rate_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch, pfe_tmu_rate_mode_t mode)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_scheduler (tmu_6(D), phy_7(D), sch_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_sch_cfg_set_rate_mode (_2, phy_7(D), sch_8(D), mode_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_shp_disable (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  pfe_tmu_shp_cfg_disable (_2, phy_7(D), shp_8(D));
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0

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

}


pfe_tmu_shp_get_idle_slope (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  uint32_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_11 = pfe_tmu_shp_cfg_get_idle_slope (_2, phy_7(D), shp_8(D));
  # DEBUG ret => ret_11

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

}


pfe_tmu_shp_set_idle_slope (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp, uint32_t isl)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_shp_cfg_set_idle_slope (_2, phy_7(D), shp_8(D), isl_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_shp_get_rate_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  pfe_tmu_rate_mode_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_11 = pfe_tmu_shp_cfg_get_rate_mode (_2, phy_7(D), shp_8(D));
  # DEBUG ret => ret_11

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_11(3), 2(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_shp_set_rate_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp, pfe_tmu_rate_mode_t mode)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_shp_cfg_set_rate_mode (_2, phy_7(D), shp_8(D), mode_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_shp_enable (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_11 = pfe_tmu_shp_cfg_enable (_2, phy_7(D), shp_8(D));
  # DEBUG ret => ret_11

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_11(3), 22(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_shp_get_position (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  uint8_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_11 = pfe_tmu_shp_cfg_get_position (_2, phy_7(D), shp_8(D));
  # DEBUG ret => ret_11

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_11(3), 255(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_shp_set_position (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp, uint8_t pos)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_shp_cfg_set_position (_2, phy_7(D), shp_8(D), pos_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_shp_get_limits (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp, int32_t * max_credit, int32_t * min_credit)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_13 = pfe_tmu_shp_cfg_get_limits (_2, phy_7(D), shp_8(D), max_credit_10(D), min_credit_11(D));
  # DEBUG ret => ret_13

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_13(3), 22(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_shp_set_limits (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp, int32_t max_credit, int32_t min_credit)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_shaper (tmu_6(D), phy_7(D), shp_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_13 = pfe_tmu_shp_cfg_set_limits (_2, phy_7(D), shp_8(D), max_credit_10(D), min_credit_11(D));
  # DEBUG ret => ret_13

  <bb 4> [local count: 1073741824]:
  # ret_3 = PHI <ret_13(3), 22(2)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_tmu_queue_get_cnt (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy)
{
  uint8_t ret;
  const struct pfe_tmu_phy_cfg_t * pcfg;

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

  <bb 3> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  ret_6 = pcfg_5->q_cnt;
  # DEBUG ret => ret_6

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

}


pfe_tmu_queue_err051211_sync (const struct pfe_tmu_t * tmu)
{
  const uint8_t queue_cnt;
  uint8_t queue;
  uint16_t sum;
  uint32_t default_max;
  uint32_t max;
  uint32_t min;
  pfe_tmu_queue_mode_t mode;
  pfe_ct_phy_if_id_t phy;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.6_1;
  const struct Eth_43_PFE_HifCfgType * _2;
  short unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  int _6;
  long unsigned int min.8_7;
  long unsigned int min.10_8;
  long unsigned int max.11_9;
  long unsigned int iftmp.5_13;
  long unsigned int iftmp.5_22;

  <bb 2> [local count: 37020937]:
  # DEBUG BEGIN_STMT
  # DEBUG phy => 6
  # DEBUG BEGIN_STMT
  # DEBUG mode => 0
  # DEBUG BEGIN_STMT
  min = 0;
  # DEBUG BEGIN_STMT
  max = 0;
  # DEBUG BEGIN_STMT
  # DEBUG default_max => 0
  # DEBUG BEGIN_STMT
  sum = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  Eth_43_PFE_InternalCfgPtr.6_1 = Eth_43_PFE_InternalCfgPtr;
  _2 = Eth_43_PFE_InternalCfgPtr.6_1->pHif;
  _3 = _2->u16RxBDNum;
  if (_3 > 42)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 18510469]:
  _4 = (long unsigned int) _3;
  _5 = _4 + 4294967255;
  iftmp.5_22 = _5 >> 1;

  <bb 4> [local count: 37020937]:
  # iftmp.5_13 = PHI <iftmp.5_22(3), 1(2)>
  # DEBUG default_max => iftmp.5_13
  # DEBUG BEGIN_STMT
  default_max_23 = MIN_EXPR <iftmp.5_13, 16>;
  # DEBUG default_max => default_max_23
  # DEBUG BEGIN_STMT
  # DEBUG phy => 6
  goto <bb 12>; [100.00%]

  <bb 5> [local count: 148083751]:
  # DEBUG BEGIN_STMT
  # DEBUG queue => 0
  # DEBUG BEGIN_STMT
  queue_cnt_29 = pfe_tmu_queue_get_cnt (tmu_27(D), phy_10);
  # DEBUG queue_cnt => queue_cnt_29
  # DEBUG BEGIN_STMT
  _6 = get_sum_of_queue_lengths (tmu_27(D), phy_10, 255, 255, &sum);
  if (_6 == 113)
    goto <bb 6>; [20.24%]
  else
    goto <bb 14>; [79.76%]

  <bb 14> [local count: 118111600]:
  goto <bb 10>; [100.00%]

  <bb 6> [local count: 29972151]:
  # DEBUG BEGIN_STMT
  set_all_queues_to_min_length (tmu_27(D), phy_10);
  # DEBUG BEGIN_STMT
  # DEBUG queue => 0
  goto <bb 8>; [100.00%]

  <bb 7> [local count: 242501952]:
  # DEBUG BEGIN_STMT
  mode_37 = pfe_tmu_queue_get_mode (tmu_27(D), phy_10, queue_11, &min, &max);
  # DEBUG mode => mode_37
  # DEBUG BEGIN_STMT
  min.8_7 = min;
  pfe_tmu_queue_set_mode (tmu_27(D), phy_10, queue_11, mode_37, min.8_7, default_max_23);
  # DEBUG BEGIN_STMT
  queue_39 = queue_11 + 1;
  # DEBUG queue => queue_39

  <bb 8> [local count: 272474104]:
  # queue_11 = PHI <0(6), queue_39(7)>
  # DEBUG queue => queue_11
  # DEBUG BEGIN_STMT
  if (queue_11 < queue_cnt_29)
    goto <bb 7>; [89.00%]
  else
    goto <bb 11>; [11.00%]

  <bb 9> [local count: 955630223]:
  # DEBUG BEGIN_STMT
  mode_32 = pfe_tmu_queue_get_mode (tmu_27(D), phy_10, queue_12, &min, &max);
  # DEBUG mode => mode_32
  # DEBUG BEGIN_STMT
  min.10_8 = min;
  max.11_9 = max;
  pfe_tmu_queue_set_mode (tmu_27(D), phy_10, queue_12, mode_32, min.10_8, max.11_9);
  # DEBUG BEGIN_STMT
  queue_34 = queue_12 + 1;
  # DEBUG queue => queue_34

  <bb 10> [local count: 1073741824]:
  # queue_12 = PHI <queue_34(9), 0(14)>
  # DEBUG queue => queue_12
  # DEBUG BEGIN_STMT
  if (queue_12 < queue_cnt_29)
    goto <bb 9>; [89.00%]
  else
    goto <bb 11>; [11.00%]

  <bb 11> [local count: 148083752]:
  # DEBUG BEGIN_STMT
  phy_40 = phy_10 + 1;
  # DEBUG phy => phy_40

  <bb 12> [local count: 185104689]:
  # phy_10 = PHI <6(4), phy_40(11)>
  # DEBUG phy => phy_10
  # DEBUG BEGIN_STMT
  if (phy_10 <= 9)
    goto <bb 5>; [80.00%]
  else
    goto <bb 13>; [20.00%]

  <bb 13> [local count: 37020938]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  min ={v} {CLOBBER};
  max ={v} {CLOBBER};
  sum ={v} {CLOBBER};
  return 0;

}


pfe_tmu_queue_reset_tail_drop_policy (const struct pfe_tmu_t * tmu)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = tmu_3(D)->cbus_base_va;
  ret_5 = pfe_tmu_q_reset_tail_drop_policy (_1);
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  return ret_5;

}


pfe_tmu_queue_get_wred_zones (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue)
{
  uint8_t ret;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_4(D), phy_5(D), queue_6(D));
  if (_1 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334800]:
  ret_8 = pfe_tmu_queue_get_wred_zones.part.0 (tmu_4(D), phy_5(D), queue_6(D));

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

}


pfe_tmu_queue_get_wred_prob (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint8_t zone, uint8_t * prob)
{
  errno_t ret;
  int _1;
  unsigned char _2;
  unsigned int _3;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_7(D), phy_8(D), queue_9(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 5>; [52.23%]

  <bb 3> [local count: 512926468]:
  # DEBUG BEGIN_STMT
  _2 = pfe_tmu_queue_get_wred_zones (tmu_7(D), phy_8(D), queue_9(D));
  if (_2 <= zone_12(D))
    goto <bb 5>; [52.23%]
  else
    goto <bb 4>; [47.77%]

  <bb 4> [local count: 245024974]:
  # DEBUG BEGIN_STMT
  _3 = tmu_7(D)->cbus_base_va;
  ret_15 = pfe_tmu_q_get_wred_probability (_3, phy_8(D), queue_9(D), zone_12(D), prob_13(D));
  # DEBUG ret => ret_15

  <bb 5> [local count: 1073741824]:
  # ret_4 = PHI <ret_15(4), 22(2), 22(3)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


pfe_tmu_queue_set_wred_prob (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint8_t zone, uint8_t prob)
{
  errno_t ret;
  int _1;
  unsigned char _2;
  unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_7(D), phy_8(D), queue_9(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 6>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = pfe_tmu_queue_get_wred_zones (tmu_7(D), phy_8(D), queue_9(D));
  if (_2 <= zone_12(D))
    goto <bb 6>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 333402205]:
  # DEBUG BEGIN_STMT
  if (prob_13(D) > 100)
    goto <bb 6>; [52.23%]
  else
    goto <bb 5>; [47.77%]

  <bb 5> [local count: 159266233]:
  # DEBUG BEGIN_STMT
  _3 = tmu_7(D)->cbus_base_va;
  ret_15 = pfe_tmu_q_set_wred_probability (_3, phy_8(D), queue_9(D), zone_12(D), prob_13(D));
  # DEBUG ret => ret_15

  <bb 6> [local count: 1073741824]:
  # ret_4 = PHI <22(4), 22(2), 22(3), ret_15(5)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


pfe_tmu_queue_get_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * min, uint32_t * max)
{
  pfe_tmu_queue_mode_t ret;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_4(D), phy_5(D), queue_6(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926472]:
  ret_8 = pfe_tmu_queue_get_mode.part.0 (tmu_4(D), phy_5(D), queue_6(D), min_9(D), max_10(D));

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

}


pfe_tmu_queue_set_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, pfe_tmu_queue_mode_t mode, uint32_t min, uint32_t max)
{
  uint16_t sum;
  errno_t ret_val;
  int _1;
  int _2;
  short unsigned int sum.0_3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret_val => 0
  # DEBUG BEGIN_STMT
  sum = 0;
  # DEBUG BEGIN_STMT
  if (min_8(D) > max_9(D))
    goto <bb 6>; [52.23%]
  else
    goto <bb 3>; [47.77%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_10(D), phy_11(D), queue_12(D));
  if (_1 != 0)
    goto <bb 6>; [52.23%]
  else
    goto <bb 4>; [47.77%]

  <bb 4> [local count: 245024975]:
  # DEBUG BEGIN_STMT
  _2 = get_sum_of_queue_lengths (tmu_10(D), phy_11(D), queue_12(D), max_9(D), &sum);
  if (_2 != 0)
    goto <bb 6>; [52.23%]
  else
    goto <bb 5>; [47.77%]

  <bb 5> [local count: 117048430]:
  # DEBUG BEGIN_STMT
  sum.0_3 = sum;
  ret_val_17 = pfe_tmu_set_queue_mode (tmu_10(D), phy_11(D), queue_12(D), mode_15(D), min_8(D), max_9(D), sum.0_3);
  # DEBUG ret_val => ret_val_17

  <bb 6> [local count: 1073741824]:
  # ret_val_4 = PHI <22(2), 22(3), 113(4), ret_val_17(5)>
  # DEBUG ret_val => ret_val_4
  # DEBUG BEGIN_STMT
  sum ={v} {CLOBBER};
  return ret_val_4;

}


pfe_tmu_queue_get_tx_count (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * cnt)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_6(D), phy_7(D), queue_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_q_cfg_get_tx_count (_2, phy_7(D), queue_8(D), cnt_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_queue_get_drop_count (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * cnt)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_6(D), phy_7(D), queue_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_q_cfg_get_drop_count (_2, phy_7(D), queue_8(D), cnt_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_queue_get_fill_level (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * level)
{
  errno_t ret;
  int _1;
  unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_6(D), phy_7(D), queue_8(D));
  if (_1 == 0)
    goto <bb 3>; [47.77%]
  else
    goto <bb 4>; [52.23%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _2 = tmu_6(D)->cbus_base_va;
  ret_12 = pfe_tmu_q_cfg_get_fill_level (_2, phy_7(D), queue_8(D), level_10(D));
  # DEBUG ret => ret_12

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

}


pfe_tmu_check_shaper (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  errno_t ret;
  const struct pfe_tmu_phy_cfg_t * pcfg;
  unsigned char _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pcfg_6 = pfe_tmu_cfg_get_phy_config (phy_4(D));
  # DEBUG pcfg => pcfg_6
  # DEBUG BEGIN_STMT
  if (pcfg_6 == 0B)
    goto <bb 5>; [18.75%]
  else
    goto <bb 3>; [81.25%]

  <bb 3> [local count: 872415233]:
  # DEBUG BEGIN_STMT
  _1 = pcfg_6->shp_cnt;
  if (_1 <= shp_7(D))
    goto <bb 5>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 567069902]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0

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

}


pfe_tmu_check_scheduler (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  errno_t ret;
  const struct pfe_tmu_phy_cfg_t * pcfg;
  unsigned char _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pcfg_6 = pfe_tmu_cfg_get_phy_config (phy_4(D));
  # DEBUG pcfg => pcfg_6
  # DEBUG BEGIN_STMT
  if (pcfg_6 == 0B)
    goto <bb 5>; [18.75%]
  else
    goto <bb 3>; [81.25%]

  <bb 3> [local count: 872415233]:
  # DEBUG BEGIN_STMT
  _1 = pcfg_6->sch_cnt;
  if (_1 <= sch_7(D))
    goto <bb 5>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 567069902]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0

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

}


pfe_tmu_check_queue (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue)
{
  errno_t ret;
  const struct pfe_tmu_phy_cfg_t * pcfg;
  unsigned char _1;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pcfg_6 = pfe_tmu_cfg_get_phy_config (phy_4(D));
  # DEBUG pcfg => pcfg_6
  # DEBUG BEGIN_STMT
  if (pcfg_6 == 0B)
    goto <bb 6>; [18.75%]
  else
    goto <bb 3>; [81.25%]

  <bb 3> [local count: 872415231]:
  # DEBUG BEGIN_STMT
  _1 = pcfg_6->q_cnt;
  if (_1 <= queue_7(D))
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 436207615]:
  if (queue_7(D) != 255)
    goto <bb 6>; [51.11%]
  else
    goto <bb 5>; [48.89%]

  <bb 5> [local count: 649469520]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0

  <bb 6> [local count: 1073741824]:
  # ret_2 = PHI <22(2), 2(4), 0(5)>
  # DEBUG ret => ret_2
  # DEBUG BEGIN_STMT
  return ret_2;

}


pfe_tmu_destroy (const struct pfe_tmu_t * tmu)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  if (tmu_2(D) != 0B)
    goto <bb 3>; [53.47%]
  else
    goto <bb 4>; [46.53%]

  <bb 3> [local count: 574129754]:
  # DEBUG BEGIN_STMT
  pfe_tmu_disable (tmu_2(D));

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

}


pfe_tmu_disable (const struct pfe_tmu_t * tmu)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = tmu_3(D)->cbus_base_va;
  pfe_tmu_cfg_disable (_1);
  return;

}


pfe_tmu_enable (const struct pfe_tmu_t * tmu)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = tmu_3(D)->cbus_base_va;
  pfe_tmu_cfg_enable (_1);
  return;

}


pfe_tmu_reset (const struct pfe_tmu_t * tmu)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = tmu_3(D)->cbus_base_va;
  pfe_tmu_cfg_reset (_1);
  return;

}


pfe_tmu_create (addr_t cbus_base_va, uint32_t pe_num, const struct pfe_tmu_cfg_t * cfg, struct pfe_class_t * class)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG tmu => &tmu_instance
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  tmu_instance.cbus_base_va = cbus_base_va_2(D);
  # DEBUG BEGIN_STMT
  tmu_instance.class = class_4(D);
  # DEBUG BEGIN_STMT
  pfe_tmu_reset (&tmu_instance);
  # DEBUG BEGIN_STMT
  pfe_tmu_reclaim_init (cbus_base_va_2(D));
  # DEBUG BEGIN_STMT
  pfe_tmu_disable (&tmu_instance);
  # DEBUG BEGIN_STMT
  pfe_tmu_init (&tmu_instance, cfg_9(D));
  # DEBUG BEGIN_STMT
  return &tmu_instance;

}


pfe_tmu_set_queue_mode (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, pfe_tmu_queue_mode_t mode, uint32_t min, uint32_t max, uint16_t sum)
{
  const uint32_t addr;
  struct pfe_ct_class_mmap_t mmap;
  uint8_t err051211_hif_idx;
  uint16_t sum_tmp;
  errno_t ret_val;
  unsigned char _1;
  unsigned char _2;
  struct pfe_class_t * _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  unsigned char err051211_hif_idx.4_14;
  unsigned int _15;
  unsigned int _16;
  short unsigned int _17;
  struct pfe_class_t * _18;
  unsigned int _19;
  short unsigned int _20;
  unsigned int _21;
  short unsigned int _22;
  short unsigned int _23;
  unsigned int _24;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG ret_val => 0
  # DEBUG BEGIN_STMT
  sum_tmp = 0;
  # DEBUG BEGIN_STMT
  err051211_hif_idx = 255;
  # DEBUG BEGIN_STMT
  _1 = is_hif_by_id (phy_32(D), &err051211_hif_idx);
  if (_1 == 1)
    goto <bb 3>; [20.24%]
  else
    goto <bb 7>; [79.76%]

  <bb 3> [local count: 217325345]:
  _2 = pfe_feature_mgr_is_available ("err051211_workaround");
  if (_2 == 1)
    goto <bb 4>; [20.24%]
  else
    goto <bb 7>; [79.76%]

  <bb 4> [local count: 43986650]:
  # DEBUG BEGIN_STMT
  mmap = {};
  # DEBUG BEGIN_STMT
  _3 = tmu_36(D)->class;
  ret_val_38 = pfe_class_get_mmap (_3, 0, &mmap);
  # DEBUG ret_val => ret_val_38
  # DEBUG BEGIN_STMT
  if (ret_val_38 == 0)
    goto <bb 5>; [33.00%]
  else
    goto <bb 6>; [67.00%]

  <bb 5> [local count: 14515594]:
  # DEBUG BEGIN_STMT
  _4 = mmap.hif_tmu_queue_sizes;
  _5 = _4 >> 24;
  _6 = _4 >> 8;
  _7 = _6 & 65280;
  _8 = _5 | _7;
  _9 = _4 << 8;
  _10 = _9 & 16711680;
  _11 = _8 | _10;
  _12 = _4 << 24;
  _13 = _11 | _12;
  err051211_hif_idx.4_14 = err051211_hif_idx;
  _15 = (unsigned int) err051211_hif_idx.4_14;
  _16 = _15 * 2;
  addr_39 = _13 + _16;
  # DEBUG addr => addr_39
  # DEBUG BEGIN_STMT
  _17 = sum_40(D) r>> 8;
  sum_tmp = _17;
  # DEBUG BEGIN_STMT
  _18 = tmu_36(D)->class;
  ret_val_43 = pfe_class_write_dmem (_18, -1, addr_39, &sum_tmp, 2);
  # DEBUG ret_val => ret_val_43

  <bb 6> [local count: 43986650]:
  # ret_val_25 = PHI <ret_val_38(4), ret_val_43(5)>
  # DEBUG ret_val => ret_val_25
  mmap ={v} {CLOBBER};
  # DEBUG ret_val => ret_val_25
  # DEBUG BEGIN_STMT
  if (ret_val_25 == 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 7> [local count: 1051748498]:
  # DEBUG ret_val => NULL
  # DEBUG BEGIN_STMT
  switch (mode_45(D)) <default: <L15> [25.00%], case 0: <L7> [25.00%], case 1: <L8> [25.00%], case 2: <L9> [25.00%]>

  <bb 8> [local count: 262937124]:
<L7>:
  # DEBUG BEGIN_STMT
  _19 = tmu_36(D)->cbus_base_va;
  _20 = (short unsigned int) max_50(D);
  ret_val_54 = pfe_tmu_q_mode_set_tail_drop (_19, phy_32(D), queue_46(D), _20);
  # DEBUG ret_val => ret_val_54
  # DEBUG BEGIN_STMT
  goto <bb 11>; [100.00%]

  <bb 9> [local count: 262937124]:
<L8>:
  # DEBUG BEGIN_STMT
  _21 = tmu_36(D)->cbus_base_va;
  _22 = (short unsigned int) min_49(D);
  _23 = (short unsigned int) max_50(D);
  ret_val_52 = pfe_tmu_q_mode_set_wred (_21, phy_32(D), queue_46(D), _22, _23);
  # DEBUG ret_val => ret_val_52
  # DEBUG BEGIN_STMT
  goto <bb 11>; [100.00%]

  <bb 10> [local count: 262937124]:
<L9>:
  # DEBUG BEGIN_STMT
  _24 = tmu_36(D)->cbus_base_va;
  ret_val_48 = pfe_tmu_q_mode_set_default (_24, phy_32(D), queue_46(D));
  # DEBUG ret_val => ret_val_48
  # DEBUG BEGIN_STMT

  <bb 11> [local count: 1073741824]:
  # ret_val_26 = PHI <ret_val_25(6), ret_val_54(8), ret_val_52(9), ret_val_48(10), 22(7)>
<L15>:
  # DEBUG ret_val => ret_val_26
  # DEBUG BEGIN_STMT
  sum_tmp ={v} {CLOBBER};
  err051211_hif_idx ={v} {CLOBBER};
  return ret_val_26;

}


set_all_queues_to_min_length (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy)
{
  uint32_t max;
  uint32_t min;
  pfe_tmu_queue_mode_t mode;
  uint8_t queue_cnt;
  uint8_t queue;
  errno_t ret_val;
  int _1;
  unsigned int _2;
  unsigned int _3;
  unsigned int _4;

  <bb 2> [local count: 118111602]:
  # DEBUG BEGIN_STMT
  # DEBUG ret_val => 22
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG queue_cnt => 0
  # DEBUG BEGIN_STMT
  # DEBUG mode => 0
  # DEBUG BEGIN_STMT
  min = 0;
  # DEBUG BEGIN_STMT
  max = 0;
  # DEBUG BEGIN_STMT
  queue_cnt_16 = pfe_tmu_queue_get_cnt (tmu_13(D), phy_14(D));
  # DEBUG queue_cnt => queue_cnt_16
  # DEBUG BEGIN_STMT
  # DEBUG queue => 0
  goto <bb 9>; [100.00%]

  <bb 3> [local count: 955630223]:
  # DEBUG BEGIN_STMT
  _1 = pfe_tmu_check_queue (tmu_13(D), phy_14(D), queue_7);
  if (_1 != 0)
    goto <bb 8>; [67.00%]
  else
    goto <bb 4>; [33.00%]

  <bb 4> [local count: 315357973]:
  # DEBUG BEGIN_STMT
  mode_22 = pfe_tmu_queue_get_mode (tmu_13(D), phy_14(D), queue_7, &min, &max);
  # DEBUG mode => mode_22
  # DEBUG BEGIN_STMT
  switch (mode_22) <default: <L13> [25.00%], case 0: <L3> [25.00%], case 1: <L4> [25.00%], case 2: <L5> [25.00%]>

  <bb 5> [local count: 78839493]:
<L3>:
  # DEBUG BEGIN_STMT
  _2 = tmu_13(D)->cbus_base_va;
  ret_val_28 = pfe_tmu_q_mode_set_tail_drop (_2, phy_14(D), queue_7, 1);
  # DEBUG ret_val => ret_val_28
  # DEBUG BEGIN_STMT
  goto <bb 8>; [100.00%]

  <bb 6> [local count: 78839493]:
<L4>:
  # DEBUG BEGIN_STMT
  _3 = tmu_13(D)->cbus_base_va;
  ret_val_26 = pfe_tmu_q_mode_set_wred (_3, phy_14(D), queue_7, 0, 1);
  # DEBUG ret_val => ret_val_26
  # DEBUG BEGIN_STMT
  goto <bb 8>; [100.00%]

  <bb 7> [local count: 78839493]:
<L5>:
  # DEBUG BEGIN_STMT
  _4 = tmu_13(D)->cbus_base_va;
  ret_val_24 = pfe_tmu_q_mode_set_default (_4, phy_14(D), queue_7);
  # DEBUG ret_val => ret_val_24
  # DEBUG BEGIN_STMT

  <bb 8> [local count: 955630222]:
  # ret_val_5 = PHI <22(3), ret_val_28(5), ret_val_26(6), ret_val_24(7), 22(4)>
<L13>:
  # DEBUG ret_val => ret_val_5
  # DEBUG BEGIN_STMT
  queue_29 = queue_7 + 1;
  # DEBUG queue => queue_29

  <bb 9> [local count: 1073741824]:
  # ret_val_6 = PHI <22(2), ret_val_5(8)>
  # queue_7 = PHI <0(2), queue_29(8)>
  # DEBUG queue => queue_7
  # DEBUG ret_val => ret_val_6
  # DEBUG BEGIN_STMT
  if (queue_7 < queue_cnt_16)
    goto <bb 3>; [89.00%]
  else
    goto <bb 10>; [11.00%]

  <bb 10> [local count: 118111601]:
  # ret_val_17 = PHI <ret_val_6(9)>
  # DEBUG BEGIN_STMT
  min ={v} {CLOBBER};
  max ={v} {CLOBBER};
  return ret_val_17;

}


get_sum_of_queue_lengths (const struct pfe_tmu_t * tmu, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t max, uint16_t * sum)
{
  const uint8_t cnt;
  uint8_t i;
  uint32_t tmp_max;
  uint32_t tmp_min;
  uint32_t tmp_sum;
  errno_t ret_val;
  long unsigned int tmp_max.1_1;
  unsigned char _2;
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_InternalCfgPtr.3_3;
  const struct Eth_43_PFE_HifCfgType * _4;
  short unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  short unsigned int _8;
  unsigned char _34;

  <bb 2> [local count: 118111600]:
  # DEBUG BEGIN_STMT
  # DEBUG ret_val => 113
  # DEBUG BEGIN_STMT
  # DEBUG tmp_sum => 0
  # DEBUG BEGIN_STMT
  tmp_min = 0;
  # DEBUG BEGIN_STMT
  tmp_max = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  cnt_22 = pfe_tmu_queue_get_cnt (tmu_19(D), phy_20(D));
  # DEBUG cnt => cnt_22
  # DEBUG BEGIN_STMT
  # DEBUG i => 0
  goto <bb 7>; [100.00%]

  <bb 3> [local count: 955630223]:
  # DEBUG BEGIN_STMT
  if (i_12 == queue_28(D))
    goto <bb 4>; [37.04%]
  else
    goto <bb 5>; [62.96%]

  <bb 4> [local count: 353965434]:
  # DEBUG BEGIN_STMT
  tmp_sum_32 = tmp_sum_11 + max_31(D);
  # DEBUG tmp_sum => tmp_sum_32
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 601664789]:
  # DEBUG BEGIN_STMT
  pfe_tmu_queue_get_mode (tmu_19(D), phy_20(D), i_12, &tmp_min, &tmp_max);
  # DEBUG BEGIN_STMT
  tmp_max.1_1 = tmp_max;
  tmp_sum_30 = tmp_max.1_1 + tmp_sum_11;
  # DEBUG tmp_sum => tmp_sum_30

  <bb 6> [local count: 955630223]:
  # tmp_sum_10 = PHI <tmp_sum_32(4), tmp_sum_30(5)>
  # DEBUG tmp_sum => tmp_sum_10
  # DEBUG BEGIN_STMT
  i_33 = i_12 + 1;
  # DEBUG i => i_33

  <bb 7> [local count: 1073741824]:
  # tmp_sum_11 = PHI <0(2), tmp_sum_10(6)>
  # i_12 = PHI <0(2), i_33(6)>
  # DEBUG i => i_12
  # DEBUG tmp_sum => tmp_sum_11
  # DEBUG BEGIN_STMT
  if (i_12 < cnt_22)
    goto <bb 3>; [89.00%]
  else
    goto <bb 8>; [11.00%]

  <bb 8> [local count: 118111601]:
  # tmp_sum_35 = PHI <tmp_sum_11(7)>
  # DEBUG BEGIN_STMT
  # DEBUG id => phy_20(D)
  # DEBUG err051211_hif_idx => 0B
  # DEBUG INLINE_ENTRY is_hif_by_id
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _34 = phy_20(D) + 250;
  if (_34 <= 3)
    goto <bb 10>; [50.00%]
  else
    goto <bb 9>; [50.00%]

  <bb 9> [local count: 59055800]:
  # DEBUG hif_idx => 0
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG err051211_hif_idx => NULL
  # DEBUG hif_idx => NULL
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  if (tmp_sum_35 > 255)
    goto <bb 15>; [35.00%]
  else
    goto <bb 14>; [65.00%]

  <bb 10> [local count: 59055800]:
<L22>:
  # DEBUG hif_idx => _34
  # DEBUG ret => 1
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG err051211_hif_idx => NULL
  # DEBUG hif_idx => NULL
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  if (tmp_sum_35 > 32)
    goto <bb 15>; [52.23%]
  else
    goto <bb 11>; [47.77%]

  <bb 11> [local count: 28210956]:
  # DEBUG BEGIN_STMT
  _2 = pfe_feature_mgr_is_available ("err051211_workaround");
  if (_2 == 1)
    goto <bb 12>; [34.00%]
  else
    goto <bb 13>; [66.00%]

  <bb 12> [local count: 9591725]:
  Eth_43_PFE_InternalCfgPtr.3_3 = Eth_43_PFE_InternalCfgPtr;
  _4 = Eth_43_PFE_InternalCfgPtr.3_3->pHif;
  _5 = _4->u16RxBDNum;
  _6 = (long unsigned int) _5;
  _7 = tmp_sum_35 + 41;
  if (_6 < _7)
    goto <bb 15>; [35.00%]
  else
    goto <bb 13>; [65.00%]

  <bb 13> [local count: 24853852]:
  # DEBUG BEGIN_STMT
  # DEBUG ret_val => 0
  goto <bb 15>; [100.00%]

  <bb 14> [local count: 38386270]:
  # DEBUG BEGIN_STMT
  # DEBUG ret_val => 0

  <bb 15> [local count: 118111601]:
  # ret_val_9 = PHI <113(12), 113(9), 0(14), 113(10), 0(13)>
  # DEBUG ret_val => ret_val_9
  # DEBUG BEGIN_STMT
  _8 = (short unsigned int) tmp_sum_35;
  *sum_24(D) = _8;
  # DEBUG BEGIN_STMT
  tmp_min ={v} {CLOBBER};
  tmp_max ={v} {CLOBBER};
  return ret_val_9;

}


