
Marking local functions: pfe_tmu_context_memory pfe_tmu_hif_q_to_tmu_q pfe_tmu_cntx_mem_read pfe_tmu_cntx_mem_write


Marking externally visible functions: pfe_tmu_sch_cfg_get_bound_sched_output pfe_tmu_sch_cfg_bind_sched_output pfe_tmu_sch_cfg_get_bound_queue pfe_tmu_sch_cfg_bind_queue pfe_tmu_sch_cfg_get_input_weight pfe_tmu_sch_cfg_set_input_weight pfe_tmu_sch_cfg_get_algo pfe_tmu_sch_cfg_set_algo pfe_tmu_sch_cfg_get_rate_mode pfe_tmu_sch_cfg_set_rate_mode pfe_tmu_sch_cfg_init pfe_tmu_shp_cfg_init pfe_tmu_shp_cfg_disable pfe_tmu_shp_cfg_get_idle_slope pfe_tmu_shp_cfg_set_idle_slope pfe_tmu_shp_cfg_get_rate_mode pfe_tmu_shp_cfg_set_rate_mode pfe_tmu_shp_cfg_enable pfe_tmu_shp_cfg_get_position pfe_tmu_shp_cfg_set_position pfe_tmu_shp_cfg_get_limits pfe_tmu_shp_cfg_set_limits pfe_tmu_q_get_wred_zones pfe_tmu_q_get_wred_probability pfe_tmu_q_set_wred_probability pfe_tmu_q_mode_set_wred pfe_tmu_q_mode_set_tail_drop pfe_tmu_q_mode_set_default pfe_tmu_q_get_mode pfe_tmu_q_cfg_get_tx_count pfe_tmu_q_cfg_get_drop_count pfe_tmu_q_cfg_get_fill_level pfe_tmu_cfg_disable pfe_tmu_cfg_enable pfe_tmu_cfg_reset pfe_tmu_cfg_init pfe_tmu_q_reset_tail_drop_policy pfe_tmu_reclaim_init pfe_tmu_cfg_get_phy_config


Marking externally visible variables:


Reclaiming functions:
Reclaiming variables:
Clearing address taken flags:
Symbol table:

oal_time_usleep/67 (oal_time_usleep) @076f91c0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_tmu_cfg_reset/27 pfe_tmu_cntx_mem_read/31 pfe_tmu_cntx_mem_write/30 pfe_tmu_reclaim_init/24 
  Calls: 
pfe_feature_mgr_is_available/66 (pfe_feature_mgr_is_available) @076f90e0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_tmu_q_cfg_get_drop_count/35 pfe_tmu_cfg_init/26 pfe_tmu_reclaim_init/24 
  Calls: 
pfe_tmu_sch_cfg_get_bound_sched_output/65 (pfe_tmu_sch_cfg_get_bound_sched_output) @076eae00
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_sch_cfg_bind_sched_output/64 (pfe_tmu_sch_cfg_bind_sched_output) @076ea9a0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_sch_cfg_bind_queue/62 
pfe_tmu_sch_cfg_get_bound_queue/63 (pfe_tmu_sch_cfg_get_bound_queue) @076ea620
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_sch_cfg_bind_queue/62 (pfe_tmu_sch_cfg_bind_queue) @076ea1c0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_sch_cfg_bind_sched_output/64 pfe_tmu_cfg_init/26 
  Calls: 
pfe_tmu_sch_cfg_get_input_weight/61 (pfe_tmu_sch_cfg_get_input_weight) @076e4460
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_sch_cfg_set_input_weight/60 (pfe_tmu_sch_cfg_set_input_weight) @076e4c40
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_sch_cfg_get_algo/59 (pfe_tmu_sch_cfg_get_algo) @076e47e0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_sch_cfg_set_algo/58 (pfe_tmu_sch_cfg_set_algo) @076e4380
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_cfg_init/26 
  Calls: pfe_tmu_sch_cfg_get_rate_mode/57 
pfe_tmu_sch_cfg_get_rate_mode/57 (pfe_tmu_sch_cfg_get_rate_mode) @076e4000
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_sch_cfg_set_algo/58 
  Calls: 
pfe_tmu_sch_cfg_set_rate_mode/56 (pfe_tmu_sch_cfg_set_rate_mode) @06e511c0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_cfg_init/26 
  Calls: 
pfe_tmu_sch_cfg_init/55 (pfe_tmu_sch_cfg_init) @06e51c40
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_cfg_init/26 pfe_tmu_cfg_init/26 
  Calls: 
pfe_tmu_shp_cfg_init/54 (pfe_tmu_shp_cfg_init) @06e518c0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_cfg_init/26 pfe_tmu_cfg_init/26 pfe_tmu_cfg_init/26 pfe_tmu_cfg_init/26 
  Calls: pfe_tmu_shp_cfg_disable/53 
pfe_tmu_shp_cfg_disable/53 (pfe_tmu_shp_cfg_disable) @06e51540
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_shp_cfg_init/54 
  Calls: 
pfe_tmu_shp_cfg_get_idle_slope/52 (pfe_tmu_shp_cfg_get_idle_slope) @06e510e0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_shp_cfg_get_rate_mode/50 
pfe_tmu_shp_cfg_set_idle_slope/51 (pfe_tmu_shp_cfg_set_idle_slope) @06e4bee0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_shp_cfg_get_rate_mode/50 
pfe_tmu_shp_cfg_get_rate_mode/50 (pfe_tmu_shp_cfg_get_rate_mode) @06e4b9a0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_shp_cfg_get_idle_slope/52 pfe_tmu_shp_cfg_set_idle_slope/51 
  Calls: 
pfe_tmu_shp_cfg_set_rate_mode/49 (pfe_tmu_shp_cfg_set_rate_mode) @06e4b460
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_shp_cfg_enable/48 (pfe_tmu_shp_cfg_enable) @06e4b000
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_shp_cfg_get_position/47 (pfe_tmu_shp_cfg_get_position) @075f7ee0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_shp_cfg_set_position/46 (pfe_tmu_shp_cfg_set_position) @075f7a80
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_shp_cfg_get_limits/45 (pfe_tmu_shp_cfg_get_limits) @075f7620
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_shp_cfg_set_limits/44 (pfe_tmu_shp_cfg_set_limits) @075f70e0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_q_get_wred_zones/43 (pfe_tmu_q_get_wred_zones) @075e8b60
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_q_get_wred_probability/42 (pfe_tmu_q_get_wred_probability) @075e8620
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_cntx_mem_read/31 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_set_wred_probability/41 (pfe_tmu_q_set_wred_probability) @075e80e0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_cntx_mem_write/30 pfe_tmu_cntx_mem_read/31 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_mode_set_wred/40 (pfe_tmu_q_mode_set_wred) @075e8d20
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_context_memory/33 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_mode_set_tail_drop/39 (pfe_tmu_q_mode_set_tail_drop) @075e8a80
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_cfg_init/26 pfe_tmu_cfg_init/26 pfe_tmu_q_reset_tail_drop_policy/25 pfe_tmu_q_reset_tail_drop_policy/25 pfe_tmu_q_reset_tail_drop_policy/25 pfe_tmu_q_reset_tail_drop_policy/25 
  Calls: pfe_tmu_cntx_mem_write/30 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_mode_set_default/38 (pfe_tmu_q_mode_set_default) @075e87e0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_reclaim_init/24 
  Calls: pfe_tmu_cntx_mem_write/30 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_get_mode/37 (pfe_tmu_q_get_mode) @075e8540
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_cntx_mem_read/31 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_cfg_get_tx_count/36 (pfe_tmu_q_cfg_get_tx_count) @075e82a0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_cntx_mem_read/31 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_cfg_get_drop_count/35 (pfe_tmu_q_cfg_get_drop_count) @075e8000
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_feature_mgr_is_available/66 pfe_tmu_cntx_mem_read/31 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_q_cfg_get_fill_level/34 (pfe_tmu_q_cfg_get_fill_level) @075b9b60
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_cntx_mem_read/31 pfe_tmu_hif_q_to_tmu_q/32 
pfe_tmu_context_memory/33 (pfe_tmu_context_memory) @075b9380
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: pfe_tmu_q_mode_set_wred/40 pfe_tmu_reclaim_init/24 
  Calls: pfe_tmu_cntx_mem_write/30 pfe_tmu_cntx_mem_write/30 pfe_tmu_cntx_mem_write/30 
