decompiled_code:
__int64 __fastcall initial_terminal_classification(__int64 a1)
{
__int64 result; // rax

result = (unsigned int)(**(_BYTE **)(a1 + 32) == 0) + 2;
*(_DWORD *)a1 = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
__int64 result; // rax

result = (unsigned int)(**(_BYTE **)(a1 + 32) == 0) + 2;
*(_DWORD *)a1 = result;
return result;
}

original_code:
static void initial_terminal_classification (member m)
 { if (strlen (m -> u.terminal) != 0)
        m -> empty = 2;
   else m -> empty = 3;
 }

canonical_original_code:
static void initial_terminal_classification(struct member_rec *m)
 { if (strlen (m -> u.terminal) != 0)
        m -> empty = 2;
   else m -> empty = 3;
 }

variable_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec { char *nonterminal; struct pos_list_rec { int size; int room; struct pos_rec { int kind; struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *ex; int type; struct element_def_rec *lat_repr; } **array; } *display; struct rule_rec { char *nonterminal; struct alt_list_rec { int size; int room; struct alt_rec { struct pos_list_rec *display; struct member_list_rec { int size; int room; struct member_rec **array; } *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; } **array; } *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec { char *remainder; struct lexend_list_rec { int size; int room; struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; } **array; } *prods; struct lextree_list_rec { int size; int room; struct lextree_rec **array; } *tails; } *rev_tree; } *def; } call; char *terminal; struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; } semi; } u; } *

user_defined_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec call; char *terminal; struct semiterminal_rec semi; } u; }

user_defined_types: struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; }

user_defined_types: struct pos_list_rec { int size; int room; struct pos_rec **array; }

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; }

user_defined_types: struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }


repo: tjordanchat/eag

decompiled_code:
__int64 __fastcall initial_semiterminal_classification(__int64 a1)
{
__int64 result; // rax

result = (unsigned int)((**(_BYTE **)(a1 + 32) & 4) == 0) + 1;
*(_DWORD *)a1 = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
__int64 result; // rax

result = (unsigned int)((**(_BYTE **)(a1 + 32) & 4) == 0) + 1;
*(_DWORD *)a1 = result;
return result;
}

original_code:
static void initial_semiterminal_classification (member m)
 { cset set = m -> u.semi.set;
   if (set -> kind & 4)
        m -> empty = 1;
   else m -> empty = 2;
 }

canonical_original_code:
static void initial_semiterminal_classification(struct member_rec *m)
 { struct cset_rec *set = m -> u.semi.set;
   if (set -> kind & 4)
        m -> empty = 1;
   else m -> empty = 2;
 }

variable_types: struct cset_rec { int kind; char *str; } *

return_type: void

user_defined_types: struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; }

user_defined_types: struct lextree_list_rec { int size; int room; struct lextree_rec **array; }

user_defined_types: struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; }

user_defined_types: struct member_list_rec { int size; int room; struct member_rec **array; }

user_defined_types: struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

user_defined_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec *val; int ref_count; int reachable; int tag; union { struct variable_rec var; char *str; int inum; double rnum; struct cset_rec *semi; struct element_rec elt; struct expr_rec *cexpr; } u; }

user_defined_types: struct affix_list_rec { int size; int room; struct affix_rec **array; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }

user_defined_types: struct element_rec { char *eltnm; struct element_def_rec *def; }

user_defined_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; }

user_defined_types: struct value_list_rec { int size; int room; struct value_rec **array; }

user_defined_types: struct int_list_rec { int size; int room; int *array; }

user_defined_types: struct meta_alt_list_rec { int size; int room; struct meta_alt_rec **array; }

user_defined_types: struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec *set; }

user_defined_types: struct element_set_rec { int number; struct element_def_list_rec *defs; }

user_defined_types: struct meta_alt_rec { struct expr_rec *e; int number; }

user_defined_types: struct element_def_list_rec { int size; int room; struct element_def_rec **array; }


decompiled_code:
__int64 __fastcall unify_empty(__int64 a1, int a2)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 20);
if ( !(_DWORD)result )
{
if ( a2 )
{
*(_DWORD *)(a1 + 20) = 1;
change = 1;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, int a2)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 20);
if ( !(_DWORD)result )
{
if ( a2 )
{
*(_DWORD *)(a1 + 20) = 1;
change = 1;
}
}
return result;
}

original_code:
static void unify_empty (rule srule, int empty)
 { if (srule -> empty) return;
   if (!empty) return;
   srule -> empty = 1;
   change = 1;
 }

canonical_original_code:
static void unify_empty(struct rule_rec *srule, int empty)
 { if (srule -> empty) return;
   if (!empty) return;
   srule -> empty = 1;
   change = 1;
 }

variable_types: struct rule_rec { char *nonterminal; struct alt_list_rec { int size; int room; struct alt_rec { struct pos_list_rec { int size; int room; struct pos_rec { int kind; struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *ex; int type; struct element_def_rec *lat_repr; } **array; } *display; struct member_list_rec { int size; int room; struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; } call; char *terminal; struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; } semi; } u; } **array; } *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; } **array; } *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec { char *remainder; struct lexend_list_rec { int size; int room; struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; } **array; } *prods; struct lextree_list_rec { int size; int room; struct lextree_rec **array; } *tails; } *rev_tree; } *

variable_types: empty int

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; }

user_defined_types: struct pos_list_rec { int size; int room; struct pos_rec **array; }

user_defined_types: struct pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }

user_defined_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec call; char *terminal; struct semiterminal_rec semi; } u; }

user_defined_types: struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }


decompiled_code:
__int64 __fastcall mark_if_rule_never_produces_empty(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 20);
if ( !(_DWORD)result )
{
result = 0x200000001LL;
*(_QWORD *)(a1 + 16) = 0x200000001LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 20);
if ( !(_DWORD)result )
{
result = 0x200000001LL;
*(_QWORD *)(a1 + 16) = 0x200000001LL;
}
return result;
}

original_code:
static void mark_if_rule_never_produces_empty (rule srule)
 { if (srule -> empty) return;
   srule -> empty = 2;
   srule -> kind = 1;
 }

canonical_original_code:
static void mark_if_rule_never_produces_empty(struct rule_rec *srule)
 { if (srule -> empty) return;
   srule -> empty = 2;
   srule -> kind = 1;
 }

user_defined_types: struct lextree_list_rec { int size; int room; struct lextree_rec **array; }

user_defined_types: struct member_list_rec { int size; int room; struct member_rec **array; }

user_defined_types: struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

user_defined_types: struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; }

user_defined_types: struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; }

user_defined_types: struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; }

user_defined_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec *val; int ref_count; int reachable; int tag; union { struct variable_rec var; char *str; int inum; double rnum; struct cset_rec *semi; struct element_rec elt; struct expr_rec *cexpr; } u; }

user_defined_types: struct affix_list_rec { int size; int room; struct affix_rec **array; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }

user_defined_types: struct element_rec { char *eltnm; struct element_def_rec *def; }

user_defined_types: struct cset_rec { int kind; char *str; }

user_defined_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; }


decompiled_code:
__int64 __fastcall member_always_produces_empty(__int64 a1)
{
__int64 result; // rax
__int64 v2; // rdx

result = *(unsigned int *)(a1 + 24);
if ( (_DWORD)result )
return *(_DWORD *)a1 == 3;
v2 = *(_QWORD *)(a1 + 48);
if ( *(_DWORD *)(v2 + 20) != 2 )
result = *(_DWORD *)(v2 + 16) != 1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
__int64 result; // rax
__int64 v2; // rdx

result = *(unsigned int *)(a1 + 24);
if ( (_DWORD)result )
return *(_DWORD *)a1 == 3;
v2 = *(_QWORD *)(a1 + 48);
if ( *(_DWORD *)(v2 + 20) != 2 )
result = *(_DWORD *)(v2 + 16) != 1;
return result;
}

original_code:
static int member_always_produces_empty (member m)
 { if (m -> tag == 0)
      { rule def = m -> u.call.def;
        if (def -> empty == 2) return (0);
        return (def -> kind != 1);
      }
   else return (m -> empty == 3);
 }

canonical_original_code:
static int member_always_produces_empty(struct member_rec *m)
 { if (m -> tag == 0)
      { struct rule_rec *def = m -> u.call.def;
        if (def -> empty == 2) return (0);
        return (def -> kind != 1);
      }
   else return (m -> empty == 3);
 }

return_type: int

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; }

user_defined_types: struct value_list_rec { int size; int room; struct value_rec **array; }

user_defined_types: struct int_list_rec { int size; int room; int *array; }

user_defined_types: struct meta_alt_list_rec { int size; int room; struct meta_alt_rec **array; }

user_defined_types: struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec *set; }

user_defined_types: struct element_set_rec { int number; struct element_def_list_rec *defs; }

user_defined_types: struct meta_alt_rec { struct expr_rec *e; int number; }

user_defined_types: struct element_def_list_rec { int size; int room; struct element_def_rec **array; }


decompiled_code:
__int64 __fastcall mark_if_rule_always_produces_empty(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 28);
if ( !(_DWORD)result && *(_DWORD *)(a1 + 16) != 1 )
{
result = 0x300000002LL;
*(_QWORD *)(a1 + 16) = 0x300000002LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 28);
if ( !(_DWORD)result && *(_DWORD *)(a1 + 16) != 1 )
{
result = 0x300000002LL;
*(_QWORD *)(a1 + 16) = 0x300000002LL;
}
return result;
}

