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

result = *(unsigned int *)(a1 + 24);
if ( !(_DWORD)result )
result = construct_lattices_in_call_isra_0(*(unsigned int **)(a1 + 40), *(_QWORD *)(a1 + 48));
return result;
}

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

result = *(unsigned int *)(a1 + 24);
if ( !(_DWORD)result )
result = func14(*(unsigned int **)(a1 + 40), *(_QWORD *)(a1 + 48));
return result;
}

original_code:
static void construct_lattices_in_member (member m)
 { if (m -> tag != 0) return;
   construct_lattices_in_call (m);
 }

canonical_original_code:
static void construct_lattices_in_member(struct member_rec *m)
 { if (m -> tag != 0) return;
   construct_lattices_in_call (m);
 }

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 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; }


repo: tjordanchat/eag

decompiled_code:
__int64 __fastcall construct_lattices_in_members(unsigned int *a1)
{
__int64 result; // rax
__int64 v3; // rbx
__int64 v4; // rdi

result = *a1;
if ( (int)result > 0 )
{
v3 = 0LL;
do
{
v4 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 8 * v3++);
result = construct_lattices_in_member(v4);
}
while ( (int)*a1 > (int)v3 );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func16(unsigned int *a1)
{
__int64 result; // rax
__int64 v3; // rbx
__int64 v4; // rdi

result = *a1;
if ( (int)result > 0 )
{
v3 = 0LL;
do
{
v4 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 8 * v3++);
result = func15(v4);
}
while ( (int)*a1 > (int)v3 );
}
return result;
}

original_code:
static void construct_lattices_in_members (member_list mems)
 { int ix;
   for (ix = 0; ix < mems -> size; ix++)
      construct_lattices_in_member (mems -> array[ix]);
 }

canonical_original_code:
static void construct_lattices_in_members(struct member_list_rec *mems)
 { int ix;
   for (ix = 0; ix < mems -> size; ix++)
      construct_lattices_in_member (mems -> array[ix]);
 }

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

return_type: void

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 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 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 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; }


decompiled_code:
void __fastcall construct_lattices_in_rule(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rbx
unsigned int **v3; // rsi

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

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

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

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; } *

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; }


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

if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
construct_lattices_in_rule(v1);
}
while ( nr_of_rules > (int)v0 );
}
}

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

if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
func18(v1);
}
while ( nr_of_rules > (int)v0 );
}
}

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

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


decompiled_code:
void construct_lattices()
{
unsigned int v0; // er12
unsigned int v1; // ebp
const char *v2; // rdx
const char *v3; // rdx

v0 = 0;
warning("coalescing lattices in meta rules...");
do
{
change = 0;
++v0;
construct_lattices_in_meta_rules();
v1 = change;
}
while ( change );
v2 = (const char *)&unk_7F9;
if ( v0 != 1 )
v2 = "es";
hint("needed %d pass%s for coalescing lattices in meta rules", v0, v2);
warning("coalescing lattices in rules...");
do
{
change = 0;
++v1;
construct_lattices_in_rules();
}
while ( change );
v3 = (const char *)&unk_7F9;
if ( v1 != 1 )
v3 = "es";
hint("needed %d pass%s for coalescing lattices in rules", v1, v3);
assign_element_numbers();
dump_lattices();
}

canonical_decompiled_code:
void func20()
{
unsigned int v0; // er12
unsigned int v1; // ebp
const char *v2; // rdx
const char *v3; // rdx

v0 = 0;
warning("coalescing lattices in meta rules...");
do
{
change = 0;
++v0;
func11();
v1 = change;
}
while ( change );
v2 = (const char *)&unk_7F9;
if ( v0 != 1 )
v2 = "es";
hint("needed %d pass%s for coalescing lattices in meta rules", v0, v2);
warning("coalescing lattices in rules...");
do
{
change = 0;
++v1;
func19();
}
while ( change );
v3 = (const char *)&unk_7F9;
if ( v1 != 1 )
v3 = "es";
hint("needed %d pass%s for coalescing lattices in rules", v1, v3);
func3();
func1();
}

original_code:
void construct_lattices ()
 { int nr_passes = 0;
   warning ("coalescing lattices in meta rules...");
   do
      { change = 0;
        nr_passes++;
        construct_lattices_in_meta_rules ();
      }
   while (change);
   hint ("needed %d pass%s for coalescing lattices in meta rules",
  nr_passes, (nr_passes == 1)?"":"es");
   nr_passes = 0;
   warning ("coalescing lattices in rules...");
   do
      { change = 0;
        nr_passes++;
        construct_lattices_in_rules ();
      }
   while (change);
   hint ("needed %d pass%s for coalescing lattices in rules",
  nr_passes, (nr_passes == 1)?"":"es");
   assign_element_numbers ();
   dump_lattices ();
 }

canonical_original_code:
void construct_lattices()
 { int nr_passes = 0;
   warning ("coalescing lattices in meta rules...");
   do
      { change = 0;
        nr_passes++;
        construct_lattices_in_meta_rules ();
      }
   while (change);
   hint ("needed %d pass%s for coalescing lattices in meta rules",
  nr_passes, (nr_passes == 1)?"":"es");
   nr_passes = 0;
   warning ("coalescing lattices in rules...");
   do
      { change = 0;
        nr_passes++;
        construct_lattices_in_rules ();
      }
   while (change);
   hint ("needed %d pass%s for coalescing lattices in rules",
  nr_passes, (nr_passes == 1)?"":"es");
   assign_element_numbers ();
   dump_lattices ();
 }


