pfe_gpi_qos_reset.part.0 (struct pfe_gpi_t * gpi)
{
  errno_t ret;
  errno_t D.11533;
  unsigned int _2;

  <bb 4> [local count: 1073741824]:

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _2 = gpi_1(D)->gpi_base_va;
  pfe_gpi_cfg_qos_default_init (_2);
  # DEBUG BEGIN_STMT
  igqos_class_clear_active_all (gpi_1(D));

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

}


igqos_entry_ready_timeout.isra.0 (const addr_t * ISRA.33)
{
  errno_t ret;
  uint32_t timeout;
  bool_t ready;
  unsigned int _2;
  unsigned int _8;

  <bb 12> [local count: 69202660]:
  # DEBUG gpi s=> gpi

  <bb 2> [local count: 69202660]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG timeout => 200
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  goto <bb 5>; [100.00%]

  <bb 3> [local count: 1063004405]:
  # DEBUG BEGIN_STMT
  _2 = *ISRA.33_21(D);
  ready_3 = pfe_gpi_cfg_qos_entry_ready (_2);
  # DEBUG ready => ready_3
  # DEBUG BEGIN_STMT
  if (ready_3 == 1)
    goto <bb 6>; [5.50%]
  else
    goto <bb 4>; [94.50%]

  <bb 4> [local count: 1004539164]:
  # DEBUG BEGIN_STMT
  oal_time_usleep (5);
  # DEBUG BEGIN_STMT
  timeout_5 = timeout_4 + 4294967295;
  # DEBUG timeout => timeout_5

  <bb 5> [local count: 1073741824]:
  # timeout_4 = PHI <200(2), timeout_5(4)>
  # ready_12 = PHI <ready_13(D)(2), ready_3(4)>
  # DEBUG ready => ready_12
  # DEBUG timeout => timeout_4
  # DEBUG BEGIN_STMT
  if (timeout_4 != 0)
    goto <bb 3>; [99.00%]
  else
    goto <bb 6>; [1.00%]

  <bb 6> [local count: 69202660]:
  # ready_7 = PHI <ready_3(3), ready_12(5)>
  # timeout_6 = PHI <timeout_4(3), timeout_4(5)>
  # DEBUG ready => ready_7
  # DEBUG BEGIN_STMT
  if (timeout_6 == 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 9>; [50.00%]

  <bb 7> [local count: 34601330]:
  if (ready_7 == 0)
    goto <bb 8>; [33.00%]
  else
    goto <bb 9>; [67.00%]

  <bb 8> [local count: 11418439]:
  # DEBUG BEGIN_STMT
  _8 = *ISRA.33_21(D);
  ready_9 = pfe_gpi_cfg_qos_entry_ready (_8);
  # DEBUG ready => ready_9

  <bb 9> [local count: 69202660]:
  # ready_10 = PHI <ready_7(6), ready_7(7), ready_9(8)>
  # DEBUG ready => ready_10
  # DEBUG BEGIN_STMT
  if (ready_10 == 0)
    goto <bb 10>; [35.00%]
  else
    goto <bb 11>; [65.00%]

  <bb 10> [local count: 24220931]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 110

  <bb 11> [local count: 69202661]:
  # ret_11 = PHI <0(9), 110(10)>
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  return ret_11;

}


igqos_class_find_entry.part.0 (const struct pfe_gpi_t * gpi, uint8_t start, bool_t is_active)
{
  uint8_t ii;
  uint8_t ret;
  unsigned char _3;

  <bb 6> [local count: 114863532]:
  goto <bb 4>; [100.00%]

  <bb 2> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _3 = igqos_class_is_active (gpi_1(D), ii_2);
  if (_3 == is_active_4(D))
    goto <bb 5>; [5.50%]
  else
    goto <bb 3>; [94.50%]

  <bb 3> [local count: 958878293]:
  # DEBUG BEGIN_STMT
  ii_5 = ii_2 + 1;
  # DEBUG ii => ii_5

  <bb 4> [local count: 1073741824]:
  # ii_2 = PHI <ii_5(3), start_7(D)(6)>
  # DEBUG ii => ii_2
  # DEBUG BEGIN_STMT
  if (ii_2 <= 63)
    goto <bb 2>; [94.50%]
  else
    goto <bb 5>; [5.50%]

  <bb 5> [local count: 114863532]:
  # ret_6 = PHI <ii_2(2), ii_2(4)>
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  return ret_6;

}


pfe_gpi_shp_get_drop_cnt (const struct pfe_gpi_t * gpi, uint8_t id, uint32_t * cnt)
{
  errno_t ret;
  unsigned int _1;
  long unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_5(D)
  # DEBUG id => id_6(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_6(D) > 1)
    goto <bb 4>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  _2 = pfe_gpi_cfg_shp_get_drop_cnt (_1, id_6(D));
  *cnt_8(D) = _2;

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

}


pfe_gpi_shp_get_limits (const struct pfe_gpi_t * gpi, uint8_t id, int32_t * max_credit, int32_t * min_credit)
{
  errno_t ret;
  uint32_t abs_min_cred;
  uint32_t abs_max_cred;
  unsigned int _1;
  long unsigned int abs_max_cred.8_2;
  long int abs_max_cred.9_3;
  long unsigned int abs_min_cred.10_4;
  long int abs_min_cred.11_5;
  long int _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_9(D)
  # DEBUG id => id_10(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_10(D) > 1)
    goto <bb 4>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_9(D)->gpi_base_va;
  pfe_gpi_cfg_shp_get_limits (_1, id_10(D), &abs_max_cred, &abs_min_cred);
  # DEBUG BEGIN_STMT
  abs_max_cred.8_2 = abs_max_cred;
  abs_max_cred.9_3 = (long int) abs_max_cred.8_2;
  *max_credit_12(D) = abs_max_cred.9_3;
  # DEBUG BEGIN_STMT
  abs_min_cred.10_4 = abs_min_cred;
  abs_min_cred.11_5 = (long int) abs_min_cred.10_4;
  _6 = -abs_min_cred.11_5;
  *min_credit_14(D) = _6;

  <bb 4> [local count: 1073741824]:
  # ret_18 = PHI <22(2), 0(3)>
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  abs_max_cred ={v} {CLOBBER};
  abs_min_cred ={v} {CLOBBER};
  return ret_18;

}


pfe_gpi_shp_set_limits (const struct pfe_gpi_t * gpi, uint8_t id, int32_t max_credit, int32_t min_credit)
{
  errno_t ret;
  unsigned int max_credit.5_1;
  unsigned int min_credit.6_2;
  unsigned int _3;
  unsigned int _4;
  long int _5;
  long unsigned int _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_10(D)
  # DEBUG id => id_11(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_11(D) > 1)
    goto <bb 6>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  max_credit.5_1 = (unsigned int) max_credit_12(D);
  if (max_credit.5_1 > 4194303)
    goto <bb 6>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 393214993]:
  # DEBUG BEGIN_STMT
  min_credit.6_2 = (unsigned int) min_credit_13(D);
  _3 = min_credit.6_2 + 4194303;
  if (_3 > 4194303)
    goto <bb 6>; [52.23%]
  else
    goto <bb 5>; [47.77%]

  <bb 5> [local count: 187838802]:
  # DEBUG BEGIN_STMT
  _4 = gpi_10(D)->gpi_base_va;
  _5 = -min_credit_13(D);
  _6 = (long unsigned int) _5;
  pfe_gpi_cfg_shp_set_limits (_4, id_11(D), max_credit.5_1, _6);

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

}