original_code:
static void mark_if_rule_always_produces_empty (rule srule)
 { if (srule -> ext) return;
   if (srule -> kind == 1) return;
   srule -> empty = 3;
   srule -> kind = 2;
 }

canonical_original_code:
static void mark_if_rule_always_produces_empty(struct rule_rec *srule)
 { if (srule -> ext) return;
   if (srule -> kind == 1) return;
   srule -> empty = 3;
   srule -> kind = 2;
 }

user_defined_types: struct lextree_list_rec { int size; int room; struct lextree_rec **array; }

user_defined_types: struct pos_list_rec { int size; int room; struct pos_rec **array; }

user_defined_types: struct member_list_rec { int size; int room; struct member_rec **array; }

user_defined_types: struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

user_defined_types: struct pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }

user_defined_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec call; char *terminal; struct semiterminal_rec semi; } u; }

user_defined_types: struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; }

user_defined_types: struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; }

user_defined_types: struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; }

user_defined_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec *val; int ref_count; int reachable; int tag; union { struct variable_rec var; char *str; int inum; double rnum; struct cset_rec *semi; struct element_rec elt; struct expr_rec *cexpr; } u; }

user_defined_types: struct affix_list_rec { int size; int room; struct affix_rec **array; }

user_defined_types: struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }


decompiled_code:
__int64 __fastcall finish_marking_in_member(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 24);
if ( !(_DWORD)result )
{
result = *(unsigned int *)(*(_QWORD *)(a1 + 48) + 20LL);
*(_DWORD *)a1 = result;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 24);
if ( !(_DWORD)result )
{
result = *(unsigned int *)(*(_QWORD *)(a1 + 48) + 20LL);
*(_DWORD *)a1 = result;
}
return result;
}

original_code:
static void finish_marking_in_member (member m)
 { if (m -> tag != 0) return;
   m -> empty = m -> u.call.def -> empty;
 }

canonical_original_code:
static void finish_marking_in_member(struct member_rec *m)
 { if (m -> tag != 0) return;
   m -> empty = m -> u.call.def -> empty;
 }

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }

user_defined_types: struct element_rec { char *eltnm; struct element_def_rec *def; }

user_defined_types: struct cset_rec { int kind; char *str; }

user_defined_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; }

user_defined_types: struct value_list_rec { int size; int room; struct value_rec **array; }

user_defined_types: struct int_list_rec { int size; int room; int *array; }

user_defined_types: struct meta_alt_list_rec { int size; int room; struct meta_alt_rec **array; }


original_code:
static void finish_marking_in_alt (alt a)
 { member_list mems = a -> members;
   int ix;
   if (mems == ((member_list) ((void *)0))) return;
   for (ix = 0; ix < mems -> size; ix++)
      finish_marking_in_member (mems -> array[ix]);
   for (ix = 0; ix < mems -> size; ix++)
      if (mems -> array[ix] -> empty == 2) return;
   a -> empty = 1;
 }

canonical_original_code:
static void finish_marking_in_alt(struct alt_rec *a)
 { struct member_list_rec *mems = a -> members;
   int ix;
   if (mems == ((member_list) ((void *)0))) return;
   for (ix = 0; ix < mems -> size; ix++)
      finish_marking_in_member (mems -> array[ix]);
   for (ix = 0; ix < mems -> size; ix++)
      if (mems -> array[ix] -> empty == 2) return;
   a -> empty = 1;
 }

variable_types: struct alt_rec { struct pos_list_rec { int size; int room; struct pos_rec { int kind; struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *ex; int type; struct element_def_rec *lat_repr; } **array; } *display; struct member_list_rec { int size; int room; struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec { char *nonterminal; struct alt_list_rec { int size; int room; struct alt_rec **array; } *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec { char *remainder; struct lexend_list_rec { int size; int room; struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; } **array; } *prods; struct lextree_list_rec { int size; int room; struct lextree_rec **array; } *tails; } *rev_tree; } *def; } call; char *terminal; struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; } semi; } u; } **array; } *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; } *

variable_types: struct member_list_rec { int size; int room; struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec { char *nonterminal; struct pos_list_rec { int size; int room; struct pos_rec { int kind; struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *ex; int type; struct element_def_rec *lat_repr; } **array; } *display; struct rule_rec { char *nonterminal; struct alt_list_rec { int size; int room; struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; } **array; } *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec { char *remainder; struct lexend_list_rec { int size; int room; struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; } **array; } *prods; struct lextree_list_rec { int size; int room; struct lextree_rec **array; } *tails; } *rev_tree; } *def; } call; char *terminal; struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; } semi; } u; } **array; } *

variable_types: ix int

user_defined_types: struct member_list_rec { int size; int room; struct member_rec **array; }

user_defined_types: struct pos_list_rec { int size; int room; struct pos_rec **array; }

user_defined_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec call; char *terminal; struct semiterminal_rec semi; } u; }

user_defined_types: struct pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }

user_defined_types: struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; }

user_defined_types: struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; }

user_defined_types: struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec *set; }

user_defined_types: struct element_set_rec { int number; struct element_def_list_rec *defs; }


decompiled_code:
__int64 __fastcall affix_nullability(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 40);
switch ( (int)result )
{
case 0:
result = *(unsigned int *)(*(_QWORD *)(a1 + 64) + 28LL);
break;
case 1:
if ( **(_BYTE **)(a1 + 48) )
result = 2LL;
break;
case 2:
if ( *(int *)(a1 + 48) <= 0 )
result = 1LL;
break;
case 3:
if ( *(double *)(a1 + 48) != 0.0 )
goto LABEL_2;
result = 1LL;
break;
case 4:
result = (unsigned int)((**(_BYTE **)(a1 + 48) & 4) == 0) + 1;
break;
case 5:
LABEL_2:
result = 2LL;
break;
default:
bad_tag((unsigned int)result, "affix_may_produce_empty");
result = 0LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 40);
switch ( (int)result )
{
case 0:
result = *(unsigned int *)(*(_QWORD *)(a1 + 64) + 28LL);
break;
case 1:
if ( **(_BYTE **)(a1 + 48) )
result = 2LL;
break;
case 2:
if ( *(int *)(a1 + 48) <= 0 )
result = 1LL;
break;
case 3:
if ( *(double *)(a1 + 48) != 0.0 )
goto LABEL_2;
result = 1LL;
break;
case 4:
result = (unsigned int)((**(_BYTE **)(a1 + 48) & 4) == 0) + 1;
break;
case 5:
LABEL_2:
result = 2LL;
break;
default:
bad_tag((unsigned int)result, "affix_may_produce_empty");
result = 0LL;
break;
}
return result;
}

original_code:
static int affix_nullability (affix a)
 { switch (a -> tag)
      { case 0:
    { meta_rule def = a -> u.var.def;
      return (def -> empty);
    };
        case 1:
    if (strlen (a -> u.str)) return (2);
    else return (1);
        case 2:
    if (a -> u.inum <= 0) return (1);
    else return (2);
        case 3:
    if (a -> u.rnum == 0.0) return (1);
    else return (2);
        case 4:
    { cset set = a -> u.semi;
      if (set -> kind & 4) return (1);
      else return (2);
    };
        case 5: return (2);
        default: bad_tag (a -> tag, "affix_may_produce_empty");
      };
   return (0);
 }

canonical_original_code:
static int affix_nullability(struct affix_rec *a)
 { switch (a -> tag)
      { case 0:
    { struct meta_rule_rec *def = a -> u.var.def;
      return (def -> empty);
    };
        case 1:
    if (strlen (a -> u.str)) return (2);
    else return (1);
        case 2:
    if (a -> u.inum <= 0) return (1);
    else return (2);
        case 3:
    if (a -> u.rnum == 0.0) return (1);
    else return (2);
        case 4:
    { struct cset_rec *set = a -> u.semi;
      if (set -> kind & 4) return (1);
      else return (2);
    };
        case 5: return (2);
        default: bad_tag (a -> tag, "affix_may_produce_empty");
      };
   return (0);
 }

variable_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *

variable_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; } *

user_defined_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec *val; int ref_count; int reachable; int tag; union { struct variable_rec var; char *str; int inum; double rnum; struct cset_rec *semi; struct element_rec elt; struct expr_rec *cexpr; } u; }

user_defined_types: struct meta_alt_rec { struct expr_rec *e; int number; }


decompiled_code:
__int64 __fastcall concat_nullability(__int64 a1)
{
unsigned int v1; // eax
unsigned int v2; // er12
__int64 v3; // rbx
int v4; // ebp
int v5; // eax

v1 = affix_nullability(**(_QWORD **)(a1 + 8));
if ( v1 != 2 )
{
v2 = v1;
v3 = 8LL;
v4 = 1;
while ( 1 )
{
v5 = affix_nullability(*(_QWORD *)(*(_QWORD *)(a1 + 8) + v3));
if ( v5 == 2 )
break;
if ( v2 != v5 )
v2 = 0;
++v4;
v3 += 8LL;
if ( *(_DWORD *)a1 <= v4 )
return v2;
}
}
return 2;
}