decompiled_code:
__int64 try_report_on_grammar_reduction()
{
__int64 v0; // rbx
__int64 v1; // rax
__int64 result; // rax
__int64 v3; // rbx
__int64 v4; // rax

if ( full_verbose )
{
if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
report_on_rule_isra_0(*(_QWORD *)v1, *(_DWORD *)(v1 + 72), *(_DWORD *)(v1 + 76));
}
while ( nr_of_rules > (int)v0 );
}
result = nr_of_meta_rules;
if ( nr_of_meta_rules > 0 )
{
v3 = 0LL;
do
{
v4 = *(_QWORD *)(all_meta_rules + 8 * v3++);
result = report_on_meta_rule_isra_0(*(const char **)v4, *(_DWORD *)(v4 + 48));
}
while ( nr_of_meta_rules > (int)v3 );
}
}
return result;
}

canonical_decompiled_code:
__int64 func2()
{
__int64 v0; // rbx
__int64 v1; // rax
__int64 result; // rax
__int64 v3; // rbx
__int64 v4; // rax

if ( full_verbose )
{
if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
func1(*(_QWORD *)v1, *(_DWORD *)(v1 + 72), *(_DWORD *)(v1 + 76));
}
while ( nr_of_rules > (int)v0 );
}
result = nr_of_meta_rules;
if ( nr_of_meta_rules > 0 )
{
v3 = 0LL;
do
{
v4 = *(_QWORD *)(all_meta_rules + 8 * v3++);
result = func0(*(const char **)v4, *(_DWORD *)(v4 + 48));
}
while ( nr_of_meta_rules > (int)v3 );
}
}
return result;
}

original_code:
static void try_report_on_grammar_reduction ()
 { int ix;
   if (!full_verbose) return;
   for (ix = 0; ix < nr_of_rules; ix++)
      report_on_rule (all_rules[ix]);
   for (ix = 0; ix < nr_of_meta_rules; ix++)
      report_on_meta_rule (all_meta_rules[ix]);
 }

canonical_original_code:
static void try_report_on_grammar_reduction()
 { int ix;
   if (!full_verbose) return;
   for (ix = 0; ix < nr_of_rules; ix++)
      report_on_rule (all_rules[ix]);
   for (ix = 0; ix < nr_of_meta_rules; ix++)
      report_on_meta_rule (all_meta_rules[ix]);
 }


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

result = *(unsigned int *)(a1 + 40);
if ( !(_DWORD)result )
result = mark_in_affix_variable_isra_0(*(_QWORD *)(a1 + 64));
*(_DWORD *)(a1 + 36) = 1;
return result;
}

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

result = *(unsigned int *)(a1 + 40);
if ( !(_DWORD)result )
result = func3(*(_QWORD *)(a1 + 64));
*(_DWORD *)(a1 + 36) = 1;
return result;
}

original_code:
static void mark_in_affix (affix a)
 { if (a -> tag == 0)
      mark_in_affix_variable (a);
   a -> reachable = 1;
 }

canonical_original_code:
static void mark_in_affix(struct affix_rec *a)
 { if (a -> tag == 0)
      mark_in_affix_variable (a);
   a -> reachable = 1;
 }

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; } *

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


decompiled_code:
__int64 __fastcall mark_in_affix_list(unsigned int *a1)
{
__int64 result; // rax
__int64 v3; // rbx
__int64 v4; // rdi

result = *a1;
if ( (int)result > 0 )
{
v3 = 0LL;
do
{
v4 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 8 * v3++);
result = mark_in_affix(v4);
}
while ( (int)*a1 > (int)v3 );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(unsigned int *a1)
{
__int64 result; // rax
__int64 v3; // rbx
__int64 v4; // rdi

result = *a1;
if ( (int)result > 0 )
{
v3 = 0LL;
do
{
v4 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 8 * v3++);
result = func4(v4);
}
while ( (int)*a1 > (int)v3 );
}
return result;
}

original_code:
static void mark_in_affix_list (affix_list al)
 { int ix;
   for (ix = 0; ix < al -> size; ix++)
      mark_in_affix (al -> array[ix]);
 }

canonical_original_code:
static void mark_in_affix_list(struct affix_list_rec *al)
 { int ix;
   for (ix = 0; ix < al -> size; ix++)
      mark_in_affix (al -> array[ix]);
 }

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; }


decompiled_code:
__int64 __fastcall mark_in_expression(__int64 a1)
{
int v1; // er8
__int64 result; // rax

if ( a1 )
{
v1 = *(_DWORD *)a1;
if ( *(_DWORD *)a1 == 3 )
return mark_in_affix_list(*(unsigned int **)(a1 + 8));
if ( v1 > 3 )
{
if ( v1 == 4 )
return mark_in_affix_list(*(unsigned int **)(a1 + 8));
return bad_tag((unsigned int)v1, "mark_in_expression");
}
if ( v1 != 1 )
{
if ( v1 == 2 )
return mark_in_affix_list(*(unsigned int **)(a1 + 8));
return bad_tag((unsigned int)v1, "mark_in_expression");
}
result = mark_in_affix(*(_QWORD *)(a1 + 8));
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
int v1; // er8
__int64 result; // rax

if ( a1 )
{
v1 = *(_DWORD *)a1;
if ( *(_DWORD *)a1 == 3 )
return func5(*(unsigned int **)(a1 + 8));
if ( v1 > 3 )
{
if ( v1 == 4 )
return func5(*(unsigned int **)(a1 + 8));
return bad_tag((unsigned int)v1, "mark_in_expression");
}
if ( v1 != 1 )
{
if ( v1 == 2 )
return func5(*(unsigned int **)(a1 + 8));
return bad_tag((unsigned int)v1, "mark_in_expression");
}
result = func4(*(_QWORD *)(a1 + 8));
}
return result;
}

original_code:
static void mark_in_expression (expr e)
 { if (e == ((expr) ((void *)0))) return;
   switch (e -> tag)
      { case 1: mark_in_affix (e -> u.single); break;
        case 3: mark_in_affix_list (e -> u.concat); break;
        case 2: mark_in_affix_list (e -> u.compos); break;
        case 4: mark_in_affix_list (e -> u.uni); break;
        default: bad_tag (e -> tag, "mark_in_expression");
      };
 }

canonical_original_code:
static void mark_in_expression(struct expr_rec *e)
 { if (e == ((expr) ((void *)0))) return;
   switch (e -> tag)
      { case 1: mark_in_affix (e -> u.single); break;
        case 3: mark_in_affix_list (e -> u.concat); break;
        case 2: mark_in_affix_list (e -> u.compos); break;
        case 4: mark_in_affix_list (e -> u.uni); break;
        default: bad_tag (e -> tag, "mark_in_expression");
      };
 }

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; } *