pfe_gpi_shp_get_idle_slope (const struct pfe_gpi_t * gpi, uint8_t id, uint32_t * isl)
{
  errno_t ret;
  bool_t is_bps;
  uint32_t weight;
  pfe_iqos_shp_rate_mode_t mode;
  unsigned int _1;
  <unnamed type> mode.3_2;
  unsigned int _3;
  long unsigned int weight.4_4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_11(D)
  # DEBUG id => id_12(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_12(D) > 1)
    goto <bb 6>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_11(D)->gpi_base_va;
  pfe_gpi_cfg_shp_get_mode (_1, id_12(D), &mode);
  # DEBUG BEGIN_STMT
  mode.3_2 = mode;
  if (mode.3_2 == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 4> [local count: 302473072]:
  # DEBUG BEGIN_STMT
  # DEBUG is_bps => 0

  <bb 5> [local count: 604946144]:
  # is_bps_8 = PHI <1(3), 0(4)>
  # DEBUG is_bps => is_bps_8
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = gpi_11(D)->gpi_base_va;
  pfe_gpi_cfg_shp_get_isl_weight (_3, id_12(D), &weight);
  # DEBUG BEGIN_STMT
  weight.4_4 = weight;
  _5 = gpi_11(D)->clk_div_log2;
  _6 = gpi_11(D)->sys_clk_mhz;
  _7 = igqos_convert_weight_to_isl (weight.4_4, _5, _6, is_bps_8);
  *isl_15(D) = _7;

  <bb 6> [local count: 1073741824]:
  # ret_19 = PHI <22(2), 0(5)>
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  mode ={v} {CLOBBER};
  weight ={v} {CLOBBER};
  return ret_19;

}


pfe_gpi_shp_set_idle_slope (struct pfe_gpi_t * gpi, uint8_t id, uint32_t isl)
{
  errno_t ret;
  bool_t is_bps;
  uint32_t weight;
  pfe_iqos_shp_rate_mode_t mode;
  unsigned int _1;
  <unnamed type> mode.1_2;
  long unsigned int _3;
  long unsigned int _4;
  unsigned int _5;
  long unsigned int weight.2_6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_10(D)
  # DEBUG id => id_11(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_11(D) > 1)
    goto <bb 6>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_10(D)->gpi_base_va;
  pfe_gpi_cfg_shp_get_mode (_1, id_11(D), &mode);
  # DEBUG BEGIN_STMT
  mode.1_2 = mode;
  if (mode.1_2 == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 4> [local count: 302473072]:
  # DEBUG BEGIN_STMT
  # DEBUG is_bps => 0

  <bb 5> [local count: 604946144]:
  # is_bps_7 = PHI <1(3), 0(4)>
  # DEBUG is_bps => is_bps_7
  # DEBUG BEGIN_STMT
  _3 = gpi_10(D)->sys_clk_mhz;
  _4 = igqos_find_optimal_weight (isl_13(D), _3, is_bps_7, &weight);
  gpi_10(D)->clk_div_log2 = _4;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = gpi_10(D)->gpi_base_va;
  weight.2_6 = weight;
  pfe_gpi_cfg_shp_set_isl_weight (_5, id_11(D), _4, weight.2_6);

  <bb 6> [local count: 1073741824]:
  # ret_19 = PHI <22(2), 0(5)>
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  mode ={v} {CLOBBER};
  weight ={v} {CLOBBER};
  return ret_19;

}


igqos_find_optimal_weight (uint32_t isl, uint32_t sys_clk_mhz, bool_t is_bps, uint32_t * wgt)
{
  uint32_t ret;
  uint32_t k;
  uint32_t r;
  uint32_t l;
  uint32_t w;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;

  <bb 2> [local count: 279554087]:
  # DEBUG BEGIN_STMT
  # DEBUG w_max => 2047
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG r => 15
  # DEBUG BEGIN_STMT
  # DEBUG l => 0
  # DEBUG BEGIN_STMT
  w_16 = igqos_convert_isl_to_weight (isl_13(D), 0, sys_clk_mhz_14(D), is_bps_15(D));
  # DEBUG w => w_16
  # DEBUG BEGIN_STMT
  if (w_16 > 2047)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 139777043]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  *wgt_19(D) = w_16;
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  goto <bb 13>; [100.00%]

  <bb 4> [local count: 139777043]:
  # DEBUG BEGIN_STMT
  w_17 = igqos_convert_isl_to_weight (isl_13(D), 15, sys_clk_mhz_14(D), is_bps_15(D));
  # DEBUG w => w_17
  # DEBUG BEGIN_STMT
  if (w_17 == 0)
    goto <bb 5>; [35.00%]
  else
    goto <bb 6>; [65.00%]

  <bb 5> [local count: 48921965]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  *wgt_19(D) = 0;
  # DEBUG BEGIN_STMT
  # DEBUG ret => 15
  goto <bb 13>; [100.00%]

  <bb 6> [local count: 90855078]:
  # DEBUG BEGIN_STMT
  if (w_17 <= 2047)
    goto <bb 7>; [35.00%]
  else
    goto <bb 14>; [65.00%]

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

  <bb 7> [local count: 31799277]:
  # DEBUG BEGIN_STMT
  *wgt_19(D) = w_17;
  # DEBUG BEGIN_STMT
  # DEBUG ret => 15
  goto <bb 13>; [100.00%]

  <bb 8> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _1 = l_5 + r_6;
  k_21 = _1 >> 1;
  # DEBUG k => k_21
  # DEBUG BEGIN_STMT
  w_22 = igqos_convert_isl_to_weight (isl_13(D), k_21, sys_clk_mhz_14(D), is_bps_15(D));
  # DEBUG w => w_22
  # DEBUG BEGIN_STMT
  if (w_22 <= 2047)
    goto <bb 16>; [94.50%]
  else
    goto <bb 15>; [5.50%]

  <bb 16> [local count: 958878293]:
  goto <bb 11>; [100.00%]

  <bb 15> [local count: 55807731]:

  <bb 10> [local count: 114863532]:
  # l_23 = PHI <0(14), l_5(15)>
  # r_24 = PHI <15(14), k_21(15)>
  # DEBUG r => NULL

  <bb 11> [local count: 1073741824]:
  # l_5 = PHI <l_23(10), k_21(16)>
  # r_6 = PHI <r_24(10), r_6(16)>
  # DEBUG r => r_6
  # DEBUG l => l_5
  # DEBUG BEGIN_STMT
  _2 = l_5 + 1;
  if (_2 < r_6)
    goto <bb 8>; [94.50%]
  else
    goto <bb 12>; [5.50%]

  <bb 12> [local count: 59055800]:
  # l_10 = PHI <l_5(11)>
  # r_11 = PHI <r_6(11)>
  # DEBUG BEGIN_STMT
  _3 = l_10 + r_11;
  k_18 = _3 >> 1;
  # DEBUG k => k_18
  # DEBUG BEGIN_STMT
  _4 = igqos_convert_isl_to_weight (isl_13(D), k_18, sys_clk_mhz_14(D), is_bps_15(D));
  *wgt_19(D) = _4;
  # DEBUG BEGIN_STMT
  # DEBUG ret => k_18

  <bb 13> [local count: 279554086]:
  # ret_7 = PHI <0(3), 15(5), 15(7), k_18(12)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  return ret_7;

}


igqos_convert_weight_to_isl (uint32_t wgt, uint32_t clk_div_log2, uint32_t sys_clk_mhz, bool_t is_bps)
{
  uint64_t isl;
  uint64_t clk_div;
  long long unsigned int _1;
  long long unsigned int _2;
  long unsigned int _6;
  uint32_t _16;
  long unsigned int _17;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG clk_div_log2 => clk_div_log2_5(D)
  # DEBUG INLINE_ENTRY igqos_clk_div
  # DEBUG BEGIN_STMT
  _6 = clk_div_log2_5(D) + 1;
  _17 = 1 << _6;
  # DEBUG clk_div_log2 => NULL
  clk_div_7 = (uint64_t) _17;
  # DEBUG clk_div => clk_div_7
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  isl_9 = (uint64_t) wgt_8(D);
  # DEBUG isl => isl_9
  # DEBUG BEGIN_STMT
  if (is_bps_10(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  isl_11 = isl_9 * 8;
  # DEBUG isl => isl_11

  <bb 4> [local count: 1073741824]:
  # isl_3 = PHI <isl_9(2), isl_11(3)>
  # DEBUG isl => isl_3
  # DEBUG BEGIN_STMT
  _1 = (long long unsigned int) sys_clk_mhz_12(D);
  _2 = _1 * isl_3;
  isl_13 = _2 * 1000000;
  # DEBUG isl => isl_13
  # DEBUG BEGIN_STMT
  isl_14 = isl_13 >> 8;
  # DEBUG isl => isl_14
  # DEBUG BEGIN_STMT
  isl_15 = isl_14 / clk_div_7;
  # DEBUG isl => isl_15
  # DEBUG BEGIN_STMT
  _16 = (uint32_t) isl_15;
  return _16;

}


igqos_convert_isl_to_weight (uint32_t isl, uint32_t clk_div_log2, uint32_t sys_clk_mhz, bool_t is_bps)
{
  uint64_t wgt;
  uint64_t clk_div;
  long long unsigned int _1;
  long long unsigned int _2;
  long unsigned int _6;
  uint32_t _16;
  long unsigned int _17;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG clk_div_log2 => clk_div_log2_5(D)
  # DEBUG INLINE_ENTRY igqos_clk_div
  # DEBUG BEGIN_STMT
  _6 = clk_div_log2_5(D) + 1;
  _17 = 1 << _6;
  # DEBUG clk_div_log2 => NULL
  clk_div_7 = (uint64_t) _17;
  # DEBUG clk_div => clk_div_7
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  wgt_9 = (uint64_t) isl_8(D);
  # DEBUG wgt => wgt_9
  # DEBUG BEGIN_STMT
  wgt_10 = clk_div_7 * wgt_9;
  # DEBUG wgt => wgt_10
  # DEBUG BEGIN_STMT
  wgt_11 = wgt_10 * 256;
  # DEBUG wgt => wgt_11
  # DEBUG BEGIN_STMT
  _1 = (long long unsigned int) sys_clk_mhz_12(D);
  _2 = _1 * 1000000;
  wgt_13 = wgt_11 / _2;
  # DEBUG wgt => wgt_13
  # DEBUG BEGIN_STMT
  if (is_bps_14(D) == 1)
    goto <bb 3>; [34.00%]
  else
    goto <bb 4>; [66.00%]

  <bb 3> [local count: 365072220]:
  # DEBUG BEGIN_STMT
  wgt_15 = wgt_13 >> 3;
  # DEBUG wgt => wgt_15

  <bb 4> [local count: 1073741824]:
  # wgt_3 = PHI <wgt_13(2), wgt_15(3)>
  # DEBUG wgt => wgt_3
  # DEBUG BEGIN_STMT
  _16 = (uint32_t) wgt_3;
  return _16;

}


pfe_gpi_shp_get_type (const struct pfe_gpi_t * gpi, uint8_t id, pfe_iqos_shp_type_t * type)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_4(D)
  # DEBUG id => id_5(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_5(D) > 1)
    goto <bb 4>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_4(D)->gpi_base_va;
  pfe_gpi_cfg_shp_get_type (_1, id_5(D), type_6(D));

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

}


pfe_gpi_shp_set_type (const struct pfe_gpi_t * gpi, uint8_t id, pfe_iqos_shp_type_t type)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_5(D)
  # DEBUG id => id_6(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_6(D) > 1)
    goto <bb 5>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (type_7(D) > 2)
    goto <bb 5>; [52.23%]
  else
    goto <bb 4>; [47.77%]

  <bb 4> [local count: 288982773]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_shp_set_type (_1, id_6(D), type_7(D));

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

}


pfe_gpi_shp_get_mode (const struct pfe_gpi_t * gpi, uint8_t id, pfe_iqos_shp_rate_mode_t * mode)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_4(D)
  # DEBUG id => id_5(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_5(D) > 1)
    goto <bb 4>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_4(D)->gpi_base_va;
  pfe_gpi_cfg_shp_get_mode (_1, id_5(D), mode_6(D));

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

}