original_code:
static int concat_nullability (affix_list affs)
 { int null = affix_nullability (affs -> array[0]);
   int ix = 1;
   if (null == 2) return (2);
   do
      { int null2 = affix_nullability (affs -> array[ix]);
        if (null2 == 2) return (2);
        if (null != null2) null = 0;
        ix++;
      }
   while (ix < affs -> size);
   return (null);
 }

canonical_original_code:
static int concat_nullability(struct affix_list_rec *affs)
 { int null = affix_nullability (affs -> array[0]);
   int ix = 1;
   if (null == 2) return (2);
   do
      { int null2 = affix_nullability (affs -> array[ix]);
        if (null2 == 2) return (2);
        if (null != null2) null = 0;
        ix++;
      }
   while (ix < affs -> size);
   return (null);
 }

variable_types: struct affix_list_rec { int size; int room; struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } **array; } *

user_defined_types: struct affix_list_rec { int size; int room; struct affix_rec **array; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }

user_defined_types: struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }


decompiled_code:
__int64 __fastcall expr_nullability(unsigned int *a1)
{
__int64 result; // rax

if ( !a1 )
return 1LL;
result = *a1;
if ( (_DWORD)result == 3 )
return concat_nullability(*((_QWORD *)a1 + 1));
if ( (int)result > 3 )
{
if ( (_DWORD)result == 4 )
return 2LL;
goto LABEL_8;
}
if ( (_DWORD)result == 1 )
return affix_nullability(*((_QWORD *)a1 + 1));
if ( (_DWORD)result != 2 )
{
LABEL_8:
bad_tag((unsigned int)result, "expr_nullability");
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func12(unsigned int *a1)
{
__int64 result; // rax

if ( !a1 )
return 1LL;
result = *a1;
if ( (_DWORD)result == 3 )
return func11(*((_QWORD *)a1 + 1));
if ( (int)result > 3 )
{
if ( (_DWORD)result == 4 )
return 2LL;
goto LABEL_8;
}
if ( (_DWORD)result == 1 )
return func10(*((_QWORD *)a1 + 1));
if ( (_DWORD)result != 2 )
{
LABEL_8:
bad_tag((unsigned int)result, "expr_nullability");
result = 0LL;
}
return result;
}

original_code:
static int expr_nullability (expr e)
 { if (e == ((expr) ((void *)0)))
      return (1);
   switch (e -> tag)
      { case 1: return (affix_nullability (e -> u.single));
        case 3: return (concat_nullability (e -> u.concat));
        case 2: return (2);
        case 4: return (2);
        default: bad_tag (e -> tag, "expr_nullability");
      };
   return (0);
 }

canonical_original_code:
static int expr_nullability(struct expr_rec *e)
 { if (e == ((expr) ((void *)0)))
      return (1);
   switch (e -> tag)
      { case 1: return (affix_nullability (e -> u.single));
        case 3: return (concat_nullability (e -> u.concat));
        case 2: return (2);
        case 4: return (2);
        default: bad_tag (e -> tag, "expr_nullability");
      };
   return (0);
 }

variable_types: struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *

user_defined_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; }


decompiled_code:
__int64 __fastcall meta_alts_nullability(__int64 a1)
{
unsigned int v1; // eax
unsigned int v2; // er12
__int64 v3; // rbx
int v4; // ebp
int v5; // eax

v1 = expr_nullability(***(unsigned int ****)(a1 + 8));
if ( v1 == 1 )
return 1;
v2 = v1;
if ( *(int *)a1 > 1 )
{
v3 = 8LL;
v4 = 1;
while ( 1 )
{
v5 = expr_nullability(**(unsigned int ***)(*(_QWORD *)(a1 + 8) + v3));
if ( v5 == 1 )
break;
if ( v5 != v2 )
v2 = 0;
++v4;
v3 += 8LL;
if ( *(_DWORD *)a1 <= v4 )
return v2;
}
return 1;
}
return v2;
}

canonical_decompiled_code:
__int64 __fastcall func13(__int64 a1)
{
unsigned int v1; // eax
unsigned int v2; // er12
__int64 v3; // rbx
int v4; // ebp
int v5; // eax

v1 = func12(***(unsigned int ****)(a1 + 8));
if ( v1 == 1 )
return 1;
v2 = v1;
if ( *(int *)a1 > 1 )
{
v3 = 8LL;
v4 = 1;
while ( 1 )
{
v5 = func12(**(unsigned int ***)(*(_QWORD *)(a1 + 8) + v3));
if ( v5 == 1 )
break;
if ( v5 != v2 )
v2 = 0;
++v4;
v3 += 8LL;
if ( *(_DWORD *)a1 <= v4 )
return v2;
}
return 1;
}
return v2;
}

original_code:
static int meta_alts_nullability (meta_alt_list alts)
 { int null = expr_nullability (alts -> array[0] -> e);
   int ix = 1;
   if (null == 1) return (1);
   for (ix = 1; ix < alts -> size; ix++)
      { int null2 = expr_nullability (alts -> array[ix] -> e);
        if (null2 == 1) return (1);
        if (null != null2) null = 0;
      };
   return (null);
 }

canonical_original_code:
static int meta_alts_nullability(struct meta_alt_list_rec *alts)
 { int null = expr_nullability (alts -> array[0] -> e);
   int ix = 1;
   if (null == 1) return (1);
   for (ix = 1; ix < alts -> size; ix++)
      { int null2 = expr_nullability (alts -> array[ix] -> e);
        if (null2 == 1) return (1);
        if (null != null2) null = 0;
      };
   return (null);
 }

variable_types: struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *e; int number; } **array; } *