decompiled_code:
__int64 __fastcall mark_in_meta_alts(unsigned int *a1)
{
__int64 result; // rax
__int64 v2; // rbx
__int64 *v3; // rax

if ( a1 )
{
result = *a1;
if ( (int)result > 0 )
{
v2 = 0LL;
do
{
v3 = *(__int64 **)(*((_QWORD *)a1 + 1) + 8 * v2++);
result = mark_in_expression(*v3);
}
while ( (int)*a1 > (int)v2 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(unsigned int *a1)
{
__int64 result; // rax
__int64 v2; // rbx
__int64 *v3; // rax

if ( a1 )
{
result = *a1;
if ( (int)result > 0 )
{
v2 = 0LL;
do
{
v3 = *(__int64 **)(*((_QWORD *)a1 + 1) + 8 * v2++);
result = func6(*v3);
}
while ( (int)*a1 > (int)v2 );
}
}
return result;
}

original_code:
static void mark_in_meta_alts (meta_alt_list al)
 { int ix;
   if (al == ((meta_alt_list) ((void *)0))) return;
   for (ix = 0; ix < al -> size; ix++)
      mark_in_expression (al -> array[ix] -> e);
 }

canonical_original_code:
static void mark_in_meta_alts(struct meta_alt_list_rec *al)
 { int ix;
   if (al == ((meta_alt_list) ((void *)0))) return;
   for (ix = 0; ix < al -> size; ix++)
      mark_in_expression (al -> array[ix] -> e);
 }

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 mark_in_meta_rule(__int64 a1)
{
__int64 result; // rax

if ( !*(_DWORD *)(a1 + 48) )
{
result = *(unsigned int *)(a1 + 16);
*(_DWORD *)(a1 + 48) = 1;
if ( !(_DWORD)result )
result = mark_in_meta_alts(*(unsigned int **)(a1 + 8));
}
return result;
}

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

if ( !*(_DWORD *)(a1 + 48) )
{
result = *(unsigned int *)(a1 + 16);
*(_DWORD *)(a1 + 48) = 1;
if ( !(_DWORD)result )
result = func7(*(unsigned int **)(a1 + 8));
}
return result;
}

original_code:
static void mark_in_meta_rule (meta_rule mrule)
 { if (mrule -> reachable) return;
   mrule -> reachable = 1;
   if (mrule -> ext) return;
   mark_in_meta_alts (mrule -> alts);
 }

canonical_original_code:
static void mark_in_meta_rule(struct meta_rule_rec *mrule)
 { if (mrule -> reachable) return;
   mrule -> reachable = 1;
   if (mrule -> ext) return;
   mark_in_meta_alts (mrule -> alts);
 }

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 element_rec { char *eltnm; struct element_def_rec *def; }


decompiled_code:
__int64 __fastcall mark_in_display(unsigned int *a1)
{
__int64 result; // rax
__int64 v2; // rbx
__int64 v3; // rax

if ( a1 )
{
result = *a1;
if ( (int)result > 0 )
{
v2 = 0LL;
do
{
v3 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 8 * v2++);
result = mark_in_position_isra_0(*(_QWORD *)(v3 + 8));
}
while ( (int)*a1 > (int)v2 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func10(unsigned int *a1)
{
__int64 result; // rax
__int64 v2; // rbx
__int64 v3; // rax

if ( a1 )
{
result = *a1;
if ( (int)result > 0 )
{
v2 = 0LL;
do
{
v3 = *(_QWORD *)(*((_QWORD *)a1 + 1) + 8 * v2++);
result = func9(*(_QWORD *)(v3 + 8));
}
while ( (int)*a1 > (int)v2 );
}
}
return result;
}

original_code:
static void mark_in_display (pos_list dpy)
 { int ix;
   if (dpy == ((pos_list) ((void *)0))) return;
   for (ix = 0; ix < dpy -> size; ix++)
      mark_in_position (dpy -> array[ix]);
 }

canonical_original_code:
static void mark_in_display(struct pos_list_rec *dpy)
 { int ix;
   if (dpy == ((pos_list) ((void *)0))) return;
   for (ix = 0; ix < dpy -> size; ix++)
      mark_in_position (dpy -> array[ix]);
 }

variable_types: 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; } *


decompiled_code:
__int64 __fastcall mark_in_member(__int64 a1, __int64 a2)
{
__int64 v3; // rdi
__int64 result; // rax

v3 = *(unsigned int *)(a2 + 24);
if ( (_DWORD)v3 == 2 )
return mark_in_semiterminal_isra_0(a1, *(unsigned int **)(a2 + 40));
if ( (int)v3 > 2 )
{
if ( (_DWORD)v3 == 3 )
return result;
return bad_tag(v3, "mark_in_member");
}
if ( !(_DWORD)v3 )
return mark_in_call(a1);
if ( (_DWORD)v3 != 1 )
return bad_tag(v3, "mark_in_member");
return result;
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1, __int64 a2)
{
__int64 v3; // rdi
__int64 result; // rax

v3 = *(unsigned int *)(a2 + 24);
if ( (_DWORD)v3 == 2 )
return func11(a1, *(unsigned int **)(a2 + 40));
if ( (int)v3 > 2 )
{
if ( (_DWORD)v3 == 3 )
return result;
return bad_tag(v3, "mark_in_member");
}
if ( !(_DWORD)v3 )
return func17(a1);
if ( (_DWORD)v3 != 1 )
return bad_tag(v3, "mark_in_member");
return result;
}

original_code:
static void mark_in_member (rule srule, member m)
 { switch (m -> tag)
      { case 0: mark_in_call (srule, m);
        case 1: break;
        case 2: mark_in_semiterminal (srule, m);
        case 3: break;
        default: bad_tag (m -> tag, "mark_in_member");
      };
 }

canonical_original_code:
static void mark_in_member(struct rule_rec *srule, struct member_rec *m)
 { switch (m -> tag)
      { case 0: mark_in_call (srule, m);
        case 1: break;
        case 2: mark_in_semiterminal (srule, m);
        case 3: break;
        default: bad_tag (m -> tag, "mark_in_member");
      };
 }

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 lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

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 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 int_list_rec { int size; int room; int *array; }

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


decompiled_code:
__int64 __fastcall mark_in_members(__int64 a1, unsigned int *a2)
{
__int64 result; // rax
__int64 v4; // rbx
__int64 v5; // rsi

if ( a2 )
{
result = *a2;
if ( (int)result > 0 )
{
v4 = 0LL;
do
{
v5 = *(_QWORD *)(*((_QWORD *)a2 + 1) + 8 * v4++);
result = mark_in_member(a1, v5);
}
while ( (int)*a2 > (int)v4 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func13(__int64 a1, unsigned int *a2)
{
__int64 result; // rax
__int64 v4; // rbx
__int64 v5; // rsi

if ( a2 )
{
result = *a2;
if ( (int)result > 0 )
{
v4 = 0LL;
do
{
v5 = *(_QWORD *)(*((_QWORD *)a2 + 1) + 8 * v4++);
result = func12(a1, v5);
}
while ( (int)*a2 > (int)v4 );
}
}
return result;
}

original_code:
static void mark_in_members (rule srule, member_list mems)
 { int ix;
   if (mems == ((member_list) ((void *)0))) return;
   for (ix = 0; ix < mems -> size; ix++)
      mark_in_member (srule, mems -> array[ix]);
 }

canonical_original_code:
static void mark_in_members(struct rule_rec *srule, struct member_list_rec *mems)
 { int ix;
   if (mems == ((member_list) ((void *)0))) return;
   for (ix = 0; ix < mems -> size; ix++)
      mark_in_member (srule, mems -> array[ix]);
 }

variable_types:
mems
struct member_list_rec *

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 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 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 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; }


decompiled_code:
__int64 __fastcall mark_in_alt(__int64 a1, unsigned int **a2)
{
mark_in_display(*a2);
return mark_in_members(a1, a2[1]);
}

canonical_decompiled_code:
__int64 __fastcall func14(__int64 a1, unsigned int **a2)
{
func10(*a2);
return func13(a1, a2[1]);
}

original_code:
static void mark_in_alt (rule srule, alt a)
 { mark_in_display (a -> display);
   mark_in_members (srule, a -> members);
 }

canonical_original_code:
static void mark_in_alt(struct rule_rec *srule, struct alt_rec *a)
 { mark_in_display (a -> display);
   mark_in_members (srule, a -> members);
 }

variable_types:
a
struct alt_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 lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

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 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 element_rec { char *eltnm; struct element_def_rec *def; }

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


decompiled_code:
__int64 __fastcall mark_in_alts(__int64 a1, unsigned int *a2)
{
__int64 result; // rax
__int64 v4; // rbx
unsigned int **v5; // rsi

result = *a2;
if ( (int)result > 0 )
{
v4 = 0LL;
do
{
v5 = *(unsigned int ***)(*((_QWORD *)a2 + 1) + 8 * v4++);
result = mark_in_alt(a1, v5);
}
while ( (int)*a2 > (int)v4 );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func15(__int64 a1, unsigned int *a2)
{
__int64 result; // rax
__int64 v4; // rbx
unsigned int **v5; // rsi

result = *a2;
if ( (int)result > 0 )
{
v4 = 0LL;
do
{
v5 = *(unsigned int ***)(*((_QWORD *)a2 + 1) + 8 * v4++);
result = func14(a1, v5);
}
while ( (int)*a2 > (int)v4 );
}
return result;
}

original_code:
static void mark_in_alts (rule srule, alt_list alts)
 { int ix;
   for (ix = 0; ix < alts -> size; ix++)
      mark_in_alt (srule, alts -> array[ix]);
 }

canonical_original_code:
static void mark_in_alts(struct rule_rec *srule, struct alt_list_rec *alts)
 { int ix;
   for (ix = 0; ix < alts -> size; ix++)
      mark_in_alt (srule, alts -> array[ix]);
 }

variable_types:
alts
struct alt_list_rec *

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 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 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 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 int_list_rec { int size; int room; int *array; }

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


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

if ( !*(_DWORD *)(a1 + 72) )
{
result = *(unsigned int *)(a1 + 28);
*(_DWORD *)(a1 + 72) = 1;
if ( !(_DWORD)result )
result = mark_in_alts(a1, *(unsigned int **)(a1 + 8));
}
return result;
}

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

if ( !*(_DWORD *)(a1 + 72) )
{
result = *(unsigned int *)(a1 + 28);
*(_DWORD *)(a1 + 72) = 1;
if ( !(_DWORD)result )
result = func15(a1, *(unsigned int **)(a1 + 8));
}
return result;
}

original_code:
static void mark_in_rule (rule srule)
 { if (srule -> reachable) return;
   srule -> reachable = 1;
   if (srule -> ext) return;
   mark_in_alts (srule, srule -> alts);
 }

canonical_original_code:
static void mark_in_rule(struct rule_rec *srule)
 { if (srule -> reachable) return;
   srule -> reachable = 1;
   if (srule -> ext) return;
   mark_in_alts (srule, srule -> alts);
 }

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 lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

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 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 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; }


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

mark_in_rule(*(_QWORD *)(a2 + 48));
result = mark_in_display(*(unsigned int **)(a2 + 40));
*(_DWORD *)(a1 + 76) = 1;
return result;
}

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

func16(*(_QWORD *)(a2 + 48));
result = func10(*(unsigned int **)(a2 + 40));
*(_DWORD *)(a1 + 76) = 1;
return result;
}

original_code:
static void mark_in_call (rule srule, member m)
 { mark_in_rule (m -> u.call.def);
   mark_in_display (m -> u.call.display);
   srule -> has_sons = 1;
 }

canonical_original_code:
static void mark_in_call(struct rule_rec *srule, struct member_rec *m)
 { mark_in_rule (m -> u.call.def);
   mark_in_display (m -> u.call.display);
   srule -> has_sons = 1;
 }

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 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 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 variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }

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

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


decompiled_code:
__int64 reduce_grammar()
{
warning("reducing grammar...");
mark_in_rule(*(_QWORD *)(start_rule + 48LL));
mark_in_display(*(unsigned int **)(start_rule + 40LL));
return try_report_on_grammar_reduction();
}

canonical_decompiled_code:
__int64 func18()
{
warning("reducing grammar...");
func16(*(_QWORD *)(start_rule + 48LL));
func10(*(unsigned int **)(start_rule + 40LL));
return func2();
}

original_code:
void reduce_grammar ()
 { warning ("reducing grammar...");
   mark_in_rule (start_rule -> u.call.def);
   mark_in_display (start_rule -> u.call.display);
   try_report_on_grammar_reduction ();
 }

canonical_original_code:
void reduce_grammar()
 { warning ("reducing grammar...");
   mark_in_rule (start_rule -> u.call.def);
   mark_in_display (start_rule -> u.call.display);
   try_report_on_grammar_reduction ();
 }


decompiled_code:
void init_flow()
{
flow_errors = 0;
}

canonical_decompiled_code:
void func0()
{
flow_errors = 0;
}

original_code:
static void init_flow ()
 { flow_errors = 0;
 }

canonical_original_code:
static void init_flow()
 { flow_errors = 0;
 }


decompiled_code:
__int64 __fastcall no_inherited_positions(__int64 a1)
{
_DWORD **v1; // rax
__int64 v2; // rcx

if ( *(int *)a1 <= 0 )
return 1LL;
v1 = *(_DWORD ***)(a1 + 8);
v2 = (__int64)&v1[(unsigned int)(*(_DWORD *)a1 - 1) + 1];
while ( **v1 != 1 )
{
if ( ++v1 == (_DWORD **)v2 )
return 1LL;
}
return 0LL;
}

original_code:
static int no_inherited_positions (pos_list proto)
 { int ix;
   for (ix = 0; ix < proto -> size; ix++)
      if (proto -> array[ix] -> kind == 1)
  return (0);
   return (1);
 }

canonical_original_code:
static int no_inherited_positions(struct pos_list_rec *proto)
 { int ix;
   for (ix = 0; ix < proto -> size; ix++)
      if (proto -> array[ix] -> kind == 1)
  return (0);
   return (1);
 }

return_type: int

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 int_list_rec { int size; int room; int *array; }

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


decompiled_code:
__int64 __fastcall check_if_semipredicate(__int64 a1)
{
__int64 result; // rax
int v2; // er8

result = *(unsigned int *)(a1 + 28);
if ( !(_DWORD)result && (*(_DWORD *)(a1 + 16) & 2) != 0 )
{
result = no_inherited_positions(*(_QWORD *)(a1 + 64));
if ( (_DWORD)result )
*(_DWORD *)(a1 + 16) = v2 & 0xFFFFFFFD | 4;
}
return result;
}

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

result = *(unsigned int *)(a1 + 28);
if ( !(_DWORD)result && (*(_DWORD *)(a1 + 16) & 2) != 0 )
{
result = func1(*(_QWORD *)(a1 + 64));
if ( (_DWORD)result )
*(_DWORD *)(a1 + 16) = v2 & 0xFFFFFFFD | 4;
}
return result;
}

original_code:
static void check_if_semipredicate (rule srule)
 { if (srule -> ext) return;
   if (!(srule -> kind & 2)) return;
   if (no_inherited_positions (srule -> proto_display))
      { srule -> kind &= ~2;
        srule -> kind |= 4;
      };
 }

canonical_original_code:
static void check_if_semipredicate(struct rule_rec *srule)
 { if (srule -> ext) return;
   if (!(srule -> kind & 2)) return;
   if (no_inherited_positions (srule -> proto_display))
      { srule -> kind &= ~2;
        srule -> kind |= 4;
      };
 }

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 lexend_rec { int nodenr; struct int_list_rec *valuenrs; }

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 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 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; }


decompiled_code:
__int64 check_for_semipredicates()
{
__int64 result; // rax
__int64 v1; // r9

result = nr_of_rules;
if ( nr_of_rules > 0 )
{
v1 = 0LL;
do
result = check_if_semipredicate(*(_QWORD *)(all_rules + 8 * v1));
while ( nr_of_rules > (int)v1 );
}
return result;
}

canonical_decompiled_code:
__int64 func3()
{
__int64 result; // rax
__int64 v1; // r9

result = nr_of_rules;
if ( nr_of_rules > 0 )
{
v1 = 0LL;
do
result = func2(*(_QWORD *)(all_rules + 8 * v1));
while ( nr_of_rules > (int)v1 );
}
return result;
}

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

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


decompiled_code:
void __fastcall merge_flow_in_displays(const char **a1, unsigned int a2, __int64 a3, __int64 a4)
{
__int64 v6; // rbx
int *v7; // rax
_DWORD *v8; // rdx

if ( a4 && *(int *)a3 > 0 )
{
v6 = 0LL;
do
{
v7 = *(int **)(*(_QWORD *)(a4 + 8) + 8 * v6);
v8 = *(_DWORD **)(*(_QWORD *)(a3 + 8) + 8 * v6++);
merge_flow_in_position_isra_0(a1, a2, v8, *v7);
}
while ( *(_DWORD *)a3 > (int)v6 );
}
}

original_code:
static void merge_flow_in_displays (rule srule, int altnr, pos_list proto,
         pos_list dpy)
 { int ix;
   if (dpy == ((pos_list) ((void *)0))) return;
   for (ix = 0; ix < proto -> size; ix++)
      merge_flow_in_position (srule, altnr,
         proto -> array[ix], dpy -> array[ix]);
 }

canonical_original_code:
static void merge_flow_in_displays(struct rule_rec *srule, int altnr, struct pos_list_rec *proto, struct pos_list_rec *dpy)
 { int ix;
   if (dpy == ((pos_list) ((void *)0))) return;
   for (ix = 0; ix < proto -> size; ix++)
      merge_flow_in_position (srule, altnr,
         proto -> array[ix], dpy -> array[ix]);
 }

variable_types: altnr int

variable_types:
proto
struct pos_list_rec *

variable_types:
dpy
struct pos_list_rec *

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 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 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 variable_rec { char *nonterminal; char *suffix; struct meta_rule_rec *def; }

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

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


decompiled_code:
void __fastcall deduce_initial_flow_in_alts(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
__int64 *v3; // rax

if ( *(int *)a2 > 0 )
{
v2 = 0LL;
do
{
v3 = *(__int64 **)(*(_QWORD *)(a2 + 8) + 8 * v2++);
deduce_initial_flow_in_alt_isra_0(a1, v2, *v3);
}
while ( *(_DWORD *)a2 > (int)v2 );
}
}

original_code:
static void deduce_initial_flow_in_alts (rule srule, alt_list alts)
 { int ix;
   for (ix = 0; ix < alts -> size; ix++)
      deduce_initial_flow_in_alt (srule, ix + 1, alts -> array[ix]);
 }

canonical_original_code:
static void deduce_initial_flow_in_alts(struct rule_rec *srule, struct alt_list_rec *alts)
 { int ix;
   for (ix = 0; ix < alts -> size; ix++)
      deduce_initial_flow_in_alt (srule, ix + 1, 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 lextree_list_rec { int size; int room; struct lextree_rec **array; }

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

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 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 int_list_rec { int size; int room; int *array; }

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


decompiled_code:
void __fastcall deduce_initial_flow_in_rule(__int64 a1)
{
deduce_initial_flow_in_alts(a1, *(_QWORD *)(a1 + 8));
}

canonical_decompiled_code:
void __fastcall func9(__int64 a1)
{
func8(a1, *(_QWORD *)(a1 + 8));
}

original_code:
static void deduce_initial_flow_in_rule (rule srule)
 { deduce_initial_flow_in_alts (srule, srule -> alts);
 }

canonical_original_code:
static void deduce_initial_flow_in_rule(struct rule_rec *srule)
 { deduce_initial_flow_in_alts (srule, srule -> alts);
 }

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 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 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 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 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; }


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

if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
deduce_initial_flow_in_rule(v1);
}
while ( nr_of_rules > (int)v0 );
}
}

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