pfe_gpi_shp_set_mode (const struct pfe_gpi_t * gpi, uint8_t id, pfe_iqos_shp_rate_mode_t mode)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_5(D)
  # DEBUG id => id_6(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_6(D) > 1)
    goto <bb 5>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (mode_7(D) > 1)
    goto <bb 5>; [61.14%]
  else
    goto <bb 4>; [38.86%]

  <bb 4> [local count: 235082071]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_shp_set_mode (_1, id_6(D), mode_7(D));

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

}


pfe_gpi_shp_disable (const struct pfe_gpi_t * gpi, uint8_t id)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_4(D)
  # DEBUG id => id_5(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_5(D) > 1)
    goto <bb 4>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_4(D)->gpi_base_va;
  pfe_gpi_cfg_shp_disable (_1, id_5(D));

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

}


pfe_gpi_shp_enable (struct pfe_gpi_t * gpi, uint8_t id)
{
  errno_t ret;
  unsigned int _1;
  unsigned char _2;
  unsigned int _3;
  long unsigned int _4;
  unsigned int _5;
  unsigned int _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_9(D)
  # DEBUG id => id_10(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_10(D) > 1)
    goto <bb 5>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_9(D)->gpi_base_va;
  _2 = pfe_gpi_cfg_shp_is_enabled (_1, id_10(D));
  if (_2 != 1)
    goto <bb 4>; [48.88%]
  else
    goto <bb 5>; [51.12%]

  <bb 4> [local count: 295697675]:
  # DEBUG BEGIN_STMT
  _3 = gpi_9(D)->cbus_base_va;
  _4 = pfe_gpi_cfg_get_sys_clk_mhz (_3);
  gpi_9(D)->sys_clk_mhz = _4;
  # DEBUG BEGIN_STMT
  gpi_9(D)->clk_div_log2 = 0;
  # DEBUG BEGIN_STMT
  _5 = gpi_9(D)->gpi_base_va;
  pfe_gpi_cfg_shp_default_init (_5, id_10(D));
  # DEBUG BEGIN_STMT
  _6 = gpi_9(D)->gpi_base_va;
  pfe_gpi_cfg_shp_enable (_6, id_10(D));

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

}


pfe_gpi_shp_is_enabled (const struct pfe_gpi_t * gpi, uint8_t id)
{
  bool_t is_enabled;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG is_enabled => 0
  # DEBUG BEGIN_STMT
  # DEBUG D#8 => gpi_5(D)
  # DEBUG id => id_6(D)
  # DEBUG INLINE_ENTRY pfe_gpi_shp_args_checks
  # DEBUG gpi => D#8
  # DEBUG D#7 => D#8
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => D#7
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_6(D) > 1)
    goto <bb 4>; [43.66%]
  else
    goto <bb 3>; [56.34%]

  <bb 3> [local count: 604946144]:
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  is_enabled_8 = pfe_gpi_cfg_shp_is_enabled (_1, id_6(D));
  # DEBUG is_enabled => is_enabled_8

  <bb 4> [local count: 1073741824]:
  # is_enabled_2 = PHI <0(2), is_enabled_8(3)>
  # DEBUG id => NULL
  # DEBUG ret => NULL
  # DEBUG ret => NULL
  # DEBUG is_enabled => is_enabled_2
  # DEBUG BEGIN_STMT
  return is_enabled_2;

}


pfe_gpi_wred_get_thr (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue, pfe_iqos_wred_thr_t thr, uint16_t * val)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_5(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_6(D) > 2)
    goto <bb 5>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  if (thr_7(D) > 2)
    goto <bb 5>; [52.23%]
  else
    goto <bb 4>; [47.77%]

  <bb 4> [local count: 333402205]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_wred_get_thr (_1, queue_6(D), thr_7(D), val_8(D));

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

}


pfe_gpi_wred_set_thr (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue, pfe_iqos_wred_thr_t thr, uint16_t val)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_5(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_6(D) > 2)
    goto <bb 9>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932185]:
  if (thr_7(D) > 2)
    goto <bb 9>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 453655920]:
  # DEBUG BEGIN_STMT
  if (queue_6(D) == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 5> [local count: 226827960]:
  if (val_8(D) > 8192)
    goto <bb 9>; [35.00%]
  else
    goto <bb 6>; [65.00%]

  <bb 6> [local count: 374266134]:
  # DEBUG BEGIN_STMT
  if (queue_6(D) != 0)
    goto <bb 7>; [67.00%]
  else
    goto <bb 8>; [33.00%]

  <bb 7> [local count: 250758310]:
  if (val_8(D) > 512)
    goto <bb 9>; [35.00%]
  else
    goto <bb 8>; [65.00%]

  <bb 8> [local count: 286500726]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_wred_set_thr (_1, queue_6(D), thr_7(D), val_8(D));

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

}


pfe_gpi_wred_get_prob (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue, pfe_iqos_wred_zone_t zone, uint8_t * val)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_5(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_6(D) > 2)
    goto <bb 5>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  if (zone_7(D) > 3)
    goto <bb 5>; [52.23%]
  else
    goto <bb 4>; [47.77%]

  <bb 4> [local count: 333402205]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_wred_get_prob (_1, queue_6(D), zone_7(D), val_8(D));

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

}


pfe_gpi_wred_set_prob (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue, pfe_iqos_wred_zone_t zone, uint8_t val)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_5(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_6(D) > 2)
    goto <bb 6>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  if (zone_7(D) > 3)
    goto <bb 6>; [35.00%]
  else
    goto <bb 4>; [65.00%]

  <bb 4> [local count: 453655921]:
  if (val_8(D) > 15)
    goto <bb 6>; [52.23%]
  else
    goto <bb 5>; [47.77%]

  <bb 5> [local count: 216711433]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_wred_set_prob (_1, queue_6(D), zone_7(D), val_8(D));

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

}


