pfe_util_get_fw_version (const struct pfe_util_t * util, struct pfe_ct_version_t * ver)
{
  errno_t ret;
  union pfe_ct_pe_mmap_t pfe_pe_mmap;
  long unsigned int _1;
  const struct pfe_pe_t * _2;
  int _3;
  errno_t _14;

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

  <bb 3> :
  _2 = &util_8(D)->pe[0];
  _3 = pfe_pe_get_mmap (_2, &pfe_pe_mmap);
  if (_3 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  MEM[(char * {ref-all})ver_10(D)] = MEM[(char * {ref-all})&pfe_pe_mmap + 4B];
  # DEBUG BEGIN_STMT
  ret_12 = 0;
  # DEBUG ret => ret_12

  <bb 6> :
  # ret_4 = PHI <ret_13(4), ret_12(5)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  _14 = ret_4;
  pfe_pe_mmap ={v} {CLOBBER};
  return _14;

}


pfe_util_irq_unmask (const struct pfe_util_t * util)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_util_irq_mask (const struct pfe_util_t * util)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_util_isr (struct pfe_util_t * util)
{
  errno_t ret;
  uint32_t count;
  struct pfe_pe_t * _1;
  int _2;
  struct pfe_pe_t * _3;
  struct pfe_pe_t * _4;
  struct pfe_pe_t * _5;
  int _6;
  long unsigned int _7;
  unsigned int _8;
  errno_t _16;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  count_11 = 0;
  # DEBUG count => count_11
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = &util_13(D)->pe[count_9];
  _2 = pfe_pe_lock (_1);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = &util_13(D)->pe[count_9];
  pfe_pe_get_fw_messages_nolock (_3);
  # DEBUG BEGIN_STMT
  _4 = &util_13(D)->pe[count_9];
  pfe_pe_check_stalled_nolock (_4);
  # DEBUG BEGIN_STMT
  _5 = &util_13(D)->pe[count_9];
  _6 = pfe_pe_unlock (_5);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  count_21 = count_9 + 1;
  # DEBUG count => count_21

  <bb 4> :
  # count_9 = PHI <count_11(2), count_21(3)>
  # DEBUG count => count_9
  # DEBUG BEGIN_STMT
  _7 = util_13(D)->pe_num;
  if (count_9 < _7)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _8 = util_13(D)->cbus_base_va;
  pfe_util_cfg_isr (_8);
  # DEBUG BEGIN_STMT
  ret_15 = 0;
  # DEBUG ret => ret_15
  # DEBUG BEGIN_STMT
  _16 = ret_15;
  return _16;

}


pfe_util_read_dmem (void * util_p, int32_t pe_idx, void * dst_ptr, addr_t src_addr, uint32_t len)
{
  errno_t ret;
  struct pfe_util_t * util;
  long unsigned int _1;
  long int _2;
  struct pfe_pe_t * _3;
  errno_t _16;

  <bb 2> :
  # DEBUG BEGIN_STMT
  util_7 = util_p_6(D);
  # DEBUG util => util_7
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = util_7->pe_num;
  _2 = (long int) _1;
  if (pe_idx_9(D) >= _2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = &util_7->pe[pe_idx_9(D)];
  pfe_pe_memcpy_from_dmem_to_host_32 (_3, dst_ptr_10(D), src_addr_11(D), len_12(D));
  # DEBUG BEGIN_STMT
  ret_14 = 0;
  # DEBUG ret => ret_14

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

}


pfe_util_write_dmem (void * util_p, int32_t pe_idx, addr_t dst_addr, const void * src_ptr, uint32_t len)
{
  errno_t ret;
  struct pfe_util_t * util;
  uint32_t count;
  long unsigned int _1;
  long int _2;
  struct pfe_pe_t * _3;
  struct pfe_pe_t * _4;
  long unsigned int _5;
  errno_t _24;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  util_12 = util_p_11(D);
  # DEBUG util => util_12
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = util_12->pe_num;
  _2 = (long int) _1;
  if (pe_idx_14(D) >= _2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _3 = &util_12->pe[pe_idx_14(D)];
  pfe_pe_memcpy_from_host_to_dmem_32 (_3, dst_addr_16(D), src_ptr_17(D), len_18(D));
  goto <bb 9>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  count_15 = 0;
  # DEBUG count => count_15
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _4 = &util_12->pe[count_6];
  pfe_pe_memcpy_from_host_to_dmem_32 (_4, dst_addr_16(D), src_ptr_17(D), len_18(D));
  # DEBUG BEGIN_STMT
  count_20 = count_6 + 1;
  # DEBUG count => count_20

  <bb 8> :
  # count_6 = PHI <count_15(6), count_20(7)>
  # DEBUG count => count_6
  # DEBUG BEGIN_STMT
  _5 = util_12->pe_num;
  if (count_6 < _5)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  ret_22 = 0;
  # DEBUG ret => ret_22

  <bb 10> :
  # ret_7 = PHI <ret_23(3), ret_22(9)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  _24 = ret_7;
  return _24;

}


pfe_util_get_feature_next (struct pfe_util_t * util, struct pfe_fw_feature_t * * feature)
{
  errno_t ret;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  struct pfe_fw_feature_t * _8;
  errno_t _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = util_12(D)->fw_features_count;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = util_12(D)->current_feature;
  _3 = _2 + 1;
  _4 = util_12(D)->fw_features_count;
  if (_3 < _4)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _5 = util_12(D)->current_feature;
  _6 = _5 + 1;
  util_12(D)->current_feature = _6;
  # DEBUG BEGIN_STMT
  _7 = util_12(D)->current_feature;
  _8 = &util_12(D)->fw_features[_7];
  *feature_16(D) = _8;
  # DEBUG BEGIN_STMT
  ret_18 = 0;
  # DEBUG ret => ret_18
  goto <bb 7>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret_13 = 2;
  # DEBUG ret => ret_13

  <bb 7> :
  # ret_9 = PHI <ret_14(5), ret_13(6), ret_18(4)>
  # DEBUG ret => ret_9
  # DEBUG BEGIN_STMT
  _19 = ret_9;
  return _19;

}


pfe_util_get_feature_first (struct pfe_util_t * util, struct pfe_fw_feature_t * * feature)
{
  errno_t ret;
  long unsigned int _1;
  long unsigned int _2;
  struct pfe_fw_feature_t * _3;
  errno_t _13;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  util_7(D)->current_feature = 0;
  # DEBUG BEGIN_STMT
  _2 = util_7(D)->current_feature;
  _3 = &util_7(D)->fw_features[_2];
  *feature_10(D) = _3;
  # DEBUG BEGIN_STMT
  ret_12 = 0;
  # DEBUG ret => ret_12
  goto <bb 5>; [INV]

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

  <bb 5> :
  # ret_4 = PHI <ret_12(3), ret_8(4)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  _13 = ret_4;
  return _13;

}


pfe_util_get_feature (struct pfe_util_t * util, struct pfe_fw_feature_t * * feature, const char * name)
{
  errno_t ret;
  const char * fname;
  uint32_t count;
  struct pfe_fw_feature_t * _1;
  const char * fname.3_2;
  int _3;
  struct pfe_fw_feature_t * _4;
  long unsigned int _5;
  errno_t _24;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_12 = 2;
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  count_13 = 0;
  # DEBUG count => count_13
  goto <bb 8>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = &util_15(D)->fw_features[count_6];
  ret_17 = pfe_fw_feature_get_name (_1, &fname);
  # DEBUG ret => ret_17
  # DEBUG BEGIN_STMT
  if (ret_17 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  fname.3_2 = fname;
  _3 = strcmp (fname.3_2, name_18(D));
  if (_3 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = &util_15(D)->fw_features[count_6];
  *feature_20(D) = _4;
  # DEBUG BEGIN_STMT
  ret_22 = 0;
  # DEBUG ret => ret_22
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  ret_19 = 2;
  # DEBUG ret => ret_19

  <bb 7> :
  # ret_7 = PHI <ret_17(3), ret_19(6)>
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  count_23 = count_6 + 1;
  # DEBUG count => count_23

  <bb 8> :
  # count_6 = PHI <count_13(2), count_23(7)>
  # ret_8 = PHI <ret_12(2), ret_7(7)>
  # DEBUG ret => ret_8
  # DEBUG count => count_6
  # DEBUG BEGIN_STMT
  _5 = util_15(D)->fw_features_count;
  if (count_6 < _5)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  # ret_9 = PHI <ret_22(5), ret_8(8)>
  # DEBUG ret => ret_9
  # DEBUG BEGIN_STMT
  _24 = ret_9;
  fname ={v} {CLOBBER};
  return _24;

}


pfe_util_destroy (struct pfe_util_t * util)
{
  uint32_t count;
  struct pfe_pe_t[1] * _1;
  long unsigned int _2;
  struct pfe_fw_feature_t * _3;
  long unsigned int _4;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = &util_8(D)->pe;
  _2 = util_8(D)->pe_num;
  pfe_pe_destroy (_1, _2);
  # DEBUG BEGIN_STMT
  count_11 = 0;
  # DEBUG count => count_11
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = &util_8(D)->fw_features[count_5];
  pfe_fw_feature_destroy (_3);
  # DEBUG BEGIN_STMT
  count_15 = count_5 + 1;
  # DEBUG count => count_15

  <bb 5> :
  # count_5 = PHI <count_11(3), count_15(4)>
  # DEBUG count => count_5
  # DEBUG BEGIN_STMT
  _4 = util_8(D)->fw_features_count;
  if (count_5 < _4)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  util_8(D)->fw_features_count = 0;
  # DEBUG BEGIN_STMT
  util_8(D)->pe_num = 0;

  <bb 7> :
  return;

}


pfe_util_load_firmware (struct pfe_util_t * util, const void * elf)
{
  errno_t ret;
  struct pfe_pe_t[1] * _1;
  long unsigned int _2;
  errno_t _11;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &util_3(D)->pe;
  _2 = util_3(D)->pe_num;
  ret_7 = pfe_pe_load_firmware (_1, _2, elf_5(D));
  # DEBUG ret => ret_7
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  util_3(D)->is_fw_loaded = 1;
  # DEBUG BEGIN_STMT
  ret_10 = pfe_util_load_fw_features (util_3(D));
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _11 = ret_10;
  return _11;

}


pfe_util_default_init (struct pfe_util_t * util)
{
  errno_t ret;
  struct pfe_pe_t[1] * _1;
  long unsigned int _2;
  errno_t _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &util_3(D)->pe;
  _2 = util_3(D)->pe_num;
  ret_6 = pfe_pe_mem_default_init (_1, _2);
  # DEBUG ret => ret_6
  # DEBUG BEGIN_STMT
  _7 = ret_6;
  return _7;

}


pfe_util_disable (struct pfe_util_t * util)
{
  unsigned int _1;
  unsigned int _2;
  volatile uint32_t * _3;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = util_5(D)->cbus_base_va;
  _2 = _1 + 835588;
  _3 = (volatile uint32_t *) _2;
  *_3 ={v} 0;
  # DEBUG BEGIN_STMT
  return;

}


pfe_util_enable (struct pfe_util_t * util)
{
  unsigned char _1;
  _Bool _2;
  long int _3;
  long int _4;
  unsigned int _5;
  unsigned int _6;
  volatile uint32_t * _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = util_9(D)->is_fw_loaded;
  _2 = _1 == 0;
  _3 = (long int) _2;
  _4 = __builtin_expect (_3, 0);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = util_9(D)->cbus_base_va;
  _6 = _5 + 835588;
  _7 = (volatile uint32_t *) _6;
  *_7 ={v} 1;
  # DEBUG BEGIN_STMT
  return;

}


pfe_util_reset (struct pfe_util_t * util)
{
  unsigned int _1;
  unsigned int _2;
  volatile uint32_t * _3;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = util_5(D)->cbus_base_va;
  _2 = _1 + 835588;
  _3 = (volatile uint32_t *) _2;
  *_3 ={v} 2;
  # DEBUG BEGIN_STMT
  return;

}


pfe_util_create (addr_t cbus_base_va, uint32_t pe_num, const struct pfe_util_cfg_t * cfg)
{
  errno_t ret;
  struct pfe_util_t * util;
  struct pfe_util_t * _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_3 = 0;
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  util_4 = &util_instance;
  # DEBUG util => util_4
  # DEBUG BEGIN_STMT
  memset (util_4, 0, 292);
  # DEBUG BEGIN_STMT
  util_4->cbus_base_va = cbus_base_va_7(D);
  # DEBUG BEGIN_STMT
  if (pe_num_9(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  ret_12 = pfe_util_create_pe (pe_num_9(D), cbus_base_va_7(D), util_4);
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  if (ret_12 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  pfe_util_destroy (util_4);
  # DEBUG BEGIN_STMT
  util_18 = 0B;
  # DEBUG util => util_18
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  pfe_util_reset (util_4);
  # DEBUG BEGIN_STMT
  pfe_util_disable (util_4);
  # DEBUG BEGIN_STMT
  pfe_util_set_config (util_4, cfg_15(D));
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  util_10 = 0B;
  # DEBUG util => util_10

  <bb 7> :
  # util_1 = PHI <util_4(5), util_10(6), util_18(4)>
  # DEBUG util => util_1
  # DEBUG BEGIN_STMT
  _19 = util_1;
  return _19;

}


pfe_util_create_pe (uint32_t pe_num, addr_t cbus_base_va, struct pfe_util_t * util)
{
  errno_t ret;
  uint8_t count;
  struct pfe_pe_t * pe;
  int _1;
  struct pfe_pe_t * _2;
  long unsigned int _3;
  long unsigned int _4;
  unsigned char count.0_5;
  long unsigned int _6;
  errno_t _25;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_11 = 0;
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  count_12 = 0;
  # DEBUG count => count_12
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = (int) count_7;
  _2 = &util_15(D)->pe[_1];
  pe_18 = pfe_pe_create (cbus_base_va_16(D), 3, count_7, _2);
  # DEBUG pe => pe_18
  # DEBUG BEGIN_STMT
  if (pe_18 == 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret_24 = 121;
  # DEBUG ret => ret_24
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  pfe_pe_set_iaccess (pe_18, 835844, 835848, 835840);
  # DEBUG BEGIN_STMT
  pfe_pe_set_dmem (pe_18, 0, 8192);
  # DEBUG BEGIN_STMT
  pfe_pe_set_imem (pe_18, 2680160256, 32768);
  # DEBUG BEGIN_STMT
  _3 = util_15(D)->pe_num;
  _4 = _3 + 1;
  util_15(D)->pe_num = _4;
  # DEBUG BEGIN_STMT
  count.0_5 = count_7;
  count_23 = count.0_5 + 1;
  # DEBUG count => count_23

  <bb 6> :
  # count_7 = PHI <count_12(2), count_23(5)>
  # DEBUG count => count_7
  # DEBUG BEGIN_STMT
  _6 = (long unsigned int) count_7;
  if (pe_num_14(D) > _6)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # ret_8 = PHI <ret_24(4), ret_11(6)>
  # DEBUG ret => ret_8
  # DEBUG BEGIN_STMT
  _25 = ret_8;
  return _25;

}


pfe_util_set_config (const struct pfe_util_t * util, const struct pfe_util_cfg_t * cfg)
{
  uint32_t regval;
  unsigned int _1;
  unsigned int _2;
  volatile uint32_t * _3;
  long unsigned int _4;
  unsigned char _5;
  unsigned int _6;
  unsigned int _7;
  volatile uint32_t * _8;
  unsigned int _9;
  unsigned int _10;
  volatile uint32_t * _11;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = util_14(D)->cbus_base_va;
  _2 = _1 + 836096;
  _3 = (volatile uint32_t *) _2;
  _4 = cfg_15(D)->pe_sys_clk_ratio;
  *_3 ={v} _4;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = cfg_15(D)->on_g3;
  if (_5 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _6 = util_14(D)->cbus_base_va;
  _7 = _6 + 836160;
  _8 = (volatile uint32_t *) _7;
  regval_17 ={v} *_8;
  # DEBUG regval => regval_17
  # DEBUG BEGIN_STMT
  regval_18 = regval_17 | 3;
  # DEBUG regval => regval_18
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = util_14(D)->cbus_base_va;
  _10 = _9 + 836160;
  _11 = (volatile uint32_t *) _10;
  *_11 ={v} regval_18;

  <bb 4> :
  # DEBUG BEGIN_STMT
  return;

}


pfe_util_load_fw_features (struct pfe_util_t * util)
{
  bool_t val_break;
  uint32_t fw_features_idx;
  errno_t ret;
  union pfe_ct_pe_mmap_t mmap;
  struct pfe_pe_t * _1;
  int _2;
  int ret.1_3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  struct pfe_fw_feature_t * _19;
  long unsigned int _20;
  errno_t _39;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  val_break_26 = 0;
  # DEBUG val_break => val_break_26
  # DEBUG BEGIN_STMT
  _1 = &util_27(D)->pe[0];
  _2 = pfe_pe_get_mmap (_1, &mmap);
  ret = _2;
  # DEBUG BEGIN_STMT
  ret.1_3 = ret;
  if (ret.1_3 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _4 = mmap.common.version.features_count;
  _5 = _4 >> 24;
  _6 = mmap.common.version.features_count;
  _7 = _6 >> 8;
  _8 = _7 & 65280;
  _9 = _5 | _8;
  _10 = mmap.common.version.features_count;
  _11 = _10 << 8;
  _12 = _11 & 16711680;
  _13 = _9 | _12;
  _14 = mmap.common.version.features_count;
  _15 = _14 << 24;
  _16 = _13 | _15;
  util_27(D)->fw_features_count = _16;
  # DEBUG BEGIN_STMT
  _17 = util_27(D)->fw_features_count;
  if (_17 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _18 = util_27(D)->fw_features_count;
  if (_18 > 8)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  util_27(D)->fw_features_count = 0;
  # DEBUG BEGIN_STMT
  ret = 11;
  goto <bb 10>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  util_27(D)->current_feature = 0;
  # DEBUG BEGIN_STMT
  fw_features_idx_32 = 0;
  # DEBUG fw_features_idx => fw_features_idx_32
  goto <bb 9>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _19 = &util_27(D)->fw_features[fw_features_idx_21];
  pfe_fw_feature_create (_19);
  # DEBUG BEGIN_STMT
  val_break_35 = pfe_util_check_new_fw_features (util_27(D), &ret, fw_features_idx_21);
  # DEBUG val_break => val_break_35
  # DEBUG BEGIN_STMT
  if (val_break_35 == 1)
    goto <bb 10>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  fw_features_idx_36 = fw_features_idx_21 + 1;
  # DEBUG fw_features_idx => fw_features_idx_36

  <bb 9> :
  # fw_features_idx_21 = PHI <fw_features_idx_32(6), fw_features_idx_36(8)>
  # DEBUG fw_features_idx => fw_features_idx_21
  # DEBUG BEGIN_STMT
  _20 = util_27(D)->fw_features_count;
  if (fw_features_idx_21 < _20)
    goto <bb 7>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _39 = ret;
  mmap ={v} {CLOBBER};
  ret ={v} {CLOBBER};
  return _39;

}


pfe_util_check_new_fw_features (struct pfe_util_t * util, errno_t * ret, uint32_t features_idx)
{
  uint32_t j;
  struct pfe_ct_feature_desc_t * entry;
  bool_t val_break;
  struct pfe_pe_t * _1;
  int _2;
  int _3;
  struct pfe_fw_feature_t * _4;
  struct pfe_fw_feature_t * _5;
  struct pfe_ct_feature_desc_t * entry.2_6;
  struct pfe_fw_feature_t * _7;
  struct pfe_pe_t * _8;
  char * _9;
  int _10;
  int _11;
  struct pfe_fw_feature_t * _12;
  struct pfe_fw_feature_t * _13;
  bool_t _44;

  <bb 2> :
  # DEBUG BEGIN_STMT
  val_break_20 = 0;
  # DEBUG val_break => val_break_20
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &util_21(D)->pe[0];
  _2 = pfe_pe_get_fw_feature_entry (_1, features_idx_23(D), &entry);
  *ret_25(D) = _2;
  # DEBUG BEGIN_STMT
  _3 = *ret_25(D);
  if (_3 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _4 = &util_21(D)->fw_features[j_15];
  pfe_fw_feature_destroy (_4);
  # DEBUG BEGIN_STMT
  j_43 = j_15 + 1;
  # DEBUG j => j_43

  <bb 5> :
  # j_15 = PHI <j_38(3), j_43(4)>
  # DEBUG j => j_15
  # DEBUG BEGIN_STMT
  if (j_15 < features_idx_23(D))
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  util_21(D)->fw_features_count = 0;
  # DEBUG BEGIN_STMT
  *ret_25(D) = 22;
  # DEBUG BEGIN_STMT
  val_break_41 = 1;
  # DEBUG val_break => val_break_41
  goto <bb 13>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _5 = &util_21(D)->fw_features[features_idx_23(D)];
  entry.2_6 = entry;
  pfe_fw_feature_set_ll_data (_5, entry.2_6);
  # DEBUG BEGIN_STMT
  _7 = &util_21(D)->fw_features[features_idx_23(D)];
  _8 = &util_21(D)->pe[0];
  _9 = pfe_pe_get_fw_feature_str_base (_8);
  _10 = pfe_fw_feature_set_string_base (_7, _9);
  *ret_25(D) = _10;
  # DEBUG BEGIN_STMT
  _11 = *ret_25(D);
  if (_11 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  j_32 = 0;
  # DEBUG j => j_32
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _12 = &util_21(D)->fw_features[j_16];
  pfe_fw_feature_destroy (_12);
  # DEBUG BEGIN_STMT
  j_37 = j_16 + 1;
  # DEBUG j => j_37

  <bb 10> :
  # j_16 = PHI <j_32(8), j_37(9)>
  # DEBUG j => j_16
  # DEBUG BEGIN_STMT
  if (j_16 < features_idx_23(D))
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  util_21(D)->fw_features_count = 0;
  # DEBUG BEGIN_STMT
  *ret_25(D) = 22;
  # DEBUG BEGIN_STMT
  val_break_35 = 1;
  # DEBUG val_break => val_break_35
  goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _13 = &util_21(D)->fw_features[features_idx_23(D)];
  pfe_fw_feature_set_dmem_funcs (_13, pfe_util_read_dmem, pfe_util_write_dmem, util_21(D));

  <bb 13> :
  # val_break_14 = PHI <val_break_41(6), val_break_35(11), val_break_20(12)>
  # DEBUG val_break => val_break_14
  # DEBUG BEGIN_STMT
  _44 = val_break_14;
  entry ={v} {CLOBBER};
  return _44;

}