decompiled_code:
__int64 __fastcall detect_meta_rule_nullability(__int64 a1)
{
__int64 result; // rax
int v2; // edx

result = *(unsigned int *)(a1 + 16);
if ( !(_DWORD)result )
{
result = meta_alts_nullability(*(_QWORD *)(a1 + 8));
v2 = *(_DWORD *)(a1 + 28);
if ( v2 != (_DWORD)result )
{
if ( v2 )
{
result = internal_error("detect_meta_rule_nullability");
}
else
{
*(_DWORD *)(a1 + 28) = result;
change = 1;
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func14(__int64 a1)
{
__int64 result; // rax
int v2; // edx

result = *(unsigned int *)(a1 + 16);
if ( !(_DWORD)result )
{
result = func13(*(_QWORD *)(a1 + 8));
v2 = *(_DWORD *)(a1 + 28);
if ( v2 != (_DWORD)result )
{
if ( v2 )
{
result = internal_error("detect_meta_rule_nullability");
}
else
{
*(_DWORD *)(a1 + 28) = result;
change = 1;
}
}
}
return result;
}

original_code:
static void detect_meta_rule_nullability (meta_rule mrule)
 { int null;
   if (mrule -> ext) return;
   null = meta_alts_nullability (mrule -> alts);
   if (mrule -> empty == null) return;
   if (mrule -> empty == 0)
      { mrule -> empty = null;
        change = 1;
        return;
      };
   internal_error ("detect_meta_rule_nullability");
 }

canonical_original_code:
static void detect_meta_rule_nullability(struct meta_rule_rec *mrule)
 { int null;
   if (mrule -> ext) return;
   null = meta_alts_nullability (mrule -> alts);
   if (mrule -> empty == null) return;
   if (mrule -> empty == 0)
      { mrule -> empty = null;
        change = 1;
        return;
      };
   internal_error ("detect_meta_rule_nullability");
 }

user_defined_types: struct element_rec { char *eltnm; struct element_def_rec *def; }

user_defined_types: struct cset_rec { int kind; char *str; }

user_defined_types: struct value_list_rec { int size; int room; struct value_rec **array; }

user_defined_types: struct element_def_list_rec { int size; int room; struct element_def_rec **array; }


decompiled_code:
__int64 detect_empty_producing_meta_rules()
{
unsigned int v0; // ebp
__int64 v1; // rbx
__int64 v2; // rdi
const char *v3; // rdx
__int64 result; // rax
__int64 i; // rcx

v0 = 0;
hint("detecting empty producing meta rules...");
change = 0;
if ( nr_of_meta_rules <= 0 )
{
LABEL_6:
++v0;
}
else
{
while ( 1 )
{
v1 = 0LL;
do
{
v2 = *(_QWORD *)(all_meta_rules + 8 * v1++);
detect_meta_rule_nullability(v2);
}
while ( nr_of_meta_rules > (int)v1 );
++v0;
if ( !change )
break;
change = 0;
if ( nr_of_meta_rules <= 0 )
goto LABEL_6;
}
}
v3 = (const char *)&unk_BE2;
if ( v0 != 1 )
v3 = "es";
hint("needed %d pass%s for empty detection of meta rules", v0, v3);
result = nr_of_meta_rules;
for ( i = 0LL; nr_of_meta_rules > (int)i; result = finish_meta_rule_nullability(*(_QWORD *)(all_meta_rules + 8 * i)) )
;
return result;
}

canonical_decompiled_code:
__int64 func15()
{
unsigned int v0; // ebp
__int64 v1; // rbx
__int64 v2; // rdi
const char *v3; // rdx
__int64 result; // rax
__int64 i; // rcx

v0 = 0;
hint("detecting empty producing meta rules...");
change = 0;
if ( nr_of_meta_rules <= 0 )
{
LABEL_6:
++v0;
}
else
{
while ( 1 )
{
v1 = 0LL;
do
{
v2 = *(_QWORD *)(all_meta_rules + 8 * v1++);
func14(v2);
}
while ( nr_of_meta_rules > (int)v1 );
++v0;
if ( !change )
break;
change = 0;
if ( nr_of_meta_rules <= 0 )
goto LABEL_6;
}
}
v3 = (const char *)&unk_BE2;
if ( v0 != 1 )
v3 = "es";
hint("needed %d pass%s for empty detection of meta rules", v0, v3);
result = nr_of_meta_rules;
for ( i = 0LL; nr_of_meta_rules > (int)i; result = func0(*(_QWORD *)(all_meta_rules + 8 * i)) )
;
return result;
}

original_code:
static void detect_empty_producing_meta_rules ()
 { int nr_passes;
   int ix;
   hint ("detecting empty producing meta rules...");
   nr_passes = 0;
   do
      { change = 0;
        for (ix = 0; ix < nr_of_meta_rules; ix++)
    detect_meta_rule_nullability (all_meta_rules[ix]);
        nr_passes++;
      }
   while (change);
   hint ("needed %d pass%s for empty detection of meta rules",
  nr_passes, (nr_passes == 1)?"":"es");
   for (ix = 0; ix < nr_of_meta_rules; ix++)
      finish_meta_rule_nullability (all_meta_rules[ix]);
 }

canonical_original_code:
static void detect_empty_producing_meta_rules()
 { int nr_passes;
   int ix;
   hint ("detecting empty producing meta rules...");
   nr_passes = 0;
   do
      { change = 0;
        for (ix = 0; ix < nr_of_meta_rules; ix++)
    detect_meta_rule_nullability (all_meta_rules[ix]);
        nr_passes++;
      }
   while (change);
   hint ("needed %d pass%s for empty detection of meta rules",
  nr_passes, (nr_passes == 1)?"":"es");
   for (ix = 0; ix < nr_of_meta_rules; ix++)
      finish_meta_rule_nullability (all_meta_rules[ix]);
 }


decompiled_code:
void __fastcall initial_member_classification(__int64 a1, _DWORD *a2)
{
__int64 v3; // rdi

v3 = (unsigned int)a2[6];
if ( (_DWORD)v3 == 2 )
{
initial_semiterminal_classification((__int64)a2);
}
else
{
if ( (int)v3 > 2 )
{
if ( (_DWORD)v3 == 3 )
{
initial_cut_classification(a2);
goto LABEL_6;
}
}
else
{
if ( !(_DWORD)v3 )
return;
if ( (_DWORD)v3 == 1 )
{
initial_terminal_classification((__int64)a2);
goto LABEL_6;
}
}
bad_tag(v3, "initial_member_classification");
}
LABEL_6:
if ( *a2 != 3 )
*(_DWORD *)(a1 + 16) = 1;
}

canonical_decompiled_code:
void __fastcall func16(__int64 a1, _DWORD *a2)
{
__int64 v3; // rdi

v3 = (unsigned int)a2[6];
if ( (_DWORD)v3 == 2 )
{
func2((__int64)a2);
}
else
{
if ( (int)v3 > 2 )
{
if ( (_DWORD)v3 == 3 )
{
func3(a2);
goto LABEL_6;
}
}
else
{
if ( !(_DWORD)v3 )
return;
if ( (_DWORD)v3 == 1 )
{
func1((__int64)a2);
goto LABEL_6;
}
}
bad_tag(v3, "initial_member_classification");
}
LABEL_6:
if ( *a2 != 3 )
*(_DWORD *)(a1 + 16) = 1;
}

original_code:
static void initial_member_classification (rule srule, member m)
 { switch (m -> tag)
      { case 0: return;
        case 1:
    initial_terminal_classification (m); break;
        case 2:
    initial_semiterminal_classification (m); break;
        case 3:
    initial_cut_classification (m); break;
        default: bad_tag (m -> tag, "initial_member_classification");
      };
   if (m -> empty != 3)
      srule -> kind = 1;
 }

canonical_original_code:
static void initial_member_classification(struct rule_rec *srule, struct member_rec *m)
 { switch (m -> tag)
      { case 0: return;
        case 1:
    initial_terminal_classification (m); break;
        case 2:
    initial_semiterminal_classification (m); break;
        case 3:
    initial_cut_classification (m); break;
        default: bad_tag (m -> tag, "initial_member_classification");
      };
   if (m -> empty != 3)
      srule -> kind = 1;
 }

variable_types:
m
struct member_rec *

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct lextree_list_rec { int size; int room; struct lextree_rec **array; }

user_defined_types: struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; }

user_defined_types: struct pos_list_rec { int size; int room; struct pos_rec **array; }

user_defined_types: struct member_list_rec { int size; int room; struct member_rec **array; }

user_defined_types: struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

user_defined_types: struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; }

user_defined_types: struct int_list_rec { int size; int room; int *array; }

user_defined_types: struct meta_alt_list_rec { int size; int room; struct meta_alt_rec **array; }


decompiled_code:
_BOOL8 __fastcall member_may_produce_empty(__int64 a1)
{
unsigned int v1; // er8

v1 = *(_DWORD *)(a1 + 24);
if ( !v1 )
return (*(_DWORD *)(*(_QWORD *)(a1 + 48) + 20LL) & 0xFFFFFFFD) == 1;
if ( v1 - 1 <= 2 )
return *(_DWORD *)a1 != 2;
bad_tag(v1, "member_may_produce_empty");
return 0LL;
}

canonical_decompiled_code:
_BOOL8 __fastcall func17(__int64 a1)
{
unsigned int v1; // er8

v1 = *(_DWORD *)(a1 + 24);
if ( !v1 )
return (*(_DWORD *)(*(_QWORD *)(a1 + 48) + 20LL) & 0xFFFFFFFD) == 1;
if ( v1 - 1 <= 2 )
return *(_DWORD *)a1 != 2;
bad_tag(v1, "member_may_produce_empty");
return 0LL;
}

original_code:
static int member_may_produce_empty (member m)
 { switch (m -> tag)
      { case 0:
           { int empty = m -> u.call.def -> empty;
             if (empty == 1) return (1);
             return (empty == 3);
    };
        case 1:
        case 2:
        case 3:
      return (m -> empty != 2);
        default: bad_tag (m -> tag, "member_may_produce_empty");
      };
   return (0);
 }

canonical_original_code:
static int member_may_produce_empty(struct member_rec *m)
 { switch (m -> tag)
      { case 0:
           { int empty = m -> u.call.def -> empty;
             if (empty == 1) return (1);
             return (empty == 3);
    };
        case 1:
        case 2:
        case 3:
      return (m -> empty != 2);
        default: bad_tag (m -> tag, "member_may_produce_empty");
      };
   return (0);
 }

user_defined_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec call; char *terminal; struct semiterminal_rec semi; } u; }

user_defined_types: struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; }

user_defined_types: struct pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }

user_defined_types: struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; }

user_defined_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec *val; int ref_count; int reachable; int tag; union { struct variable_rec var; char *str; int inum; double rnum; struct cset_rec *semi; struct element_rec elt; struct expr_rec *cexpr; } u; }

user_defined_types: struct affix_list_rec { int size; int room; struct affix_rec **array; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }

user_defined_types: struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }

user_defined_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; }

user_defined_types: struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec *set; }

user_defined_types: struct element_set_rec { int number; struct element_def_list_rec *defs; }

user_defined_types: struct meta_alt_rec { struct expr_rec *e; int number; }


decompiled_code:
__int64 check_layout_rule()
{
__int64 result; // rax

result = layoutflag;
if ( layoutflag )
{
result = layout_rule;
if ( (*(_BYTE *)(layout_rule + 16LL) & 1) == 0 )
result = panic("rule layout should be a non predicate");
}
return result;
}

canonical_decompiled_code:
__int64 func18()
{
__int64 result; // rax

result = layoutflag;
if ( layoutflag )
{
result = layout_rule;
if ( (*(_BYTE *)(layout_rule + 16LL) & 1) == 0 )
result = panic("rule layout should be a non predicate");
}
return result;
}

original_code:
static void check_layout_rule ()
 { if (!layoutflag) return;
   if (layout_rule -> kind & 1) return;
   panic ("rule layout should be a non predicate");
 }

canonical_original_code:
static void check_layout_rule()
 { if (!layoutflag) return;
   if (layout_rule -> kind & 1) return;
   panic ("rule layout should be a non predicate");
 }