pfe_gpi_wred_disable (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_5(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_6(D) > 2)
    goto <bb 4>; [52.23%]
  else
    goto <bb 3>; [47.77%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  pfe_gpi_cfg_wred_disable (_1, queue_6(D));

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

}


pfe_gpi_wred_enable (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue)
{
  errno_t ret;
  unsigned int _1;
  unsigned char _2;
  unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_7(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_8(D) > 2)
    goto <bb 5>; [52.23%]
  else
    goto <bb 3>; [47.77%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _1 = gpi_7(D)->gpi_base_va;
  _2 = pfe_gpi_cfg_wred_is_enabled (_1, queue_8(D));
  if (_2 == 1)
    goto <bb 5>; [51.12%]
  else
    goto <bb 4>; [48.88%]

  <bb 4> [local count: 250718458]:
  # DEBUG BEGIN_STMT
  _3 = gpi_7(D)->gpi_base_va;
  pfe_gpi_cfg_wred_enable (_3, queue_8(D));

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

}


pfe_gpi_wred_is_enabled (const struct pfe_gpi_t * gpi, pfe_iqos_queue_t queue)
{
  bool_t is_enabled;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_5(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (queue_6(D) > 2)
    goto <bb 4>; [67.00%]
  else
    goto <bb 3>; [33.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->gpi_base_va;
  is_enabled_8 = pfe_gpi_cfg_wred_is_enabled (_1, queue_6(D));
  # DEBUG is_enabled => is_enabled_8

  <bb 4> [local count: 1073741824]:
  # is_enabled_2 = PHI <is_enabled_8(3), 0(2)>
  # DEBUG is_enabled => is_enabled_2
  # DEBUG BEGIN_STMT
  return is_enabled_2;

}


pfe_gpi_qos_get_next_flow (struct pfe_gpi_t * gpi, uint8_t * id, struct pfe_iqos_flow_spec_t * flow)
{
  uint8_t entry_id;
  errno_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  entry_id_6 = igqos_class_get_next_active (gpi_4(D));
  # DEBUG entry_id => entry_id_6
  # DEBUG BEGIN_STMT
  if (entry_id_6 == 64)
    goto <bb 4>; [36.03%]
  else
    goto <bb 3>; [63.97%]

  <bb 3> [local count: 686872646]:
  # DEBUG BEGIN_STMT
  *id_7(D) = entry_id_6;
  # DEBUG BEGIN_STMT
  ret_11 = pfe_gpi_qos_get_flow (gpi_4(D), entry_id_6, flow_9(D));
  # DEBUG ret => ret_11

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

}


pfe_gpi_qos_get_first_flow (struct pfe_gpi_t * gpi, uint8_t * id, struct pfe_iqos_flow_spec_t * flow)
{
  uint8_t entry_id;
  errno_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  entry_id_6 = igqos_class_get_first_active (gpi_4(D));
  # DEBUG entry_id => entry_id_6
  # DEBUG BEGIN_STMT
  if (entry_id_6 == 64)
    goto <bb 4>; [36.03%]
  else
    goto <bb 3>; [63.97%]

  <bb 3> [local count: 686872646]:
  # DEBUG BEGIN_STMT
  *id_7(D) = entry_id_6;
  # DEBUG BEGIN_STMT
  ret_11 = pfe_gpi_qos_get_flow (gpi_4(D), entry_id_6, flow_9(D));
  # DEBUG ret => ret_11

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

}


pfe_gpi_qos_add_flow (struct pfe_gpi_t * gpi, uint8_t id, const struct pfe_iqos_flow_spec_t * flow)
{
  errno_t ret;
  uint8_t entry_id;
  uint32_t class_table_entry[8];
  unsigned char _1;
  unsigned int _2;
  long unsigned int _3;
  const addr_t * _18;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = id_7(D) + 192;
  if (_1 <= 190)
    goto <bb 7>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  # DEBUG BEGIN_STMT
  if (id_7(D) == 255)
    goto <bb 4>; [34.00%]
  else
    goto <bb 5>; [66.00%]

  <bb 4> [local count: 237296943]:
  # DEBUG BEGIN_STMT
  entry_id_10 = igqos_class_find_first_free (gpi_9(D));
  # DEBUG entry_id => entry_id_10

  <bb 5> [local count: 697932187]:
  # entry_id_4 = PHI <entry_id_10(4), id_7(D)(3)>
  # DEBUG entry_id => entry_id_4
  # DEBUG BEGIN_STMT
  igqos_convert_flow_to_entry (flow_11(D), &class_table_entry);
  # DEBUG BEGIN_STMT
  _2 = gpi_9(D)->gpi_base_va;
  _3 = (long unsigned int) entry_id_4;
  pfe_gpi_cfg_qos_write_flow_entry_req (_2, _3, &class_table_entry);
  # DEBUG BEGIN_STMT
  _18 = &MEM[(unsigned int *)gpi_9(D) + 8B];
  # DEBUG D#9 => gpi_9(D)
  ret_15 = igqos_entry_ready_timeout.isra.0 (_18);
  # DEBUG ret => ret_15
  # DEBUG BEGIN_STMT
  if (ret_15 == 0)
    goto <bb 6>; [33.00%]
  else
    goto <bb 7>; [67.00%]

  <bb 6> [local count: 230317621]:
  # DEBUG BEGIN_STMT
  igqos_class_set_active (gpi_9(D), entry_id_4);

  <bb 7> [local count: 1073741824]:
  # ret_5 = PHI <22(2), ret_15(5), 0(6)>
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  class_table_entry ={v} {CLOBBER};
  return ret_5;

}


pfe_gpi_qos_rem_flow (struct pfe_gpi_t * gpi, uint8_t id)
{
  errno_t ret;
  unsigned char _1;
  unsigned int _2;
  long unsigned int _3;
  const addr_t * _13;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_6(D) > 63)
    goto <bb 6>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  # DEBUG BEGIN_STMT
  _1 = igqos_class_is_active (gpi_8(D), id_6(D));
  if (_1 != 0)
    goto <bb 4>; [47.77%]
  else
    goto <bb 6>; [52.23%]

  <bb 4> [local count: 333402205]:
  # DEBUG BEGIN_STMT
  _2 = gpi_8(D)->gpi_base_va;
  _3 = (long unsigned int) id_6(D);
  pfe_gpi_cfg_qos_clear_flow_entry_req (_2, _3);
  # DEBUG BEGIN_STMT
  _13 = &MEM[(unsigned int *)gpi_8(D) + 8B];
  # DEBUG D#9 => gpi_8(D)
  ret_11 = igqos_entry_ready_timeout.isra.0 (_13);
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  if (ret_11 == 0)
    goto <bb 5>; [33.00%]
  else
    goto <bb 6>; [67.00%]

  <bb 5> [local count: 110022728]:
  # DEBUG BEGIN_STMT
  igqos_class_clear_active (gpi_8(D), id_6(D));

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

}


pfe_gpi_qos_get_flow (const struct pfe_gpi_t * gpi, uint8_t id, struct pfe_iqos_flow_spec_t * flow)
{
  errno_t ret;
  uint32_t class_table_entry[8];
  unsigned int _1;
  long unsigned int _2;
  unsigned int _3;
  const addr_t * _17;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  class_table_entry = {};
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (id_8(D) > 63)
    goto <bb 5>; [52.23%]
  else
    goto <bb 3>; [47.77%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _1 = gpi_9(D)->gpi_base_va;
  _2 = (long unsigned int) id_8(D);
  pfe_gpi_cfg_qos_rd_fl_entry_req (_1, _2);
  # DEBUG BEGIN_STMT
  _17 = &MEM[(unsigned int *)gpi_9(D) + 8B];
  # DEBUG D#9 => gpi_9(D)
  ret_12 = igqos_entry_ready_timeout.isra.0 (_17);
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  if (ret_12 == 0)
    goto <bb 4>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 4> [local count: 169265735]:
  # DEBUG BEGIN_STMT
  _3 = gpi_9(D)->gpi_base_va;
  pfe_gpi_cfg_qos_rd_fl_entry_resp (_3, &class_table_entry);
  # DEBUG BEGIN_STMT
  igqos_convert_entry_to_flow (&class_table_entry, flow_14(D));

  <bb 5> [local count: 1073741824]:
  # ret_4 = PHI <22(2), ret_12(3), 0(4)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  class_table_entry ={v} {CLOBBER};
  return ret_4;

}


igqos_convert_flow_to_entry (const struct pfe_iqos_flow_spec_t * flow, uint32_t * entry)
{
  uint8_t hw_encoded;
  uint8_t hw_encoded;
  uint32_t val;
  <unnamed type> _1;
  unsigned char _2;
  unsigned char _3;
  long unsigned int _4;
  unsigned char _5;
  long unsigned int _6;
  long unsigned int _7;
  unsigned char _8;
  long unsigned int _9;
  long unsigned int _10;
  <unnamed type> _11;
  <unnamed type> _12;
  <unnamed type> _13;
  unsigned char _14;
  long unsigned int _15;
  long unsigned int _16;
  <unnamed type> _17;
  <unnamed type> _30;
  <unnamed type> _33;
  long unsigned int _34;
  long unsigned int _39;
  <unnamed type> _49;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#6 => &flow_25(D)->args
  # DEBUG args => D#6
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  igqos_convert_flow_to_entry_reg0123 (flow_25(D), entry_27(D));
  # DEBUG BEGIN_STMT
  igqos_convert_flow_to_entry_reg45 (flow_25(D), entry_27(D));
  # DEBUG BEGIN_STMT
  # DEBUG val => 0
  # DEBUG BEGIN_STMT
  _1 = flow_25(D)->arg_type_mask;
  _30 = _1 & 2;
  if (_30 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _2 = MEM[(const struct pfe_iqos_flow_args_t *)flow_25(D) + 4B].tos_m;
  _3 = _2 >> 3;
  _4 = (long unsigned int) _3;
  # DEBUG val => _4

  <bb 4> [local count: 1073741824]:
  # val_18 = PHI <0(2), _4(3)>
  # DEBUG val => val_18
  # DEBUG BEGIN_STMT
  _33 = _1 & 4;
  if (_33 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 5> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _5 = MEM[(const struct pfe_iqos_flow_args_t *)flow_25(D) + 4B].l4proto_m;
  _6 = (long unsigned int) _5;
  _7 = _6 << 5;
  val_31 = _7 | val_18;
  # DEBUG val => val_31

  <bb 6> [local count: 1073741824]:
  # val_19 = PHI <val_18(4), val_31(5)>
  # DEBUG val => val_19
  # DEBUG BEGIN_STMT
  _49 = _1 & 8;
  if (_49 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 7> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _8 = MEM[(const struct pfe_iqos_flow_args_t *)flow_25(D) + 4B].sip_m;
  # DEBUG ip_m => _8
  # DEBUG INLINE_ENTRY igqos_ip_mask_hw_encode
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (_8 != 0)
    goto <bb 8>; [65.00%]
  else
    goto <bb 9>; [35.00%]

  <bb 8> [local count: 348966093]:
  # DEBUG BEGIN_STMT
  hw_encoded_36 = _8 + 255;
  # DEBUG hw_encoded => hw_encoded_36

  <bb 9> [local count: 536870913]:
  # hw_encoded_38 = PHI <32(7), hw_encoded_36(8)>
  # DEBUG hw_encoded => hw_encoded_38
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => NULL
  # DEBUG hw_encoded => NULL
  _9 = (long unsigned int) hw_encoded_38;
  _10 = _9 << 13;
  _34 = _10 & 516096;
  val_35 = val_19 | _34;
  # DEBUG val => val_35
  goto <bb 11>; [100.00%]

  <bb 10> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => 0
  # DEBUG INLINE_ENTRY NULL
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG hw_encoded => 32
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => NULL
  # DEBUG hw_encoded => NULL
  val_32 = val_19 | 262144;
  # DEBUG val => val_32

  <bb 11> [local count: 1073741824]:
  # val_20 = PHI <val_35(9), val_32(10)>
  # DEBUG val => val_20
  # DEBUG BEGIN_STMT
  _11 = _1 & 16;
  if (_11 != 0)
    goto <bb 12>; [50.00%]
  else
    goto <bb 15>; [50.00%]

  <bb 12> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _14 = MEM[(const struct pfe_iqos_flow_args_t *)flow_25(D) + 4B].dip_m;
  # DEBUG ip_m => _14
  # DEBUG INLINE_ENTRY igqos_ip_mask_hw_encode
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (_14 != 0)
    goto <bb 13>; [65.00%]
  else
    goto <bb 14>; [35.00%]

  <bb 13> [local count: 348966093]:
  # DEBUG BEGIN_STMT
  hw_encoded_47 = _14 + 255;
  # DEBUG hw_encoded => hw_encoded_47

  <bb 14> [local count: 536870913]:
  # hw_encoded_48 = PHI <32(12), hw_encoded_47(13)>
  # DEBUG hw_encoded => hw_encoded_48
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => NULL
  # DEBUG hw_encoded => NULL
  _15 = (long unsigned int) hw_encoded_48;
  _16 = _15 << 19;
  _39 = _16 & 33030144;
  val_40 = val_20 | _39;
  # DEBUG val => val_40
  goto <bb 16>; [100.00%]

  <bb 15> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => 0
  # DEBUG INLINE_ENTRY NULL
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG hw_encoded => 32
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => NULL
  # DEBUG hw_encoded => NULL
  val_37 = val_20 | 16777216;
  # DEBUG val => val_37

  <bb 16> [local count: 1073741824]:
  # val_21 = PHI <val_40(14), val_37(15)>
  # DEBUG val => val_21
  # DEBUG BEGIN_STMT
  _12 = _1 & 32;
  if (_12 != 0)
    goto <bb 17>; [50.00%]
  else
    goto <bb 18>; [50.00%]

  <bb 17> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  val_41 = val_21 | 33554432;
  # DEBUG val => val_41

  <bb 18> [local count: 1073741824]:
  # val_22 = PHI <val_21(16), val_41(17)>
  # DEBUG val => val_22
  # DEBUG BEGIN_STMT
  _13 = _1 & 64;
  if (_13 != 0)
    goto <bb 19>; [50.00%]
  else
    goto <bb 20>; [50.00%]

  <bb 19> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  val_42 = val_22 | 67108864;
  # DEBUG val => val_42

  <bb 20> [local count: 1073741824]:
  # val_23 = PHI <val_22(18), val_42(19)>
  # DEBUG val => val_23
  # DEBUG BEGIN_STMT
  _17 = flow_25(D)->action;
  if (_17 == 1)
    goto <bb 21>; [34.00%]
  else
    goto <bb 22>; [66.00%]

  <bb 21> [local count: 365072220]:
  # DEBUG BEGIN_STMT
  val_44 = val_23 | 134217728;
  # DEBUG val => val_44
  goto <bb 24>; [100.00%]

  <bb 22> [local count: 708669605]:
  # DEBUG BEGIN_STMT
  if (_17 == 2)
    goto <bb 23>; [34.00%]
  else
    goto <bb 24>; [66.00%]

  <bb 23> [local count: 240947665]:
  # DEBUG BEGIN_STMT
  val_43 = val_23 | 268435456;
  # DEBUG val => val_43

  <bb 24> [local count: 1073741824]:
  # val_24 = PHI <val_44(21), val_23(22), val_43(23)>
  # DEBUG val => val_24
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_27(D) + 24B] = val_24;
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_27(D) + 28B] = 0;
  return;

}


igqos_convert_flow_to_entry_reg45 (const struct pfe_iqos_flow_spec_t * flow, uint32_t * entry)
{
  uint32_t val;
  <unnamed type> _1;
  short unsigned int _2;
  short unsigned int _3;
  long unsigned int _4;
  short unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  short unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  <unnamed type> _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  short unsigned int _15;
  short unsigned int _16;
  long unsigned int _17;
  short unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  unsigned char _22;
  long unsigned int _23;
  long unsigned int _24;
  <unnamed type> _31;
  <unnamed type> _37;
  <unnamed type> _43;
  <unnamed type> _44;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#5 => &flow_30(D)->args
  # DEBUG args => D#5
  # DEBUG BEGIN_STMT
  # DEBUG val => 0
  # DEBUG BEGIN_STMT
  _1 = flow_30(D)->arg_type_mask;
  _31 = _1 & 32;
  if (_31 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _2 = MEM[(const struct pfe_iqos_flow_args_t *)flow_30(D) + 4B].sport_min;
  _3 = _2 >> 10;
  _4 = (long unsigned int) _3;
  # DEBUG val => _4

  <bb 4> [local count: 1073741824]:
  # val_25 = PHI <0(2), _4(3)>
  # DEBUG val => val_25
  # DEBUG BEGIN_STMT
  _37 = _1 & 64;
  if (_37 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 5> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _5 = MEM[(const struct pfe_iqos_flow_args_t *)flow_30(D) + 4B].dport_max;
  _6 = (long unsigned int) _5;
  _7 = _6 << 6;
  val_33 = _7 | val_25;
  # DEBUG val => val_33
  # DEBUG BEGIN_STMT
  _8 = MEM[(const struct pfe_iqos_flow_args_t *)flow_30(D) + 4B].dport_min;
  _9 = (long unsigned int) _8;
  _10 = _9 << 22;
  val_34 = _10 | val_33;
  # DEBUG val => val_34

  <bb 6> [local count: 1073741824]:
  # val_26 = PHI <val_25(4), val_34(5)>
  # DEBUG val => val_26
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_35(D) + 16B] = val_26;
  # DEBUG BEGIN_STMT
  # DEBUG val => 64
  # DEBUG BEGIN_STMT
  _11 = flow_30(D)->type_mask;
  _12 = (long unsigned int) _11;
  _13 = _12 << 7;
  _14 = _13 & 130944;
  val_38 = _14 | 64;
  # DEBUG val => val_38
  # DEBUG BEGIN_STMT
  if (_37 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _15 = MEM[(const struct pfe_iqos_flow_args_t *)flow_30(D) + 4B].dport_min;
  _16 = _15 >> 10;
  _17 = (long unsigned int) _16;
  val_39 = _17 | val_38;
  # DEBUG val => val_39

  <bb 8> [local count: 1073741824]:
  # val_27 = PHI <val_38(6), val_39(7)>
  # DEBUG val => val_27
  # DEBUG BEGIN_STMT
  _43 = _1 & 1;
  if (_43 != 0)
    goto <bb 9>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 9> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _18 = MEM[(const struct pfe_iqos_flow_args_t *)flow_30(D) + 4B].vlan_m;
  _19 = (long unsigned int) _18;
  _20 = _19 << 17;
  _21 = _20 & 536739840;
  val_40 = _21 | val_27;
  # DEBUG val => val_40

  <bb 10> [local count: 1073741824]:
  # val_28 = PHI <val_27(8), val_40(9)>
  # DEBUG val => val_28
  # DEBUG BEGIN_STMT
  _44 = _1 & 2;
  if (_44 != 0)
    goto <bb 11>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 11> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _22 = MEM[(const struct pfe_iqos_flow_args_t *)flow_30(D) + 4B].tos_m;
  _23 = (long unsigned int) _22;
  _24 = _23 << 29;
  val_41 = _24 | val_28;
  # DEBUG val => val_41

  <bb 12> [local count: 1073741824]:
  # val_29 = PHI <val_28(10), val_41(11)>
  # DEBUG val => val_29
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_35(D) + 20B] = val_29;
  return;

}


igqos_convert_flow_to_entry_reg0123 (const struct pfe_iqos_flow_spec_t * flow, uint32_t * entry)
{
  uint32_t val;
  <unnamed type> _1;
  <unnamed type> _2;
  short unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  unsigned char _7;
  long unsigned int _8;
  long unsigned int _9;
  unsigned char _10;
  long unsigned int _11;
  long unsigned int _12;
  unsigned char _13;
  unsigned char _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  short unsigned int _24;
  long unsigned int _25;
  long unsigned int _26;
  short unsigned int _27;
  long unsigned int _28;
  long unsigned int _29;
  <unnamed type> _47;
  <unnamed type> _50;
  <unnamed type> _53;
  <unnamed type> _57;
  <unnamed type> _58;
  <unnamed type> _59;
  <unnamed type> _60;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#4 => &flow_39(D)->args
  # DEBUG args => D#4
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = flow_39(D)->type_mask;
  _47 = _1 & 1023;
  val_41 = (uint32_t) _47;
  # DEBUG val => val_41
  # DEBUG BEGIN_STMT
  _2 = flow_39(D)->arg_type_mask;
  _50 = _2 & 1;
  if (_50 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _3 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].vlan;
  _4 = (long unsigned int) _3;
  _5 = _4 << 10;
  _6 = _5 & 4193280;
  val_42 = _6 | val_41;
  # DEBUG val => val_42

  <bb 4> [local count: 1073741824]:
  # val_30 = PHI <val_41(2), val_42(3)>
  # DEBUG val => val_30
  # DEBUG BEGIN_STMT
  _53 = _2 & 2;
  if (_53 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 5> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _7 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].tos;
  _8 = (long unsigned int) _7;
  _9 = _8 << 22;
  val_43 = _9 | val_30;
  # DEBUG val => val_43

  <bb 6> [local count: 1073741824]:
  # val_31 = PHI <val_30(4), val_43(5)>
  # DEBUG val => val_31
  # DEBUG BEGIN_STMT
  _57 = _2 & 4;
  if (_57 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _10 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].l4proto;
  _11 = (long unsigned int) _10;
  _12 = _11 << 30;
  val_44 = _12 | val_31;
  # DEBUG val => val_44

  <bb 8> [local count: 1073741824]:
  # val_32 = PHI <val_31(6), val_44(7)>
  # DEBUG val => val_32
  # DEBUG BEGIN_STMT
  *entry_45(D) = val_32;
  # DEBUG BEGIN_STMT
  # DEBUG val => 0
  # DEBUG BEGIN_STMT
  if (_57 != 0)
    goto <bb 9>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 9> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _13 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].l4proto;
  _14 = _13 >> 2;
  _15 = (long unsigned int) _14;
  # DEBUG val => _15

  <bb 10> [local count: 1073741824]:
  # val_33 = PHI <0(8), _15(9)>
  # DEBUG val => val_33
  # DEBUG BEGIN_STMT
  _58 = _2 & 8;
  if (_58 != 0)
    goto <bb 11>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 11> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _16 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].sip;
  _17 = _16 << 6;
  val_48 = _17 | val_33;
  # DEBUG val => val_48

  <bb 12> [local count: 1073741824]:
  # val_34 = PHI <val_33(10), val_48(11)>
  # DEBUG val => val_34
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_45(D) + 4B] = val_34;
  # DEBUG BEGIN_STMT
  # DEBUG val => 0
  # DEBUG BEGIN_STMT
  if (_58 != 0)
    goto <bb 13>; [50.00%]
  else
    goto <bb 14>; [50.00%]

  <bb 13> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _18 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].sip;
  _19 = _18 >> 26;
  # DEBUG val => _19

  <bb 14> [local count: 1073741824]:
  # val_35 = PHI <0(12), _19(13)>
  # DEBUG val => val_35
  # DEBUG BEGIN_STMT
  _59 = _2 & 16;
  if (_59 != 0)
    goto <bb 15>; [50.00%]
  else
    goto <bb 16>; [50.00%]

  <bb 15> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _20 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].dip;
  _21 = _20 << 6;
  val_51 = _21 | val_35;
  # DEBUG val => val_51

  <bb 16> [local count: 1073741824]:
  # val_36 = PHI <val_35(14), val_51(15)>
  # DEBUG val => val_36
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_45(D) + 8B] = val_36;
  # DEBUG BEGIN_STMT
  # DEBUG val => 0
  # DEBUG BEGIN_STMT
  if (_59 != 0)
    goto <bb 17>; [50.00%]
  else
    goto <bb 18>; [50.00%]

  <bb 17> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _22 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].dip;
  _23 = _22 >> 26;
  # DEBUG val => _23

  <bb 18> [local count: 1073741824]:
  # val_37 = PHI <0(16), _23(17)>
  # DEBUG val => val_37
  # DEBUG BEGIN_STMT
  _60 = _2 & 32;
  if (_60 != 0)
    goto <bb 19>; [50.00%]
  else
    goto <bb 20>; [50.00%]

  <bb 19> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _24 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].sport_max;
  _25 = (long unsigned int) _24;
  _26 = _25 << 6;
  val_54 = _26 | val_37;
  # DEBUG val => val_54
  # DEBUG BEGIN_STMT
  _27 = MEM[(const struct pfe_iqos_flow_args_t *)flow_39(D) + 4B].sport_min;
  _28 = (long unsigned int) _27;
  _29 = _28 << 22;
  val_55 = _29 | val_54;
  # DEBUG val => val_55

  <bb 20> [local count: 1073741824]:
  # val_38 = PHI <val_37(18), val_55(19)>
  # DEBUG val => val_38
  # DEBUG BEGIN_STMT
  MEM[(uint32_t *)entry_45(D) + 12B] = val_38;
  return;

}


