
Marking local functions: pfe_spd_destroy_phyif pfe_spd_update_phyif


Marking externally visible functions: pfe_spd_get_rule pfe_spd_remove_rule pfe_spd_add_rule pfe_spd_destroy pfe_spd_init


Marking externally visible variables:


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

pfe_class_write_dmem/39 (pfe_class_write_dmem) @07285c40
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_update_phyif/20 pfe_spd_add_rule/24 
  Calls: 
pfe_class_dmem_heap_alloc/38 (pfe_class_dmem_heap_alloc) @07285b60
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_update_phyif/20 pfe_spd_add_rule/24 
  Calls: 
memcpy/37 (memcpy) @07285a80
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_get_rule/26 pfe_spd_remove_rule/25 pfe_spd_remove_rule/25 pfe_spd_remove_rule/25 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 
  Calls: 
oal_mm_malloc/36 (oal_mm_malloc) @072859a0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_remove_rule/25 pfe_spd_add_rule/24 pfe_spd_add_rule/24 
  Calls: 
pfe_phy_if_get_id/35 (pfe_phy_if_get_id) @072858c0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_get_rule/26 pfe_spd_remove_rule/25 pfe_spd_add_rule/24 
  Calls: 
pfe_phy_if_set_spd/34 (pfe_phy_if_set_spd) @07285620
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_remove_rule/25 pfe_spd_update_phyif/20 pfe_spd_add_rule/24 pfe_spd_destroy_phyif/21 
  Calls: 
pfe_class_dmem_heap_free/33 (pfe_class_dmem_heap_free) @07285540
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_remove_rule/25 pfe_spd_update_phyif/20 pfe_spd_destroy_phyif/21 
  Calls: 
pfe_phy_if_get_spd/32 (pfe_phy_if_get_spd) @07285460
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_remove_rule/25 pfe_spd_update_phyif/20 pfe_spd_destroy_phyif/21 
  Calls: 
pfe_if_db_unlock/31 (pfe_if_db_unlock) @072852a0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_destroy/23 
  Calls: 
oal_mm_free/30 (oal_mm_free) @072851c0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_remove_rule/25 pfe_spd_remove_rule/25 pfe_spd_remove_rule/25 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_add_rule/24 pfe_spd_destroy/23 
  Calls: 
pfe_if_db_entry_get_phy_if/29 (pfe_if_db_entry_get_phy_if) @072850e0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_destroy/23 
  Calls: 
pfe_if_db_get_first/28 (pfe_if_db_get_first) @07285000
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_destroy/23 
  Calls: 
pfe_if_db_lock/27 (pfe_if_db_lock) @07219c40
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: pfe_spd_destroy/23 
  Calls: 
pfe_spd_get_rule/26 (pfe_spd_get_rule) @07219e00
  Type: function definition analyzed
  Visibility: externally_visible public
  References: pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: memcpy/37 pfe_phy_if_get_id/35 
pfe_spd_remove_rule/25 (pfe_spd_remove_rule) @07219b60
  Type: function definition analyzed
  Visibility: externally_visible public
  References: pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (write)class_ptr/19 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (write)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: oal_mm_free/30 oal_mm_free/30 pfe_spd_update_phyif/20 memcpy/37 memcpy/37 memcpy/37 oal_mm_malloc/36 pfe_class_dmem_heap_free/33 pfe_phy_if_set_spd/34 pfe_phy_if_get_spd/32 oal_mm_free/30 pfe_phy_if_get_id/35 
pfe_spd_add_rule/24 (pfe_spd_add_rule) @072198c0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: pfe_spds/18 (read)pfe_spds/18 (write)class_ptr/19 (read)class_ptr/19 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (write)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: oal_mm_free/30 oal_mm_free/30 pfe_spd_update_phyif/20 memcpy/37 memcpy/37 memcpy/37 memcpy/37 memcpy/37 memcpy/37 memcpy/37 oal_mm_malloc/36 oal_mm_free/30 pfe_phy_if_set_spd/34 pfe_class_write_dmem/39 pfe_class_dmem_heap_alloc/38 memcpy/37 oal_mm_malloc/36 pfe_phy_if_get_id/35 
pfe_spd_destroy/23 (pfe_spd_destroy) @07219620
  Type: function definition analyzed
  Visibility: externally_visible public
  References: pfe_spds/18 (read)pfe_spds/18 (read)pfe_spds/18 (write)class_ptr/19 (write)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: pfe_if_db_unlock/31 oal_mm_free/30 pfe_spd_destroy_phyif/21 pfe_if_db_entry_get_phy_if/29 pfe_if_db_get_first/28 pfe_if_db_lock/27 