decompiled_code:
__int64 __fastcall report_empty_detection_for_rule(__int64 a1)
{
int v1; // eax
int v2; // eax
__int64 result; // rax

v1 = *(_DWORD *)(a1 + 16);
if ( (v1 & 2) != 0 )
{
eprint_log("predicate");
}
else if ( (v1 & 4) != 0 )
{
eprint_log("semipredicate");
}
else if ( (v1 & 1) != 0 )
{
eprint_log("rule");
}
else
{
eprint_log("?? rule ??");
}
eprint_log(" %s ", *(const char **)a1);
v2 = *(_DWORD *)(a1 + 20);
if ( v2 == 2 )
{
eprint_log("never produces empty");
result = eprint_log("\n");
}
else if ( v2 == 3 )
{
eprint_log("always produces empty");
result = eprint_log("\n");
}
else
{
if ( v2 == 1 )
eprint_log("may produce empty");
else
eprint_log("may or may not produce empty");
result = eprint_log("\n");
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func19(__int64 a1)
{
int v1; // eax
int v2; // eax
__int64 result; // rax

v1 = *(_DWORD *)(a1 + 16);
if ( (v1 & 2) != 0 )
{
eprint_log("predicate");
}
else if ( (v1 & 4) != 0 )
{
eprint_log("semipredicate");
}
else if ( (v1 & 1) != 0 )
{
eprint_log("rule");
}
else
{
eprint_log("?? rule ??");
}
eprint_log(" %s ", *(const char **)a1);
v2 = *(_DWORD *)(a1 + 20);
if ( v2 == 2 )
{
eprint_log("never produces empty");
result = eprint_log("\n");
}
else if ( v2 == 3 )
{
eprint_log("always produces empty");
result = eprint_log("\n");
}
else
{
if ( v2 == 1 )
eprint_log("may produce empty");
else
eprint_log("may or may not produce empty");
result = eprint_log("\n");
}
return result;
}

original_code:
static void report_empty_detection_for_rule (rule srule)
 { if (srule -> kind & 2) eprint_log ("predicate");
   else if (srule -> kind & 4)
       eprint_log ("semipredicate");
   else if (srule -> kind & 1) eprint_log ("rule");
   else eprint_log ("?? rule ??");
   eprint_log (" %s ", srule -> nonterminal);
   switch (srule -> empty)
      { case 1:
    eprint_log ("may produce empty");
    break;
        case 2:
    eprint_log ("never produces empty");
    break;
        case 3:
    eprint_log ("always produces empty");
    break;
        default: eprint_log ("may or may not produce empty");
      };
   eprint_log ("\n");
 }

canonical_original_code:
static void report_empty_detection_for_rule(struct rule_rec *srule)
 { if (srule -> kind & 2) eprint_log ("predicate");
   else if (srule -> kind & 4)
       eprint_log ("semipredicate");
   else if (srule -> kind & 1) eprint_log ("rule");
   else eprint_log ("?? rule ??");
   eprint_log (" %s ", srule -> nonterminal);
   switch (srule -> empty)
      { case 1:
    eprint_log ("may produce empty");
    break;
        case 2:
    eprint_log ("never produces empty");
    break;
        case 3:
    eprint_log ("always produces empty");
    break;
        default: eprint_log ("may or may not produce empty");
      };
   eprint_log ("\n");
 }

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct lextree_list_rec { int size; int room; struct lextree_rec **array; }

user_defined_types: struct alt_rec { struct pos_list_rec *display; struct member_list_rec *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; }

user_defined_types: struct pos_list_rec { int size; int room; struct pos_rec **array; }

user_defined_types: struct member_list_rec { int size; int room; struct member_rec **array; }

user_defined_types: struct element_rec { char *eltnm; struct element_def_rec *def; }

user_defined_types: struct cset_rec { int kind; char *str; }

user_defined_types: struct value_list_rec { int size; int room; struct value_rec **array; }

user_defined_types: struct element_def_list_rec { int size; int room; struct element_def_rec **array; }


decompiled_code:
__int64 try_report_empty_detection()
{
__int64 result; // rax
__int64 v1; // rbx
__int64 v2; // rdi

if ( full_verbose )
{
wlog("Rules have been classified as follows:");
result = nr_of_rules;
if ( nr_of_rules > 0 )
{
v1 = 0LL;
do
{
v2 = *(_QWORD *)(all_rules + 8 * v1++);
result = report_empty_detection_for_rule(v2);
}
while ( nr_of_rules > (int)v1 );
}
}
return result;
}

canonical_decompiled_code:
__int64 func20()
{
__int64 result; // rax
__int64 v1; // rbx
__int64 v2; // rdi

if ( full_verbose )
{
wlog("Rules have been classified as follows:");
result = nr_of_rules;
if ( nr_of_rules > 0 )
{
v1 = 0LL;
do
{
v2 = *(_QWORD *)(all_rules + 8 * v1++);
result = func19(v2);
}
while ( nr_of_rules > (int)v1 );
}
}
return result;
}

original_code:
static void try_report_empty_detection ()
 { int ix;
   if (!full_verbose) return;
   wlog ("Rules have been classified as follows:");
   for (ix = 0; ix < nr_of_rules; ix++)
      report_empty_detection_for_rule (all_rules [ix]);
 }

canonical_original_code:
static void try_report_empty_detection()
 { int ix;
   if (!full_verbose) return;
   wlog ("Rules have been classified as follows:");
   for (ix = 0; ix < nr_of_rules; ix++)
      report_empty_detection_for_rule (all_rules [ix]);
 }


decompiled_code:
void finish_rule_marking()
{
__int64 v0; // r11

if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
finish_marking_isra_0(
*(_QWORD *)(*(_QWORD *)(all_rules + 8 * v0) + 8LL),
*(_DWORD *)(*(_QWORD *)(all_rules + 8 * v0) + 28LL));
while ( nr_of_rules > (int)v0 );
}
}

canonical_decompiled_code:
void func22()
{
__int64 v0; // r11

if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
func21(
*(_QWORD *)(*(_QWORD *)(all_rules + 8 * v0) + 8LL),
*(_DWORD *)(*(_QWORD *)(all_rules + 8 * v0) + 28LL));
while ( nr_of_rules > (int)v0 );
}
}

original_code:
static void finish_rule_marking ()
 { int ix;
   for (ix = 0; ix < nr_of_rules; ix++)
      finish_marking (all_rules [ix]);
 }

canonical_original_code:
static void finish_rule_marking()
 { int ix;
   for (ix = 0; ix < nr_of_rules; ix++)
      finish_marking (all_rules [ix]);
 }


decompiled_code:
__int64 __fastcall determine_user_predicates(__int64 a1, __int64 a2)
{
__int64 i; // rdx
unsigned int v3; // ebp
__int64 v4; // r11
const char *v5; // rdx
__int64 result; // rax
__int64 j; // rdx

for ( i = 0LL; nr_of_rules > (int)i; mark_if_rule_never_produces_empty(*(_QWORD *)(all_rules + 8 * i)) )
;
v3 = 0;
hint("detecting user defined predicates...", a2, i);
change = 0;
if ( nr_of_rules <= 0 )
{
LABEL_8:
++v3;
}
else
{
while ( 1 )
{
v4 = 0LL;
do
detect_if_rule_always_produces_empty(*(_QWORD *)(all_rules + 8 * v4));
while ( nr_of_rules > (int)v4 );
++v3;
if ( !change )
break;
change = 0;
if ( nr_of_rules <= 0 )
goto LABEL_8;
}
}
v5 = (const char *)&unk_BE2;
if ( v3 != 1 )
v5 = "es";
hint("needed %d pass%s for predicate detection", v3, v5);
result = nr_of_rules;
for ( j = 0LL; nr_of_rules > (int)j; result = mark_if_rule_always_produces_empty(*(_QWORD *)(all_rules + 8 * j)) )
;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func24(__int64 a1, __int64 a2)
{
__int64 i; // rdx
unsigned int v3; // ebp
__int64 v4; // r11
const char *v5; // rdx
__int64 result; // rax
__int64 j; // rdx

for ( i = 0LL; nr_of_rules > (int)i; func5(*(_QWORD *)(all_rules + 8 * i)) )
;
v3 = 0;
hint("detecting user defined predicates...", a2, i);
change = 0;
if ( nr_of_rules <= 0 )
{
LABEL_8:
++v3;
}
else
{
while ( 1 )
{
v4 = 0LL;
do
detect_if_rule_always_produces_empty(*(_QWORD *)(all_rules + 8 * v4));
while ( nr_of_rules > (int)v4 );
++v3;
if ( !change )
break;
change = 0;
if ( nr_of_rules <= 0 )
goto LABEL_8;
}
}
v5 = (const char *)&unk_BE2;
if ( v3 != 1 )
v5 = "es";
hint("needed %d pass%s for predicate detection", v3, v5);
result = nr_of_rules;
for ( j = 0LL; nr_of_rules > (int)j; result = func7(*(_QWORD *)(all_rules + 8 * j)) )
;
return result;
}

original_code:
static void determine_user_predicates ()
 { int nr_passes;
   int ix;
   for (ix = 0; ix < nr_of_rules; ix++)
      mark_if_rule_never_produces_empty (all_rules [ix]);
   hint ("detecting user defined predicates...");
   nr_passes = 0;
   do { change = 0;
        for (ix = 0; ix < nr_of_rules; ix++)
    detect_if_rule_always_produces_empty (all_rules [ix]);
        nr_passes++;
      }
   while (change);
   hint ("needed %d pass%s for predicate detection",
  nr_passes, (nr_passes == 1)?"":"es");
   for (ix = 0; ix < nr_of_rules; ix++)
      mark_if_rule_always_produces_empty (all_rules [ix]);
 }

canonical_original_code:
static void determine_user_predicates()
 { int nr_passes;
   int ix;
   for (ix = 0; ix < nr_of_rules; ix++)
      mark_if_rule_never_produces_empty (all_rules [ix]);
   hint ("detecting user defined predicates...");
   nr_passes = 0;
   do { change = 0;
        for (ix = 0; ix < nr_of_rules; ix++)
    detect_if_rule_always_produces_empty (all_rules [ix]);
        nr_passes++;
      }
   while (change);
   hint ("needed %d pass%s for predicate detection",
  nr_passes, (nr_passes == 1)?"":"es");
   for (ix = 0; ix < nr_of_rules; ix++)
      mark_if_rule_always_produces_empty (all_rules [ix]);
 }


decompiled_code:
void __fastcall detect_if_rule_produces_empty(__int64 a1)
{
__int64 v1; // rbp
__int64 v2; // rbx
__int64 v3; // rax
int v4; // eax

if ( !*(_DWORD *)(a1 + 28) )
{
v1 = *(_QWORD *)(a1 + 8);
if ( *(int *)v1 > 0 )
{
v2 = 0LL;
do
{
v3 = *(_QWORD *)(*(_QWORD *)(v1 + 8) + 8 * v2++);
v4 = alt_may_produce_empty_isra_0(*(_QWORD *)(v3 + 8));
unify_empty(a1, v4);
}
while ( *(_DWORD *)v1 > (int)v2 );
}
}
}

original_code:
static void detect_if_rule_produces_empty (rule srule)
 { int ix;
   alt_list alts = srule -> alts;
   if (srule -> ext) return;
   for (ix = 0; ix < alts -> size; ix++)
      unify_empty (srule, alt_may_produce_empty (alts -> array[ix]));
 }

canonical_original_code:
static void detect_if_rule_produces_empty(struct rule_rec *srule)
 { int ix;
   struct alt_list_rec *alts = srule -> alts;
   if (srule -> ext) return;
   for (ix = 0; ix < alts -> size; ix++)
      unify_empty (srule, alt_may_produce_empty (alts -> array[ix]));
 }

variable_types: struct alt_list_rec { int size; int room; struct alt_rec { struct pos_list_rec { int size; int room; struct pos_rec { int kind; struct expr_rec { int tag; union { struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; int ref_count; int reachable; int tag; union { struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec { int size; int room; struct meta_alt_rec { struct expr_rec *e; int number; } **array; } *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec { int number; struct element_def_list_rec { int size; int room; struct element_def_rec **array; } *defs; } *set; } *lat_repr; int needs_rec; int needs_recbup; } *def; } var; char *str; int inum; double rnum; struct cset_rec { int kind; char *str; } *semi; struct element_rec { char *eltnm; struct element_def_rec *def; } elt; struct expr_rec *cexpr; } u; } *single; struct affix_list_rec { int size; int room; struct affix_rec **array; } *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; } *ex; int type; struct element_def_rec *lat_repr; } **array; } *display; struct member_list_rec { int size; int room; struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec { char *remainder; struct lexend_list_rec { int size; int room; struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; } **array; } *prods; struct lextree_list_rec { int size; int room; struct lextree_rec **array; } *tails; } *rev_tree; } *def; } call; char *terminal; struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; } semi; } u; } **array; } *members; int number; int nodenr; int nrsons; struct affix_rec *locals; int empty; char *first; char *director; int rule_nr; } **array; } *