if ( nr_of_rules > 0 )
{
v0 = 0LL;
do
{
v1 = *(_QWORD *)(all_rules + 8 * v0++);
func9(v1);
}
while ( nr_of_rules > (int)v0 );
}
}

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

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


decompiled_code:
__int64 flow_check()
{
const char *v0; // rcx
const char *v1; // rdx

warning("checking flow...");
init_flow();
deduce_initial_flow_in_rules();
if ( flow_errors )
{
v0 = "as";
v1 = (const char *)&unk_398;
if ( flow_errors != 1 )
v0 = "ere";
if ( flow_errors != 1 )
v1 = "s";
panic("%d flow error%s w%s found", (unsigned int)flow_errors, v1, v0);
}
hint("determing semipredicates...");
return check_for_semipredicates();
}

canonical_decompiled_code:
__int64 func11()
{
const char *v0; // rcx
const char *v1; // rdx

warning("checking flow...");
func0();
func10();
if ( flow_errors )
{
v0 = "as";
v1 = (const char *)&unk_398;
if ( flow_errors != 1 )
v0 = "ere";
if ( flow_errors != 1 )
v1 = "s";
panic("%d flow error%s w%s found", (unsigned int)flow_errors, v1, v0);
}
hint("determing semipredicates...");
return func3();
}

