pfe_mirror_get_actions (const struct pfe_mirror_t * mirror, pfe_ct_route_actions_t * actions, struct pfe_ct_route_actions_args_t * args)
{
  <unnamed type> _1;
  const struct pfe_ct_route_actions_args_t * _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  _1 = mirror_5(D)->phys.actions;
  *actions_6(D) = _1;
  # DEBUG BEGIN_STMT
  if (_1 != 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _2 = &mirror_5(D)->phys.args;
  memcpy (args_8(D), _2, 60);

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

}


pfe_mirror_set_actions (struct pfe_mirror_t * mirror, pfe_ct_route_actions_t actions, const struct pfe_ct_route_actions_args_t * args)
{
  errno_t ret;
  struct pfe_ct_route_actions_args_t * _1;
  struct pfe_mirror_db_t * _2;
  struct pfe_class_t * _3;
  unsigned int _4;
  struct pfe_ct_mirror_t * _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  mirror_8(D)->phys.actions = actions_9(D);
  # DEBUG BEGIN_STMT
  if (actions_9(D) != 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _1 = &mirror_8(D)->phys.args;
  memcpy (_1, args_11(D), 60);

  <bb 4> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _2 = mirror_8(D)->db;
  _3 = _2->class;
  _4 = mirror_8(D)->phys_addr;
  _5 = &mirror_8(D)->phys;
  ret_14 = pfe_class_write_dmem (_3, -1, _4, _5, 72);
  # DEBUG ret => ret_14
  # DEBUG BEGIN_STMT
  return ret_14;

}


pfe_mirror_get_filter (const struct pfe_mirror_t * mirror)
{
  uint32_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;
  long unsigned int _8;
  long unsigned int _9;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = mirror_11(D)->phys.flexible_filter;
  _2 = _1 >> 24;
  _3 = _1 >> 8;
  _4 = _3 & 65280;
  _5 = _2 | _4;
  _6 = _1 << 8;
  _7 = _6 & 16711680;
  _8 = _5 | _7;
  _9 = _1 << 24;
  ret_12 = _8 | _9;
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  return ret_12;

}


pfe_mirror_set_filter (struct pfe_mirror_t * mirror, uint32_t filter_address)
{
  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;
  long unsigned int _8;
  long unsigned int _9;
  struct pfe_mirror_db_t * _10;
  struct pfe_class_t * _11;
  unsigned int _12;
  struct pfe_ct_mirror_t * _13;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = filter_address_14(D) >> 24;
  _2 = filter_address_14(D) >> 8;
  _3 = _2 & 65280;
  _4 = _1 | _3;
  _5 = filter_address_14(D) << 8;
  _6 = _5 & 16711680;
  _7 = _4 | _6;
  _8 = filter_address_14(D) << 24;
  _9 = _7 | _8;
  mirror_16(D)->phys.flexible_filter = _9;
  # DEBUG BEGIN_STMT
  _10 = mirror_16(D)->db;
  _11 = _10->class;
  _12 = mirror_16(D)->phys_addr;
  _13 = &mirror_16(D)->phys;
  ret_19 = pfe_class_write_dmem (_11, -1, _12, _13, 72);
  # DEBUG ret => ret_19
  # DEBUG BEGIN_STMT
  return ret_19;

}


pfe_mirror_get_egress_port (const struct pfe_mirror_t * mirror)
{
  pfe_ct_phy_if_id_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_3 = mirror_2(D)->phys.e_phy_if;
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_mirror_set_egress_port (struct pfe_mirror_t * mirror, pfe_ct_phy_if_id_t egress)
{
  errno_t ret;
  struct pfe_mirror_db_t * _1;
  struct pfe_class_t * _2;
  unsigned int _3;
  struct pfe_ct_mirror_t * _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  mirror_6(D)->phys.e_phy_if = egress_7(D);
  # DEBUG BEGIN_STMT
  _1 = mirror_6(D)->db;
  _2 = _1->class;
  _3 = mirror_6(D)->phys_addr;
  _4 = &mirror_6(D)->phys;
  ret_10 = pfe_class_write_dmem (_2, -1, _3, _4, 72);
  # DEBUG ret => ret_10
  # DEBUG BEGIN_STMT
  return ret_10;

}


pfe_mirror_get_name (const struct pfe_mirror_t * mirror)
{
  const char * str;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  str_3 = mirror_2(D)->name;
  # DEBUG str => str_3
  # DEBUG BEGIN_STMT
  return str_3;

}


pfe_mirror_get_address (const struct pfe_mirror_t * mirror)
{
  uint32_t ret;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_3 = mirror_2(D)->phys_addr;
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  return ret_3;

}


pfe_mirror_destroy (struct pfe_mirror_t * mirror)
{
  struct pfe_mirror_db_t * _1;
  struct pfe_class_t * _2;
  unsigned int _3;
  struct LLIST_Struct * _4;
  struct LLIST_Struct * _5;
  struct LLIST_Struct * _6;

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

  <bb 3> [local count: 574129754]:
  # DEBUG BEGIN_STMT
  _1 = mirror_8(D)->db;
  _2 = _1->class;
  _3 = mirror_8(D)->phys_addr;
  pfe_class_dmem_heap_free (_2, _3);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = mirror_8(D)->this.prPrev;
  _5 = mirror_8(D)->this.prNext;
  _4->prNext = _5;
  # DEBUG BEGIN_STMT
  _6 = mirror_8(D)->this.prNext;
  _6->prPrev = _4;
  # DEBUG BEGIN_STMT
  mirror_8(D)->this.prPrev = 0B;
  # DEBUG BEGIN_STMT
  mirror_8(D)->this.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (mirror_8(D));

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

}


pfe_mirror_create (const char * name)
{
  struct pfe_mirror_t * mirror;
  struct pfe_mirror_db_t * pfe_mirror_db.9_1;
  struct pfe_mirror_t * _2;
  struct pfe_mirror_t * _3;
  unsigned int _4;
  unsigned int _5;
  struct pfe_mirror_db_t * pfe_mirror_db.11_6;
  struct pfe_mirror_t * _7;
  struct pfe_class_t * _8;
  unsigned int _9;
  struct pfe_mirror_db_t * pfe_mirror_db.12_10;
  struct LLIST_Struct * _11;
  struct LLIST_t * _12;
  struct LLIST_t * _13;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG mirror => 0B
  # DEBUG BEGIN_STMT
  pfe_mirror_db.9_1 = pfe_mirror_db;
  if (pfe_mirror_db.9_1 != 0B)
    goto <bb 3>; [73.78%]
  else
    goto <bb 8>; [26.22%]

  <bb 3> [local count: 792206719]:
  # DEBUG BEGIN_STMT
  _3 = pfe_mirror_db_get_by_crit (pfe_mirror_db.9_1, 1, name_17(D));
  if (_3 == 0B)
    goto <bb 4>; [34.07%]
  else
    goto <bb 8>; [65.93%]

  <bb 4> [local count: 269904829]:
  # DEBUG BEGIN_STMT
  _4 = strlen (name_17(D));
  _5 = _4 + 92;
  mirror_20 = oal_mm_malloc (_5);
  # DEBUG mirror => mirror_20
  # DEBUG BEGIN_STMT
  if (mirror_20 != 0B)
    goto <bb 5>; [53.47%]
  else
    goto <bb 8>; [46.53%]

  <bb 5> [local count: 144318112]:
  # DEBUG BEGIN_STMT
  _2 = mirror_20 + 4;
  memset (_2, 0, 88);
  # DEBUG BEGIN_STMT
  pfe_mirror_db.11_6 = pfe_mirror_db;
  mirror_20->db = pfe_mirror_db.11_6;
  # DEBUG BEGIN_STMT
  _7 = mirror_20 + 92;
  mirror_20->name = _7;
  # DEBUG BEGIN_STMT
  strcpy (_7, name_17(D));
  # DEBUG BEGIN_STMT
  _8 = pfe_mirror_db.11_6->class;
  _9 = pfe_class_dmem_heap_alloc (_8, 72);
  mirror_20->phys_addr = _9;
  # DEBUG BEGIN_STMT
  if (_9 == 0)
    goto <bb 6>; [16.75%]
  else
    goto <bb 7>; [83.25%]

  <bb 6> [local count: 24173284]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (mirror_20);
  # DEBUG BEGIN_STMT
  # DEBUG mirror => 0B
  goto <bb 8>; [100.00%]

  <bb 7> [local count: 120144828]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pfe_mirror_db.12_10 = pfe_mirror_db;
  _11 = pfe_mirror_db.12_10->mirrors.prPrev;
  mirror_20->this.prPrev = _11;
  # DEBUG BEGIN_STMT
  _12 = &pfe_mirror_db.12_10->mirrors;
  mirror_20->this.prNext = _12;
  # DEBUG BEGIN_STMT
  _13 = &mirror_20->this;
  _11->prNext = _13;
  # DEBUG BEGIN_STMT
  pfe_mirror_db.12_10->mirrors.prPrev = _13;

  <bb 8> [local count: 1073741824]:
  # mirror_14 = PHI <0B(2), 0B(3), mirror_20(4), 0B(6), mirror_20(7)>
  # DEBUG mirror => mirror_14
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  return mirror_14;

}


pfe_mirror_get_next ()
{
  struct pfe_mirror_t * mirror;
  struct pfe_mirror_db_t * pfe_mirror_db.7_1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG mirror => 0B
  # DEBUG BEGIN_STMT
  pfe_mirror_db.7_1 = pfe_mirror_db;
  if (pfe_mirror_db.7_1 != 0B)
    goto <bb 3>; [73.78%]
  else
    goto <bb 4>; [26.22%]

  <bb 3> [local count: 792206719]:
  # DEBUG BEGIN_STMT
  mirror_6 = pfe_mirror_db_get_next (pfe_mirror_db.7_1);
  # DEBUG mirror => mirror_6

  <bb 4> [local count: 1073741824]:
  # mirror_2 = PHI <0B(2), mirror_6(3)>
  # DEBUG mirror => mirror_2
  # DEBUG BEGIN_STMT
  return mirror_2;

}


pfe_mirror_get_first (pfe_mirror_db_crit_t crit, const void * arg)
{
  struct pfe_mirror_t * mirror;
  struct pfe_mirror_db_t * pfe_mirror_db.4_1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG mirror => 0B
  # DEBUG BEGIN_STMT
  pfe_mirror_db.4_1 = pfe_mirror_db;
  if (pfe_mirror_db.4_1 != 0B)
    goto <bb 3>; [73.78%]
  else
    goto <bb 4>; [26.22%]

  <bb 3> [local count: 792206719]:
  # DEBUG BEGIN_STMT
  mirror_8 = pfe_mirror_db_get_by_crit (pfe_mirror_db.4_1, crit_5(D), arg_6(D));
  # DEBUG mirror => mirror_8

  <bb 4> [local count: 1073741824]:
  # mirror_2 = PHI <0B(2), mirror_8(3)>
  # DEBUG mirror => mirror_2
  # DEBUG BEGIN_STMT
  return mirror_2;

}


pfe_mirror_deinit ()
{
  struct pfe_mirror_db_t * pfe_mirror_db.2_1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  pfe_mirror_db.2_1 = pfe_mirror_db;
  if (pfe_mirror_db.2_1 != 0B)
    goto <bb 3>; [53.47%]
  else
    goto <bb 4>; [46.53%]

  <bb 3> [local count: 574129754]:
  # DEBUG BEGIN_STMT
  pfe_mirror_destroy_db (pfe_mirror_db.2_1);
  # DEBUG BEGIN_STMT
  pfe_mirror_db = 0B;

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

}


pfe_mirror_init (struct pfe_class_t * class)
{
  errno_t ret;
  struct pfe_mirror_db_t * pfe_mirror_db.0_1;
  struct pfe_mirror_db_t * _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  pfe_mirror_db.0_1 = pfe_mirror_db;
  if (pfe_mirror_db.0_1 != 0B)
    goto <bb 5>; [71.84%]
  else
    goto <bb 3>; [28.16%]

  <bb 3> [local count: 302365698]:
  # DEBUG BEGIN_STMT
  _2 = pfe_mirror_create_db (class_6(D));
  pfe_mirror_db = _2;
  # DEBUG BEGIN_STMT
  if (_2 == 0B)
    goto <bb 4>; [18.75%]
  else
    goto <bb 5>; [81.25%]

  <bb 4> [local count: 56693568]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 11

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

}


pfe_mirror_db_get_next (struct pfe_mirror_db_t * db)
{
  struct pfe_mirror_t * mirror;
  struct LLIST_Struct * _1;
  struct LLIST_t * _2;
  struct LLIST_t * _3;
  int _4;
  struct LLIST_Struct * _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG mirror => 0B
  # DEBUG BEGIN_STMT
  _1 = db_9(D)->mirrors.prNext;
  _2 = &db_9(D)->mirrors;
  if (_1 == _2)
    goto <bb 5>; [14.90%]
  else
    goto <bb 3>; [85.10%]

  <bb 3> [local count: 913754293]:
  # DEBUG BEGIN_STMT
  _3 = db_9(D)->curr;
  if (_2 != _3)
    goto <bb 4>; [85.10%]
  else
    goto <bb 5>; [14.90%]

  <bb 4> [local count: 777604903]:
  # DEBUG BEGIN_STMT
  _4 = _3 - 12B;
  mirror_10 = (struct pfe_mirror_t *) _4;
  # DEBUG mirror => mirror_10
  # DEBUG BEGIN_STMT
  _5 = _3->prNext;
  db_9(D)->curr = _5;

  <bb 5> [local count: 1073741824]:
  # mirror_6 = PHI <0B(2), 0B(3), mirror_10(4)>
  # DEBUG mirror => mirror_6
  # DEBUG BEGIN_STMT
  return mirror_6;

}


pfe_mirror_db_get_by_crit (struct pfe_mirror_db_t * db, pfe_mirror_db_crit_t crit, const void * arg)
{
  struct pfe_mirror_t * mirror;
  struct LLIST_t * curr;
  struct LLIST_Struct * _1;
  struct LLIST_t * _2;
  struct LLIST_Struct * _3;
  int _4;
  int _5;
  char * _6;
  int _7;
  unsigned int _8;
  unsigned int arg.6_9;

  <bb 2> [local count: 151916042]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG match => 0
  # DEBUG BEGIN_STMT
  _1 = db_14(D)->mirrors.prNext;
  _2 = &db_14(D)->mirrors;
  if (_1 == _2)
    goto <bb 10>; [14.90%]
  else
    goto <bb 3>; [85.10%]

  <bb 3> [local count: 129280552]:
  # DEBUG BEGIN_STMT
  if (crit_15(D) == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 11> [local count: 64640276]:
  goto <bb 9>; [100.00%]

  <bb 4> [local count: 64640276]:
  # DEBUG BEGIN_STMT
  _3 = _1->prNext;
  db_14(D)->curr = _3;
  # DEBUG BEGIN_STMT
  _4 = _1 - 12B;
  mirror_21 = (struct pfe_mirror_t *) _4;
  # DEBUG mirror => mirror_21
  goto <bb 10>; [100.00%]

  <bb 5> [local count: 1034442874]:
  # DEBUG BEGIN_STMT
  _5 = curr_10 - 12B;
  mirror_17 = (struct pfe_mirror_t *) _5;
  # DEBUG mirror => mirror_17
  # DEBUG BEGIN_STMT
  switch (crit_15(D)) <default: <L20> [33.33%], case 1: <L5> [33.33%], case 2: <L8> [33.33%]>

  <bb 6> [local count: 344779809]:
<L5>:
  # DEBUG BEGIN_STMT
  _6 = mirror_17->name;
  _7 = strcmp (_6, arg_18(D));
  if (_7 == 0)
    goto <bb 10>; [3.66%]
  else
    goto <bb 8>; [96.34%]

  <bb 7> [local count: 344779809]:
<L8>:
  # DEBUG BEGIN_STMT
  _8 = mirror_17->phys_addr;
  arg.6_9 = (unsigned int) arg_18(D);
  if (_8 == arg.6_9)
    goto <bb 10>; [3.66%]
  else
    goto <bb 8>; [96.34%]

  <bb 8> [local count: 1009101546]:
<L20>:
  # DEBUG match => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG mirror => 0B
  # DEBUG BEGIN_STMT
  curr_19 = curr_10->prNext;
  # DEBUG curr => curr_19

  <bb 9> [local count: 1073741824]:
  # curr_10 = PHI <curr_19(8), _1(11)>
  # DEBUG match => 0
  # DEBUG mirror => 0B
  # DEBUG curr => curr_10
  # DEBUG BEGIN_STMT
  if (_2 != curr_10)
    goto <bb 5>; [96.34%]
  else
    goto <bb 10>; [3.66%]

  <bb 10> [local count: 151812599]:
  # mirror_11 = PHI <0B(2), mirror_21(4), mirror_17(7), 0B(9), mirror_17(6)>
  # DEBUG match => NULL
  # DEBUG mirror => mirror_11
  # DEBUG BEGIN_STMT
  return mirror_11;

}


pfe_mirror_destroy_db (struct pfe_mirror_db_t * db)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  if (db_2(D) != 0B)
    goto <bb 3>; [53.47%]
  else
    goto <bb 4>; [46.53%]

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

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

}


pfe_mirror_create_db (struct pfe_class_t * class)
{
  struct pfe_mirror_db_t * db;
  struct LLIST_t * _1;
  struct pfe_mirror_db_t * _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  db_6 = oal_mm_malloc (16);
  # DEBUG db => db_6
  # DEBUG BEGIN_STMT
  if (db_6 != 0B)
    goto <bb 3>; [53.47%]
  else
    goto <bb 4>; [46.53%]

  <bb 3> [local count: 574129754]:
  # DEBUG BEGIN_STMT
  _2 = db_6 + 12;
  memset (_2, 0, 4);
  # DEBUG BEGIN_STMT
  db_6->class = class_8(D);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &db_6->mirrors;
  db_6->mirrors.prNext = _1;
  # DEBUG BEGIN_STMT
  db_6->mirrors.prPrev = _1;

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

}