igqos_convert_entry_to_flow (const uint32_t * entry, struct pfe_iqos_flow_spec_t * flow)
{
  uint8_t hw_decoded;
  uint8_t hw_decoded;
  uint32_t val;
  short unsigned int _1;
  short unsigned int _2;
  long unsigned int _3;
  short unsigned int _4;
  short unsigned int _5;
  long unsigned int _6;
  unsigned char _7;
  long unsigned int _8;
  unsigned char _9;
  unsigned char _10;
  unsigned char _11;
  unsigned char _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  short unsigned int _20;
  long unsigned int _21;
  short unsigned int _22;
  short unsigned int _23;
  short unsigned int _24;
  short unsigned int _25;
  long unsigned int _26;
  short unsigned int _27;
  long unsigned int _28;
  short unsigned int _29;
  short unsigned int _30;
  short unsigned int _31;
  short unsigned int _32;
  long unsigned int _33;
  short unsigned int _34;
  short unsigned int _35;
  long unsigned int _36;
  unsigned char _37;
  unsigned char _38;
  unsigned char _39;
  unsigned char _40;
  long unsigned int _41;
  unsigned char _42;
  long unsigned int _43;
  unsigned char _44;
  unsigned char _45;
  long unsigned int _46;
  unsigned char _47;
  unsigned char _48;
  long unsigned int _49;
  long unsigned int _50;
  long unsigned int _51;
  long unsigned int _52;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#3 => &flow_55(D)->args
  # DEBUG args => D#3
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  val_58 = *entry_57(D);
  # DEBUG val => val_58
  # DEBUG BEGIN_STMT
  _1 = (short unsigned int) val_58;
  _2 = _1 & 1023;
  flow_55(D)->type_mask = _2;
  # DEBUG BEGIN_STMT
  _3 = val_58 >> 10;
  _4 = (short unsigned int) _3;
  _5 = _4 & 4095;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].vlan = _5;
  # DEBUG BEGIN_STMT
  _6 = val_58 >> 22;
  _7 = (unsigned char) _6;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].tos = _7;
  # DEBUG BEGIN_STMT
  _8 = val_58 >> 30;
  _9 = (unsigned char) _8;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].l4proto = _9;
  # DEBUG BEGIN_STMT
  val_63 = MEM[(const uint32_t *)entry_57(D) + 4B];
  # DEBUG val => val_63
  # DEBUG BEGIN_STMT
  _10 = (unsigned char) val_63;
  _11 = _10 << 2;
  _12 = _9 | _11;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].l4proto = _12;
  # DEBUG BEGIN_STMT
  _13 = val_63 >> 6;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].sip = _13;
  # DEBUG BEGIN_STMT
  val_66 = MEM[(const uint32_t *)entry_57(D) + 8B];
  # DEBUG val => val_66
  # DEBUG BEGIN_STMT
  _14 = val_66 << 26;
  _15 = _13 | _14;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].sip = _15;
  # DEBUG BEGIN_STMT
  _16 = val_66 >> 6;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].dip = _16;
  # DEBUG BEGIN_STMT
  val_69 = MEM[(const uint32_t *)entry_57(D) + 12B];
  # DEBUG val => val_69
  # DEBUG BEGIN_STMT
  _17 = val_69 << 26;
  _18 = _16 | _17;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].dip = _18;
  # DEBUG BEGIN_STMT
  _19 = val_69 >> 6;
  _20 = (short unsigned int) _19;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].sport_max = _20;
  # DEBUG BEGIN_STMT
  _21 = val_69 >> 22;
  _22 = (short unsigned int) _21;
  # DEBUG BEGIN_STMT
  val_72 = MEM[(const uint32_t *)entry_57(D) + 16B];
  # DEBUG val => val_72
  # DEBUG BEGIN_STMT
  _23 = (short unsigned int) val_72;
  _24 = _23 << 10;
  _25 = _22 | _24;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].sport_min = _25;
  # DEBUG BEGIN_STMT
  _26 = val_72 >> 6;
  _27 = (short unsigned int) _26;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].dport_max = _27;
  # DEBUG BEGIN_STMT
  _28 = val_72 >> 22;
  _29 = (short unsigned int) _28;
  # DEBUG BEGIN_STMT
  val_75 = MEM[(const uint32_t *)entry_57(D) + 20B];
  # DEBUG val => val_75
  # DEBUG BEGIN_STMT
  _30 = (short unsigned int) val_75;
  _31 = _30 << 10;
  _32 = _29 | _31;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].dport_min = _32;
  # DEBUG BEGIN_STMT
  _33 = val_75 >> 17;
  _34 = (short unsigned int) _33;
  _35 = _34 & 4095;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].vlan_m = _35;
  # DEBUG BEGIN_STMT
  _36 = val_75 >> 29;
  _37 = (unsigned char) _36;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].tos_m = _37;
  # DEBUG BEGIN_STMT
  val_79 = MEM[(const uint32_t *)entry_57(D) + 24B];
  # DEBUG val => val_79
  # DEBUG BEGIN_STMT
  _38 = (unsigned char) val_79;
  _39 = _38 << 3;
  _40 = _37 | _39;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].tos_m = _40;
  # DEBUG BEGIN_STMT
  _41 = val_79 >> 5;
  _42 = (unsigned char) _41;
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].l4proto_m = _42;
  # DEBUG BEGIN_STMT
  _43 = val_79 >> 13;
  _44 = (unsigned char) _43;
  _45 = _44 & 63;
  # DEBUG ip_m => _45
  # DEBUG INLINE_ENTRY igqos_ip_mask_hw_decode
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (_45 != 32)
    goto <bb 3>; [66.00%]
  else
    goto <bb 4>; [34.00%]

  <bb 3> [local count: 708669605]:
  # DEBUG BEGIN_STMT
  hw_decoded_88 = _45 + 1;
  # DEBUG hw_decoded => hw_decoded_88

  <bb 4> [local count: 1073741824]:
  # hw_decoded_89 = PHI <0(2), hw_decoded_88(3)>
  # DEBUG hw_decoded => hw_decoded_89
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => NULL
  # DEBUG hw_decoded => NULL
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].sip_m = hw_decoded_89;
  # DEBUG BEGIN_STMT
  _46 = val_79 >> 19;
  _47 = (unsigned char) _46;
  _48 = _47 & 63;
  # DEBUG ip_m => _48
  # DEBUG INLINE_ENTRY igqos_ip_mask_hw_decode
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (_48 != 32)
    goto <bb 5>; [66.00%]
  else
    goto <bb 6>; [34.00%]

  <bb 5> [local count: 708669605]:
  # DEBUG BEGIN_STMT
  hw_decoded_84 = _48 + 1;
  # DEBUG hw_decoded => hw_decoded_84

  <bb 6> [local count: 1073741824]:
  # hw_decoded_82 = PHI <0(4), hw_decoded_84(5)>
  # DEBUG hw_decoded => hw_decoded_82
  # DEBUG BEGIN_STMT
  # DEBUG ip_m => NULL
  # DEBUG hw_decoded => NULL
  MEM[(struct pfe_iqos_flow_args_t *)flow_55(D) + 4B].dip_m = hw_decoded_82;
  # DEBUG BEGIN_STMT
  _49 = val_79 >> 27;
  _50 = _49 & 1;
  if (_50 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  flow_55(D)->action = 1;

  <bb 8> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _51 = val_79 >> 28;
  _52 = _51 & 1;
  if (_52 != 0)
    goto <bb 9>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 9> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  flow_55(D)->action = 2;

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

}