original_code:
void flow_check ()
 { warning ("checking flow...");
   init_flow ();
   deduce_initial_flow_in_rules ();
   if (flow_errors)
      panic ("%d flow error%s w%s found", flow_errors,
      (flow_errors == 1)?"":"s", (flow_errors == 1)?"as":"ere");
   hint ("determing semipredicates...");
   check_for_semipredicates ();
 }

canonical_original_code:
void flow_check()
 { warning ("checking flow...");
   init_flow ();
   deduce_initial_flow_in_rules ();
   if (flow_errors)
      panic ("%d flow error%s w%s found", flow_errors,
      (flow_errors == 1)?"":"s", (flow_errors == 1)?"as":"ere");
   hint ("determing semipredicates...");
   check_for_semipredicates ();
 }


canonical_decompiled_code:
void func0()
{
nr_of_rules = 0;
nr_of_alts = 0;
nr_of_members = 0;
max_members_per_alt = 0;
nr_of_meta_rules = 0;
nr_of_meta_alts = 0;
nr_of_elements = 0;
}

original_code:
static void init_numbering ()
 { nr_of_rules = 0;
   nr_of_alts = 0;
   nr_of_members = 0;
   max_members_per_alt = 0;
   nr_of_meta_rules = 0;
   nr_of_meta_alts = 0;
   nr_of_elements = 0;
 }