user_defined_types: struct pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }

user_defined_types: struct member_rec { int empty; int followlayout; char *first; int number; int sonnr; int tag; union { struct call_rec call; char *terminal; struct semiterminal_rec semi; } u; }

user_defined_types: struct expr_rec { int tag; union { struct affix_rec *single; struct affix_list_rec *compos; struct affix_list_rec *concat; struct affix_list_rec *uni; } u; }

user_defined_types: struct call_rec { char *nonterminal; struct pos_list_rec *display; struct rule_rec *def; }

user_defined_types: struct affix_rec { char *name; int type; struct affix_rec *next; struct value_rec *val; int ref_count; int reachable; int tag; union { struct variable_rec var; char *str; int inum; double rnum; struct cset_rec *semi; struct element_rec elt; struct expr_rec *cexpr; } u; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }

user_defined_types: struct variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }

user_defined_types: struct meta_alt_list_rec { int size; int room; struct meta_alt_rec **array; }


decompiled_code:
__int64 detect_empty_producing_rules()
{
unsigned int v0; // ebp
__int64 v1; // rbx
__int64 v2; // rdi
const char *v3; // rdx

v0 = 0;
hint("detecting empty producing rules...");
change = 0;
if ( nr_of_rules <= 0 )
{
LABEL_6:
++v0;
}
else
{
while ( 1 )
{
v1 = 0LL;
do
{
v2 = *(_QWORD *)(all_rules + 8 * v1++);
detect_if_rule_produces_empty(v2);
}
while ( nr_of_rules > (int)v1 );
++v0;
if ( !change )
break;
change = 0;
if ( nr_of_rules <= 0 )
goto LABEL_6;
}
}
v3 = (const char *)&unk_BE2;
if ( v0 != 1 )
v3 = "es";
return hint("needed %d pass%s for empty detection", v0, v3);
}

canonical_decompiled_code:
__int64 func27()
{
unsigned int v0; // ebp
__int64 v1; // rbx
__int64 v2; // rdi
const char *v3; // rdx

v0 = 0;
hint("detecting empty producing rules...");
change = 0;
if ( nr_of_rules <= 0 )
{
LABEL_6:
++v0;
}
else
{
while ( 1 )
{
v1 = 0LL;
do
{
v2 = *(_QWORD *)(all_rules + 8 * v1++);
func26(v2);
}
while ( nr_of_rules > (int)v1 );
++v0;
if ( !change )
break;
change = 0;
if ( nr_of_rules <= 0 )
goto LABEL_6;
}
}
v3 = (const char *)&unk_BE2;
if ( v0 != 1 )
v3 = "es";
return hint("needed %d pass%s for empty detection", v0, v3);
}

original_code:
static void detect_empty_producing_rules ()
 { int nr_passes;
   int ix;
   hint ("detecting empty producing rules...");
   nr_passes = 0;
   do
      { change = 0;
        for (ix = 0; ix < nr_of_rules; ix++)
    detect_if_rule_produces_empty (all_rules [ix]);
        nr_passes++;
      }
   while (change);
   hint ("needed %d pass%s for empty detection",
  nr_passes, (nr_passes == 1)?"":"es");
 }

canonical_original_code:
static void detect_empty_producing_rules()
 { int nr_passes;
   int ix;
   hint ("detecting empty producing rules...");
   nr_passes = 0;
   do
      { change = 0;
        for (ix = 0; ix < nr_of_rules; ix++)
    detect_if_rule_produces_empty (all_rules [ix]);
        nr_passes++;
      }
   while (change);
   hint ("needed %d pass%s for empty detection",
  nr_passes, (nr_passes == 1)?"":"es");
 }


decompiled_code:
void __fastcall initial_rule_classification(__int64 a1)
{
__int64 v1; // rbp
__int64 i; // rbx
__int64 v3; // rax

if ( *(_DWORD *)(a1 + 28) )
{
*(_DWORD *)(a1 + 20) = 3;
}
else
{
v1 = *(_QWORD *)(a1 + 8);
for ( i = 0LL; *(_DWORD *)v1 > (int)i; ++i )
{
v3 = *(_QWORD *)(*(_QWORD *)(v1 + 8) + 8 * i);
initial_alt_classification_isra_0(a1, *(_QWORD *)(v3 + 8));
}
}
}

original_code:
static void initial_rule_classification (rule srule)
 { alt_list alts = srule -> alts;
   int ix;
   if (srule -> ext) srule -> empty = 3;
   else
      for (ix = 0; ix < alts -> size; ix++)
         initial_alt_classification (srule, alts -> array[ix]);
 }

canonical_original_code:
static void initial_rule_classification(struct rule_rec *srule)
 { struct alt_list_rec *alts = srule -> alts;
   int ix;
   if (srule -> ext) srule -> empty = 3;
   else
      for (ix = 0; ix < alts -> size; ix++)
         initial_alt_classification (srule, alts -> array[ix]);
 }

user_defined_types: struct rule_rec { char *nonterminal; struct alt_list_rec *alts; int kind; int empty; int lex; int ext; int number; int placeholder; int startswithlayout; int endsinlayout; char *first; char *follow; struct pos_list_rec *proto_display; int reachable; int has_sons; int goal; struct lextree_rec *rev_tree; }

user_defined_types: struct alt_list_rec { int size; int room; struct alt_rec **array; }

user_defined_types: struct lextree_rec { char *remainder; struct lexend_list_rec *prods; struct lextree_list_rec *tails; }

user_defined_types: struct lexend_list_rec { int size; int room; struct lexend_rec **array; }

user_defined_types: struct lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

user_defined_types: struct semiterminal_rec { struct cset_rec *set; struct pos_list_rec *display; }

user_defined_types: struct affix_list_rec { int size; int room; struct affix_rec **array; }

user_defined_types: struct meta_rule_rec { char *nonterminal; struct meta_alt_list_rec *alts; int ext; int type; int kind; int empty; int number; struct value_rec *mvalue; int reachable; struct element_def_rec *lat_repr; int needs_rec; int needs_recbup; }

user_defined_types: struct int_list_rec { int size; int room; int *array; }

user_defined_types: struct element_def_rec { char *eltnm; int number; int eltnr; struct element_set_rec *set; }

user_defined_types: struct element_set_rec { int number; struct element_def_list_rec *defs; }