igqos_class_get_next_active (struct pfe_gpi_t * gpi)
{
  unsigned char _1;
  unsigned char _2;
  unsigned char _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = gpi_5(D)->igqos_entry_iter;
  _2 = _1 + 1;
  _3 = igqos_class_find_entry (gpi_5(D), _2, 1);
  gpi_5(D)->igqos_entry_iter = _3;
  # DEBUG BEGIN_STMT
  return _3;

}


igqos_class_get_first_active (struct pfe_gpi_t * gpi)
{
  uint8_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG gpi => gpi_2(D)
  # DEBUG start => 0
  # DEBUG is_active => 1
  # DEBUG INLINE_ENTRY igqos_class_find_entry
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_4 = igqos_class_find_entry.part.0 (gpi_2(D), 0, 1);
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  # DEBUG gpi => NULL
  # DEBUG start => NULL
  # DEBUG is_active => NULL
  # DEBUG ret => NULL
  # DEBUG ii => NULL
  gpi_2(D)->igqos_entry_iter = ret_4;
  # DEBUG BEGIN_STMT
  return ret_4;

}


igqos_class_find_first_free (const struct pfe_gpi_t * gpi)
{
  uint8_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG gpi => gpi_2(D)
  # DEBUG start => 0
  # DEBUG is_active => 0
  # DEBUG INLINE_ENTRY igqos_class_find_entry
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_3 = igqos_class_find_entry.part.0 (gpi_2(D), 0, 0);
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  # DEBUG gpi => NULL
  # DEBUG start => NULL
  # DEBUG is_active => NULL
  # DEBUG ret => NULL
  # DEBUG ii => NULL
  return ret_3;

}


