fci_fp_db_get_table_next_rule (char_t * table_name, struct fci_fp_rule_info_t * rule_info, char_t * * next_rule)
{
  errno_t ret;
  struct fci_fp_rule_t * rule;
  struct fci_fp_table_t * fp_table;
  errno_t D.11733;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, table_name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = &fp_table->rules_db;
  rule = fci_fp_rule_get_next (_1, 1);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    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
  _2 = rule->name;
  rule_info->rule_name = _2;
  # DEBUG BEGIN_STMT
  _3 = rule->data;
  rule_info->data = _3;
  # DEBUG BEGIN_STMT
  _4 = rule->mask;
  rule_info->mask = _4;
  # DEBUG BEGIN_STMT
  _5 = rule->offset;
  rule_info->offset = _5;
  # DEBUG BEGIN_STMT
  _6 = rule->flags;
  rule_info->flags = _6;
  # DEBUG BEGIN_STMT
  _7 = rule->next_rule;
  *next_rule = _7;
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_get_table_first_rule (char_t * table_name, struct fci_fp_rule_info_t * rule_info, char_t * * next_rule)
{
  errno_t ret;
  struct fci_fp_rule_t * rule;
  struct fci_fp_table_t * fp_table;
  errno_t D.11725;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, table_name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = &fp_table->rules_db;
  rule = fci_fp_rule_get_first (_1, 0, 0B, 1);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    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
  _2 = rule->name;
  rule_info->rule_name = _2;
  # DEBUG BEGIN_STMT
  _3 = rule->data;
  rule_info->data = _3;
  # DEBUG BEGIN_STMT
  _4 = rule->mask;
  rule_info->mask = _4;
  # DEBUG BEGIN_STMT
  _5 = rule->offset;
  rule_info->offset = _5;
  # DEBUG BEGIN_STMT
  _6 = rule->flags;
  rule_info->flags = _6;
  # DEBUG BEGIN_STMT
  _7 = rule->next_rule;
  *next_rule = _7;
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_get_next_rule (struct fci_fp_rule_info_t * rule_info, char_t * * next_rule)
{
  errno_t ret;
  struct fci_fp_rule_t * rule;
  errno_t D.11704;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule = fci_fp_rule_get_next (&fci_fp_rule_db, 0);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = rule->name;
  rule_info->rule_name = _1;
  # DEBUG BEGIN_STMT
  _2 = rule->data;
  rule_info->data = _2;
  # DEBUG BEGIN_STMT
  _3 = rule->mask;
  rule_info->mask = _3;
  # DEBUG BEGIN_STMT
  _4 = rule->offset;
  rule_info->offset = _4;
  # DEBUG BEGIN_STMT
  _5 = rule->flags;
  rule_info->flags = _5;
  # DEBUG BEGIN_STMT
  _6 = rule->next_rule;
  *next_rule = _6;
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_get_first_rule (struct fci_fp_rule_info_t * rule_info, char_t * * next_rule)
{
  errno_t ret;
  struct fci_fp_rule_t * rule;
  errno_t D.11699;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule = fci_fp_rule_get_first (&fci_fp_rule_db, 0, 0B, 0);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = rule->name;
  rule_info->rule_name = _1;
  # DEBUG BEGIN_STMT
  _2 = rule->data;
  rule_info->data = _2;
  # DEBUG BEGIN_STMT
  _3 = rule->mask;
  rule_info->mask = _3;
  # DEBUG BEGIN_STMT
  _4 = rule->offset;
  rule_info->offset = _4;
  # DEBUG BEGIN_STMT
  _5 = rule->flags;
  rule_info->flags = _5;
  # DEBUG BEGIN_STMT
  _6 = rule->next_rule;
  *next_rule = _6;
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_get_first (fci_fp_table_criterion_t crit, void * arg)
{
  struct fci_fp_table_t * D.11694;

  <bb 2> :
  # DEBUG BEGIN_STMT
  D.11694 = fci_fp_table_get_first (&fci_fp_table_db, crit, arg);
  return D.11694;

}


fci_fp_db_get_table_from_addr (uint32_t addr, char_t * * table_name)
{
  errno_t ret;
  const struct fci_fp_table_t * fp_table;
  errno_t D.11692;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  addr.3_1 = addr;
  if (addr.3_1 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 2, &addr);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _2 = fp_table->name;
  *table_name = _2;
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_pop_table_from_hw (char_t * table_name)
{
  errno_t ret;
  struct fci_fp_table_t * fp_table;
  errno_t D.11684;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, table_name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = fp_table->class;
  _2 = fp_table->dmem_addr;
  pfe_fp_destroy_table (_1, _2);
  # DEBUG BEGIN_STMT
  fp_table->dmem_addr = 0;
  # DEBUG BEGIN_STMT
  fp_table->class = 0B;
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_push_table_to_hw (struct pfe_class_t * class, char_t * table_name)
{
  errno_t ret;
  uint8_t pos;
  uint16_t i;
  struct fci_fp_rule_t * rule;
  struct LLIST_t * item;
  struct pfe_ct_fp_rule_t rule_buf;
  struct fci_fp_rule_t * next_rule;
  struct fci_fp_table_t * fp_table;
  errno_t D.11674;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  i = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, table_name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = fp_table->rule_count;
  _2 = pfe_fp_create_table (class, _1);
  fp_table->dmem_addr = _2;
  # DEBUG BEGIN_STMT
  fp_table->class = class;
  # DEBUG BEGIN_STMT
  _3 = fp_table->dmem_addr;
  if (_3 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 117;
  goto <bb 16>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  item = fp_table->rules_db.rules.prNext;
  goto <bb 15>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _4 = item - 12B;
  rule = (struct fci_fp_rule_t *) _4;
  # DEBUG BEGIN_STMT
  _5 = rule->data;
  rule_buf.data = _5;
  # DEBUG BEGIN_STMT
  _6 = rule->mask;
  rule_buf.mask = _6;
  # DEBUG BEGIN_STMT
  _7 = rule->offset;
  rule_buf.offset = _7;
  # DEBUG BEGIN_STMT
  _8 = rule->flags;
  rule_buf.flags = _8;
  # DEBUG BEGIN_STMT
  _9 = rule->next_rule;
  if (_9 != 0B)
    goto <bb 8>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _10 = &fp_table->rules_db;
  _11 = rule->next_rule;
  next_rule = fci_fp_rule_get_first (_10, 1, _11, 1);
  # DEBUG BEGIN_STMT
  if (next_rule == 0B)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = fp_table->dmem_addr;
  pfe_fp_destroy_table (class, _12);
  # DEBUG BEGIN_STMT
  fp_table->dmem_addr = 0;
  # DEBUG BEGIN_STMT
  ret = 2;
  # DEBUG BEGIN_STMT
  goto <bb 16>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _13 = fci_fp_get_rule_pos_in_table (fp_table, next_rule, &pos);
  if (_13 != 0)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _14 = fp_table->dmem_addr;
  pfe_fp_destroy_table (class, _14);
  # DEBUG BEGIN_STMT
  fp_table->dmem_addr = 0;
  # DEBUG BEGIN_STMT
  ret = 2;
  # DEBUG BEGIN_STMT
  goto <bb 16>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  pos.0_15 = pos;
  rule_buf.next_idx = pos.0_15;
  goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  rule_buf.next_idx = 255;

  <bb 14> :
  # DEBUG BEGIN_STMT
  _16 = fp_table->dmem_addr;
  pfe_fp_table_write_rule (class, _16, &rule_buf, i);
  # DEBUG BEGIN_STMT
  i.1_17 = i;
  i = i.1_17 + 1;
  # DEBUG BEGIN_STMT
  item = item->prNext;

  <bb 15> :
  # DEBUG BEGIN_STMT
  _18 = &fp_table->rules_db.rules;
  if (item != _18)
    goto <bb 7>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  D.11674 = ret;
  rule_buf = {CLOBBER};
  pos = {CLOBBER};
  return D.11674;

}


fci_fp_db_get_table_dmem_addr (char_t * table_name)
{
  uint32_t retval;
  const struct fci_fp_table_t * fp_table;
  uint32_t D.11659;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, table_name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  retval = fp_table->dmem_addr;

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.11659 = retval;
  return D.11659;

}


fci_fp_db_remove_rule_from_table (char_t * rule_name)
{
  errno_t ret;
  struct fci_fp_rule_t * rule;
  errno_t D.11654;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule = fci_fp_rule_get_first (&fci_fp_rule_db, 1, rule_name, 0);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = rule->table;
  if (_1 != 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = rule->table_entry.prPrev;
  _3 = rule->table_entry.prNext;
  _2->prNext = _3;
  # DEBUG BEGIN_STMT
  _4 = rule->table_entry.prNext;
  _5 = rule->table_entry.prPrev;
  _4->prPrev = _5;
  # DEBUG BEGIN_STMT
  rule->table_entry.prPrev = 0B;
  # DEBUG BEGIN_STMT
  rule->table_entry.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = rule->table;
  _7 = _6->rule_count;
  _8 = _7;
  _9 = _8 + 65535;
  _6->rule_count = _9;
  # DEBUG BEGIN_STMT
  rule->table = 0B;

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

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

}


fci_fp_db_add_rule_to_table (char_t * table_name, char_t * rule_name, uint16_t position)
{
  bool_t added;
  errno_t ret;
  uint32_t i;
  struct LLIST_t * item;
  struct fci_fp_rule_t * rule;
  struct fci_fp_table_t * fp_table;
  errno_t D.11646;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  i = 0;
  # DEBUG BEGIN_STMT
  ret = 22;
  # DEBUG BEGIN_STMT
  rule = fci_fp_rule_get_first (&fci_fp_rule_db, 1, rule_name, 0);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = rule->table;
  if (_1 != 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 13;
  goto <bb 23>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, table_name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

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

  <bb 8> :
  # DEBUG BEGIN_STMT
  _2 = fp_table->rules_db.rules.prNext;
  _3 = &fp_table->rules_db.rules;
  if (_2 == _3)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = fp_table->rules_db.rules.prNext;
  rule->table_entry.prNext = _4;
  # DEBUG BEGIN_STMT
  _5 = &fp_table->rules_db.rules;
  rule->table_entry.prPrev = _5;
  # DEBUG BEGIN_STMT
  _6 = fp_table->rules_db.rules.prNext;
  _7 = &rule->table_entry;
  _6->prPrev = _7;
  # DEBUG BEGIN_STMT
  _8 = &rule->table_entry;
  fp_table->rules_db.rules.prNext = _8;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule->table = fp_table;
  # DEBUG BEGIN_STMT
  fp_table->rule_count = 1;
  # DEBUG BEGIN_STMT
  ret = 0;
  goto <bb 23>; [INV]

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

  <bb 11> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = fp_table->rules_db.rules.prNext;
  rule->table_entry.prNext = _9;
  # DEBUG BEGIN_STMT
  _10 = &fp_table->rules_db.rules;
  rule->table_entry.prPrev = _10;
  # DEBUG BEGIN_STMT
  _11 = fp_table->rules_db.rules.prNext;
  _12 = &rule->table_entry;
  _11->prPrev = _12;
  # DEBUG BEGIN_STMT
  _13 = &rule->table_entry;
  fp_table->rules_db.rules.prNext = _13;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule->table = fp_table;
  # DEBUG BEGIN_STMT
  _14 = fp_table->rule_count;
  _15 = _14 + 1;
  fp_table->rule_count = _15;
  # DEBUG BEGIN_STMT
  ret = 0;
  goto <bb 23>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  if (position > 255)
    goto <bb 13>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _16 = fp_table->rules_db.rules.prPrev;
  rule->table_entry.prPrev = _16;
  # DEBUG BEGIN_STMT
  _17 = &fp_table->rules_db.rules;
  rule->table_entry.prNext = _17;
  # DEBUG BEGIN_STMT
  _18 = fp_table->rules_db.rules.prPrev;
  _19 = &rule->table_entry;
  _18->prNext = _19;
  # DEBUG BEGIN_STMT
  _20 = &rule->table_entry;
  fp_table->rules_db.rules.prPrev = _20;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule->table = fp_table;
  # DEBUG BEGIN_STMT
  _21 = fp_table->rule_count;
  _22 = _21 + 1;
  fp_table->rule_count = _22;
  # DEBUG BEGIN_STMT
  ret = 0;
  goto <bb 23>; [INV]

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

  <bb 15> :
  # DEBUG BEGIN_STMT
  added = 0;
  # DEBUG BEGIN_STMT
  item = fp_table->rules_db.rules.prNext;
  goto <bb 19>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  _23 = (long unsigned int) position;
  if (i == _23)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _24 = item->prPrev;
  rule->table_entry.prPrev = _24;
  # DEBUG BEGIN_STMT
  _25 = rule->table_entry.prPrev;
  _26 = &rule->table_entry;
  _25->prNext = _26;
  # DEBUG BEGIN_STMT
  _27 = &rule->table_entry;
  item->prPrev = _27;
  # DEBUG BEGIN_STMT
  rule->table_entry.prNext = item;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule->table = fp_table;
  # DEBUG BEGIN_STMT
  _28 = fp_table->rule_count;
  _29 = _28 + 1;
  fp_table->rule_count = _29;
  # DEBUG BEGIN_STMT
  added = 1;
  # DEBUG BEGIN_STMT
  goto <bb 20>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  i = i + 1;
  # DEBUG BEGIN_STMT
  item = item->prNext;

  <bb 19> :
  # DEBUG BEGIN_STMT
  _30 = &fp_table->rules_db.rules;
  if (item != _30)
    goto <bb 16>; [INV]
  else
    goto <bb 20>; [INV]

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

  <bb 21> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _31 = fp_table->rules_db.rules.prPrev;
  rule->table_entry.prPrev = _31;
  # DEBUG BEGIN_STMT
  _32 = &fp_table->rules_db.rules;
  rule->table_entry.prNext = _32;
  # DEBUG BEGIN_STMT
  _33 = fp_table->rules_db.rules.prPrev;
  _34 = &rule->table_entry;
  _33->prNext = _34;
  # DEBUG BEGIN_STMT
  _35 = &rule->table_entry;
  fp_table->rules_db.rules.prPrev = _35;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule->table = fp_table;
  # DEBUG BEGIN_STMT
  _36 = fp_table->rule_count;
  _37 = _36 + 1;
  fp_table->rule_count = _37;

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

  <bb 23> :
  # DEBUG BEGIN_STMT
  D.11646 = ret;
  return D.11646;

}


fci_fp_db_destroy_table (char_t * name, bool_t force)
{
  errno_t ret;
  struct LLIST_t * aux;
  struct LLIST_t * item;
  struct fci_fp_rule_t * rule;
  struct fci_fp_table_t * fp_table;
  errno_t D.11615;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  fp_table = fci_fp_table_get_first (&fci_fp_table_db, 1, name);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = fp_table->dmem_addr;
  if (_1 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

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

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fp_table->dmem_addr = 0;

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

  <bb 9> :
  # DEBUG BEGIN_STMT
  _2 = fp_table->rules_db.rules.prNext;
  _3 = &fp_table->rules_db.rules;
  if (_2 != _3)
    goto <bb 10>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  item = fp_table->rules_db.rules.prNext;
  aux = item->prNext;
  goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _4 = item - 12B;
  rule = (struct fci_fp_rule_t *) _4;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = item->prPrev;
  _6 = item->prNext;
  _5->prNext = _6;
  # DEBUG BEGIN_STMT
  _7 = item->prNext;
  _8 = item->prPrev;
  _7->prPrev = _8;
  # DEBUG BEGIN_STMT
  item->prPrev = 0B;
  # DEBUG BEGIN_STMT
  item->prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = fp_table->rule_count;
  _10 = _9 + 65535;
  fp_table->rule_count = _10;
  # DEBUG BEGIN_STMT
  rule->table = 0B;
  # DEBUG BEGIN_STMT
  item = aux;
  aux = aux->prNext;

  <bb 12> :
  # DEBUG BEGIN_STMT
  _11 = &fp_table->rules_db.rules;
  if (item != _11)
    goto <bb 11>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _12 = fp_table->db_entry.prPrev;
  _13 = fp_table->db_entry.prNext;
  _12->prNext = _13;
  # DEBUG BEGIN_STMT
  _14 = fp_table->db_entry.prNext;
  _15 = fp_table->db_entry.prPrev;
  _14->prPrev = _15;
  # DEBUG BEGIN_STMT
  fp_table->db_entry.prPrev = 0B;
  # DEBUG BEGIN_STMT
  fp_table->db_entry.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (fp_table);

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

}


fci_fp_db_create_table (char_t * name)
{
  errno_t ret;
  struct fci_fp_table_t * fp_table;
  uint32_t mem_size;
  errno_t D.11573;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = fci_fp_table_get_first (&fci_fp_table_db, 1, name);
  if (_1 != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = strlen (name);
  mem_size = _2 + 45;
  # DEBUG BEGIN_STMT
  fp_table = oal_mm_malloc (mem_size);
  # DEBUG BEGIN_STMT
  if (fp_table == 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  memset (fp_table, 0, mem_size);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = &fp_table->db_entry;
  fp_table->db_entry.prNext = _3;
  # DEBUG BEGIN_STMT
  _4 = &fp_table->db_entry;
  fp_table->db_entry.prPrev = _4;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = &fp_table->rules_db.rules;
  fp_table->rules_db.rules.prNext = _5;
  # DEBUG BEGIN_STMT
  _6 = &fp_table->rules_db.rules;
  fp_table->rules_db.rules.prPrev = _6;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = fp_table + 44;
  fp_table->name = _7;
  # DEBUG BEGIN_STMT
  _8 = fp_table->name;
  strcpy (_8, name);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _9 = fci_fp_table_db.tables.prPrev;
  fp_table->db_entry.prPrev = _9;
  # DEBUG BEGIN_STMT
  fp_table->db_entry.prNext = &fci_fp_table_db.tables;
  # DEBUG BEGIN_STMT
  _10 = fci_fp_table_db.tables.prPrev;
  _11 = &fp_table->db_entry;
  _10->prNext = _11;
  # DEBUG BEGIN_STMT
  _12 = &fp_table->db_entry;
  fci_fp_table_db.tables.prPrev = _12;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_destroy_rule (char_t * name)
{
  errno_t ret;
  struct fci_fp_rule_t * rule;
  errno_t D.11565;

  <bb 2> :
  # DEBUG BEGIN_STMT
  rule = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule = fci_fp_rule_get_first (&fci_fp_rule_db, 1, name, 0);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = rule->table;
  if (_1 != 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = rule->db_entry.prPrev;
  _3 = rule->db_entry.prNext;
  _2->prNext = _3;
  # DEBUG BEGIN_STMT
  _4 = rule->db_entry.prNext;
  _5 = rule->db_entry.prPrev;
  _4->prPrev = _5;
  # DEBUG BEGIN_STMT
  rule->db_entry.prPrev = 0B;
  # DEBUG BEGIN_STMT
  rule->db_entry.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (rule);
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_create_rule (char_t * name, uint32_t data, uint32_t mask, uint16_t offset, pfe_ct_fp_flags_t flags, char_t * next_rule)
{
  errno_t ret;
  bool_t ignore_next_rule;
  struct fci_fp_rule_t * rule;
  uint32_t mem_size;
  errno_t D.11529;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  rule = 0B;
  # DEBUG BEGIN_STMT
  ignore_next_rule = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (unsigned int) flags;
  _2 = _1 & 6;
  if (_2 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

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

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _3 = (int) flags;
  _4 = _3 & 6;
  if (_4 == 6)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  _5 = (unsigned int) flags;
  _6 = _5 & 6;
  if (_6 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 8> :
  if (next_rule != 0B)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ignore_next_rule = 1;

  <bb 10> :
  # DEBUG BEGIN_STMT
  _7 = fci_fp_rule_get_first (&fci_fp_rule_db, 1, name, 0);
  if (_7 != 0B)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

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

  <bb 12> :
  # DEBUG BEGIN_STMT
  _8 = strlen (name);
  mem_size = _8 + 45;
  # DEBUG BEGIN_STMT
  if (next_rule != 0B)
    goto <bb 13>; [INV]
  else
    goto <bb 15>; [INV]

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

  <bb 14> :
  # DEBUG BEGIN_STMT
  _9 = strlen (next_rule);
  _10 = mem_size + _9;
  mem_size = _10 + 1;

  <bb 15> :
  # DEBUG BEGIN_STMT
  rule = oal_mm_malloc (mem_size);
  # DEBUG BEGIN_STMT
  if (rule == 0B)
    goto <bb 16>; [INV]
  else
    goto <bb 17>; [INV]

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

  <bb 17> :
  # DEBUG BEGIN_STMT
  memset (rule, 0, mem_size);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _11 = &rule->db_entry;
  rule->db_entry.prNext = _11;
  # DEBUG BEGIN_STMT
  _12 = &rule->db_entry;
  rule->db_entry.prPrev = _12;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _13 = &rule->table_entry;
  rule->table_entry.prNext = _13;
  # DEBUG BEGIN_STMT
  _14 = &rule->table_entry;
  rule->table_entry.prPrev = _14;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _15 = rule + 44;
  rule->name = _15;
  # DEBUG BEGIN_STMT
  _16 = rule->name;
  strcpy (_16, name);
  # DEBUG BEGIN_STMT
  rule->data = data;
  # DEBUG BEGIN_STMT
  rule->mask = mask;
  # DEBUG BEGIN_STMT
  rule->offset = offset;
  # DEBUG BEGIN_STMT
  if (next_rule != 0B)
    goto <bb 18>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 18> :
  if (ignore_next_rule == 0)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  _17 = rule->name;
  _18 = strlen (name);
  _19 = _18 + 1;
  _20 = _17 + _19;
  rule->next_rule = _20;
  # DEBUG BEGIN_STMT
  _21 = rule->next_rule;
  strcpy (_21, next_rule);
  goto <bb 21>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  rule->next_rule = 0B;

  <bb 21> :
  # DEBUG BEGIN_STMT
  rule->flags = flags;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _22 = fci_fp_rule_db.rules.prPrev;
  rule->db_entry.prPrev = _22;
  # DEBUG BEGIN_STMT
  rule->db_entry.prNext = &fci_fp_rule_db.rules;
  # DEBUG BEGIN_STMT
  _23 = fci_fp_rule_db.rules.prPrev;
  _24 = &rule->db_entry;
  _23->prNext = _24;
  # DEBUG BEGIN_STMT
  _25 = &rule->db_entry;
  fci_fp_rule_db.rules.prPrev = _25;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;

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

}


fci_fp_db_init ()
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  memset (&fci_fp_rule_db, 0, 20);
  # DEBUG BEGIN_STMT
  memset (&fci_fp_table_db, 0, 20);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fci_fp_table_db.tables.prNext = &fci_fp_table_db.tables;
  # DEBUG BEGIN_STMT
  fci_fp_table_db.tables.prPrev = &fci_fp_table_db.tables;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  fci_fp_rule_db.rules.prNext = &fci_fp_rule_db.rules;
  # DEBUG BEGIN_STMT
  fci_fp_rule_db.rules.prPrev = &fci_fp_rule_db.rules;
  # DEBUG BEGIN_STMT
  return;

}


fci_fp_get_rule_pos_in_table (const struct fci_fp_table_t * fp_table, struct fci_fp_rule_t * rule, uint8_t * pos)
{
  errno_t ret;
  struct LLIST_t * item;
  struct fci_fp_rule_t * rule_item;
  uint8_t i;
  errno_t D.11679;

  <bb 2> :
  # DEBUG BEGIN_STMT
  i = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 2;
  # DEBUG BEGIN_STMT
  item = fp_table->rules_db.rules.prNext;
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = item - 12B;
  rule_item = (struct fci_fp_rule_t *) _1;
  # DEBUG BEGIN_STMT
  if (rule_item == rule)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  *pos = i;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  i.2_2 = i;
  i = i.2_2 + 1;
  # DEBUG BEGIN_STMT
  item = item->prNext;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _3 = &fp_table->rules_db.rules;
  if (item != _3)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

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

}


fci_fp_table_get_first (struct fci_fp_table_db_t * db, fci_fp_table_criterion_t crit, void * arg)
{
  char_t * mem;
  bool_t cur_crit_remember_success;
  bool_t match;
  struct fci_fp_table_t * fp_table;
  struct LLIST_t * item;
  struct fci_fp_table_t * D.11592;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT
  cur_crit_remember_success = 1;
  # DEBUG BEGIN_STMT
  _1 = db->cur_crit;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = db->cur_crit_arg.name;
  if (_2 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = db->cur_crit_arg.name;
  oal_mm_free (_3);
  # DEBUG BEGIN_STMT
  db->cur_crit_arg.name = 0B;

  <bb 5> :
  # DEBUG BEGIN_STMT
  db->cur_crit = crit;
  # DEBUG BEGIN_STMT
  _4 = db->cur_crit;
  _5 = (int) _4;
  switch (_5) <default: <L10> [INV], case 0: <L26> [INV], case 1: <L5> [INV], case 2: <L9> [INV]>

  <bb 6> :
<L5>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = strlen (arg);
  _7 = _6 + 1;
  mem = oal_mm_malloc (_7);
  # DEBUG BEGIN_STMT
  if (mem == 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  cur_crit_remember_success = 0;
  goto <bb 11>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  db->cur_crit_arg.name = mem;
  # DEBUG BEGIN_STMT
  strcpy (mem, arg);
  goto <bb 11>; [INV]

  <bb 9> :
<L9>:
  # DEBUG BEGIN_STMT
  _8 = MEM[(uint32_t *)arg];
  db->cur_crit_arg.address = _8;
  # DEBUG BEGIN_STMT
  goto <bb 11>; [INV]

  <bb 10> :
<L10>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  cur_crit_remember_success = 0;

  <bb 11> :
<L26>:
  # DEBUG BEGIN_STMT
  if (cur_crit_remember_success == 1)
    goto <bb 12>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _9 = db->tables.prNext;
  _10 = &db->tables;
  if (_9 != _10)
    goto <bb 13>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  item = db->tables.prNext;
  goto <bb 18>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  _11 = item - 16B;
  fp_table = (struct fci_fp_table_t *) _11;
  # DEBUG BEGIN_STMT
  _12 = item->prNext;
  db->cur_item = _12;
  # DEBUG BEGIN_STMT
  if (fp_table != 0B)
    goto <bb 15>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  _13 = db->cur_crit;
  _14 = &db->cur_crit_arg;
  _15 = fci_fp_match_table_by_criterion (_13, _14, fp_table);
  if (_15 == 1)
    goto <bb 16>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  match = 1;
  # DEBUG BEGIN_STMT
  goto <bb 19>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  item = item->prNext;

  <bb 18> :
  # DEBUG BEGIN_STMT
  _16 = &db->tables;
  if (item != _16)
    goto <bb 14>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  if (match != 1)
    goto <bb 20>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  fp_table = 0B;

  <bb 21> :
  # DEBUG BEGIN_STMT
  D.11592 = fp_table;
  return D.11592;

}


fci_fp_match_table_by_criterion (fci_fp_table_criterion_t crit, const union fci_fp_table_criterion_arg_t * arg, const struct fci_fp_table_t * fp_table)
{
  bool_t match;
  bool_t D.11601;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) crit;
  switch (_1) <default: <L9> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L5> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  match = 1;
  # DEBUG BEGIN_STMT
  goto <bb 11>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _2 = arg->name;
  _3 = fp_table->name;
  _4 = strcmp (_2, _3);
  if (_4 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  match = 1;
  goto <bb 11>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  match = 0;
  goto <bb 11>; [INV]

  <bb 7> :
<L5>:
  # DEBUG BEGIN_STMT
  _5 = arg->address;
  _6 = fp_table->dmem_addr;
  if (_5 == _6)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  match = 1;
  goto <bb 11>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  match = 0;
  goto <bb 11>; [INV]

  <bb 10> :
<L9>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;

  <bb 11> :
  # DEBUG BEGIN_STMT
  D.11601 = match;
  return D.11601;

}


fci_fp_rule_get_next (struct fci_fp_rule_db_t * db, dbase_t dbase)
{
  struct fci_fp_rule_t * rule;
  struct fci_fp_rule_t * D.11717;

  <bb 2> :
  # DEBUG BEGIN_STMT
  rule = 0B;
  # DEBUG BEGIN_STMT
  _1 = db->rules.prNext;
  _2 = &db->rules;
  if (_1 != _2)
    goto <bb 3>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = db->cur_item;
  _4 = &db->rules;
  if (_3 == _4)
    goto <bb 4>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  rule = 0B;
  goto <bb 11>; [INV]

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

  <bb 6> :
  # DEBUG BEGIN_STMT
  _5 = db->cur_item;
  _6 = _5 - 4B;
  rule = (struct fci_fp_rule_t *) _6;
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _7 = db->cur_item;
  _8 = _7 - 12B;
  rule = (struct fci_fp_rule_t *) _8;

  <bb 8> :
  # DEBUG BEGIN_STMT
  _9 = db->cur_item;
  _10 = _9->prNext;
  db->cur_item = _10;
  # DEBUG BEGIN_STMT
  if (rule != 0B)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _11 = db->cur_crit;
  _12 = &db->cur_crit_arg;
  _13 = fci_fp_match_rule_by_criterion (_11, _12, rule);
  if (_13 == 1)
    goto <bb 11>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _14 = db->cur_item;
  _15 = &db->rules;
  if (_14 != _15)
    goto <bb 5>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  D.11717 = rule;
  return D.11717;

}


fci_fp_rule_get_first (struct fci_fp_rule_db_t * db, fci_fp_rule_criterion_t crit, void * arg, dbase_t dbase)
{
  char_t * mem;
  bool_t cur_crit_remember_success;
  bool_t match;
  struct fci_fp_rule_t * rule;
  struct LLIST_t * item;
  struct fci_fp_rule_t * D.11551;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT
  cur_crit_remember_success = 1;
  # DEBUG BEGIN_STMT
  _1 = db->cur_crit;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = db->cur_crit_arg.name;
  if (_2 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = db->cur_crit_arg.name;
  oal_mm_free (_3);
  # DEBUG BEGIN_STMT
  db->cur_crit_arg.name = 0B;

  <bb 5> :
  # DEBUG BEGIN_STMT
  db->cur_crit = crit;
  # DEBUG BEGIN_STMT
  _4 = db->cur_crit;
  _5 = (int) _4;
  switch (_5) <default: <L9> [INV], case 0: <L28> [INV], case 1: <L5> [INV]>

  <bb 6> :
<L5>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = strlen (arg);
  _7 = _6 + 1;
  mem = oal_mm_malloc (_7);
  # DEBUG BEGIN_STMT
  if (mem == 0B)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  cur_crit_remember_success = 0;
  goto <bb 10>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  db->cur_crit_arg.name = mem;
  # DEBUG BEGIN_STMT
  strcpy (mem, arg);
  goto <bb 10>; [INV]

  <bb 9> :
<L9>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  cur_crit_remember_success = 0;

  <bb 10> :
<L28>:
  # DEBUG BEGIN_STMT
  if (cur_crit_remember_success == 1)
    goto <bb 11>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _8 = db->rules.prNext;
  _9 = &db->rules;
  if (_8 != _9)
    goto <bb 12>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  item = db->rules.prNext;
  goto <bb 20>; [INV]

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

  <bb 14> :
  # DEBUG BEGIN_STMT
  _10 = item - 4B;
  rule = (struct fci_fp_rule_t *) _10;
  goto <bb 16>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  _11 = item - 12B;
  rule = (struct fci_fp_rule_t *) _11;

  <bb 16> :
  # DEBUG BEGIN_STMT
  _12 = item->prNext;
  db->cur_item = _12;
  # DEBUG BEGIN_STMT
  if (rule != 0B)
    goto <bb 17>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  _13 = db->cur_crit;
  _14 = &db->cur_crit_arg;
  _15 = fci_fp_match_rule_by_criterion (_13, _14, rule);
  if (_15 == 1)
    goto <bb 18>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  match = 1;
  # DEBUG BEGIN_STMT
  goto <bb 21>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  item = item->prNext;

  <bb 20> :
  # DEBUG BEGIN_STMT
  _16 = &db->rules;
  if (item != _16)
    goto <bb 13>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 21> :
  # DEBUG BEGIN_STMT
  if (match != 1)
    goto <bb 22>; [INV]
  else
    goto <bb 23>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  rule = 0B;

  <bb 23> :
  # DEBUG BEGIN_STMT
  D.11551 = rule;
  return D.11551;

}


fci_fp_match_rule_by_criterion (fci_fp_rule_criterion_t crit, const union fci_fp_rule_criterion_arg_t * arg, const struct fci_fp_rule_t * rule)
{
  bool_t match;
  bool_t D.11557;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) crit;
  switch (_1) <default: <L5> [INV], case 0: <L0> [INV], case 1: <L1> [INV]>

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

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _2 = arg->name;
  _3 = rule->name;
  _4 = strcmp (_2, _3);
  if (_4 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

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

  <bb 7> :
<L5>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT

  <bb 8> :
  # DEBUG BEGIN_STMT
  D.11557 = match;
  return D.11557;

}