user_defined_types: struct meta_alt_rec { struct expr_rec *e; int number; }


decompiled_code:
void do_initial_rule_classification()
{
__int64 v0; // rbx
__int64 v1; // rdi

hint("initial rule classification...");
if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
initial_rule_classification(v1);
}
while ( nr_of_rules > (int)v0 );
}
}

canonical_decompiled_code:
void func30()
{
__int64 v0; // rbx
__int64 v1; // rdi

hint("initial rule classification...");
if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
func29(v1);
}
while ( nr_of_rules > (int)v0 );
}
}

original_code:
static void do_initial_rule_classification ()
 { int ix;
   hint ("initial rule classification...");
   for (ix = 0; ix < nr_of_rules; ix++)
      initial_rule_classification (all_rules [ix]);
 }

canonical_original_code:
static void do_initial_rule_classification()
 { int ix;
   hint ("initial rule classification...");
   for (ix = 0; ix < nr_of_rules; ix++)
      initial_rule_classification (all_rules [ix]);
 }


decompiled_code:
__int64 __fastcall do_empty_classification(__int64 a1, __int64 a2)
{
warning("empty detection and rule classification...");
detect_empty_producing_meta_rules();
do_initial_rule_classification();
detect_empty_producing_rules();
determine_user_predicates((__int64)"empty detection and rule classification...", a2);
finish_rule_marking();
check_layout_rule();
return try_report_empty_detection();
}

canonical_decompiled_code:
__int64 __fastcall func31(__int64 a1, __int64 a2)
{
warning("empty detection and rule classification...");
func15();
func30();
func27();
func24((__int64)"empty detection and rule classification...", a2);
func22();
func18();
return func20();
}

original_code:
void do_empty_classification ()
 { warning ("empty detection and rule classification...");
   detect_empty_producing_meta_rules ();
   do_initial_rule_classification ();
   detect_empty_producing_rules ();
   determine_user_predicates ();
   finish_rule_marking ();
   check_layout_rule ();
   try_report_empty_detection ();
 }

canonical_original_code:
void do_empty_classification()
 { warning ("empty detection and rule classification...");
   detect_empty_producing_meta_rules ();
   do_initial_rule_classification ();
   detect_empty_producing_rules ();
   determine_user_predicates ();
   finish_rule_marking ();
   check_layout_rule ();
   try_report_empty_detection ();
 }


decompiled_code:
__int64 pred_makeemptyfield()
{
__int64 v0; // r12
__int64 v1; // rbp
_QWORD *v2; // rax
__int64 v3; // rdi
__int64 v4; // rax
__int64 result; // rax

v0 = new_affix_node("makeemptyfield_af1");
v1 = new_affix_node("makeemptyfield_af2");
v2 = (_QWORD *)qptr;
*(_DWORD *)(qptr + 64LL) = alib_modnr << 16;
v2 += 9;
*(v2 - 7) = v1;
*(v2 - 5) = v0;
*(v2 - 9) = delayed_makeemptyfield;
*(v2 - 8) = &make_node_delayed;
*((_DWORD *)v2 - 12) = 1;
*((_DWORD *)v2 - 8) = 1;
*((_DWORD *)v2 - 6) = 2;
*((_DWORD *)v2 - 4) = 0;
*v2 = &make_predicate_node;
qptr = v2;
make_predicate_node();
v3 = *(_QWORD *)(v0 + 8);
qptr -= 80LL;
rfre_value(v3);
free_affix_node(v0);
rfre_value(*(_QWORD *)(v1 + 8));
free_affix_node(v1);
v4 = qptr;
*qptr = pred_makeemptyfield;
result = v4 + 8;
qptr = result;
return result;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 v0; // r12
__int64 v1; // rbp
_QWORD *v2; // rax
__int64 v3; // rdi
__int64 v4; // rax
__int64 result; // rax

v0 = new_affix_node("makeemptyfield_af1");
v1 = new_affix_node("makeemptyfield_af2");
v2 = (_QWORD *)qptr;
*(_DWORD *)(qptr + 64LL) = alib_modnr << 16;
v2 += 9;
*(v2 - 7) = v1;
*(v2 - 5) = v0;
*(v2 - 9) = delayed_makeemptyfield;
*(v2 - 8) = &make_node_delayed;
*((_DWORD *)v2 - 12) = 1;
*((_DWORD *)v2 - 8) = 1;
*((_DWORD *)v2 - 6) = 2;
*((_DWORD *)v2 - 4) = 0;
*v2 = &make_predicate_node;
qptr = v2;
make_predicate_node();
v3 = *(_QWORD *)(v0 + 8);
qptr -= 80LL;
rfre_value(v3);
free_affix_node(v0);
rfre_value(*(_QWORD *)(v1 + 8));
free_affix_node(v1);
v4 = qptr;
*qptr = pred_makeemptyfield;
result = v4 + 8;
qptr = result;
return result;
}

original_code:
void pred_makeemptyfield ()
 { affix_node af1 = new_affix_node ("makeemptyfield_af1");
   affix_node af2 = new_affix_node ("makeemptyfield_af2");
   qptr -> q = delayed_makeemptyfield; qptr++;
   qptr -> q = make_node_delayed; qptr++;
   qptr -> a = af2; qptr++;
   qptr -> i = 1; qptr++;
   qptr -> a = af1; qptr++;
   qptr -> i = 1; qptr++;
   qptr -> i = 2; qptr++;
   qptr -> i = 0; qptr++;
   qptr -> i = (((alib_modnr) << 16) + (0)); qptr++;
   qptr -> q = make_predicate_node; qptr++;
   (--qptr) -> q();
   qptr -= 10;
   rfre_value (af1 -> val);
   free_affix_node (af1);
   rfre_value (af2 -> val);
   free_affix_node (af2);
   qptr -> q = pred_makeemptyfield; qptr++;
 }

canonical_original_code:
void pred_makeemptyfield()
 { struct affix_rec *af1 = new_affix_node ("makeemptyfield_af1");
   struct affix_rec *af2 = new_affix_node ("makeemptyfield_af2");
   qptr -> q = delayed_makeemptyfield; qptr++;
   qptr -> q = make_node_delayed; qptr++;
   qptr -> a = af2; qptr++;
   qptr -> i = 1; qptr++;
   qptr -> a = af1; qptr++;
   qptr -> i = 1; qptr++;
   qptr -> i = 2; qptr++;
   qptr -> i = 0; qptr++;
   qptr -> i = (((alib_modnr) << 16) + (0)); qptr++;
   qptr -> q = make_predicate_node; qptr++;
   (--qptr) -> q();
   qptr -= 10;
   rfre_value (af1 -> val);
   free_affix_node (af1);
   rfre_value (af2 -> val);
   free_affix_node (af2);
   qptr -> q = pred_makeemptyfield; qptr++;
 }

variable_types: struct affix_rec { char *name; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; void (*mfunc)(); struct link_rec { struct pos_rec { struct tree_rec { char *name; int type; int nodenr; int nrsons; struct tree_rec **sons; int nraffs; struct pos_rec **affs; } *node; struct pos_side_rec { int sill; int tag; union { struct affix_rec *affx; struct { int nr; struct affix_rec **affs; } co; } a; } sides[2]; int delayed; struct pos_rec **args; void (*dfunc)(); } *pos; int side; struct link_rec *next; } *links; } *

user_defined_types: struct affix_rec { char *name; struct value_rec *val; void (*mfunc)(); struct link_rec *links; }

user_defined_types: struct link_rec { struct pos_rec *pos; int side; struct link_rec *next; }

user_defined_types: struct pos_rec { struct tree_rec *node; struct pos_side_rec sides[2]; int delayed; struct pos_rec **args; void (*dfunc)(); }


decompiled_code:
__int64 semipred_showfield()
{
int v0; // ebx
int v1; // eax
int i; // ebp
__int64 v3; // rax
_QWORD *v4; // rax
int v5; // edx
__int64 v6; // rax
__int64 result; // rax

v0 = 0;
fwrite("Field:\n", 1uLL, 7uLL, stderr);
if ( height > 0 )
{
do
{
v1 = width;
for ( i = 0; width > i; v1 = width )
{
v3 = i + v0 * v1;
++i;
fputc(*((_BYTE *)field + v3) == 0 ? 32 : 88, stderr);
}
++v0;
fputc(10, stderr);
}
while ( height > v0 );
}
fputc(10, stderr);
v4 = (_QWORD *)qptr;
v5 = alib_modnr << 16;
*qptr = 0;
v4 += 3;
*((_DWORD *)v4 - 4) = 0;
*((_DWORD *)v4 - 2) = v5 + 3;
*v4 = &make_semipredicate_node;
qptr = v4;
make_semipredicate_node();
v6 = qptr;
*(_QWORD *)(qptr - 32LL) = semipred_showfield;
result = v6 - 24;
qptr = result;
return result;
}