pfe_tmu_hif_q_to_tmu_q/32 (pfe_tmu_hif_q_to_tmu_q) @075b9e00
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: pfe_tmu_q_get_wred_probability/42 pfe_tmu_q_set_wred_probability/41 pfe_tmu_q_mode_set_wred/40 pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_q_mode_set_default/38 pfe_tmu_q_get_mode/37 pfe_tmu_q_cfg_get_tx_count/36 pfe_tmu_q_cfg_get_drop_count/35 pfe_tmu_q_cfg_get_fill_level/34 
  Calls: 
pfe_tmu_cntx_mem_read/31 (pfe_tmu_cntx_mem_read) @075b9a80
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: pfe_tmu_q_get_wred_probability/42 pfe_tmu_q_set_wred_probability/41 pfe_tmu_q_get_mode/37 pfe_tmu_q_cfg_get_tx_count/36 pfe_tmu_q_cfg_get_drop_count/35 pfe_tmu_q_cfg_get_fill_level/34 pfe_tmu_reclaim_init/24 
  Calls: oal_time_usleep/67 
pfe_tmu_cntx_mem_write/30 (pfe_tmu_cntx_mem_write) @075b9620
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: pfe_tmu_q_set_wred_probability/41 pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_q_mode_set_default/38 pfe_tmu_context_memory/33 pfe_tmu_context_memory/33 pfe_tmu_context_memory/33 
  Calls: oal_time_usleep/67 
pfe_tmu_cfg_disable/29 (pfe_tmu_cfg_disable) @075b92a0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_cfg_enable/28 (pfe_tmu_cfg_enable) @075b9000
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_tmu_cfg_reset/27 (pfe_tmu_cfg_reset) @075439a0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: pfe_tmu_cfg_init/26 
  Calls: oal_time_usleep/67 
pfe_tmu_cfg_init/26 (pfe_tmu_cfg_init) @07543ee0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_sch_cfg_set_algo/58 pfe_tmu_sch_cfg_set_rate_mode/56 pfe_tmu_sch_cfg_bind_queue/62 pfe_tmu_shp_cfg_init/54 pfe_tmu_shp_cfg_init/54 pfe_tmu_shp_cfg_init/54 pfe_tmu_shp_cfg_init/54 pfe_tmu_sch_cfg_init/55 pfe_tmu_sch_cfg_init/55 pfe_tmu_cfg_reset/27 pfe_feature_mgr_is_available/66 
pfe_tmu_q_reset_tail_drop_policy/25 (pfe_tmu_q_reset_tail_drop_policy) @07543b60
  Type: function definition analyzed
  Visibility: externally_visible public
  References: phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)phy_if_id_temp/22 (read)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_q_mode_set_tail_drop/39 pfe_tmu_q_mode_set_tail_drop/39 
pfe_tmu_reclaim_init/24 (pfe_tmu_reclaim_init) @075438c0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_tmu_q_mode_set_default/38 pfe_tmu_cntx_mem_read/31 oal_time_usleep/67 pfe_tmu_context_memory/33 pfe_feature_mgr_is_available/66 
pfe_tmu_cfg_get_phy_config/23 (pfe_tmu_cfg_get_phy_config) @07543620
  Type: function definition analyzed
  Visibility: externally_visible public
  References: tmu_phys/21 (read)tmu_phys/21 (addr)tmu_phys/21 (read)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
phy_if_id_temp/22 (phy_if_id_temp) @0753e360
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: pfe_tmu_q_reset_tail_drop_policy/25 (read)pfe_tmu_q_reset_tail_drop_policy/25 (read)pfe_tmu_q_reset_tail_drop_policy/25 (read)pfe_tmu_q_reset_tail_drop_policy/25 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)pfe_tmu_cfg_init/26 (read)
  Availability: available
  Varpool flags: initialized read-only const-value-known
tmu_phys/21 (tmu_phys) @0753e0d8
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: pfe_tmu_cfg_get_phy_config/23 (read)pfe_tmu_cfg_get_phy_config/23 (addr)pfe_tmu_cfg_get_phy_config/23 (read)
  Availability: available
  Varpool flags: initialized read-only const-value-known