canonical_original_code:
static void init_numbering()
 { nr_of_rules = 0;
   nr_of_alts = 0;
   nr_of_members = 0;
   max_members_per_alt = 0;
   nr_of_meta_rules = 0;
   nr_of_meta_alts = 0;
   nr_of_elements = 0;
 }


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

v1 = nr_of_members;
*(_DWORD *)(a1 + 16) = nr_of_members;
result = (unsigned int)(v1 + 1);
nr_of_members = result;
return result;
}

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

v1 = nr_of_members;
*(_DWORD *)(a1 + 16) = nr_of_members;
result = (unsigned int)(v1 + 1);
nr_of_members = result;
return result;
}

original_code:
static void number_member (member m)
 { m -> number = nr_of_members;
   nr_of_members++;
 }

canonical_original_code:
static void number_member(struct member_rec *m)
 { m -> number = nr_of_members;
   nr_of_members++;
 }

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 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 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 number_alt(int a1, __int64 a2)
{
int v2; // eax
unsigned int *v3; // rcx
__int64 result; // rax
__int64 v5; // rdx

v2 = nr_of_alts;
v3 = *(unsigned int **)(a2 + 8);
*(_DWORD *)(a2 + 64) = a1;
*(_DWORD *)(a2 + 16) = v2;
result = (unsigned int)(v2 + 1);
nr_of_alts = result;
if ( v3 )
{
result = *v3;
if ( (int)result > max_members_per_alt )
max_members_per_alt = *v3;
if ( (int)result > 0 )
{
v5 = 0LL;
do
result = number_member(*(_QWORD *)(*((_QWORD *)v3 + 1) + 8 * v5));
while ( (int)*v3 > (int)v5 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(int a1, __int64 a2)
{
int v2; // eax
unsigned int *v3; // rcx
__int64 result; // rax
__int64 v5; // rdx

v2 = nr_of_alts;
v3 = *(unsigned int **)(a2 + 8);
*(_DWORD *)(a2 + 64) = a1;
*(_DWORD *)(a2 + 16) = v2;
result = (unsigned int)(v2 + 1);
nr_of_alts = result;
if ( v3 )
{
result = *v3;
if ( (int)result > max_members_per_alt )
max_members_per_alt = *v3;
if ( (int)result > 0 )
{
v5 = 0LL;
do
result = func1(*(_QWORD *)(*((_QWORD *)v3 + 1) + 8 * v5));
while ( (int)*v3 > (int)v5 );
}
}
return result;
}

original_code:
static void number_alt (int rule_nr, alt a)
 { member_list mems = a -> members;
   int ix;
   a -> number = nr_of_alts;
   nr_of_alts++;
   a -> rule_nr = rule_nr;
   if (mems == ((member_list) ((void *)0))) return;
   if (mems -> size > max_members_per_alt)
      max_members_per_alt = mems -> size;
   for (ix = 0; ix < mems -> size; ix++)
      number_member (mems -> array[ix]);
 }

canonical_original_code:
static void number_alt(int rule_nr, struct alt_rec *a)
 { struct member_list_rec *mems = a -> members;
   int ix;
   a -> number = nr_of_alts;
   nr_of_alts++;
   a -> rule_nr = rule_nr;
   if (mems == ((member_list) ((void *)0))) return;
   if (mems -> size > max_members_per_alt)
      max_members_per_alt = mems -> size;
   for (ix = 0; ix < mems -> size; ix++)
      number_member (mems -> array[ix]);
 }

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; } *

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 pos_rec { int kind; struct expr_rec *ex; int type; struct element_def_rec *lat_repr; }


decompiled_code:
__int64 __fastcall number_rule(__int64 a1)
{
unsigned int *v1; // r9
int v3; // edi
int v4; // eax
__int64 result; // rax
__int64 v6; // r8
__int64 v7; // r10

v1 = *(unsigned int **)(a1 + 8);
v3 = nr_of_rules;
v4 = nr_of_rules + 1;
*(_DWORD *)(a1 + 32) = nr_of_rules;
nr_of_rules = v4;
result = *v1;
if ( (int)result > 0 )
{
v6 = 0LL;
while ( 1 )
{
result = number_alt(v3, *(_QWORD *)(*((_QWORD *)v1 + 1) + 8 * v6));
if ( (int)*v1 <= (int)v6 )
break;
v3 = *(_DWORD *)(v7 + 32);
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
unsigned int *v1; // r9
int v3; // edi
int v4; // eax
__int64 result; // rax
__int64 v6; // r8
__int64 v7; // r10

v1 = *(unsigned int **)(a1 + 8);
v3 = nr_of_rules;
v4 = nr_of_rules + 1;
*(_DWORD *)(a1 + 32) = nr_of_rules;
nr_of_rules = v4;
result = *v1;
if ( (int)result > 0 )
{
v6 = 0LL;
while ( 1 )
{
result = func2(v3, *(_QWORD *)(*((_QWORD *)v1 + 1) + 8 * v6));
if ( (int)*v1 <= (int)v6 )
break;
v3 = *(_DWORD *)(v7 + 32);
}
}
return result;
}

original_code:
static void number_rule (rule rule)
 { alt_list alts = rule -> alts;
   int ix;
   rule -> number = nr_of_rules;
   nr_of_rules++;
   for (ix = 0; ix < alts -> size; ix++)
      number_alt (rule -> number, alts -> array[ix]);
 }

canonical_original_code:
static void number_rule(struct rule_rec *rule)
 { struct alt_list_rec *alts = rule -> alts;
   int ix;
   rule -> number = nr_of_rules;
   nr_of_rules++;
   for (ix = 0; ix < alts -> size; ix++)
      number_alt (rule -> number, alts -> array[ix]);
 }

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: 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; } *

variable_types: ix int

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 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; }


decompiled_code:
__int64 __fastcall number_rules(__int64 *a1)
{
__int64 *v1; // rbx
__int64 result; // rax

if ( a1 )
{
v1 = a1;
do
{
number_rule(*v1);
result = number_rules(v1[1]);
v1 = (__int64 *)v1[2];
}
while ( v1 );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 *a1)
{
__int64 *v1; // rbx
__int64 result; // rax

if ( a1 )
{
v1 = a1;
do
{
func3(*v1);
result = func4(v1[1]);
v1 = (__int64 *)v1[2];
}
while ( v1 );
}
return result;
}

original_code:
static void number_rules (rule_tree root)
 { if (root == ((rule_tree) ((void *)0))) return;
   number_rule (root -> node);
   number_rules (root -> left);
   number_rules (root -> right);
 }

canonical_original_code:
static void number_rules(struct rule_tree_rec *root)
 { if (root == ((rule_tree) ((void *)0))) return;
   number_rule (root -> node);
   number_rules (root -> left);
   number_rules (root -> right);
 }

variable_types: struct rule_tree_rec { 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; } *node; struct rule_tree_rec *left; struct rule_tree_rec *right; } *

user_defined_types: struct rule_tree_rec { struct rule_rec *node; struct rule_tree_rec *left; struct rule_tree_rec *right; }

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 meta_alt_list_rec { int size; int room; struct meta_alt_rec **array; }


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

v1 = nr_of_meta_alts;
*(_DWORD *)(a1 + 8) = nr_of_meta_alts;
result = (unsigned int)(v1 + 1);
nr_of_meta_alts = result;
return result;
}

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

v1 = nr_of_meta_alts;
*(_DWORD *)(a1 + 8) = nr_of_meta_alts;
result = (unsigned int)(v1 + 1);
nr_of_meta_alts = result;
return result;
}

original_code:
static void number_meta_alt (meta_alt a)
 { a -> number = nr_of_meta_alts;
   nr_of_meta_alts++;
 }

canonical_original_code:
static void number_meta_alt(struct meta_alt_rec *a)
 { a -> number = nr_of_meta_alts;
   nr_of_meta_alts++;
 }

variable_types: 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 { int size; int room; struct meta_alt_rec **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; } *e; int number; } *

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

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 number_meta_rule(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
__int64 result; // rax
__int64 v4; // rdx

v1 = nr_of_meta_rules;
v2 = *(unsigned int **)(a1 + 8);
*(_DWORD *)(a1 + 32) = nr_of_meta_rules;
result = (unsigned int)(v1 + 1);
nr_of_meta_rules = result;
if ( v2 )
{
result = *v2;
if ( (int)result > 0 )
{
v4 = 0LL;
do
result = number_meta_alt(*(_QWORD *)(*((_QWORD *)v2 + 1) + 8 * v4));
while ( (int)*v2 > (int)v4 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
__int64 result; // rax
__int64 v4; // rdx

v1 = nr_of_meta_rules;
v2 = *(unsigned int **)(a1 + 8);
*(_DWORD *)(a1 + 32) = nr_of_meta_rules;
result = (unsigned int)(v1 + 1);
nr_of_meta_rules = result;
if ( v2 )
{
result = *v2;
if ( (int)result > 0 )
{
v4 = 0LL;
do
result = func5(*(_QWORD *)(*((_QWORD *)v2 + 1) + 8 * v4));
while ( (int)*v2 > (int)v4 );
}
}
return result;
}

original_code:
static void number_meta_rule (meta_rule mrule)
 { int ix;
   meta_alt_list alts = mrule -> alts;
   mrule -> number = nr_of_meta_rules;
   nr_of_meta_rules++;
   if (alts == ((meta_alt_list) ((void *)0))) return;
   for (ix = 0; ix < alts -> size; ix++)
      number_meta_alt (alts -> array[ix]);
 }

canonical_original_code:
static void number_meta_rule(struct meta_rule_rec *mrule)
 { int ix;
   struct meta_alt_list_rec *alts = mrule -> alts;
   mrule -> number = nr_of_meta_rules;
   nr_of_meta_rules++;
   if (alts == ((meta_alt_list) ((void *)0))) return;
   for (ix = 0; ix < alts -> size; ix++)
      number_meta_alt (alts -> array[ix]);
 }

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; } *

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 number_meta_rules(__int64 *a1)
{
__int64 *v1; // rbx
__int64 result; // rax

if ( a1 )
{
v1 = a1;
do
{
number_meta_rule(*v1);
result = number_meta_rules(v1[1]);
v1 = (__int64 *)v1[2];
}
while ( v1 );
}
return result;
}

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

if ( a1 )
{
v1 = a1;
do
{
func6(*v1);
result = func7(v1[1]);
v1 = (__int64 *)v1[2];
}
while ( v1 );
}
return result;
}

original_code:
static void number_meta_rules (meta_tree root)
 { if (root == ((meta_tree) ((void *)0))) return;
   number_meta_rule (root -> node);
   number_meta_rules (root -> left);
   number_meta_rules (root -> right);
 }

canonical_original_code:
static void number_meta_rules(struct meta_tree_rec *root)
 { if (root == ((meta_tree) ((void *)0))) return;
   number_meta_rule (root -> node);
   number_meta_rules (root -> left);
   number_meta_rules (root -> right);
 }

variable_types: struct meta_tree_rec { 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; } *node; struct meta_tree_rec *left; struct meta_tree_rec *right; } *

user_defined_types: struct meta_tree_rec { struct meta_rule_rec *node; struct meta_tree_rec *left; struct meta_tree_rec *right; }

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