canonical_decompiled_code:
__int64 func3()
{
int v0; // ebx
int v1; // eax
int i; // ebp
__int64 v3; // rax
_QWORD *v4; // rax
int v5; // edx
__int64 v6; // rax
__int64 result; // rax

v0 = 0;
fwrite("Field:\n", 1uLL, 7uLL, stderr);
if ( height > 0 )
{
do
{
v1 = width;
for ( i = 0; width > i; v1 = width )
{
v3 = i + v0 * v1;
++i;
fputc(*((_BYTE *)field + v3) == 0 ? 32 : 88, stderr);
}
++v0;
fputc(10, stderr);
}
while ( height > v0 );
}
fputc(10, stderr);
v4 = (_QWORD *)qptr;
v5 = alib_modnr << 16;
*qptr = 0;
v4 += 3;
*((_DWORD *)v4 - 4) = 0;
*((_DWORD *)v4 - 2) = v5 + 3;
*v4 = &make_semipredicate_node;
qptr = v4;
make_semipredicate_node();
v6 = qptr;
*(_QWORD *)(qptr - 32LL) = semipred_showfield;
result = v6 - 24;
qptr = result;
return result;
}

original_code:
void semipred_showfield ()
 { int i,j;
   fprintf (stderr, "Field:\n");
   for (i = 0; i < height; i++)
      { for (j = 0; j < width; j++)
    fputc ((field [i*width +j])?'X':' ', stderr);
        fputc ('\n', stderr);
      };
   fputc ('\n', stderr);
   qptr -> i = 0; qptr++;
   qptr -> i = 0; qptr++;
   qptr -> i = (((alib_modnr) << 16) + (3)); qptr++;
   qptr -> q = make_semipredicate_node; qptr++;
   (--qptr) -> q();
   qptr -= 4;
   qptr -> q = semipred_showfield; qptr++;
 }

canonical_original_code:
void semipred_showfield()
 { int i; int j;
   fprintf (stderr, "Field:\n");
   for (i = 0; i < height; i++)
      { for (j = 0; j < width; j++)
    fputc ((field [i*width +j])?'X':' ', stderr);
        fputc ('\n', stderr);
      };
   fputc ('\n', stderr);
   qptr -> i = 0; qptr++;
   qptr -> i = 0; qptr++;
   qptr -> i = (((alib_modnr) << 16) + (3)); qptr++;
   qptr -> q = make_semipredicate_node; qptr++;
   (--qptr) -> q();
   qptr -= 4;
   qptr -> q = semipred_showfield; qptr++;
 }

variable_types: i int

variable_types: j int


original_code:
static void delayed_take (pos_node *ps)
 { pos_node ps1 = ps[0];
   pos_node ps2 = ps[1];
   if (!((ps1) -> sides[0].a.affx -> val != ((value) ((void *)0))) || !((ps2) -> sides[0].a.affx -> val != ((value) ((void *)0))))
      (--qptr) -> q();
   else
    { ps1 -> delayed = 0;
      ps2 -> delayed = 0;
      act_take (ps1, ps2);
      ps1 -> delayed = 1;
      ps2 -> delayed = 1;
    };
 }

canonical_original_code:
static void delayed_take(struct pos_rec **ps)
 { struct pos_rec *ps1 = ps[0];
   struct pos_rec *ps2 = ps[1];
   if (!((ps1) -> sides[0].a.affx -> val != ((value) ((void *)0))) || !((ps2) -> sides[0].a.affx -> val != ((value) ((void *)0))))
      (--qptr) -> q();
   else
    { ps1 -> delayed = 0;
      ps2 -> delayed = 0;
      act_take (ps1, ps2);
      ps1 -> delayed = 1;
      ps2 -> delayed = 1;
    };
 }

variable_types: struct pos_rec { struct tree_rec { char *name; int type; int nodenr; int nrsons; struct tree_rec **sons; int nraffs; struct pos_rec **affs; } *node; struct pos_side_rec { int sill; int tag; union { struct affix_rec { char *name; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; void (*mfunc)(); struct link_rec { struct pos_rec *pos; int side; struct link_rec *next; } *links; } *affx; struct { int nr; struct affix_rec **affs; } co; } a; } sides[2]; int delayed; struct pos_rec **args; void (*dfunc)(); } **

user_defined_types: struct pos_side_rec { int sill; int tag; union { struct affix_rec *affx; struct { int nr; struct affix_rec **affs; } co; } a; }

user_defined_types: struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec *tuple; int slat; struct int_list_rec *elat; struct value_rec *free; } u; }


original_code:
static void delayed_isempty (pos_node *ps)
 { pos_node ps1 = ps[0];
   pos_node ps2 = ps[1];
   if (!((ps1) -> sides[0].a.affx -> val != ((value) ((void *)0))) || !((ps2) -> sides[0].a.affx -> val != ((value) ((void *)0))))
      (--qptr) -> q();
   else
    { ps1 -> delayed = 0;
      ps2 -> delayed = 0;
      act_isempty (ps1, ps2);
      ps1 -> delayed = 1;
      ps2 -> delayed = 1;
    };
 }

canonical_original_code:
static void delayed_isempty(struct pos_rec **ps)
 { struct pos_rec *ps1 = ps[0];
   struct pos_rec *ps2 = ps[1];
   if (!((ps1) -> sides[0].a.affx -> val != ((value) ((void *)0))) || !((ps2) -> sides[0].a.affx -> val != ((value) ((void *)0))))
      (--qptr) -> q();
   else
    { ps1 -> delayed = 0;
      ps2 -> delayed = 0;
      act_isempty (ps1, ps2);
      ps1 -> delayed = 1;
      ps2 -> delayed = 1;
    };
 }

variable_types: struct pos_rec { struct tree_rec { char *name; int type; int nodenr; int nrsons; struct tree_rec **sons; int nraffs; struct pos_rec **affs; } *node; struct pos_side_rec { int sill; int tag; union { struct affix_rec { char *name; struct value_rec { int admin_nr; int ref_count; void *dptr; int tag; union { char *str; int inum; double rnum; struct value_list_rec { int size; int room; struct value_rec **array; } *tuple; int slat; struct int_list_rec { int size; int room; int *array; } *elat; struct value_rec *free; } u; } *val; void (*mfunc)(); struct link_rec { struct pos_rec *pos; int side; struct link_rec *next; } *links; } *affx; struct { int nr; struct affix_rec **affs; } co; } a; } sides[2]; int delayed; struct pos_rec **args; void (*dfunc)(); } *


original_code:
static void delayed_makeemptyfield (pos_node *ps)
 { pos_node ps1 = ps[0];
   pos_node ps2 = ps[1];
   if (!((ps1) -> sides[0].a.affx -> val != ((value) ((void *)0))) || !((ps2) -> sides[0].a.affx -> val != ((value) ((void *)0)))) (--qptr) -> q();
   else
    { ps1 -> delayed = 0;
      ps2 -> delayed = 0;
      act_makeemptyfield (ps1, ps2);
      ps1 -> delayed = 1;
      ps2 -> delayed = 1;
    };
 }

canonical_original_code:
static void delayed_makeemptyfield(struct pos_rec **ps)
 { struct pos_rec *ps1 = ps[0];
   struct pos_rec *ps2 = ps[1];
   if (!((ps1) -> sides[0].a.affx -> val != ((value) ((void *)0))) || !((ps2) -> sides[0].a.affx -> val != ((value) ((void *)0)))) (--qptr) -> q();
   else
    { ps1 -> delayed = 0;
      ps2 -> delayed = 0;
      act_makeemptyfield (ps1, ps2);
      ps1 -> delayed = 1;
      ps2 -> delayed = 1;
    };
 }

user_defined_types: struct tree_rec { char *name; int type; int nodenr; int nrsons; struct tree_rec **sons; int nraffs; struct pos_rec **affs; }

user_defined_types: struct value_list_rec { int size; int room; struct value_rec **array; }


decompiled_code:
char *__fastcall alib_name_from_nodenr(unsigned __int16 a1)
{
if ( (a1 & 0xFFFC) != 0 )
{
fprintf(stderr, "strange nodenr %d in alib\n", a1);
exit(4);
}
return CSWTCH_143[a1];
}

canonical_decompiled_code:
char *__fastcall func10(unsigned __int16 a1)
{
if ( (a1 & 0xFFFC) != 0 )
{
fprintf(stderr, "strange nodenr %d in alib\n", a1);
exit(4);
}
return CSWTCH_143[a1];
}

original_code:
char *alib_name_from_nodenr (int nodenr)
 { int lnr = ((nodenr) & 0xffff);
   switch (lnr)
      { case 0: return ("pred_makeemptyfield");
        case 1: return ("pred_isempty");
        case 2: return ("pred_take");
        case 3: return ("semipred_showfield");
        default: fprintf (stderr, "strange nodenr %d in alib\n", lnr);
      };
   exit (4);
 }

canonical_original_code:
char *alib_name_from_nodenr(int nodenr)
 { int lnr = ((nodenr) & 0xffff);
   switch (lnr)
      { case 0: return ("pred_makeemptyfield");
        case 1: return ("pred_isempty");
        case 2: return ("pred_take");
        case 3: return ("semipred_showfield");
        default: fprintf (stderr, "strange nodenr %d in alib\n", lnr);
      };
   exit (4);
 }

variable_types: nodenr int

variable_types: lnr int

return_type: char *


decompiled_code:
void __fastcall init_alib(int a1)
{
alib_modnr = a1;
}

canonical_decompiled_code:
void __fastcall func11(int a1)
{
alib_modnr = a1;
}

original_code:
void init_alib (int modnr)
 { alib_modnr = modnr;
 }

canonical_original_code:
void init_alib(int modnr)
 { alib_modnr = modnr;
 }

variable_types: modnr int