igqos_class_is_active (const struct pfe_gpi_t * gpi, uint8_t id)
{
  unsigned char _1;
  unsigned int _2;
  long unsigned int _3;
  unsigned char _4;
  unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  unsigned char _8;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 1
  # DEBUG BEGIN_STMT
  _1 = id_9(D) >> 5;
  _2 = (unsigned int) _1;
  _3 = gpi_11(D)->igqos_active_entries[_2];
  _8 = id_9(D) & 31;
  _5 = (unsigned int) _8;
  _6 = _3 >> _5;
  _7 = _6 & 1;
  _4 = (unsigned char) _7;
  # DEBUG ret => _4
  # DEBUG BEGIN_STMT
  return _4;

}


igqos_class_clear_active (struct pfe_gpi_t * gpi, uint8_t id)
{
  unsigned int _1;
  long unsigned int _2;
  unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  unsigned char _8;
  unsigned char _12;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _8 = id_7(D) >> 5;
  _1 = (unsigned int) _8;
  _2 = gpi_10(D)->igqos_active_entries[_1];
  _12 = id_7(D) & 31;
  _3 = (unsigned int) _12;
  _4 = 1 << _3;
  _5 = ~_4;
  _6 = _2 & _5;
  gpi_10(D)->igqos_active_entries[_1] = _6;
  return;

}


igqos_class_set_active (struct pfe_gpi_t * gpi, uint8_t id)
{
  unsigned int _1;
  long unsigned int _2;
  unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  unsigned char _7;
  unsigned char _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _7 = id_6(D) >> 5;
  _1 = (unsigned int) _7;
  _2 = gpi_9(D)->igqos_active_entries[_1];
  _11 = id_6(D) & 31;
  _3 = (unsigned int) _11;
  _4 = 1 << _3;
  _5 = _2 | _4;
  gpi_9(D)->igqos_active_entries[_1] = _5;
  return;

}


pfe_gpi_qos_disable (const struct pfe_gpi_t * gpi)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_3(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_3(D)->gpi_base_va;
  pfe_gpi_cfg_qos_disable (_1);
  # DEBUG BEGIN_STMT
  return 0;

}