pfe_tmu_sch_cfg_get_bound_sched_output (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input)
{
  uint8_t sched_id;
  uint32_t reg;
  addr_t sch_base_va;
  uint8_t D.11379;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 4096;
  sch_base_va = cbus_base_va + _3;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (sch != 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  sched_id = 255;

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = sch_base_va + 84;
  _5 = (volatile uint32_t *) _4;
  _6 = *_5;
  reg = _6 & 255;
  # DEBUG BEGIN_STMT
  _7 = (long unsigned int) input;
  if (reg == _7)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  sched_id = 0;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  sched_id = 255;

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11379 = sched_id;
  return D.11379;

}


pfe_tmu_sch_cfg_bind_sched_output (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t src_sch, uint8_t dst_sch, uint8_t input)
{
  errno_t ret;
  addr_t sch_base_va;
  errno_t D.11372;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) src_sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (src_sch != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

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

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _7 = pfe_tmu_sch_cfg_bind_queue (cbus_base_va, phy, dst_sch, input, 255);
  if (_7 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _8 = (long unsigned int) input;
  _9 = sch_base_va + 84;
  _10 = (volatile uint32_t *) _9;
  _11 = _8 & 15;
  *_10 = _11;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

  <bb 8> :
  # DEBUG BEGIN_STMT
  D.11372 = ret;
  return D.11372;

}


pfe_tmu_sch_cfg_get_bound_queue (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input)
{
  uint8_t queue;
  addr_t sch_base_va;
  uint32_t reg;
  uint8_t D.11363;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (input > 7)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  queue = 255;
  goto <bb 6>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _7 = input / 4;
  _8 = (long unsigned int) _7;
  _9 = _8 + 16;
  _10 = _9 * 4;
  _11 = sch_base_va + _10;
  _12 = (volatile uint32_t *) _11;
  reg = *_12;
  # DEBUG BEGIN_STMT
  _13 = (unsigned int) input;
  _14 = _13 & 3;
  _15 = _14 * 8;
  _16 = reg >> _15;
  queue = (uint8_t) _16;
  # DEBUG BEGIN_STMT
  if (queue > 7)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  queue = 255;

  <bb 6> :
  # DEBUG BEGIN_STMT
  D.11363 = queue;
  return D.11363;

}


pfe_tmu_sch_cfg_bind_queue (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input, uint8_t queue)
{
  errno_t ret;
  addr_t sch_base_va;
  uint32_t reg;
  errno_t D.11356;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = queue + 248;
  if (_7 <= 246)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (input > 7)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _8 = input / 4;
  _9 = (long unsigned int) _8;
  _10 = _9 + 16;
  _11 = _10 * 4;
  _12 = sch_base_va + _11;
  _13 = (volatile uint32_t *) _12;
  reg = *_13;
  # DEBUG BEGIN_STMT
  _14 = (unsigned int) input;
  _15 = _14 & 3;
  _16 = _15 * 8;
  _17 = 255 << _16;
  _18 = ~_17;
  reg = reg & _18;
  # DEBUG BEGIN_STMT
  _19 = (long unsigned int) queue;
  _20 = _19 & 31;
  _21 = (unsigned int) input;
  _22 = _21 & 3;
  _23 = _22 * 8;
  _24 = _20 << _23;
  reg = reg | _24;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _25 = input / 4;
  _26 = (long unsigned int) _25;
  _27 = _26 + 16;
  _28 = _27 * 4;
  _29 = sch_base_va + _28;
  _30 = (volatile uint32_t *) _29;
  *_30 = reg;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11356 = ret;
  return D.11356;

}


pfe_tmu_sch_cfg_get_input_weight (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input)
{
  uint32_t input_weight;
  addr_t sch_base_va;
  uint32_t D.11348;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (input > 7)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _7 = (long unsigned int) input;
  _8 = _7 + 8;
  _9 = _8 * 4;
  _10 = sch_base_va + _9;
  _11 = (volatile uint32_t *) _10;
  input_weight = *_11;

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.11348 = input_weight;
  return D.11348;

}


pfe_tmu_sch_cfg_set_input_weight (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, uint8_t input, uint32_t weight)
{
  errno_t ret;
  addr_t sch_base_va;
  errno_t D.11343;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (input > 7)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = (long unsigned int) input;
  _8 = _7 + 8;
  _9 = _8 * 4;
  _10 = sch_base_va + _9;
  _11 = (volatile uint32_t *) _10;
  *_11 = weight;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.11343 = ret;
  return D.11343;

}


pfe_tmu_sch_cfg_get_algo (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  pfe_tmu_sched_algo_t algo;
  addr_t sch_base_va;
  uint32_t reg;
  pfe_tmu_sched_algo_t D.11338;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  algo = 4;
  # DEBUG BEGIN_STMT
  sch_base_va.33_7 = (volatile uint32_t *) sch_base_va;
  reg = *sch_base_va.33_7;
  # DEBUG BEGIN_STMT
  _8 = reg & 15;
  switch (_8) <default: <L4> [INV], case 0: <L0> [INV], case 2: <L1> [INV], case 3: <L2> [INV], case 4: <L3> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  algo = 0;
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  algo = 1;
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  algo = 2;
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 6> :
<L3>:
  # DEBUG BEGIN_STMT
  algo = 3;
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 7> :
<L4>:
  # DEBUG BEGIN_STMT
  algo = 4;
  # DEBUG BEGIN_STMT

  <bb 8> :
  # DEBUG BEGIN_STMT
  D.11338 = algo;
  return D.11338;

}


pfe_tmu_sch_cfg_set_algo (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, pfe_tmu_sched_algo_t algo)
{
  errno_t ret;
  addr_t sch_base_va;
  uint32_t reg;
  errno_t D.11336;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  if (algo == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  reg = 0;
  goto <bb 13>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  reg = 2;
  goto <bb 13>; [INV]

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  reg = 3;
  goto <bb 13>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  if (algo == 3)
    goto <bb 9>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _7 = pfe_tmu_sch_cfg_get_rate_mode (cbus_base_va, phy, sch);
  if (_7 != 1)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

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

  <bb 11> :
  # DEBUG BEGIN_STMT
  reg = 4;
  goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  ret = 22;

  <bb 13> :
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  sch_base_va.32_8 = (volatile uint32_t *) sch_base_va;
  *sch_base_va.32_8 = reg;

  <bb 15> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11336 = ret;
  return D.11336;

}


pfe_tmu_sch_cfg_get_rate_mode (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  pfe_tmu_rate_mode_t rmode;
  addr_t sch_base_va;
  uint32_t reg;
  pfe_tmu_rate_mode_t D.11317;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  rmode = 2;
  # DEBUG BEGIN_STMT
  _7 = sch_base_va + 72;
  _8 = (volatile uint32_t *) _7;
  reg = *_8;
  # DEBUG BEGIN_STMT
  if (reg == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  rmode = 0;
  goto <bb 7>; [INV]

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

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  rmode = 2;

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11317 = rmode;
  return D.11317;

}


pfe_tmu_sch_cfg_set_rate_mode (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch, pfe_tmu_rate_mode_t mode)
{
  errno_t ret;
  addr_t sch_base_va;
  uint32_t reg;
  errno_t D.11309;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  if (mode == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  reg = 0;
  goto <bb 7>; [INV]

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

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = sch_base_va + 72;
  _8 = (volatile uint32_t *) _7;
  *_8 = reg;

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11309 = ret;
  return D.11309;

}


pfe_tmu_sch_cfg_init (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t sch)
{
  addr_t sch_base_va;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) sch;
  _5 = _3 + _4;
  _6 = _5 * 256;
  sch_base_va = cbus_base_va + _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = sch_base_va + 64;
  _8 = (volatile uint32_t *) _7;
  *_8 = 4294967295;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = sch_base_va + 68;
  _10 = (volatile uint32_t *) _9;
  *_10 = 4294967295;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (sch == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _11 = sch_base_va + 84;
  _12 = (volatile uint32_t *) _11;
  *_12 = 15;

  <bb 4> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_shp_cfg_init (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  addr_t shp_base_va;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  pfe_tmu_shp_cfg_disable (cbus_base_va, phy, shp);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _8 = shp_base_va + 12;
  _9 = (volatile uint32_t *) _8;
  *_9 = 62;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _10 = shp_base_va + 8;
  _11 = (volatile uint32_t *) _10;
  *_11 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = shp_base_va + 16;
  _13 = (volatile uint32_t *) _12;
  *_13 = 0;
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_shp_cfg_disable (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  uint32_t reg;
  addr_t shp_base_va;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  shp_base_va.30_8 = (volatile uint32_t *) shp_base_va;
  _9 = *shp_base_va.30_8;
  reg = _9 & 4294967294;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  shp_base_va.31_10 = (volatile uint32_t *) shp_base_va;
  *shp_base_va.31_10 = reg;
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_shp_cfg_get_idle_slope (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  addr_t shp_base_va;
  uint64_t isl;
  uint32_t reg;
  uint32_t wgt;
  uint64_t sys_clk_hz;
  uint32_t D.11297;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  _8 = cbus_base_va + 606272;
  _9 = (volatile uint32_t *) _8;
  reg = *_9;
  # DEBUG BEGIN_STMT
  _10 = (long long unsigned int) reg;
  _11 = _10 & 65535;
  sys_clk_hz = _11 * 1000000;
  # DEBUG BEGIN_STMT
  _12 = shp_base_va + 4;
  _13 = (volatile uint32_t *) _12;
  _14 = *_13;
  wgt = _14 & 1048575;
  # DEBUG BEGIN_STMT
  _15 = pfe_tmu_shp_cfg_get_rate_mode (cbus_base_va, phy, shp);
  _16 = (int) _15;
  switch (_16) <default: <L2> [INV], case 0: <L0> [INV], case 1: <L1> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  _17 = (long long unsigned int) wgt;
  _18 = sys_clk_hz * _17;
  _19 = _18 * 8;
  isl = _19 / 1048576;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _20 = (long long unsigned int) wgt;
  _21 = sys_clk_hz * _20;
  isl = _21 / 1048576;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  isl = 0;
  # DEBUG BEGIN_STMT

  <bb 6> :
  # DEBUG BEGIN_STMT
  D.11297 = (uint32_t) isl;
  return D.11297;

}


pfe_tmu_shp_cfg_set_idle_slope (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp, uint32_t isl)
{
  addr_t shp_base_va;
  uint64_t sys_clk_hz;
  uint64_t wgt;
  errno_t ret;
  uint32_t reg;
  errno_t D.11295;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  _8 = cbus_base_va + 606272;
  _9 = (volatile uint32_t *) _8;
  reg = *_9;
  # DEBUG BEGIN_STMT
  _10 = (long long unsigned int) reg;
  _11 = _10 & 65535;
  sys_clk_hz = _11 * 1000000;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = pfe_tmu_shp_cfg_get_rate_mode (cbus_base_va, phy, shp);
  _13 = (int) _12;
  switch (_13) <default: <L2> [INV], case 0: <L0> [INV], case 1: <L1> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  _14 = (long long unsigned int) isl;
  _15 = _14 + 1;
  _16 = _15 * 1048576;
  _17 = sys_clk_hz * 8;
  wgt = _16 / _17;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _18 = (long long unsigned int) isl;
  _19 = _18 + 1;
  _20 = _19 * 1048576;
  wgt = _20 / sys_clk_hz;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  ret = 22;
  # DEBUG BEGIN_STMT

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _21 = (long unsigned int) wgt;
  _22 = shp_base_va + 4;
  _23 = (volatile uint32_t *) _22;
  _24 = _21 & 1048575;
  *_23 = _24;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  shp_base_va.28_25 = (volatile uint32_t *) shp_base_va;
  reg = *shp_base_va.28_25;
  # DEBUG BEGIN_STMT
  reg = reg & 1;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  shp_base_va.29_26 = (volatile uint32_t *) shp_base_va;
  _27 = reg | 14;
  *shp_base_va.29_26 = _27;

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11295 = ret;
  return D.11295;

}


pfe_tmu_shp_cfg_get_rate_mode (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  pfe_tmu_rate_mode_t rate_mode;
  addr_t shp_base_va;
  uint32_t reg;
  pfe_tmu_rate_mode_t D.11289;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  shp_base_va.27_8 = (volatile uint32_t *) shp_base_va;
  reg = *shp_base_va.27_8;
  # DEBUG BEGIN_STMT
  _9 = reg & 1;
  if (_9 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  rate_mode = 2;
  goto <bb 7>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _10 = shp_base_va + 12;
  _11 = (volatile uint32_t *) _10;
  reg = *_11;
  # DEBUG BEGIN_STMT
  _12 = reg & 1;
  if (_12 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  rate_mode = 0;

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11289 = rate_mode;
  return D.11289;

}


pfe_tmu_shp_cfg_set_rate_mode (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp, pfe_tmu_rate_mode_t mode)
{
  errno_t ret;
  addr_t shp_base_va;
  uint32_t reg;
  errno_t D.11281;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  _8 = shp_base_va + 12;
  _9 = (volatile uint32_t *) _8;
  reg = *_9;
  # DEBUG BEGIN_STMT
  if (mode == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  reg = reg & 4294967294;
  goto <bb 7>; [INV]

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

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _10 = shp_base_va + 12;
  _11 = (volatile uint32_t *) _10;
  *_11 = reg;

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11281 = ret;
  return D.11281;

}


pfe_tmu_shp_cfg_enable (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  addr_t shp_base_va;
  uint32_t reg;
  errno_t D.11271;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  shp_base_va.25_8 = (volatile uint32_t *) shp_base_va;
  _9 = *shp_base_va.25_8;
  reg = _9 | 1;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  shp_base_va.26_10 = (volatile uint32_t *) shp_base_va;
  *shp_base_va.26_10 = reg;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11271 = 0;
  return D.11271;

}


pfe_tmu_shp_cfg_get_position (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp)
{
  addr_t shp_base_va;
  uint8_t D.11269;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  _8 = shp_base_va + 12;
  _9 = (volatile uint32_t *) _8;
  _10 = *_9;
  _11 = _10 >> 1;
  _12 = (unsigned char) _11;
  D.11269 = _12 & 31;
  return D.11269;

}


pfe_tmu_shp_cfg_set_position (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp, uint8_t pos)
{
  errno_t ret;
  uint32_t reg;
  addr_t shp_base_va;
  errno_t D.11267;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _8 = pos + 239;
  if (_8 <= 237)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _9 = shp_base_va + 12;
  _10 = (volatile uint32_t *) _9;
  reg = *_10;
  # DEBUG BEGIN_STMT
  reg = reg & 4294967233;
  # DEBUG BEGIN_STMT
  _11 = (long unsigned int) pos;
  _12 = _11 << 1;
  _13 = _12 & 62;
  reg = reg | _13;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _14 = shp_base_va + 12;
  _15 = (volatile uint32_t *) _14;
  *_15 = reg;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.11267 = ret;
  return D.11267;

}


pfe_tmu_shp_cfg_get_limits (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp, int32_t * max_credit, int32_t * min_credit)
{
  addr_t shp_base_va;
  errno_t D.11262;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  _8 = shp_base_va + 8;
  _9 = (volatile uint32_t *) _8;
  _10 = *_9;
  _11 = (long int) _10;
  _12 = _11 >> 10;
  *max_credit = _12;
  # DEBUG BEGIN_STMT
  _13 = shp_base_va + 16;
  _14 = (volatile uint32_t *) _13;
  _15 = *_14;
  _16 = (long int) _15;
  _17 = -_16;
  *min_credit = _17;
  # DEBUG BEGIN_STMT
  D.11262 = 0;
  return D.11262;

}


pfe_tmu_shp_cfg_set_limits (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t shp, int32_t max_credit, int32_t min_credit)
{
  errno_t ret;
  addr_t shp_base_va;
  errno_t D.11260;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) phy;
  _2 = _1 + 129;
  _3 = _2 * 16;
  _4 = (long unsigned int) shp;
  _5 = _3 + _4;
  _6 = _5 + 2;
  _7 = _6 * 256;
  shp_base_va = cbus_base_va + _7;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  max_credit.22_8 = (unsigned int) max_credit;
  if (max_credit.22_8 > 4194303)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  min_credit.23_9 = (unsigned int) min_credit;
  _10 = min_credit.23_9 + 4194303;
  if (_10 > 4194303)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  max_credit.24_11 = (long unsigned int) max_credit;
  _12 = shp_base_va + 8;
  _13 = (volatile uint32_t *) _12;
  _14 = max_credit.24_11 << 10;
  *_13 = _14;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _15 = -min_credit;
  _16 = shp_base_va + 16;
  _17 = (volatile uint32_t *) _16;
  _18 = (long unsigned int) _15;
  *_17 = _18;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11260 = ret;
  return D.11260;

}


pfe_tmu_q_get_wred_zones (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue)
{
  uint8_t D.11252;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11252 = 8;
  return D.11252;

}


pfe_tmu_q_get_wred_probability (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint8_t zone, uint8_t * prob)
{
  uint8_t queue_temp;
  uint8_t pos;
  uint32_t reg;
  errno_t ret;
  errno_t D.11249;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  queue_temp = queue;
  # DEBUG BEGIN_STMT
  if (zone > 7)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  queue_temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (queue_temp == 255)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 8> :
  # DEBUG BEGIN_STMT
  _2 = zone / 6;
  pos = _2 + 5;
  # DEBUG BEGIN_STMT
  _3 = queue_temp * 8;
  _4 = pos + _3;
  ret = pfe_tmu_cntx_mem_read (cbus_base_va, phy, _4, &reg);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  reg.20_5 = reg;
  _6 = zone % 6;
  _7 = (unsigned int) _6;
  _8 = _7 * 5;
  _9 = reg.20_5 >> _8;
  reg = _9;
  # DEBUG BEGIN_STMT
  reg.21_10 = reg;
  _11 = reg.21_10 & 31;
  _12 = _11 * 100;
  _13 = _12 / 31;
  _14 = (unsigned char) _13;
  *prob = _14;

  <bb 10> :
  # DEBUG BEGIN_STMT
  D.11249 = ret;
  reg = {CLOBBER};
  return D.11249;

}


pfe_tmu_q_set_wred_probability (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint8_t zone, uint8_t prob)
{
  uint8_t queue_temp;
  uint8_t pos;
  uint32_t reg;
  errno_t ret;
  errno_t D.11235;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  queue_temp = queue;
  # DEBUG BEGIN_STMT
  if (prob > 100)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  if (zone > 7)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  queue_temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (queue_temp == 255)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 9> :
  # DEBUG BEGIN_STMT
  _2 = zone / 6;
  pos = _2 + 5;
  # DEBUG BEGIN_STMT
  _3 = queue_temp * 8;
  _4 = pos + _3;
  ret = pfe_tmu_cntx_mem_read (cbus_base_va, phy, _4, &reg);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _5 = zone % 6;
  _6 = (unsigned int) _5;
  _7 = _6 * 5;
  _8 = 31 << _7;
  _9 = ~_8;
  reg.17_10 = reg;
  _11 = _9 & reg.17_10;
  reg = _11;
  # DEBUG BEGIN_STMT
  _12 = (long unsigned int) prob;
  _13 = _12 * 31;
  _14 = _13 / 100;
  _15 = _14 & 31;
  _16 = zone % 6;
  _17 = (unsigned int) _16;
  _18 = _17 * 5;
  _19 = _15 << _18;
  reg.18_20 = reg;
  _21 = _19 | reg.18_20;
  reg = _21;
  # DEBUG BEGIN_STMT
  _22 = queue_temp * 8;
  _23 = pos + _22;
  reg.19_24 = reg;
  ret = pfe_tmu_cntx_mem_write (cbus_base_va, phy, _23, reg.19_24);

  <bb 11> :
  # DEBUG BEGIN_STMT
  D.11235 = ret;
  reg = {CLOBBER};
  return D.11235;

}


pfe_tmu_q_mode_set_wred (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint16_t min, uint16_t max)
{
  uint8_t queue_temp;
  errno_t ret;
  errno_t D.11221;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  queue_temp = queue;
  # DEBUG BEGIN_STMT
  if (max > 511)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  if (min > 511)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  queue_temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (queue_temp == 255)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 9> :
  # DEBUG BEGIN_STMT
  ret = pfe_tmu_context_memory (cbus_base_va, phy, queue_temp, min, max);

  <bb 10> :
  # DEBUG BEGIN_STMT
  D.11221 = ret;
  return D.11221;

}


pfe_tmu_q_mode_set_tail_drop (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint16_t max)
{
  errno_t ret;
  uint8_t queue_temp;
  uint32_t reg;
  errno_t D.11209;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  queue_temp = queue;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  if (max > 255)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  queue_temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (queue_temp == 255)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 8> :
  # DEBUG BEGIN_STMT
  _2 = (long unsigned int) max;
  _3 = _2 << 11;
  reg = _3 | 1;
  # DEBUG BEGIN_STMT
  _4 = queue_temp * 8;
  _5 = _4 + 4;
  ret = pfe_tmu_cntx_mem_write (cbus_base_va, phy, _5, reg);

  <bb 9> :
  # DEBUG BEGIN_STMT
  D.11209 = ret;
  return D.11209;

}


pfe_tmu_q_mode_set_default (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue)
{
  errno_t ret;
  uint8_t temp;
  errno_t D.11198;

  <bb 2> :
  # DEBUG BEGIN_STMT
  temp = queue;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (temp == 255)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = cbus_base_va + 524364;
  _3 = (volatile uint32_t *) _2;
  *_3 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = temp * 8;
  _5 = _4 + 4;
  ret = pfe_tmu_cntx_mem_write (cbus_base_va, phy, _5, 0);

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11198 = ret;
  return D.11198;

}


pfe_tmu_q_get_mode (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * min, uint32_t * max)
{
  uint8_t temp;
  pfe_tmu_queue_mode_t mode;
  errno_t ret;
  uint32_t reg;
  pfe_tmu_queue_mode_t D.11189;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  mode = 2;
  # DEBUG BEGIN_STMT
  temp = queue;
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (temp == 255)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  mode = 3;

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (mode == 2)
    goto <bb 6>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = temp * 8;
  _3 = _2 + 4;
  ret = pfe_tmu_cntx_mem_read (cbus_base_va, phy, _3, &reg);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  mode = 3;
  goto <bb 12>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  reg.13_4 = reg;
  _5 = reg.13_4 & 3;
  switch (_5) <default: <L9> [INV], case 1: <L7> [INV], case 2: <L8> [INV]>

  <bb 9> :
<L7>:
  # DEBUG BEGIN_STMT
  mode = 0;
  # DEBUG BEGIN_STMT
  reg.14_6 = reg;
  _7 = reg.14_6 >> 11;
  _8 = _7 & 511;
  *max = _8;
  # DEBUG BEGIN_STMT
  *min = 0;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 10> :
<L8>:
  # DEBUG BEGIN_STMT
  mode = 1;
  # DEBUG BEGIN_STMT
  reg.15_9 = reg;
  _10 = reg.15_9 >> 11;
  _11 = _10 & 511;
  *max = _11;
  # DEBUG BEGIN_STMT
  reg.16_12 = reg;
  _13 = reg.16_12 >> 2;
  _14 = _13 & 511;
  *min = _14;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 11> :
<L9>:
  # DEBUG BEGIN_STMT
  mode = 2;
  # DEBUG BEGIN_STMT
  *max = 0;
  # DEBUG BEGIN_STMT
  *min = 0;
  # DEBUG BEGIN_STMT

  <bb 12> :
  # DEBUG BEGIN_STMT
  D.11189 = mode;
  reg = {CLOBBER};
  return D.11189;

}


pfe_tmu_q_cfg_get_tx_count (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * cnt)
{
  errno_t ret;
  uint8_t temp;
  errno_t D.11178;

  <bb 2> :
  # DEBUG BEGIN_STMT
  temp = queue;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (temp == 255)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = temp * 8;
  _3 = _2 + 3;
  ret = pfe_tmu_cntx_mem_read (cbus_base_va, phy, _3, cnt);

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11178 = ret;
  return D.11178;

}


pfe_tmu_q_cfg_get_drop_count (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * cnt)
{
  uint8_t temp;
  errno_t ret;
  uint32_t drops;
  errno_t D.11169;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  temp = queue;
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (temp == 255)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = temp * 8;
  _3 = _2 + 2;
  ret = pfe_tmu_cntx_mem_read (cbus_base_va, phy, _3, &drops);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  if (phy == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 8> :
  if (queue == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 9> :
  _4 = pfe_feature_mgr_is_available ("drv_run_on_g3");
  if (_4 == 0)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  drops.11_5 = drops;
  _6 = drops.11_5 + 4294967040;
  *cnt = _6;
  goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  drops.12_7 = drops;
  *cnt = drops.12_7;

  <bb 12> :
  # DEBUG BEGIN_STMT
  D.11169 = ret;
  drops = {CLOBBER};
  return D.11169;

}


pfe_tmu_q_cfg_get_fill_level (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue, uint32_t * level)
{
  errno_t ret;
  uint8_t queue_temp;
  errno_t D.11146;

  <bb 2> :
  # DEBUG BEGIN_STMT
  queue_temp = queue;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  queue_temp = pfe_tmu_hif_q_to_tmu_q (cbus_base_va, phy, queue);
  # DEBUG BEGIN_STMT
  if (queue_temp == 255)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret = 22;

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = queue_temp * 8;
  _3 = _2 + 1;
  ret = pfe_tmu_cntx_mem_read (cbus_base_va, phy, _3, level);

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11146 = ret;
  return D.11146;

}


pfe_tmu_context_memory (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue_temp, uint16_t min, uint16_t max)
{
  errno_t ret;
  uint32_t reg;
  errno_t D.11083;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  reg = 0;
  # DEBUG BEGIN_STMT
  _1 = queue_temp * 8;
  _2 = _1 + 5;
  ret = pfe_tmu_cntx_mem_write (cbus_base_va, phy, _2, reg);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = queue_temp * 8;
  _4 = _3 + 6;
  ret = pfe_tmu_cntx_mem_write (cbus_base_va, phy, _4, reg);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _5 = (long unsigned int) max;
  _6 = _5 << 11;
  _7 = (long unsigned int) min;
  _8 = _7 << 2;
  _9 = _6 | _8;
  reg = _9 | 2;
  # DEBUG BEGIN_STMT
  _10 = queue_temp * 8;
  _11 = _10 + 4;
  ret = pfe_tmu_cntx_mem_write (cbus_base_va, phy, _11, reg);

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.11083 = ret;
  return D.11083;

}


pfe_tmu_hif_q_to_tmu_q (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t queue)
{
  uint8_t tmu_queue;
  int8_t hif_queue;
  uint32_t ii;
  uint32_t reg;
  uint8_t D.11154;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  hif_queue = -1;
  # DEBUG BEGIN_STMT
  tmu_queue = 255;
  # DEBUG BEGIN_STMT
  _1 = phy + 250;
  if (_1 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = cbus_base_va + 622796;
  _3 = (volatile uint32_t *) _2;
  reg = *_3;
  # DEBUG BEGIN_STMT
  ii = 0;
  goto <bb 8>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) phy;
  _5 = _4 + 4294967290;
  _6 = ii * 4;
  _7 = reg >> _6;
  _8 = _7 & 15;
  if (_5 == _8)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  hif_queue.8_9 = hif_queue;
  hif_queue.9_10 = (unsigned char) hif_queue.8_9;
  _11 = hif_queue.9_10 + 1;
  hif_queue = (int8_t) _11;
  # DEBUG BEGIN_STMT
  hif_queue.10_12 = (unsigned char) hif_queue;
  if (queue == hif_queue.10_12)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  tmu_queue = (uint8_t) ii;
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ii = ii + 1;

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

  <bb 9> :
  # DEBUG BEGIN_STMT
  D.11154 = tmu_queue;
  return D.11154;

}


pfe_tmu_cntx_mem_read (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t loc, uint32_t * data)
{
  errno_t ret;
  pfe_ct_phy_if_id_t phy_temp;
  uint32_t timeout;
  uint32_t reg;
  errno_t D.11099;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  timeout = 20;
  # DEBUG BEGIN_STMT
  phy_temp = phy;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = cbus_base_va + 524596;
  _2 = (volatile uint32_t *) _1;
  *_2 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = (int) phy;
  switch (_3) <default: <L10> [INV], case 0 ... 2: <L21> [INV], case 3: <L5> [INV], case 4 ... 5: <L21> [INV], case 6 ... 9: <L5> [INV]>

  <bb 3> :
<L5>:
  # DEBUG BEGIN_STMT
  phy_temp = 3;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 4> :
<L10>:
  # DEBUG BEGIN_STMT
  ret = 22;
  # DEBUG BEGIN_STMT

  <bb 5> :
<L21>:
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) phy_temp;
  _5 = _4 << 16;
  _6 = _5 & 2031616;
  _7 = (long unsigned int) loc;
  _8 = cbus_base_va + 524600;
  _9 = (volatile uint32_t *) _8;
  _10 = _6 | _7;
  *_9 = _10;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _11 = cbus_base_va + 524608;
  _12 = (volatile uint32_t *) _11;
  *_12 = 2;

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_time_usleep (10);
  # DEBUG BEGIN_STMT
  timeout = timeout + 4294967295;
  # DEBUG BEGIN_STMT
  _13 = cbus_base_va + 524608;
  _14 = (volatile uint32_t *) _13;
  reg = *_14;
  # DEBUG BEGIN_STMT
  _15 = reg & 4;
  if (_15 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  if (timeout != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

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

  <bb 10> :
  # DEBUG BEGIN_STMT
  ret = 110;
  goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _16 = cbus_base_va + 524604;
  _17 = (volatile uint32_t *) _16;
  _18 = *_17;
  *data = _18;

  <bb 12> :
  # DEBUG BEGIN_STMT
  D.11099 = ret;
  return D.11099;

}


pfe_tmu_cntx_mem_write (addr_t cbus_base_va, pfe_ct_phy_if_id_t phy, uint8_t loc, uint32_t data)
{
  errno_t ret;
  pfe_ct_phy_if_id_t phy_temp;
  uint32_t timeout;
  uint32_t reg;
  errno_t D.11090;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  timeout = 200;
  # DEBUG BEGIN_STMT
  phy_temp = phy;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = cbus_base_va + 524596;
  _2 = (volatile uint32_t *) _1;
  *_2 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = (int) phy;
  switch (_3) <default: <L10> [INV], case 0 ... 2: <L20> [INV], case 3: <L5> [INV], case 4 ... 5: <L20> [INV], case 6 ... 9: <L5> [INV]>

  <bb 3> :
<L5>:
  # DEBUG BEGIN_STMT
  phy_temp = 3;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 4> :
<L10>:
  # DEBUG BEGIN_STMT
  ret = 22;
  # DEBUG BEGIN_STMT

  <bb 5> :
<L20>:
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) phy_temp;
  _5 = _4 << 16;
  _6 = _5 & 2031616;
  _7 = (long unsigned int) loc;
  _8 = cbus_base_va + 524600;
  _9 = (volatile uint32_t *) _8;
  _10 = _6 | _7;
  *_9 = _10;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _11 = cbus_base_va + 524604;
  _12 = (volatile uint32_t *) _11;
  *_12 = data;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _13 = cbus_base_va + 524608;
  _14 = (volatile uint32_t *) _13;
  *_14 = 3;

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_time_usleep (1);
  # DEBUG BEGIN_STMT
  timeout = timeout + 4294967295;
  # DEBUG BEGIN_STMT
  _15 = cbus_base_va + 524608;
  _16 = (volatile uint32_t *) _15;
  reg = *_16;
  # DEBUG BEGIN_STMT
  _17 = reg & 4;
  if (_17 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  if (timeout != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

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

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

  <bb 11> :
  # DEBUG BEGIN_STMT
  D.11090 = ret;
  return D.11090;

}


pfe_tmu_cfg_disable (addr_t cbus_base_va)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_cfg_enable (addr_t cbus_base_va)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_cfg_reset (addr_t cbus_base_va)
{
  uint32_t reg;
  uint32_t timeout;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timeout = 200;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = cbus_base_va + 524344;
  _2 = (volatile uint32_t *) _1;
  *_2 = 1;

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_time_usleep (10);
  # DEBUG BEGIN_STMT
  timeout = timeout + 4294967295;
  # DEBUG BEGIN_STMT
  _3 = cbus_base_va + 524344;
  _4 = (volatile uint32_t *) _3;
  reg = *_4;
  # DEBUG BEGIN_STMT
  _5 = reg & 1;
  if (_5 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return;

}


pfe_tmu_cfg_init (addr_t cbus_base_va, const struct pfe_tmu_cfg_t * cfg)
{
  uint32_t regval;
  errno_t ret;
  uint32_t ii;
  uint8_t queue;
  errno_t D.11135;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = pfe_feature_mgr_is_available ("drv_run_on_g3");
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = cbus_base_va + 524364;
  _3 = (volatile uint32_t *) _2;
  regval = *_3;
  # DEBUG BEGIN_STMT
  regval = regval | 4;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = cbus_base_va + 524364;
  _5 = (volatile uint32_t *) _4;
  *_5 = regval;

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = cbus_base_va + 524528;
  _7 = (volatile uint32_t *) _6;
  *_7 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _8 = cbus_base_va + 524532;
  _9 = (volatile uint32_t *) _8;
  *_9 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _10 = cbus_base_va + 524536;
  _11 = (volatile uint32_t *) _10;
  *_11 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = cbus_base_va + 524540;
  _13 = (volatile uint32_t *) _12;
  *_13 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _14 = cbus_base_va + 524548;
  _15 = (volatile uint32_t *) _14;
  *_15 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_tmu_cfg_reset (cbus_base_va);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _16 = cbus_base_va + 524388;
  _17 = (volatile uint32_t *) _16;
  *_17 = 3221930032;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _18 = cbus_base_va + 524392;
  _19 = (volatile uint32_t *) _18;
  *_19 = 3221946416;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _20 = cbus_base_va + 524396;
  _21 = (volatile uint32_t *) _20;
  *_21 = 3221962800;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _22 = cbus_base_va + 524452;
  _23 = (volatile uint32_t *) _22;
  *_23 = 3221864496;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _24 = cbus_base_va + 524400;
  _25 = (volatile uint32_t *) _24;
  *_25 = 3221864496;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _26 = cbus_base_va + 524408;
  _27 = (volatile uint32_t *) _26;
  *_27 = 3222061072;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ii = 0;
  goto <bb 24>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _28 = phy_if_id_temp[ii];
  pfe_tmu_sch_cfg_init (cbus_base_va, _28, 0);
  # DEBUG BEGIN_STMT
  _29 = phy_if_id_temp[ii];
  pfe_tmu_sch_cfg_init (cbus_base_va, _29, 1);
  # DEBUG BEGIN_STMT
  _30 = phy_if_id_temp[ii];
  pfe_tmu_shp_cfg_init (cbus_base_va, _30, 0);
  # DEBUG BEGIN_STMT
  _31 = phy_if_id_temp[ii];
  pfe_tmu_shp_cfg_init (cbus_base_va, _31, 1);
  # DEBUG BEGIN_STMT
  _32 = phy_if_id_temp[ii];
  pfe_tmu_shp_cfg_init (cbus_base_va, _32, 2);
  # DEBUG BEGIN_STMT
  _33 = phy_if_id_temp[ii];
  pfe_tmu_shp_cfg_init (cbus_base_va, _33, 3);
  # DEBUG BEGIN_STMT
  queue = 0;
  goto <bb 9>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _34 = phy_if_id_temp[ii];
  ret = pfe_tmu_sch_cfg_bind_queue (cbus_base_va, _34, 1, queue, queue);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 114;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  queue.6_35 = queue;
  queue = queue.6_35 + 1;

  <bb 9> :
  # DEBUG BEGIN_STMT
  if (queue <= 7)
    goto <bb 6>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 11>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _36 = phy_if_id_temp[ii];
  ret = pfe_tmu_sch_cfg_set_rate_mode (cbus_base_va, _36, 1, 0);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 114;
  goto <bb 22>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  _37 = phy_if_id_temp[ii];
  ret = pfe_tmu_sch_cfg_set_algo (cbus_base_va, _37, 1, 2);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 114;
  goto <bb 22>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  queue = 0;
  goto <bb 21>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  if (ii == 3)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  _38 = phy_if_id_temp[ii];
  ret = pfe_tmu_q_mode_set_tail_drop (cbus_base_va, _38, queue, 16);
  goto <bb 19>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  _39 = phy_if_id_temp[ii];
  ret = pfe_tmu_q_mode_set_tail_drop (cbus_base_va, _39, queue, 31);

  <bb 19> :
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 22>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  queue.7_40 = queue;
  queue = queue.7_40 + 1;

  <bb 21> :
  # DEBUG BEGIN_STMT
  if (queue <= 7)
    goto <bb 16>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 25>; [INV]
  else
    goto <bb 23>; [INV]

  <bb 23> :
  # DEBUG BEGIN_STMT
  ii = ii + 1;

  <bb 24> :
  # DEBUG BEGIN_STMT
  if (ii <= 5)
    goto <bb 5>; [INV]
  else
    goto <bb 25>; [INV]

  <bb 25> :
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 26>; [INV]
  else
    goto <bb 27>; [INV]

  <bb 26> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _41 = cbus_base_va + 524348;
  _42 = (volatile uint32_t *) _41;
  *_42 = 3221782580;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _43 = cbus_base_va + 524368;
  _44 = (volatile uint32_t *) _43;
  *_44 = 3221798964;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _45 = cbus_base_va + 524352;
  _46 = (volatile uint32_t *) _45;
  *_46 = 256;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _47 = cbus_base_va + 524292;
  _48 = (volatile uint32_t *) _47;
  *_48 = 252;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _49 = cbus_base_va + 524528;
  _50 = (volatile uint32_t *) _49;
  *_50 = 15;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _51 = cbus_base_va + 524532;
  _52 = (volatile uint32_t *) _51;
  *_52 = 15;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _53 = cbus_base_va + 524536;
  _54 = (volatile uint32_t *) _53;
  *_54 = 15;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _55 = cbus_base_va + 524592;
  _56 = (volatile uint32_t *) _55;
  *_56 = 15;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _57 = cbus_base_va + 524540;
  _58 = (volatile uint32_t *) _57;
  *_58 = 15;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _59 = cbus_base_va + 524548;
  _60 = (volatile uint32_t *) _59;
  *_60 = 15;

  <bb 27> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.11135 = ret;
  return D.11135;

}


pfe_tmu_q_reset_tail_drop_policy (addr_t cbus_base_va)
{
  errno_t ret;
  uint32_t ii;
  uint8_t queue;
  errno_t D.11114;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ii = 0;
  goto <bb 21>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = phy_if_id_temp[ii];
  ret = pfe_tmu_q_mode_set_tail_drop (cbus_base_va, _1, 0, 150);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 22>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = phy_if_id_temp[ii];
  ret = pfe_tmu_q_mode_set_tail_drop (cbus_base_va, _2, queue, 15);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 18>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  queue.3_3 = queue;
  queue = queue.3_3 + 1;

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

  <bb 9> :
  # DEBUG BEGIN_STMT
  if (ii == 3)
    goto <bb 10>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  queue = 0;
  goto <bb 13>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _4 = phy_if_id_temp[ii];
  ret = pfe_tmu_q_mode_set_tail_drop (cbus_base_va, _4, queue, 16);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 18>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  queue.4_5 = queue;
  queue = queue.4_5 + 1;

  <bb 13> :
  # DEBUG BEGIN_STMT
  if (queue <= 7)
    goto <bb 11>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  queue = 0;
  goto <bb 17>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  _6 = phy_if_id_temp[ii];
  ret = pfe_tmu_q_mode_set_tail_drop (cbus_base_va, _6, queue, 31);
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 18>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  queue.5_7 = queue;
  queue = queue.5_7 + 1;

  <bb 17> :
  # DEBUG BEGIN_STMT
  if (queue <= 7)
    goto <bb 15>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  if (ret != 0)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  D.11114 = ret;
  // predicted unlikely by early return (on trees) predictor.
  goto <bb 23>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  ii = ii + 1;

  <bb 21> :
  # DEBUG BEGIN_STMT
  if (ii <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  D.11114 = ret;

  <bb 23> :
  return D.11114;

}


pfe_tmu_reclaim_init (addr_t cbus_base_va)
{
  uint32_t retries;
  uint32_t dropped_packets;
  uint32_t ii;
  uint8_t queue;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  dropped_packets = 0;
  # DEBUG BEGIN_STMT
  retries = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = cbus_base_va + 524596;
  _2 = (volatile uint32_t *) _1;
  *_2 = 1;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ii = 0;
  goto <bb 7>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = ii << 8;
  _4 = _3 & 7936;
  _5 = (long unsigned int) queue;
  _6 = _5 & 7;
  _7 = cbus_base_va + 524308;
  _8 = (volatile uint32_t *) _7;
  _9 = _4 | _6;
  *_8 = _9;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  __asm__ __volatile__("nop" :  :  : "memory");
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _10 = cbus_base_va + 524312;
  _11 = (volatile uint32_t *) _10;
  *_11 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = cbus_base_va + 524316;
  _13 = (volatile uint32_t *) _12;
  *_13 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _14 = cbus_base_va + 524320;
  _15 = (volatile uint32_t *) _14;
  *_15 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _16 = cbus_base_va + 524324;
  _17 = (volatile uint32_t *) _16;
  *_17 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _18 = cbus_base_va + 524328;
  _19 = (volatile uint32_t *) _18;
  *_19 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _20 = cbus_base_va + 524332;
  _21 = (volatile uint32_t *) _20;
  *_21 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _22 = cbus_base_va + 524336;
  _23 = (volatile uint32_t *) _22;
  *_23 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _24 = cbus_base_va + 524340;
  _25 = (volatile uint32_t *) _24;
  *_25 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  queue.0_26 = queue;
  queue = queue.0_26 + 1;

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  ii = ii + 1;

  <bb 7> :
  # DEBUG BEGIN_STMT
  if (ii <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _27 = pfe_feature_mgr_is_available ("drv_run_on_g3");
  if (_27 == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _28 = pfe_tmu_context_memory (cbus_base_va, 0, 0, 0, 0);
  if (_28 == 0)
    goto <bb 10>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  ii = 0;
  goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _29 = cbus_base_va + 524300;
  _30 = (volatile uint32_t *) _29;
  *_30 = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ii = ii + 1;

  <bb 12> :
  # DEBUG BEGIN_STMT
  if (ii <= 255)
    goto <bb 11>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_time_usleep (10);
  # DEBUG BEGIN_STMT
  pfe_tmu_cntx_mem_read (cbus_base_va, 0, 2, &dropped_packets);
  # DEBUG BEGIN_STMT
  retries = retries + 1;
  # DEBUG BEGIN_STMT
  dropped_packets.1_31 = dropped_packets;
  if (dropped_packets.1_31 != 256)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  if (retries <= 9)
    goto <bb 13>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  dropped_packets.2_32 = dropped_packets;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_tmu_q_mode_set_default (cbus_base_va, 0, 0);

  <bb 16> :
  dropped_packets = {CLOBBER};
  return;

}


pfe_tmu_cfg_get_phy_config (pfe_ct_phy_if_id_t phy)
{
  const struct pfe_tmu_phy_cfg_t * phy_config;
  uint32_t ii;
  const struct pfe_tmu_phy_cfg_t * D.11070;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  phy_config = 0B;
  # DEBUG BEGIN_STMT
  ii = 0;
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = tmu_phys[ii].id;
  if (phy == _1)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  phy_config = &tmu_phys[ii];
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  ii = ii + 1;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = tmu_phys[ii].id;
  if (_2 != 10)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.11070 = phy_config;
  return D.11070;

}