pfe_spd_init/22 (pfe_spd_init) @07219380
  Type: function definition analyzed
  Visibility: externally_visible public
  References: class_ptr/19 (write)pfe_spds/18 (write)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
pfe_spd_destroy_phyif/21 (pfe_spd_destroy_phyif) @072190e0
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: class_ptr/19 (read)
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: pfe_spd_destroy/23 
  Calls: pfe_phy_if_set_spd/34 pfe_class_dmem_heap_free/33 pfe_phy_if_get_spd/32 
pfe_spd_update_phyif/20 (pfe_spd_update_phyif) @07212e00
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: class_ptr/19 (read)class_ptr/19 (read)class_ptr/19 (read)
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: pfe_spd_remove_rule/25 pfe_spd_add_rule/24 
  Calls: pfe_class_dmem_heap_free/33 pfe_phy_if_set_spd/34 pfe_phy_if_get_spd/32 pfe_class_write_dmem/39 pfe_class_dmem_heap_alloc/38 
class_ptr/19 (class_ptr) @072104c8
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: pfe_spd_init/22 (write)pfe_spd_destroy/23 (write)pfe_spd_destroy_phyif/21 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_update_phyif/20 (read)pfe_spd_update_phyif/20 (read)pfe_spd_update_phyif/20 (read)pfe_spd_remove_rule/25 (read)
  Availability: available
  Varpool flags: initialized
pfe_spds/18 (pfe_spds) @07210438
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: pfe_spd_init/22 (write)pfe_spd_destroy/23 (read)pfe_spd_destroy/23 (read)pfe_spd_destroy/23 (write)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (write)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (read)pfe_spd_add_rule/24 (write)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (write)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (read)pfe_spd_remove_rule/25 (write)pfe_spd_get_rule/26 (read)pfe_spd_get_rule/26 (read)pfe_spd_get_rule/26 (read)pfe_spd_get_rule/26 (read)pfe_spd_get_rule/26 (read)pfe_spd_get_rule/26 (read)
  Availability: available
  Varpool flags:
pfe_spd_get_rule (const struct pfe_phy_if_t * phy_if, uint16_t position, struct pfe_ct_spd_entry_t * entry)
{
  pfe_ct_phy_if_id_t phy_if_id;
  struct pfe_ct_spd_entry_t * entries;
  uint32_t entry_count;
  errno_t ret;
  errno_t D.9654;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  phy_if_id = pfe_phy_if_get_id (phy_if);
  # DEBUG BEGIN_STMT
  _1 = (int) phy_if_id;
  _2 = pfe_spds[_1];
  if (_2 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = (int) phy_if_id;
  _4 = pfe_spds[_3];
  _5 = _4->entry_count;
  _6 = _5 >> 24;
  _7 = (int) phy_if_id;
  _8 = pfe_spds[_7];
  _9 = _8->entry_count;
  _10 = _9 >> 8;
  _11 = _10 & 65280;
  _12 = _6 | _11;
  _13 = (int) phy_if_id;
  _14 = pfe_spds[_13];
  _15 = _14->entry_count;
  _16 = _15 << 8;
  _17 = _16 & 16711680;
  _18 = _12 | _17;
  _19 = (int) phy_if_id;
  _20 = pfe_spds[_19];
  _21 = _20->entry_count;
  _22 = _21 << 24;
  entry_count = _18 | _22;
  # DEBUG BEGIN_STMT
  _23 = (long unsigned int) position;
  if (entry_count <= _23)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _24 = (int) phy_if_id;
  _25 = pfe_spds[_24];
  entries = _25 + 12;
  # DEBUG BEGIN_STMT
  _26 = (unsigned int) position;
  _27 = _26 * 56;
  _28 = entries + _27;
  memcpy (entry, _28, 56);
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


pfe_spd_remove_rule (struct pfe_phy_if_t * phy_if, uint16_t position)
{
  struct pfe_ct_ipsec_spd_t * spd;
  uint32_t old_addr;
  uint32_t entry_count;
  errno_t ret;
  struct pfe_ct_spd_entry_t * old_entries;
  struct pfe_ct_spd_entry_t * entries;
  pfe_ct_phy_if_id_t phy_if_id;
  errno_t D.9646;

  <bb 2> :
  # DEBUG BEGIN_STMT
  phy_if_id = pfe_phy_if_get_id (phy_if);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) phy_if_id;
  _2 = pfe_spds[_1];
  if (_2 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = (int) phy_if_id;
  _4 = pfe_spds[_3];
  _5 = _4->entry_count;
  _6 = _5 >> 24;
  _7 = (int) phy_if_id;
  _8 = pfe_spds[_7];
  _9 = _8->entry_count;
  _10 = _9 >> 8;
  _11 = _10 & 65280;
  _12 = _6 | _11;
  _13 = (int) phy_if_id;
  _14 = pfe_spds[_13];
  _15 = _14->entry_count;
  _16 = _15 << 8;
  _17 = _16 & 16711680;
  _18 = _12 | _17;
  _19 = (int) phy_if_id;
  _20 = pfe_spds[_19];
  _21 = _20->entry_count;
  _22 = _21 << 24;
  entry_count = _18 | _22;
  # DEBUG BEGIN_STMT
  if (entry_count <= 1)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _23 = (int) phy_if_id;
  _24 = pfe_spds[_23];
  oal_mm_free (_24);
  # DEBUG BEGIN_STMT
  _25 = (int) phy_if_id;
  pfe_spds[_25] = 0B;
  # DEBUG BEGIN_STMT
  old_addr = pfe_phy_if_get_spd (phy_if);
  # DEBUG BEGIN_STMT
  pfe_phy_if_set_spd (phy_if, 0);
  # DEBUG BEGIN_STMT
  class_ptr.10_26 = class_ptr;
  pfe_class_dmem_heap_free (class_ptr.10_26, old_addr);
  # DEBUG BEGIN_STMT
  ret = 0;
  goto <bb 14>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  entry_count = entry_count + 4294967295;
  # DEBUG BEGIN_STMT
  _27 = entry_count * 56;
  _28 = _27 + 12;
  spd = oal_mm_malloc (_28);
  # DEBUG BEGIN_STMT
  _29 = (int) phy_if_id;
  _30 = pfe_spds[_29];
  old_entries = _30 + 12;
  # DEBUG BEGIN_STMT
  if (spd != 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  entries = spd + 12;
  # DEBUG BEGIN_STMT
  _31 = entry_count >> 24;
  _32 = entry_count >> 8;
  _33 = _32 & 65280;
  _34 = _31 | _33;
  _35 = entry_count << 8;
  _36 = _35 & 16711680;
  _37 = _34 | _36;
  _38 = entry_count << 24;
  _39 = _37 | _38;
  spd->entry_count = _39;
  # DEBUG BEGIN_STMT
  _40 = (int) phy_if_id;
  _41 = pfe_spds[_40];
  _42 = _41->no_ip_action;
  spd->no_ip_action = _42;
  # DEBUG BEGIN_STMT
  _43 = (int) phy_if_id;
  _44 = pfe_spds[_43];
  _45 = _44->entries;
  spd->entries = _45;
  # DEBUG BEGIN_STMT
  _46 = (long unsigned int) position;
  if (entry_count <= _46)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _47 = entry_count * 56;
  memcpy (entries, old_entries, _47);
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _48 = (long unsigned int) position;
  _49 = _48 * 56;
  memcpy (entries, old_entries, _49);
  # DEBUG BEGIN_STMT
  _50 = (unsigned int) position;
  _51 = _50 * 56;
  _52 = entries + _51;
  _53 = (sizetype) position;
  _54 = _53 + 1;
  _55 = _54 * 56;
  _56 = old_entries + _55;
  _57 = (long unsigned int) position;
  _58 = entry_count - _57;
  _59 = _58 * 56;
  memcpy (_52, _56, _59);

  <bb 10> :
  # DEBUG BEGIN_STMT
  _60 = entry_count * 56;
  _61 = _60 + 12;
  ret = pfe_spd_update_phyif (phy_if, spd, _61);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _62 = (int) phy_if_id;
  _63 = pfe_spds[_62];
  oal_mm_free (_63);
  # DEBUG BEGIN_STMT
  _64 = (int) phy_if_id;
  pfe_spds[_64] = spd;
  goto <bb 14>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  oal_mm_free (spd);
  goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  ret = 11;

  <bb 14> :
  # DEBUG BEGIN_STMT
  D.9646 = ret;
  return D.9646;

}


pfe_spd_add_rule (struct pfe_phy_if_t * phy_if, uint16_t position, struct pfe_ct_spd_entry_t * entry)
{
  addr_t dmem_addr;
  uint32_t old_count;
  uint32_t new_count;
  errno_t ret;
  struct pfe_ct_spd_entry_t * old_entries;
  struct pfe_ct_spd_entry_t * entries;
  struct pfe_ct_ipsec_spd_t * spd;
  pfe_ct_phy_if_id_t phy_if_id;
  errno_t D.9624;

  <bb 2> :
  # DEBUG BEGIN_STMT
  phy_if_id = pfe_phy_if_get_id (phy_if);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) phy_if_id;
  _2 = pfe_spds[_1];
  if (_2 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  new_count = 1;
  # DEBUG BEGIN_STMT
  spd = oal_mm_malloc (68);
  # DEBUG BEGIN_STMT
  if (spd != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  entries = spd + 12;
  # DEBUG BEGIN_STMT
  _3 = new_count >> 24;
  _4 = new_count >> 8;
  _5 = _4 & 65280;
  _6 = _3 | _5;
  _7 = new_count << 8;
  _8 = _7 & 16711680;
  _9 = _6 | _8;
  _10 = new_count << 24;
  _11 = _9 | _10;
  spd->entry_count = _11;
  # DEBUG BEGIN_STMT
  spd->no_ip_action = 2;
  # DEBUG BEGIN_STMT
  memcpy (entries, entry, 56);
  # DEBUG BEGIN_STMT
  _12 = (int) phy_if_id;
  pfe_spds[_12] = spd;
  # DEBUG BEGIN_STMT
  class_ptr.5_13 = class_ptr;
  dmem_addr = pfe_class_dmem_heap_alloc (class_ptr.5_13, 68);
  # DEBUG BEGIN_STMT
  if (dmem_addr != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _14 = dmem_addr + 12;
  _15 = _14 >> 24;
  _16 = dmem_addr + 12;
  _17 = _16 >> 8;
  _18 = _17 & 65280;
  _19 = _15 | _18;
  _20 = dmem_addr + 12;
  _21 = _20 << 8;
  _22 = _21 & 16711680;
  _23 = _19 | _22;
  _24 = dmem_addr + 12;
  _25 = _24 << 24;
  _26 = _23 | _25;
  spd->entries = _26;
  # DEBUG BEGIN_STMT
  class_ptr.6_27 = class_ptr;
  pfe_class_write_dmem (class_ptr.6_27, -1, dmem_addr, spd, 68);
  # DEBUG BEGIN_STMT
  pfe_phy_if_set_spd (phy_if, dmem_addr);
  # DEBUG BEGIN_STMT
  ret = 0;
  goto <bb 18>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  oal_mm_free (spd);
  # DEBUG BEGIN_STMT
  ret = 11;
  goto <bb 18>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ret = 11;
  goto <bb 18>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _28 = (int) phy_if_id;
  _29 = pfe_spds[_28];
  _30 = _29->entry_count;
  _31 = _30 >> 24;
  _32 = (int) phy_if_id;
  _33 = pfe_spds[_32];
  _34 = _33->entry_count;
  _35 = _34 >> 8;
  _36 = _35 & 65280;
  _37 = _31 | _36;
  _38 = (int) phy_if_id;
  _39 = pfe_spds[_38];
  _40 = _39->entry_count;
  _41 = _40 << 8;
  _42 = _41 & 16711680;
  _43 = _37 | _42;
  _44 = (int) phy_if_id;
  _45 = pfe_spds[_44];
  _46 = _45->entry_count;
  _47 = _46 << 24;
  old_count = _43 | _47;
  # DEBUG BEGIN_STMT
  new_count = old_count + 1;
  # DEBUG BEGIN_STMT
  _48 = new_count * 56;
  _49 = _48 + 12;
  spd = oal_mm_malloc (_49);
  # DEBUG BEGIN_STMT
  _50 = (int) phy_if_id;
  _51 = pfe_spds[_50];
  old_entries = _51 + 12;
  # DEBUG BEGIN_STMT
  if (spd != 0B)
    goto <bb 9>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  entries = spd + 12;
  # DEBUG BEGIN_STMT
  _52 = new_count >> 24;
  _53 = new_count >> 8;
  _54 = _53 & 65280;
  _55 = _52 | _54;
  _56 = new_count << 8;
  _57 = _56 & 16711680;
  _58 = _55 | _57;
  _59 = new_count << 24;
  _60 = _58 | _59;
  spd->entry_count = _60;
  # DEBUG BEGIN_STMT
  _61 = (int) phy_if_id;
  _62 = pfe_spds[_61];
  _63 = _62->no_ip_action;
  spd->no_ip_action = _63;
  # DEBUG BEGIN_STMT
  _64 = (int) phy_if_id;
  _65 = pfe_spds[_64];
  _66 = _65->entries;
  spd->entries = _66;
  # DEBUG BEGIN_STMT
  _67 = (long unsigned int) position;
  if (old_count <= _67)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _68 = old_count * 56;
  memcpy (entries, old_entries, _68);
  # DEBUG BEGIN_STMT
  _69 = old_count * 56;
  _70 = entries + _69;
  memcpy (_70, entry, 56);
  goto <bb 14>; [INV]

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

  <bb 12> :
  # DEBUG BEGIN_STMT
  _71 = entries + 56;
  _72 = old_count * 56;
  memcpy (_71, old_entries, _72);
  # DEBUG BEGIN_STMT
  memcpy (entries, entry, 56);
  goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  _73 = (long unsigned int) position;
  _74 = _73 * 56;
  memcpy (entries, old_entries, _74);
  # DEBUG BEGIN_STMT
  _75 = (sizetype) position;
  _76 = _75 + 1;
  _77 = _76 * 56;
  _78 = entries + _77;
  _79 = (unsigned int) position;
  _80 = _79 * 56;
  _81 = old_entries + _80;
  _82 = (long unsigned int) position;
  _83 = old_count - _82;
  _84 = _83 * 56;
  memcpy (_78, _81, _84);
  # DEBUG BEGIN_STMT
  _85 = (unsigned int) position;
  _86 = _85 * 56;
  _87 = entries + _86;
  memcpy (_87, entry, 56);

  <bb 14> :
  # DEBUG BEGIN_STMT
  _88 = new_count * 56;
  _89 = _88 + 12;
  ret = pfe_spd_update_phyif (phy_if, spd, _89);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 15>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  _90 = (int) phy_if_id;
  _91 = pfe_spds[_90];
  oal_mm_free (_91);
  # DEBUG BEGIN_STMT
  _92 = (int) phy_if_id;
  pfe_spds[_92] = spd;
  goto <bb 18>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  oal_mm_free (spd);
  goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  ret = 11;

  <bb 18> :
  # DEBUG BEGIN_STMT
  D.9624 = ret;
  return D.9624;

}


pfe_spd_destroy (struct pfe_if_db_t * phy_if_db)
{
  struct pfe_if_db_entry_t * if_db_entry;
  struct pfe_phy_if_t * phy_if;
  errno_t ret;
  uint32_t session_id;
  uint32_t idx;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  session_id = 0;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  phy_if = 0B;
  # DEBUG BEGIN_STMT
  if_db_entry = 0B;
  # DEBUG BEGIN_STMT
  idx = 0;
  goto <bb 10>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = pfe_spds[idx];
  if (_1 == 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  // predicted unlikely by continue predictor.
  goto <bb 9>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  phy_if = 0B;
  # DEBUG BEGIN_STMT
  if_db_entry = 0B;
  # DEBUG BEGIN_STMT
  _2 = pfe_if_db_lock (&session_id);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  session_id.0_3 = session_id;
  idx.1_4 = (void *) idx;
  ret = pfe_if_db_get_first (phy_if_db, session_id.0_3, 1, idx.1_4, &if_db_entry);
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  if_db_entry.2_5 = if_db_entry;
  phy_if = pfe_if_db_entry_get_phy_if (if_db_entry.2_5);
  # DEBUG BEGIN_STMT
  if (phy_if != 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  pfe_spd_destroy_phyif (phy_if);

  <bb 8> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = pfe_spds[idx];
  oal_mm_free (_6);
  # DEBUG BEGIN_STMT
  pfe_spds[idx] = 0B;
  # DEBUG BEGIN_STMT
  session_id.3_7 = session_id;
  _8 = pfe_if_db_unlock (session_id.3_7);

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  idx = idx + 1;

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

  <bb 11> :
  # DEBUG BEGIN_STMT
  class_ptr = 0B;
  session_id = {CLOBBER};
  if_db_entry = {CLOBBER};
  return;

}


pfe_spd_init (struct pfe_class_t * class)
{
  uint32_t idx;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  class_ptr = class;
  # DEBUG BEGIN_STMT
  idx = 0;
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  pfe_spds[idx] = 0B;
  # DEBUG BEGIN_STMT
  idx = idx + 1;

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

  <bb 5> :
  return;

}


pfe_spd_destroy_phyif (struct pfe_phy_if_t * phy_if)
{
  uint32_t baddr;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  baddr = pfe_phy_if_get_spd (phy_if);
  # DEBUG BEGIN_STMT
  class_ptr.4_1 = class_ptr;
  pfe_class_dmem_heap_free (class_ptr.4_1, baddr);
  # DEBUG BEGIN_STMT
  _2 = pfe_phy_if_set_spd (phy_if, 0);
  # DEBUG BEGIN_STMT
  return;

}


pfe_spd_update_phyif (struct pfe_phy_if_t * phy_if, struct pfe_ct_ipsec_spd_t * spd, const uint32_t size)
{
  uint32_t old_addr;
  addr_t dmem_addr;
  errno_t ret;
  errno_t D.9629;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  class_ptr.7_1 = class_ptr;
  dmem_addr = pfe_class_dmem_heap_alloc (class_ptr.7_1, size);
  # DEBUG BEGIN_STMT
  if (dmem_addr == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = dmem_addr + 12;
  _3 = _2 >> 24;
  _4 = dmem_addr + 12;
  _5 = _4 >> 8;
  _6 = _5 & 65280;
  _7 = _3 | _6;
  _8 = dmem_addr + 12;
  _9 = _8 << 8;
  _10 = _9 & 16711680;
  _11 = _7 | _10;
  _12 = dmem_addr + 12;
  _13 = _12 << 24;
  _14 = _11 | _13;
  spd->entries = _14;
  # DEBUG BEGIN_STMT
  class_ptr.8_15 = class_ptr;
  pfe_class_write_dmem (class_ptr.8_15, -1, dmem_addr, spd, size);
  # DEBUG BEGIN_STMT
  old_addr = pfe_phy_if_get_spd (phy_if);
  # DEBUG BEGIN_STMT
  pfe_phy_if_set_spd (phy_if, dmem_addr);
  # DEBUG BEGIN_STMT
  class_ptr.9_16 = class_ptr;
  pfe_class_dmem_heap_free (class_ptr.9_16, old_addr);
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