pfe_gpi_qos_enable (struct pfe_gpi_t * gpi)
{
  errno_t ret;
  unsigned int _1;
  unsigned char _2;
  unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_7(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_7(D)->gpi_base_va;
  _2 = pfe_gpi_cfg_qos_is_enabled (_1);
  if (_2 != 1)
    goto <bb 3>; [48.88%]
  else
    goto <bb 5>; [51.12%]

  <bb 3> [local count: 524845004]:
  # DEBUG BEGIN_STMT
  ret_10 = pfe_gpi_qos_reset (gpi_7(D));
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  if (ret_10 == 0)
    goto <bb 4>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 4> [local count: 173198851]:
  # DEBUG BEGIN_STMT
  _3 = gpi_7(D)->gpi_base_va;
  pfe_gpi_cfg_qos_enable (_3);

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

}


pfe_gpi_qos_reset (struct pfe_gpi_t * gpi)
{
  errno_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_3(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_7 = igqos_class_clear_flow_entry_table (gpi_3(D));
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  if (ret_7 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  ret_9 = igqos_class_clear_lru_entry_table (gpi_3(D));
  # DEBUG ret => ret_9
  # DEBUG BEGIN_STMT
  if (ret_9 == 0)
    goto <bb 4>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 4> [local count: 116930484]:
  ret_4 = pfe_gpi_qos_reset.part.0 (gpi_3(D));

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

}


igqos_class_clear_lru_entry_table (const struct pfe_gpi_t * gpi)
{
  errno_t ret;
  uint32_t ii;
  unsigned int _1;
  const addr_t * _14;

  <bb 2> [local count: 74681964]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ii => 0
  goto <bb 5>; [100.00%]

  <bb 3> [local count: 1057206201]:
  # DEBUG BEGIN_STMT
  _1 = gpi_9(D)->gpi_base_va;
  pfe_gpi_cfg_qos_clear_lru_entry_req (_1, ii_2);
  # DEBUG BEGIN_STMT
  _14 = &MEM[(unsigned int *)gpi_9(D) + 8B];
  # DEBUG D#9 => gpi_9(D)
  ret_12 = igqos_entry_ready_timeout.isra.0 (_14);
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  if (ret_12 != 0)
    goto <bb 6>; [5.50%]
  else
    goto <bb 4>; [94.50%]

  <bb 4> [local count: 999059859]:
  # DEBUG BEGIN_STMT
  ii_13 = ii_2 + 1;
  # DEBUG ii => ii_13

  <bb 5> [local count: 1073741824]:
  # ii_2 = PHI <0(2), ii_13(4)>
  # ret_3 = PHI <ret_7(D)(2), 0(4)>
  # DEBUG ret => ret_3
  # DEBUG ii => ii_2
  # DEBUG BEGIN_STMT
  if (ii_2 != 64)
    goto <bb 3>; [98.46%]
  else
    goto <bb 6>; [1.54%]

  <bb 6> [local count: 74681965]:
  # ret_4 = PHI <ret_12(3), ret_3(5)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


igqos_class_clear_flow_entry_table (const struct pfe_gpi_t * gpi)
{
  errno_t ret;
  uint32_t ii;
  unsigned int _1;
  const addr_t * _14;

  <bb 2> [local count: 74681964]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ii => 0
  goto <bb 5>; [100.00%]

  <bb 3> [local count: 1057206201]:
  # DEBUG BEGIN_STMT
  _1 = gpi_9(D)->gpi_base_va;
  pfe_gpi_cfg_qos_clear_flow_entry_req (_1, ii_2);
  # DEBUG BEGIN_STMT
  _14 = &MEM[(unsigned int *)gpi_9(D) + 8B];
  # DEBUG D#9 => gpi_9(D)
  ret_12 = igqos_entry_ready_timeout.isra.0 (_14);
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  if (ret_12 != 0)
    goto <bb 6>; [5.50%]
  else
    goto <bb 4>; [94.50%]

  <bb 4> [local count: 999059859]:
  # DEBUG BEGIN_STMT
  ii_13 = ii_2 + 1;
  # DEBUG ii => ii_13

  <bb 5> [local count: 1073741824]:
  # ii_2 = PHI <0(2), ii_13(4)>
  # ret_3 = PHI <ret_7(D)(2), 0(4)>
  # DEBUG ret => ret_3
  # DEBUG ii => ii_2
  # DEBUG BEGIN_STMT
  if (ii_2 != 64)
    goto <bb 3>; [98.46%]
  else
    goto <bb 6>; [1.54%]

  <bb 6> [local count: 74681965]:
  # ret_4 = PHI <ret_12(3), ret_3(5)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


igqos_class_clear_active_all (struct pfe_gpi_t * gpi)
{
  uint32_t i;

  <bb 2> [local count: 357878150]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG i => 0
  goto <bb 4>; [100.00%]

  <bb 3> [local count: 715863676]:
  # DEBUG BEGIN_STMT
  gpi_4(D)->igqos_active_entries[i_1] = 0;
  # DEBUG BEGIN_STMT
  i_7 = i_1 + 1;
  # DEBUG i => i_7

  <bb 4> [local count: 1073741824]:
  # i_1 = PHI <0(2), i_7(3)>
  # DEBUG i => i_1
  # DEBUG BEGIN_STMT
  if (i_1 != 2)
    goto <bb 3>; [66.67%]
  else
    goto <bb 5>; [33.33%]

  <bb 5> [local count: 357878150]:
  # DEBUG BEGIN_STMT
  gpi_4(D)->igqos_entry_iter = 0;
  return;

}


pfe_gpi_qos_is_enabled (const struct pfe_gpi_t * gpi)
{
  bool_t is_enabled;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_3(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_3(D)->gpi_base_va;
  is_enabled_5 = pfe_gpi_cfg_qos_is_enabled (_1);
  # DEBUG is_enabled => is_enabled_5
  # DEBUG BEGIN_STMT
  return is_enabled_5;

}


pfe_gpi_destroy (struct pfe_gpi_t * gpi)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (gpi_4(D) != 0B)
    goto <bb 3>; [53.47%]
  else
    goto <bb 8>; [46.53%]

  <bb 3> [local count: 574129754]:
  # DEBUG BEGIN_STMT
  pfe_gpi_disable (gpi_4(D));
  # DEBUG BEGIN_STMT
  _1 = gpi_4(D)->gpi_base_offset;
  if (_1 == 704512)
    goto <bb 6>; [20.24%]
  else
    goto <bb 4>; [79.76%]

  <bb 4> [local count: 457925891]:
  if (_1 == 720896)
    goto <bb 6>; [34.00%]
  else
    goto <bb 5>; [66.00%]

  <bb 5> [local count: 302231088]:
  if (_1 == 737280)
    goto <bb 6>; [34.00%]
  else
    goto <bb 7>; [66.00%]

  <bb 6> [local count: 374657235]:
  # DEBUG BEGIN_STMT
  pfe_gpi_qos_reset (gpi_4(D));
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT

  <bb 7> [local count: 574129754]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_gpi_reset (gpi_4(D));
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT

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

}


pfe_gpi_disable (const struct pfe_gpi_t * gpi)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_3(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_3(D)->gpi_base_va;
  pfe_gpi_cfg_disable (_1);
  return;

}


pfe_gpi_enable (const struct pfe_gpi_t * gpi)
{
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_3(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_3(D)->gpi_base_va;
  pfe_gpi_cfg_enable (_1);
  return;

}


pfe_gpi_reset (const struct pfe_gpi_t * gpi)
{
  errno_t ret;
  unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => gpi_3(D)
  # DEBUG D#2 => 22
  # DEBUG INLINE_ENTRY NULL
  # DEBUG gpi => D#1
  # DEBUG err => D#2
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gpi_3(D)->gpi_base_va;
  ret_5 = pfe_gpi_cfg_reset (_1);
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  # DEBUG ret => ret_5
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return ret_5;

}


pfe_gpi_create (addr_t cbus_base_va, addr_t gpi_base, const struct pfe_gpi_cfg_t * cfg, pfe_xxgpi_id_t xxgpi_id)
{
  errno_t ret;
  addr_t gpi_cbus_offset;
  struct pfe_gpi_t * gpi;
  _Bool _1;
  long int _2;
  long int _3;
  int _4;
  unsigned int _5;
  long unsigned int _6;
  unsigned int _7;
  unsigned int _8;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = xxgpi_id_12(D) > 6;
  _2 = (long int) _1;
  _3 = __builtin_expect (_2, 0);
  if (_3 != 0)
    goto <bb 8>; [10.00%]
  else
    goto <bb 3>; [90.00%]

  <bb 3> [local count: 966367642]:
  # DEBUG BEGIN_STMT
  _4 = (int) xxgpi_id_12(D);
  gpi_13 = &xxgpi_instance[_4];
  # DEBUG gpi => gpi_13
  # DEBUG BEGIN_STMT
  memset (gpi_13, 0, 32);
  # DEBUG BEGIN_STMT
  MEM[(struct pfe_gpi_t *)&xxgpi_instance][_4].cbus_base_va = cbus_base_va_16(D);
  # DEBUG BEGIN_STMT
  MEM[(struct pfe_gpi_t *)&xxgpi_instance][_4].gpi_base_offset = gpi_base_18(D);
  # DEBUG BEGIN_STMT
  _5 = cbus_base_va_16(D) + gpi_base_18(D);
  MEM[(struct pfe_gpi_t *)&xxgpi_instance][_4].gpi_base_va = _5;
  # DEBUG BEGIN_STMT
  _6 = pfe_gpi_cfg_get_sys_clk_mhz (cbus_base_va_16(D));
  MEM[(struct pfe_gpi_t *)&xxgpi_instance][_4].sys_clk_mhz = _6;
  # DEBUG BEGIN_STMT
  _7 = MEM[(struct pfe_gpi_t *)&xxgpi_instance][_4].gpi_base_va;
  gpi_cbus_offset_23 = _7 - cbus_base_va_16(D);
  # DEBUG gpi_cbus_offset => gpi_cbus_offset_23
  # DEBUG BEGIN_STMT
  ret_25 = pfe_gpi_reset (gpi_13);
  # DEBUG ret => ret_25
  # DEBUG BEGIN_STMT
  if (ret_25 != 0)
    goto <bb 8>; [29.00%]
  else
    goto <bb 4>; [71.00%]

  <bb 4> [local count: 686121026]:
  # DEBUG BEGIN_STMT
  switch (gpi_cbus_offset_23) <default: <L16> [50.00%], case 704512: <L4> [50.00%], case 720896: <L4> [50.00%], case 737280: <L4> [50.00%]>

  <bb 5> [local count: 343060513]:
<L4>:
  # DEBUG BEGIN_STMT
  ret_27 = pfe_gpi_qos_reset (gpi_13);
  # DEBUG ret => ret_27
  # DEBUG BEGIN_STMT
  if (ret_27 != 0)
    goto <bb 8>; [29.00%]
  else
    goto <bb 7>; [71.00%]

  <bb 7> [local count: 586633478]:
<L16>:
  # DEBUG gpi => gpi_13
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_gpi_disable (gpi_13);
  # DEBUG BEGIN_STMT
  _8 = gpi_13->gpi_base_va;
  pfe_gpi_cfg_init (_8, cfg_29(D));

  <bb 8> [local count: 1073741824]:
  # gpi_9 = PHI <0B(2), 0B(3), 0B(5), gpi_13(7)>
  # DEBUG gpi => gpi_9
  # DEBUG BEGIN_STMT
  return gpi_9;

}


