decompiled_code:
bool *__fastcall fopt_on(bool *a1, const char *a2, _BOOL4 a3)
{
int v3; // eax
_BOOL4 v4; // edx
int v5; // eax
int v6; // eax
_BOOL4 v7; // edx
int v8; // eax
int v9; // eax
_BOOL4 v10; // edx
int v11; // eax
int v12; // er8
bool *result; // rax

if ( !strcmp(a2, "asm") || !strcmp(a2, "gnu-keywords") )
{
result = a1;
*a1 = !a3;
}
else if ( !strcmp(a2, "builtin") )
{
result = a1 + 1;
a1[1] = !a3;
}
else if ( !strcmp(a2, "freestanding") )
{
result = a1 + 2;
a1[2] = !a3;
}
else if ( !strcmp(a2, "ms-extensions") )
{
result = a1 + 3;
a1[3] = !a3;
}
else if ( !strcmp(a2, "plan9-extensions") )
{
result = a1 + 4;
a1[4] = !a3;
}
else if ( !strcmp(a2, "signed-char") )
{
result = a1 + 5;
a1[5] = !a3;
}
else if ( !strcmp(a2, "unsigned-char") )
{
a1[5] = a3;
result = a1 + 5;
}
else if ( !strcmp(a2, "force-va_list-type") )
{
result = a1 + 6;
a1[6] = !a3;
}
else if ( !strcmp(a2, "strict-aliasing") )
{
result = a1 + 7;
a1[7] = !a3;
}
else if ( !strcmp(a2, "dump-bblocks") )
{
result = a1 + 8;
a1[8] = !a3;
}
else if ( !strcmp(a2, "dump-init") )
{
result = a1 + 9;
a1[9] = !a3;
}
else if ( !strcmp(a2, "dump-bitfield-init") )
{
result = a1 + 10;
a1[10] = !a3;
}
else if ( !strcmp(a2, "dump-record-layouts") )
{
result = a1 + 11;
a1[11] = !a3;
}
else if ( !strcmp(a2, "dump-symtab") )
{
result = a1 + 12;
a1[12] = !a3;
}
else if ( !strcmp(a2, "dump-type-tree") )
{
result = a1 + 13;
a1[13] = !a3;
}
else if ( !strcmp(a2, "dump-decl-sections") )
{
result = a1 + 14;
a1[14] = !a3;
}
else if ( !strcmp(a2, "dump-frame-layout") )
{
result = a1 + 15;
a1[15] = !a3;
}
else if ( !strcmp(a2, "print-aka") )
{
result = a1 + 16;
a1[16] = !a3;
}
else if ( !strcmp(a2, "print-typedefs") )
{
result = a1 + 17;
a1[17] = !a3;
}
else if ( !strcmp(a2, "show-inlined") )
{
result = a1 + 18;
a1[18] = !a3;
}
else if ( !strcmp(a2, "show-line") )
{
result = a1 + 19;
a1[19] = !a3;
}
else if ( !strcmp(a2, "show-static-asserts") )
{
result = a1 + 20;
a1[20] = !a3;
}
else
{
v3 = strcmp(a2, "show-warning-option");
v4 = a3;
if ( v3 && (v5 = strcmp(a2, "diagnostics-show-option"), v4 = a3, v5) )
{
if ( !strcmp(a2, "track-initial-fname") )
{
result = a1 + 22;
a1[22] = !a3;
}
else if ( !strcmp(a2, "verbose-asm") )
{
result = a1 + 23;
a1[23] = !a3;
}
else if ( !strcmp(a2, "color-diagnostics") )
{
result = a1 + 24;
a1[24] = !a3;
}
else if ( !strcmp(a2, "cast-with-builtin-types") )
{
result = a1 + 25;
a1[25] = !a3;
}
else if ( !strcmp(a2, "common") )
{
result = a1 + 26;
a1[26] = !a3;
}
else if ( !strcmp(a2, "const-fold") )
{
result = a1 + 27;
a1[27] = !a3;
}
else if ( !strcmp(a2, "data-sections") )
{
result = a1 + 28;
a1[28] = !a3;
}
else if ( !strcmp(a2, "finite-math-only") )
{
result = a1 + 29;
a1[29] = !a3;
}
else if ( !strcmp(a2, "fold-const-vlas") )
{
result = a1 + 30;
a1[30] = !a3;
}
else if ( !strcmp(a2, "function-sections") )
{
result = a1 + 31;
a1[31] = !a3;
}
else if ( !strcmp(a2, "inline-functions") )
{
result = a1 + 32;
a1[32] = !a3;
}
else if ( !strcmp(a2, "integral-float-load") )
{
result = a1 + 33;
a1[33] = !a3;
}
else if ( !strcmp(a2, "leading-underscore") )
{
result = a1 + 34;
a1[34] = !a3;
}
else if ( !strcmp(a2, "omit-frame-pointer") )
{
result = a1 + 35;
a1[35] = !a3;
}
else if ( !strcmp(a2, "pcc-struct-return") )
{
a1[37] = 0;
result = a1 + 36;
a1[36] = !a3;
}
else if ( !strcmp(a2, "reg-struct-return") )
{
a1[36] = 0;
result = a1 + 37;
a1[37] = !a3;
}
else
{
v6 = strcmp(a2, "pic");
v7 = a3;
if ( v6 && (v8 = strcmp(a2, "PIC"), v7 = a3, v8) )
{
v9 = strcmp(a2, "pie");
v10 = a3;
if ( v9 && (v11 = strcmp(a2, "PIE"), v10 = a3, v11) )
{
if ( !strcmp(a2, "plt") )
{
result = a1 + 40;
a1[40] = !a3;
}
else if ( !strcmp(a2, "rounding-math") )
{
result = a1 + 41;
a1[41] = !a3;
}
else if ( !strcmp(a2, "semantic-interposition") )
{
result = a1 + 42;
a1[42] = !a3;
}
else if ( !strcmp(a2, "short-enums") )
{
result = a1 + 43;
a1[43] = !a3;
}
else if ( !strcmp(a2, "stack-protector") )
{
a1[45] = 0;
result = a1 + 44;
a1[44] = !a3;
}
else if ( !strcmp(a2, "stack-protector-all") )
{
a1[44] = 0;
result = a1 + 45;
a1[45] = !a3;
}
else if ( !strcmp(a2, "symbol-arith") )
{
result = a1 + 46;
a1[46] = !a3;
}
else if ( !strcmp(a2, "thread-jumps") )
{
result = a1 + 47;
a1[47] = !a3;
}
else
{
v12 = strcmp(a2, "trapv");
result = 0LL;
if ( !v12 )
{
result = a1 + 48;
a1[48] = !a3;
}
}
}
else
{
a1[38] = 0;
result = a1 + 39;
a1[39] = !v10;
}
}
else
{
a1[39] = 0;
result = a1 + 38;
a1[38] = !v7;
}
}
}
else
{
result = a1 + 21;
a1[21] = !v4;
}
}
return result;
}

canonical_decompiled_code:
bool *__fastcall func1(bool *a1, const char *a2, _BOOL4 a3)
{
int v3; // eax
_BOOL4 v4; // edx
int v5; // eax
int v6; // eax
_BOOL4 v7; // edx
int v8; // eax
int v9; // eax
_BOOL4 v10; // edx
int v11; // eax
int v12; // er8
bool *result; // rax

if ( !strcmp(a2, "asm") || !strcmp(a2, "gnu-keywords") )
{
result = a1;
*a1 = !a3;
}
else if ( !strcmp(a2, "builtin") )
{
result = a1 + 1;
a1[1] = !a3;
}
else if ( !strcmp(a2, "freestanding") )
{
result = a1 + 2;
a1[2] = !a3;
}
else if ( !strcmp(a2, "ms-extensions") )
{
result = a1 + 3;
a1[3] = !a3;
}
else if ( !strcmp(a2, "plan9-extensions") )
{
result = a1 + 4;
a1[4] = !a3;
}
else if ( !strcmp(a2, "signed-char") )
{
result = a1 + 5;
a1[5] = !a3;
}
else if ( !strcmp(a2, "unsigned-char") )
{
a1[5] = a3;
result = a1 + 5;
}
else if ( !strcmp(a2, "force-va_list-type") )
{
result = a1 + 6;
a1[6] = !a3;
}
else if ( !strcmp(a2, "strict-aliasing") )
{
result = a1 + 7;
a1[7] = !a3;
}
else if ( !strcmp(a2, "dump-bblocks") )
{
result = a1 + 8;
a1[8] = !a3;
}
else if ( !strcmp(a2, "dump-init") )
{
result = a1 + 9;
a1[9] = !a3;
}
else if ( !strcmp(a2, "dump-bitfield-init") )
{
result = a1 + 10;
a1[10] = !a3;
}
else if ( !strcmp(a2, "dump-record-layouts") )
{
result = a1 + 11;
a1[11] = !a3;
}
else if ( !strcmp(a2, "dump-symtab") )
{
result = a1 + 12;
a1[12] = !a3;
}
else if ( !strcmp(a2, "dump-type-tree") )
{
result = a1 + 13;
a1[13] = !a3;
}
else if ( !strcmp(a2, "dump-decl-sections") )
{
result = a1 + 14;
a1[14] = !a3;
}
else if ( !strcmp(a2, "dump-frame-layout") )
{
result = a1 + 15;
a1[15] = !a3;
}
else if ( !strcmp(a2, "print-aka") )
{
result = a1 + 16;
a1[16] = !a3;
}
else if ( !strcmp(a2, "print-typedefs") )
{
result = a1 + 17;
a1[17] = !a3;
}
else if ( !strcmp(a2, "show-inlined") )
{
result = a1 + 18;
a1[18] = !a3;
}
else if ( !strcmp(a2, "show-line") )
{
result = a1 + 19;
a1[19] = !a3;
}
else if ( !strcmp(a2, "show-static-asserts") )
{
result = a1 + 20;
a1[20] = !a3;
}
else
{
v3 = strcmp(a2, "show-warning-option");
v4 = a3;
if ( v3 && (v5 = strcmp(a2, "diagnostics-show-option"), v4 = a3, v5) )
{
if ( !strcmp(a2, "track-initial-fname") )
{
result = a1 + 22;
a1[22] = !a3;
}
else if ( !strcmp(a2, "verbose-asm") )
{
result = a1 + 23;
a1[23] = !a3;
}
else if ( !strcmp(a2, "color-diagnostics") )
{
result = a1 + 24;
a1[24] = !a3;
}
else if ( !strcmp(a2, "cast-with-builtin-types") )
{
result = a1 + 25;
a1[25] = !a3;
}
else if ( !strcmp(a2, "common") )
{
result = a1 + 26;
a1[26] = !a3;
}
else if ( !strcmp(a2, "const-fold") )
{
result = a1 + 27;
a1[27] = !a3;
}
else if ( !strcmp(a2, "data-sections") )
{
result = a1 + 28;
a1[28] = !a3;
}
else if ( !strcmp(a2, "finite-math-only") )
{
result = a1 + 29;
a1[29] = !a3;
}
else if ( !strcmp(a2, "fold-const-vlas") )
{
result = a1 + 30;
a1[30] = !a3;
}
else if ( !strcmp(a2, "function-sections") )
{
result = a1 + 31;
a1[31] = !a3;
}
else if ( !strcmp(a2, "inline-functions") )
{
result = a1 + 32;
a1[32] = !a3;
}
else if ( !strcmp(a2, "integral-float-load") )
{
result = a1 + 33;
a1[33] = !a3;
}
else if ( !strcmp(a2, "leading-underscore") )
{
result = a1 + 34;
a1[34] = !a3;
}
else if ( !strcmp(a2, "omit-frame-pointer") )
{
result = a1 + 35;
a1[35] = !a3;
}
else if ( !strcmp(a2, "pcc-struct-return") )
{
a1[37] = 0;
result = a1 + 36;
a1[36] = !a3;
}
else if ( !strcmp(a2, "reg-struct-return") )
{
a1[36] = 0;
result = a1 + 37;
a1[37] = !a3;
}
else
{
v6 = strcmp(a2, "pic");
v7 = a3;
if ( v6 && (v8 = strcmp(a2, "PIC"), v7 = a3, v8) )
{
v9 = strcmp(a2, "pie");
v10 = a3;
if ( v9 && (v11 = strcmp(a2, "PIE"), v10 = a3, v11) )
{
if ( !strcmp(a2, "plt") )
{
result = a1 + 40;
a1[40] = !a3;
}
else if ( !strcmp(a2, "rounding-math") )
{
result = a1 + 41;
a1[41] = !a3;
}
else if ( !strcmp(a2, "semantic-interposition") )
{
result = a1 + 42;
a1[42] = !a3;
}
else if ( !strcmp(a2, "short-enums") )
{
result = a1 + 43;
a1[43] = !a3;
}
else if ( !strcmp(a2, "stack-protector") )
{
a1[45] = 0;
result = a1 + 44;
a1[44] = !a3;
}
else if ( !strcmp(a2, "stack-protector-all") )
{
a1[44] = 0;
result = a1 + 45;
a1[45] = !a3;
}
else if ( !strcmp(a2, "symbol-arith") )
{
result = a1 + 46;
a1[46] = !a3;
}
else if ( !strcmp(a2, "thread-jumps") )
{
result = a1 + 47;
a1[47] = !a3;
}
else
{
v12 = strcmp(a2, "trapv");
result = 0LL;
if ( !v12 )
{
result = a1 + 48;
a1[48] = !a3;
}
}
}
else
{
a1[38] = 0;
result = a1 + 39;
a1[39] = !v10;
}
}
else
{
a1[39] = 0;
result = a1 + 38;
a1[38] = !v7;
}
}
}
else
{
result = a1 + 21;
a1[21] = !v4;
}
}
return result;
}

original_code:
unsigned char *fopt_on(struct cc1_fopt *fopt, const char *argument, int invert)
{
 if(0);
else if(!strcmp(argument, "asm")){ fopt->ext_keywords = !invert; return &fopt->ext_keywords; }
else if(!strcmp(argument, "gnu-keywords")){ fopt->ext_keywords = !invert; return &fopt->ext_keywords; }
else if(!strcmp(argument, "builtin")){ fopt->builtin = !invert; return &fopt->builtin; }
else if(!strcmp(argument, "freestanding")){ fopt->freestanding = !invert; return &fopt->freestanding; }
else if(!strcmp(argument, "ms-extensions")){ fopt->ms_extensions = !invert; return &fopt->ms_extensions; }
else if(!strcmp(argument, "plan9-extensions")){ fopt->plan9_extensions = !invert; return &fopt->plan9_extensions; }
else if(!strcmp(argument, "signed-char")){ fopt->signed_char = !invert; return &fopt->signed_char; }
else if(!strcmp(argument, "unsigned-char")){ fopt->signed_char = invert; return &fopt->signed_char; }
else if(!strcmp(argument, "force-va_list-type")){ fopt->force_valist_type = !invert; return &fopt->force_valist_type; }
else if(!strcmp(argument, "strict-aliasing")){ fopt->strict_aliasing = !invert; return &fopt->strict_aliasing; }
else if(!strcmp(argument, "dump-bblocks")){ fopt->dump_basic_blocks = !invert; return &fopt->dump_basic_blocks; }
else if(!strcmp(argument, "dump-init")){ fopt->dump_init = !invert; return &fopt->dump_init; }
else if(!strcmp(argument, "dump-bitfield-init")){ fopt->dump_bitfield_init = !invert; return &fopt->dump_bitfield_init; }
else if(!strcmp(argument, "dump-record-layouts")){ fopt->dump_layouts = !invert; return &fopt->dump_layouts; }
else if(!strcmp(argument, "dump-symtab")){ fopt->dump_symtab = !invert; return &fopt->dump_symtab; }
else if(!strcmp(argument, "dump-type-tree")){ fopt->dump_type_tree = !invert; return &fopt->dump_type_tree; }
else if(!strcmp(argument, "dump-decl-sections")){ fopt->dump_decl_sections = !invert; return &fopt->dump_decl_sections; }
else if(!strcmp(argument, "dump-frame-layout")){ fopt->dump_frame_layout = !invert; return &fopt->dump_frame_layout; }
else if(!strcmp(argument, "print-aka")){ fopt->print_aka = !invert; return &fopt->print_aka; }
else if(!strcmp(argument, "print-typedefs")){ fopt->print_typedefs = !invert; return &fopt->print_typedefs; }
else if(!strcmp(argument, "show-inlined")){ fopt->show_inlined = !invert; return &fopt->show_inlined; }
else if(!strcmp(argument, "show-line")){ fopt->show_line = !invert; return &fopt->show_line; }
else if(!strcmp(argument, "show-static-asserts")){ fopt->show_static_asserts = !invert; return &fopt->show_static_asserts; }
else if(!strcmp(argument, "show-warning-option")){ fopt->show_warning_option = !invert; return &fopt->show_warning_option; }
else if(!strcmp(argument, "diagnostics-show-option")){ fopt->show_warning_option = !invert; return &fopt->show_warning_option; }
else if(!strcmp(argument, "track-initial-fname")){ fopt->track_initial_fnam = !invert; return &fopt->track_initial_fnam; }
else if(!strcmp(argument, "verbose-asm")){ fopt->verbose_asm = !invert; return &fopt->verbose_asm; }
else if(!strcmp(argument, "color-diagnostics")){ fopt->colour_diagnostics = !invert; return &fopt->colour_diagnostics; }
else if(!strcmp(argument, "cast-with-builtin-types")){ fopt->cast_w_builtin_types = !invert; return &fopt->cast_w_builtin_types; }
else if(!strcmp(argument, "common")){ fopt->common = !invert; return &fopt->common; }
else if(!strcmp(argument, "const-fold")){ fopt->const_fold = !invert; return &fopt->const_fold; }
else if(!strcmp(argument, "data-sections")){ fopt->data_sections = !invert; return &fopt->data_sections; }
else if(!strcmp(argument, "finite-math-only")){ fopt->finite_math_only = !invert; return &fopt->finite_math_only; }
else if(!strcmp(argument, "fold-const-vlas")){ fopt->fold_const_vlas = !invert; return &fopt->fold_const_vlas; }
else if(!strcmp(argument, "function-sections")){ fopt->function_sections = !invert; return &fopt->function_sections; }
else if(!strcmp(argument, "inline-functions")){ fopt->inline_functions = !invert; return &fopt->inline_functions; }
else if(!strcmp(argument, "integral-float-load")){ fopt->integral_float_load = !invert; return &fopt->integral_float_load; }
else if(!strcmp(argument, "leading-underscore")){ fopt->leading_underscore = !invert; return &fopt->leading_underscore; }
else if(!strcmp(argument, "omit-frame-pointer")){ fopt->omit_frame_pointer = !invert; return &fopt->omit_frame_pointer; }
else if(!strcmp(argument, "pcc-struct-return")){ fopt->pcc_struct_return = !invert; fopt->reg_struct_return = 0; return &fopt->pcc_struct_return; }
else if(!strcmp(argument, "reg-struct-return")){ fopt->reg_struct_return = !invert; fopt->pcc_struct_return = 0; return &fopt->reg_struct_return; }
else if(!strcmp(argument, "pic")){ fopt->pic = !invert; fopt->pie = 0; return &fopt->pic; }
else if(!strcmp(argument, "PIC")){ fopt->pic = !invert; fopt->pie = 0; return &fopt->pic; }
else if(!strcmp(argument, "pie")){ fopt->pie = !invert; fopt->pic = 0; return &fopt->pie; }
else if(!strcmp(argument, "PIE")){ fopt->pie = !invert; fopt->pic = 0; return &fopt->pie; }
else if(!strcmp(argument, "plt")){ fopt->plt = !invert; return &fopt->plt; }
else if(!strcmp(argument, "rounding-math")){ fopt->rounding_math = !invert; return &fopt->rounding_math; }
else if(!strcmp(argument, "semantic-interposition")){ fopt->semantic_interposition = !invert; return &fopt->semantic_interposition; }
else if(!strcmp(argument, "short-enums")){ fopt->short_enums = !invert; return &fopt->short_enums; }
else if(!strcmp(argument, "stack-protector")){ fopt->stack_protector = !invert; fopt->stack_protector_all = 0; return &fopt->stack_protector; }
else if(!strcmp(argument, "stack-protector-all")){ fopt->stack_protector_all = !invert; fopt->stack_protector = 0; return &fopt->stack_protector_all; }
else if(!strcmp(argument, "symbol-arith")){ fopt->symbol_arith = !invert; return &fopt->symbol_arith; }
else if(!strcmp(argument, "thread-jumps")){ fopt->thread_jumps = !invert; return &fopt->thread_jumps; }
else if(!strcmp(argument, "trapv")){ fopt->trapv = !invert; return &fopt->trapv; }
 return ((void *)0);
}

canonical_original_code:
unsigned char *fopt_on(struct cc1_fopt *fopt, char *argument, int invert)
{
 if(0);
else if(!strcmp(argument, "asm")){ fopt->ext_keywords = !invert; return &fopt->ext_keywords; }
else if(!strcmp(argument, "gnu-keywords")){ fopt->ext_keywords = !invert; return &fopt->ext_keywords; }
else if(!strcmp(argument, "builtin")){ fopt->builtin = !invert; return &fopt->builtin; }
else if(!strcmp(argument, "freestanding")){ fopt->freestanding = !invert; return &fopt->freestanding; }
else if(!strcmp(argument, "ms-extensions")){ fopt->ms_extensions = !invert; return &fopt->ms_extensions; }
else if(!strcmp(argument, "plan9-extensions")){ fopt->plan9_extensions = !invert; return &fopt->plan9_extensions; }
else if(!strcmp(argument, "signed-char")){ fopt->signed_char = !invert; return &fopt->signed_char; }
else if(!strcmp(argument, "unsigned-char")){ fopt->signed_char = invert; return &fopt->signed_char; }
else if(!strcmp(argument, "force-va_list-type")){ fopt->force_valist_type = !invert; return &fopt->force_valist_type; }
else if(!strcmp(argument, "strict-aliasing")){ fopt->strict_aliasing = !invert; return &fopt->strict_aliasing; }
else if(!strcmp(argument, "dump-bblocks")){ fopt->dump_basic_blocks = !invert; return &fopt->dump_basic_blocks; }
else if(!strcmp(argument, "dump-init")){ fopt->dump_init = !invert; return &fopt->dump_init; }
else if(!strcmp(argument, "dump-bitfield-init")){ fopt->dump_bitfield_init = !invert; return &fopt->dump_bitfield_init; }
else if(!strcmp(argument, "dump-record-layouts")){ fopt->dump_layouts = !invert; return &fopt->dump_layouts; }
else if(!strcmp(argument, "dump-symtab")){ fopt->dump_symtab = !invert; return &fopt->dump_symtab; }
else if(!strcmp(argument, "dump-type-tree")){ fopt->dump_type_tree = !invert; return &fopt->dump_type_tree; }
else if(!strcmp(argument, "dump-decl-sections")){ fopt->dump_decl_sections = !invert; return &fopt->dump_decl_sections; }
else if(!strcmp(argument, "dump-frame-layout")){ fopt->dump_frame_layout = !invert; return &fopt->dump_frame_layout; }
else if(!strcmp(argument, "print-aka")){ fopt->print_aka = !invert; return &fopt->print_aka; }
else if(!strcmp(argument, "print-typedefs")){ fopt->print_typedefs = !invert; return &fopt->print_typedefs; }
else if(!strcmp(argument, "show-inlined")){ fopt->show_inlined = !invert; return &fopt->show_inlined; }
else if(!strcmp(argument, "show-line")){ fopt->show_line = !invert; return &fopt->show_line; }
else if(!strcmp(argument, "show-static-asserts")){ fopt->show_static_asserts = !invert; return &fopt->show_static_asserts; }
else if(!strcmp(argument, "show-warning-option")){ fopt->show_warning_option = !invert; return &fopt->show_warning_option; }
else if(!strcmp(argument, "diagnostics-show-option")){ fopt->show_warning_option = !invert; return &fopt->show_warning_option; }
else if(!strcmp(argument, "track-initial-fname")){ fopt->track_initial_fnam = !invert; return &fopt->track_initial_fnam; }
else if(!strcmp(argument, "verbose-asm")){ fopt->verbose_asm = !invert; return &fopt->verbose_asm; }
else if(!strcmp(argument, "color-diagnostics")){ fopt->colour_diagnostics = !invert; return &fopt->colour_diagnostics; }
else if(!strcmp(argument, "cast-with-builtin-types")){ fopt->cast_w_builtin_types = !invert; return &fopt->cast_w_builtin_types; }
else if(!strcmp(argument, "common")){ fopt->common = !invert; return &fopt->common; }
else if(!strcmp(argument, "const-fold")){ fopt->const_fold = !invert; return &fopt->const_fold; }
else if(!strcmp(argument, "data-sections")){ fopt->data_sections = !invert; return &fopt->data_sections; }
else if(!strcmp(argument, "finite-math-only")){ fopt->finite_math_only = !invert; return &fopt->finite_math_only; }
else if(!strcmp(argument, "fold-const-vlas")){ fopt->fold_const_vlas = !invert; return &fopt->fold_const_vlas; }
else if(!strcmp(argument, "function-sections")){ fopt->function_sections = !invert; return &fopt->function_sections; }
else if(!strcmp(argument, "inline-functions")){ fopt->inline_functions = !invert; return &fopt->inline_functions; }
else if(!strcmp(argument, "integral-float-load")){ fopt->integral_float_load = !invert; return &fopt->integral_float_load; }
else if(!strcmp(argument, "leading-underscore")){ fopt->leading_underscore = !invert; return &fopt->leading_underscore; }
else if(!strcmp(argument, "omit-frame-pointer")){ fopt->omit_frame_pointer = !invert; return &fopt->omit_frame_pointer; }
else if(!strcmp(argument, "pcc-struct-return")){ fopt->pcc_struct_return = !invert; fopt->reg_struct_return = 0; return &fopt->pcc_struct_return; }
else if(!strcmp(argument, "reg-struct-return")){ fopt->reg_struct_return = !invert; fopt->pcc_struct_return = 0; return &fopt->reg_struct_return; }
else if(!strcmp(argument, "pic")){ fopt->pic = !invert; fopt->pie = 0; return &fopt->pic; }
else if(!strcmp(argument, "PIC")){ fopt->pic = !invert; fopt->pie = 0; return &fopt->pic; }
else if(!strcmp(argument, "pie")){ fopt->pie = !invert; fopt->pic = 0; return &fopt->pie; }
else if(!strcmp(argument, "PIE")){ fopt->pie = !invert; fopt->pic = 0; return &fopt->pie; }
else if(!strcmp(argument, "plt")){ fopt->plt = !invert; return &fopt->plt; }
else if(!strcmp(argument, "rounding-math")){ fopt->rounding_math = !invert; return &fopt->rounding_math; }
else if(!strcmp(argument, "semantic-interposition")){ fopt->semantic_interposition = !invert; return &fopt->semantic_interposition; }
else if(!strcmp(argument, "short-enums")){ fopt->short_enums = !invert; return &fopt->short_enums; }
else if(!strcmp(argument, "stack-protector")){ fopt->stack_protector = !invert; fopt->stack_protector_all = 0; return &fopt->stack_protector; }
else if(!strcmp(argument, "stack-protector-all")){ fopt->stack_protector_all = !invert; fopt->stack_protector = 0; return &fopt->stack_protector_all; }
else if(!strcmp(argument, "symbol-arith")){ fopt->symbol_arith = !invert; return &fopt->symbol_arith; }
else if(!strcmp(argument, "thread-jumps")){ fopt->thread_jumps = !invert; return &fopt->thread_jumps; }
else if(!strcmp(argument, "trapv")){ fopt->trapv = !invert; return &fopt->trapv; }
 return ((void *)0);
}

variable_types: struct cc1_fopt { unsigned char ext_keywords; unsigned char builtin; unsigned char freestanding; unsigned char ms_extensions; unsigned char plan9_extensions; unsigned char signed_char; unsigned char force_valist_type; unsigned char strict_aliasing; unsigned char dump_basic_blocks; unsigned char dump_init; unsigned char dump_bitfield_init; unsigned char dump_layouts; unsigned char dump_symtab; unsigned char dump_type_tree; unsigned char dump_decl_sections; unsigned char dump_frame_layout; unsigned char print_aka; unsigned char print_typedefs; unsigned char show_inlined; unsigned char show_line; unsigned char show_static_asserts; unsigned char show_warning_option; unsigned char track_initial_fnam; unsigned char verbose_asm; unsigned char colour_diagnostics; unsigned char cast_w_builtin_types; unsigned char common; unsigned char const_fold; unsigned char data_sections; unsigned char finite_math_only; unsigned char fold_const_vlas; unsigned char function_sections; unsigned char inline_functions; unsigned char integral_float_load; unsigned char leading_underscore; unsigned char omit_frame_pointer; unsigned char pcc_struct_return; unsigned char reg_struct_return; unsigned char pic; unsigned char pie; unsigned char plt; unsigned char rounding_math; unsigned char semantic_interposition; unsigned char short_enums; unsigned char stack_protector; unsigned char stack_protector_all; unsigned char symbol_arith; unsigned char thread_jumps; unsigned char trapv; } *

variable_types:
argument
char *

variable_types: invert int

return_type: unsigned char *


repo: bobrippling/ucc-c-compiler

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

if ( !init )
_assert_fail("init", "platform.c", 0xFu, "platform_word_size");
result = 8LL;
if ( arch )
{
if ( arch != 1 )
platform_word_size_cold();
result = 4LL;
}
return result;
}

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

if ( !init )
_assert_fail("init", "platform.c", 0xFu, "platform_word_size");
result = 8LL;
if ( arch )
{
if ( arch != 1 )
func6();
result = 4LL;
}
return result;
}

original_code:
unsigned platform_word_size(void)
{
 ((init) ? (void) (0) : __assert_fail ("init", "platform.c", 15, __extension__ __PRETTY_FUNCTION__));
 switch(arch){
  case ARCH_i386: return 4;
  case ARCH_x86_64: return 8;
 }
 abort();
}

canonical_original_code:
unsigned int platform_word_size()
{
 ((init) ? (void) (0) : __assert_fail ("init", "platform.c", 15, __extension__ __PRETTY_FUNCTION__));
 switch(arch){
  case ARCH_i386: return 4;
  case ARCH_x86_64: return 8;
 }
 abort();
}

return_type: unsigned int


decompiled_code:
_BOOL8 platform_32bit()
{
return (unsigned int)platform_word_size() == 4;
}

canonical_decompiled_code:
_BOOL8 func1()
{
return (unsigned int)func0() == 4;
}

original_code:
int platform_32bit(void)
{
 return platform_word_size() == 4;
}

canonical_original_code:
int platform_32bit()
{
 return platform_word_size() == 4;
}

return_type: int


decompiled_code:
__int64 platform_align_max()
{
int v0; // eax

v0 = platform_word_size();
if ( v0 == 4 )
return 8LL;
if ( v0 != 8 )
platform_align_max_cold();
return 16LL;
}

canonical_decompiled_code:
__int64 func2()
{
int v0; // eax

v0 = func0();
if ( v0 == 4 )
return 8LL;
if ( v0 != 8 )
func7();
return 16LL;
}

original_code:
unsigned platform_align_max(void)
{
 switch(platform_word_size()){
  case 4:
   return 8;
  case 8:
   return 16;
 }
 abort();
}

canonical_original_code:
unsigned int platform_align_max()
{
 switch(platform_word_size()){
  case 4:
   return 8;
  case 8:
   return 16;
 }
 abort();
}


decompiled_code:
__int64 platform_type()
{
if ( !init )
_assert_fail("init", "platform.c", 0x29u, "platform_type");
return (unsigned int)arch;
}

canonical_decompiled_code:
__int64 func3()
{
if ( !init )
_assert_fail("init", "platform.c", 0x29u, "platform_type");
return (unsigned int)arch;
}

original_code:
enum arch platform_type(void)
{
 ((init) ? (void) (0) : __assert_fail ("init", "platform.c", 41, __extension__ __PRETTY_FUNCTION__));
 return arch;
}

canonical_original_code:
enum arch platform_type()
{
 ((init) ? (void) (0) : __assert_fail ("init", "platform.c", 41, __extension__ __PRETTY_FUNCTION__));
 return arch;
}

return_type: enum arch { ARCH_x86_64=0, ARCH_i386=1 }


decompiled_code:
__int64 platform_sys()
{
if ( !init )
_assert_fail("init", "platform.c", 0x2Fu, "platform_sys");
return (unsigned int)sys;
}

canonical_decompiled_code:
__int64 func4()
{
if ( !init )
_assert_fail("init", "platform.c", 0x2Fu, "platform_sys");
return (unsigned int)sys;
}

original_code:
enum sys platform_sys(void)
{
 ((init) ? (void) (0) : __assert_fail ("init", "platform.c", 47, __extension__ __PRETTY_FUNCTION__));
 return sys;
}

canonical_original_code:
enum sys platform_sys()
{
 ((init) ? (void) (0) : __assert_fail ("init", "platform.c", 47, __extension__ __PRETTY_FUNCTION__));
 return sys;
}

return_type: enum sys { SYS_linux=0, SYS_freebsd=1, SYS_darwin=2, SYS_cygwin=3 }


decompiled_code:
void __fastcall platform_init(int a1, int a2)
{
arch = a1;
sys = a2;
init = 1;
}

canonical_decompiled_code:
void __fastcall func5(int a1, int a2)
{
arch = a1;
sys = a2;
init = 1;
}

original_code:
void platform_init(enum arch a, enum sys s)
{
 arch = a;
 sys = s;
 init = 1;
}

variable_types: enum arch { ARCH_x86_64=0, ARCH_i386=1 }

variable_types: enum sys { SYS_linux=0, SYS_freebsd=1, SYS_darwin=2, SYS_cygwin=3 }

return_type: void


decompiled_code:
__int64 __fastcall handle_pragma_stdc(const char *a1, __int64 a2)
{
return cc1_warn_at_w(a2, (unsigned int)((_DWORD)&cc1_warning + 118), "unhandled STDC pragma '%s'", a1);
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1, __int64 a2)
{
return cc1_warn_at_w(a2, (unsigned int)((_DWORD)&cc1_warning + 118), "unhandled STDC pragma '%s'", a1);
}

original_code:
static void handle_pragma_stdc(const char *pragma, where *loc)
{
 cc1_warn_at_w(loc, &cc1_warning.unknown_pragma, "unhandled STDC pragma '%s'", pragma);
}

canonical_original_code:
static void handle_pragma_stdc(char *pragma, struct where *loc)
{
 cc1_warn_at_w(loc, &cc1_warning.unknown_pragma, "unhandled STDC pragma '%s'", pragma);
}

variable_types:
pragma
char *

variable_types: struct where { char *fname; unsigned int line; unsigned short chr; unsigned char is_sysh; } *


decompiled_code:
int __fastcall handle_pragma_ucc(const char *a1, __int64 a2)
{
bool v2; // cf
bool v3; // zf
const char *v6; // rdi
__int64 v7; // rcx
const char *v8; // rsi

v6 = "namespace ";
v7 = 10LL;
v8 = a1;
do
{
if ( !v7 )
break;
v2 = *v8 < (unsigned int)*v6;
v3 = *v8++ == *v6++;
--v7;
}
while ( v3 );
if ( (!v2 && !v3) != v2 )
return cc1_warn_at_w(a2, (unsigned int)((_DWORD)&cc1_warning + 118), "unknown ucc pragma '%s'", a1);
free(ucc_namespace);
ucc_namespace = (void *)ustrdup(a1 + 10, v8);
return fprintf(stderr, "namespace \"%s\"\n", (const char *)ucc_namespace);
}

canonical_decompiled_code:
int __fastcall func1(const char *a1, __int64 a2)
{
bool v2; // cf
bool v3; // zf
const char *v6; // rdi
__int64 v7; // rcx
const char *v8; // rsi

v6 = "namespace ";
v7 = 10LL;
v8 = a1;
do
{
if ( !v7 )
break;
v2 = *v8 < (unsigned int)*v6;
v3 = *v8++ == *v6++;
--v7;
}
while ( v3 );
if ( (!v2 && !v3) != v2 )
return cc1_warn_at_w(a2, (unsigned int)((_DWORD)&cc1_warning + 118), "unknown ucc pragma '%s'", a1);
free(ucc_namespace);
ucc_namespace = (void *)ustrdup(a1 + 10, v8);
return fprintf(stderr, "namespace \"%s\"\n", (const char *)ucc_namespace);
}

original_code:
static void handle_pragma_ucc(const char *pragma, where *loc)
{
 if(!strncmp(pragma, "namespace ", 10)){
  free(ucc_namespace);
  ucc_namespace = ustrdup(pragma + 10);
  fprintf(stderr, "namespace \"%s\"\n", ucc_namespace);
 }else{
  cc1_warn_at_w(loc, &cc1_warning.unknown_pragma, "unknown ucc pragma '%s'", pragma);
 }
}

canonical_original_code:
static void handle_pragma_ucc(char *pragma, struct where *loc)
{
 if(!strncmp(pragma, "namespace ", 10)){
  free(ucc_namespace);
  ucc_namespace = ustrdup(pragma + 10);
  fprintf(stderr, "namespace \"%s\"\n", ucc_namespace);
 }else{
  cc1_warn_at_w(loc, &cc1_warning.unknown_pragma, "unknown ucc pragma '%s'", pragma);
 }
}

user_defined_types: struct where { char *fname; unsigned int line; unsigned short chr; unsigned char is_sysh; }


decompiled_code:
int __fastcall pragma_handle(const char *a1, __int64 a2)
{
bool v2; // cf
bool v3; // zf
const char *v6; // rdi
__int64 v7; // rcx
const char *v8; // rsi
int result; // eax
const char *v10; // rax
const char *v11; // rax

v6 = "STDC";
v7 = 4LL;
v8 = a1;
do
{
if ( !v7 )
break;
v2 = *v8 < (unsigned int)*v6;
v3 = *v8++ == *v6++;
--v7;
}
while ( v3 );
if ( (!v2 && !v3) == v2 )
{
v11 = (const char *)str_spc_skip(a1 + 4, v8);
result = handle_pragma_stdc(v11, a2);
}
else if ( *a1 == 117 && a1[1] == 99 && a1[2] == 99 )
{
v10 = (const char *)str_spc_skip(a1 + 3, v8);
result = handle_pragma_ucc(v10, a2);
}
else
{
result = cc1_warn_at_w(a2, (unsigned int)((_DWORD)&cc1_warning + 118), "unknown pragma '%s'", a1);
}
return result;
}

canonical_decompiled_code:
int __fastcall func2(const char *a1, __int64 a2)
{
bool v2; // cf
bool v3; // zf
const char *v6; // rdi
__int64 v7; // rcx
const char *v8; // rsi
int result; // eax
const char *v10; // rax
const char *v11; // rax

v6 = "STDC";
v7 = 4LL;
v8 = a1;
do
{
if ( !v7 )
break;
v2 = *v8 < (unsigned int)*v6;
v3 = *v8++ == *v6++;
--v7;
}
while ( v3 );
if ( (!v2 && !v3) == v2 )
{
v11 = (const char *)str_spc_skip(a1 + 4, v8);
result = func0(v11, a2);
}
else if ( *a1 == 117 && a1[1] == 99 && a1[2] == 99 )
{
v10 = (const char *)str_spc_skip(a1 + 3, v8);
result = func1(v10, a2);
}
else
{
result = cc1_warn_at_w(a2, (unsigned int)((_DWORD)&cc1_warning + 118), "unknown pragma '%s'", a1);
}
return result;
}

original_code:
void pragma_handle(const char *pragma, where *loc)
{
 if(!strncmp(pragma, "STDC", 4)){
  handle_pragma_stdc(str_spc_skip(pragma + 4), loc);
 }else if(!strncmp(pragma, "ucc", 3)){
  handle_pragma_ucc(str_spc_skip(pragma + 3), loc);
 }else{
  cc1_warn_at_w(loc, &cc1_warning.unknown_pragma, "unknown pragma '%s'", pragma);
 }
}

canonical_original_code:
void pragma_handle(char *pragma, struct where *loc)
{
 if(!strncmp(pragma, "STDC", 4)){
  handle_pragma_stdc(str_spc_skip(pragma + 4), loc);
 }else if(!strncmp(pragma, "ucc", 3)){
  handle_pragma_ucc(str_spc_skip(pragma + 3), loc);
 }else{
  cc1_warn_at_w(loc, &cc1_warning.unknown_pragma, "unknown pragma '%s'", pragma);
 }
}


decompiled_code:
char *__fastcall word_strstr(char *s1, char *s2)
{
size_t v2; // rbp
char v3; // al
char *v4; // r12
__int64 v5; // rax

v2 = (int)strlen(s2);
if ( !strstr(s1, s2) )
return 0LL;
v3 = *s1;
if ( !*s1 )
return 0LL;
v4 = s1;
while ( 1 )
{
if ( v3 != 34 )
{
if ( !strncmp(v4, s2, v2) )
return v4;
v5 = (__int64)v4;
goto LABEL_6;
}
v5 = str_quotefin(v4 + 1);
if ( !v5 )
break;
LABEL_6:
v4 = (char *)(v5 + 1);
v3 = *(_BYTE *)(v5 + 1);
if ( !v3 )
return 0LL;
}
ice("str.c", 154LL, "word_strstr", "terminating quote not found\nhaystack = >>%s<<\nneedle = >>%s<<", s1, s2);
return 0LL;
}

canonical_decompiled_code:
char *__fastcall func0(char *s1, char *s2)
{
size_t v2; // rbp
char v3; // al
char *v4; // r12
__int64 v5; // rax

v2 = (int)strlen(s2);
if ( !strstr(s1, s2) )
return 0LL;
v3 = *s1;
if ( !*s1 )
return 0LL;
v4 = s1;
while ( 1 )
{
if ( v3 != 34 )
{
if ( !strncmp(v4, s2, v2) )
return v4;
v5 = (__int64)v4;
goto LABEL_6;
}
v5 = str_quotefin(v4 + 1);
if ( !v5 )
break;
LABEL_6:
v4 = (char *)(v5 + 1);
v3 = *(_BYTE *)(v5 + 1);
if ( !v3 )
return 0LL;
}
ice("str.c", 154LL, "word_strstr", "terminating quote not found\nhaystack = >>%s<<\nneedle = >>%s<<", s1, s2);
return 0LL;
}

original_code:
static char *word_strstr(char *haystack, const char *needle)
{
 const int nlen = strlen(needle);
 char *i;
 if(!strstr(haystack, needle))
  return ((void *)0);
 for(i = haystack; *i; i++)
  if(*i == '"'){
   i = str_quotefin(i + 1);
   if(!i)
    ice("str.c", 154, __func__, "terminating quote not found\nhaystack = >>%s<<\nneedle = >>%s<<", haystack, needle);
  }else if(!strncmp(i, needle, nlen)){
   return i;
  }
 return ((void *)0);
}

canonical_original_code:
static char *word_strstr(char *haystack, char *needle)
{
 int nlen = strlen(needle);
 char *i;
 if(!strstr(haystack, needle))
  return ((void *)0);
 for(i = haystack; *i; i++)
  if(*i == '"'){
   i = str_quotefin(i + 1);
   if(!i)
    ice("str.c", 154, __func__, "terminating quote not found\nhaystack = >>%s<<\nneedle = >>%s<<", haystack, needle);
  }else if(!strncmp(i, needle, nlen)){
   return i;
  }
 return ((void *)0);
}

variable_types:
haystack
char *

variable_types:
needle
char *

variable_types: nlen int

variable_types:
i
char *

return_type: char *


iswordpart

decompiled_code:
__int64 __fastcall iswordpart(char a1)
{
const unsigned __int16 *v1; // rdx
__int64 result; // rax

v1 = *_ctype_b_loc();
result = 1LL;
if ( (v1[a1] & 8) == 0 )
result = (a1 == 36) | (unsigned __int8)(a1 == 95);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(char a1)
{
const unsigned __int16 *v1; // rdx
__int64 result; // rax

v1 = *_ctype_b_loc();
result = 1LL;
if ( (v1[a1] & 8) == 0 )
result = (a1 == 36) | (unsigned __int8)(a1 == 95);
return result;
}

original_code:
int iswordpart(char c)
{
 return ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISalnum) || c == '_' || c == '$';
}

canonical_original_code:
int iswordpart(char c)
{
 return ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short) _ISalnum) || c == '_' || c == '$';
}

variable_types: c char


decompiled_code:
char *__fastcall word_end(char *a1)
{
while ( (unsigned int)iswordpart(*a1) )
++a1;
return a1;
}

canonical_decompiled_code:
char *__fastcall func2(char *a1)
{
while ( (unsigned int)func1(*a1) )
++a1;
return a1;
}

original_code:
char *word_end(char *s)
{
 for(; iswordpart(*s); s++);
 return s;
}

variable_types:
s
char *


decompiled_code:
char *__fastcall word_find_any(char *a1)
{
char i; // si
char *v2; // r12

for ( i = *a1; i; a1 = v2 + 1 )
{
if ( i == 34 || (v2 = a1, i == 39) )
{
v2 = (char *)str_quotefin2(a1 + 1);
if ( !v2 )
break;
}
if ( (unsigned int)iswordpart(*v2) )
return v2;
i = v2[1];
}
return 0LL;
}

canonical_decompiled_code:
char *__fastcall func3(char *a1)
{
char i; // si
char *v2; // r12

for ( i = *a1; i; a1 = v2 + 1 )
{
if ( i == 34 || (v2 = a1, i == 39) )
{
v2 = (char *)str_quotefin2(a1 + 1);
if ( !v2 )
break;
}
if ( (unsigned int)func1(*v2) )
return v2;
i = v2[1];
}
return 0LL;
}

original_code:
char *word_find_any(char *s)
{
 for(; *s; s++){
  switch(*s){
   case '"':
   case '\'':
    s = str_quotefin2(s + 1, *s);
    if(!s)
     return ((void *)0);
    break;
  }
  if(iswordpart(*s))
   return s;
 }
 return ((void *)0);
}


decompiled_code:
__int64 __fastcall str_join(const char **a1, const char *a2)
{
const char **v2; // rbx
int v3; // eax
const char *v4; // rdi
int v5; // er14
const char **v6; // r13
int v7; // ebp
int v8; // eax
__int64 v9; // rdi
__int64 v10; // rax
const char *v11; // rdx
__int64 v12; // r13
char *i; // r14
const char *v14; // rcx
int v15; // eax

v2 = a1;
v3 = strlen(a2);
v4 = *a1;
if ( v4 )
{
v5 = v3;
v6 = v2;
v7 = 1;
do
{
v8 = strlen(v4);
v4 = v6[1];
++v6;
v7 += v8 + v5;
}
while ( v4 );
v9 = v7;
}
else
{
v9 = 1LL;
}
v10 = umalloc(v9);
v11 = *v2;
v12 = v10;
for ( i = (char *)v10; *v2; i += v15 )
{
v14 = (const char *)&unk_584;
if ( v2[1] )
v14 = a2;
++v2;
v15 = sprintf(i, "%s%s", v11, v14);
v11 = *v2;
}
return v12;
}

canonical_decompiled_code:
__int64 __fastcall func4(const char **a1, const char *a2)
{
const char **v2; // rbx
int v3; // eax
const char *v4; // rdi
int v5; // er14
const char **v6; // r13
int v7; // ebp
int v8; // eax
__int64 v9; // rdi
__int64 v10; // rax
const char *v11; // rdx
__int64 v12; // r13
char *i; // r14
const char *v14; // rcx
int v15; // eax

v2 = a1;
v3 = strlen(a2);
v4 = *a1;
if ( v4 )
{
v5 = v3;
v6 = v2;
v7 = 1;
do
{
v8 = strlen(v4);
v4 = v6[1];
++v6;
v7 += v8 + v5;
}
while ( v4 );
v9 = v7;
}
else
{
v9 = 1LL;
}
v10 = umalloc(v9);
v11 = *v2;
v12 = v10;
for ( i = (char *)v10; *v2; i += v15 )
{
v14 = (const char *)&unk_584;
if ( v2[1] )
v14 = a2;
++v2;
v15 = sprintf(i, "%s%s", v11, v14);
v11 = *v2;
}
return v12;
}

original_code:
char *str_join(char **strs, const char *with)
{
 const int with_len = strlen(with);
 int len;
 char **itr;
 char *ret, *p;
 len = 1;
 for(itr = strs; *itr; itr++)
  len += strlen(*itr) + with_len;
 p = ret = umalloc(len);
 for(itr = strs; *itr; itr++)
  p += sprintf(p, "%s%s", *itr, itr[1] ? with : "");
 return ret;
}

canonical_original_code:
char *str_join(char **strs, char *with)
{
 int with_len = strlen(with);
 int len;
 char **itr;
 char *ret; char *p;
 len = 1;
 for(itr = strs; *itr; itr++)
  len += strlen(*itr) + with_len;
 p = ret = umalloc(len);
 for(itr = strs; *itr; itr++)
  p += sprintf(p, "%s%s", *itr, itr[1] ? with : "");
 return ret;
}

variable_types:
strs
char **

variable_types:
with
char *

variable_types: len int

variable_types:
itr
char **

variable_types:
ret
char *

variable_types:
p
char *


decompiled_code:
__int64 __fastcall word_dup(char *a1)
{
char *i; // rbp

for ( i = a1; (unsigned int)iswordpart(*i); ++i )
;
return ustrdup2(a1, i);
}

canonical_decompiled_code:
__int64 __fastcall func5(char *a1)
{
char *i; // rbp

for ( i = a1; (unsigned int)func1(*i); ++i )
;
return ustrdup2(a1, i);
}

original_code:
char *word_dup(const char *s)
{
 const char *start = s;
 while(iswordpart(*s))
  s++;
 return ustrdup2(start, s);
}

canonical_original_code:
char *word_dup(char *s)
{
 char *start = s;
 while(iswordpart(*s))
  s++;
 return ustrdup2(start, s);
}

variable_types:
start
char *


decompiled_code:
void *__fastcall str_replace(void *ptr, void *dest, void *src, void *a4)
{
unsigned int v6; // eax
__int64 v7; // rbx
size_t v8; // rax
void *result; // rax
void *v10; // r12

v6 = strlen((const char *)a4);
if ( (int)src - (int)dest <= v6 )
{
*(_BYTE *)dest = 0;
v10 = (void *)ustrprintf("%s%s%s", (const char *)ptr, (const char *)a4, (const char *)src);
free(ptr);
result = v10;
}
else
{
v7 = v6;
memcpy(dest, a4, v6);
v8 = strlen((const char *)src);
memmove((char *)dest + v7, src, v8 + 1);
result = ptr;
}
return result;
}

canonical_decompiled_code:
void *__fastcall func6(void *ptr, void *dest, void *src, void *a4)
{
unsigned int v6; // eax
__int64 v7; // rbx
size_t v8; // rax
void *result; // rax
void *v10; // r12

v6 = strlen((const char *)a4);
if ( (int)src - (int)dest <= v6 )
{
*(_BYTE *)dest = 0;
v10 = (void *)ustrprintf("%s%s%s", (const char *)ptr, (const char *)a4, (const char *)src);
free(ptr);
result = v10;
}
else
{
v7 = v6;
memcpy(dest, a4, v6);
v8 = strlen((const char *)src);
memmove((char *)dest + v7, src, v8 + 1);
result = ptr;
}
return result;
}

original_code:
char *str_replace(char *line, char *start, char *end, const char *replace)
{
 const unsigned int len_find = end - start;
 const unsigned int len_replace = strlen(replace);
 if(len_replace < len_find){
  memcpy(start, replace, len_replace);
  memmove(start + len_replace, end, strlen(end) + 1);
  return line;
 }else{
  char *del = line;
  *start = '\0';
  line = ustrprintf("%s%s%s", line, replace, end);
  free(del);
  return line;
 }
}

canonical_original_code:
char *str_replace(char *line, char *start, char *end, char *replace)
{
 unsigned int len_find = end - start;
 unsigned int len_replace = strlen(replace);
 if(len_replace < len_find){
  memcpy(start, replace, len_replace);
  memmove(start + len_replace, end, strlen(end) + 1);
  return line;
 }else{
  char *del = line;
  *start = '\0';
  line = ustrprintf("%s%s%s", line, replace, end);
  free(del);
  return line;
 }
}

variable_types:
line
char *

variable_types:
end
char *

variable_types:
replace
char *

variable_types:
del
char *


decompiled_code:
void *__fastcall word_replace(void *a1, char *a2, __int64 a3, void *a4)
{
return str_replace(a1, a2, &a2[a3], a4);
}

canonical_decompiled_code:
void *__fastcall func7(void *a1, char *a2, __int64 a3, void *a4)
{
return func6(a1, a2, &a2[a3], a4);
}

original_code:
char *word_replace(char *line, char *pos, size_t len, const char *replace)
{
 return str_replace(line, pos, pos + len, replace);
}

canonical_original_code:
char *word_replace(char *line, char *pos, unsigned long len, char *replace)
{
 return str_replace(line, pos, pos + len, replace);
}

variable_types:
pos
char *

variable_types:
len
unsigned long


decompiled_code:
char *__fastcall word_find(char *s1, char *s2)
{
char *v2; // rbp
__int64 v3; // r13
char *v4; // rax
char *v5; // r12

v2 = s1;
v3 = (int)strlen(s2);
while ( 1 )
{
v4 = word_strstr(s1, s2);
v5 = v4;
if ( !v4 || (v2 >= v4 || !(unsigned int)iswordpart(*(v4 - 1))) && !(unsigned int)iswordpart(v5[v3]) )
break;
s1 = v5 + 1;
}
return v5;
}

canonical_decompiled_code:
char *__fastcall func8(char *s1, char *s2)
{
char *v2; // rbp
__int64 v3; // r13
char *v4; // rax
char *v5; // r12

v2 = s1;
v3 = (int)strlen(s2);
while ( 1 )
{
v4 = func0(s1, s2);
v5 = v4;
if ( !v4 || (v2 >= v4 || !(unsigned int)func1(*(v4 - 1))) && !(unsigned int)func1(v5[v3]) )
break;
s1 = v5 + 1;
}
return v5;
}

original_code:
char *word_find(char *line, const char *word)
{
 const int wordlen = strlen(word);
 char *pos = line;
 while((pos = word_strstr(pos, word))){
  char *fin;
  if(pos > line && iswordpart(pos[-1])){
   pos++;
   continue;
  }
  fin = pos + wordlen;
  if(iswordpart(*fin)){
   pos++;
   continue;
  }
  return pos;
 }
 return ((void *)0);
}

canonical_original_code:
char *word_find(char *line, char *word)
{
 int wordlen = strlen(word);
 char *pos = line;
 while((pos = word_strstr(pos, word))){
  char *fin;
  if(pos > line && iswordpart(pos[-1])){
   pos++;
   continue;
  }
  fin = pos + wordlen;
  if(iswordpart(*fin)){
   pos++;
   continue;
  }
  return pos;
 }
 return ((void *)0);
}

variable_types:
word
char *

variable_types: wordlen int

variable_types:
fin
char *


decompiled_code:
__int64 __fastcall op_to_flag(int a1)
{
__int64 v1; // rdi

v1 = (unsigned int)(a1 - 14);
if ( (unsigned int)v1 <= 7 )
return (unsigned int)CSWTCH_11[v1];
ice("out/impl.c", 59LL, "op_to_flag", "invalid op");
return flag_cmp_to_str();
}

canonical_decompiled_code:
__int64 __fastcall func2(int a1)
{
__int64 v1; // rdi

v1 = (unsigned int)(a1 - 14);
if ( (unsigned int)v1 <= 7 )
return (unsigned int)CSWTCH_11[v1];
ice("out/impl.c", 59LL, "op_to_flag", "invalid op");
return func3();
}

original_code:
enum flag_cmp op_to_flag(enum op_type op)
{
 switch(op){
  case op_eq: return flag_eq;
  case op_ne: return flag_ne;
  case op_le: return flag_le;
  case op_lt: return flag_lt;
  case op_ge: return flag_ge;
  case op_gt: return flag_gt;
  case op_signbit: return flag_signbit;
  case op_no_signbit: return flag_no_signbit;
  case op_multiply:
  case op_divide:
  case op_modulus:
  case op_plus:
  case op_minus:
  case op_xor:
  case op_or:
  case op_and:
  case op_orsc:
  case op_andsc:
  case op_shiftl:
  case op_shiftr:
  case op_not:
  case op_bnot:
  case op_unknown:
   break;
 }
 ice("out/impl.c", 59, __func__, "invalid op");
 return -1;
}

variable_types: enum op_type { op_multiply=0, op_divide=1, op_modulus=2, op_plus=3, op_minus=4, op_xor=5, op_or=6, op_and=7, op_orsc=8, op_andsc=9, op_shiftl=10, op_shiftr=11, op_not=12, op_bnot=13, op_eq=14, op_ne=15, op_le=16, op_lt=17, op_ge=18, op_gt=19, op_signbit=20, op_no_signbit=21, op_unknown=22 }

return_type: enum flag_cmp { flag_eq=0, flag_ne=1, flag_le=2, flag_lt=3, flag_ge=4, flag_gt=5, flag_overflow=6, flag_no_overflow=7, flag_signbit=8, flag_no_signbit=9 }


decompiled_code:
char *__fastcall flag_cmp_to_str(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 9 )
result = CSWTCH_13[a1];
return result;
}

canonical_decompiled_code:
char *__fastcall func3(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 9 )
result = CSWTCH_13[a1];
return result;
}

original_code:
const char *flag_cmp_to_str(enum flag_cmp cmp)
{
 switch(cmp){
  case flag_eq: return "eq";
  case flag_ne: return "ne";
  case flag_le: return "le";
  case flag_lt: return "lt";
  case flag_ge: return "ge";
  case flag_gt: return "gt";
  case flag_overflow: return "overflow";
  case flag_no_overflow: return "no_overflow";
  case flag_signbit: return "signbit";
  case flag_no_signbit: return "no_signbit";
 }
 return ((void *)0);
}

variable_types: enum flag_cmp { flag_eq=0, flag_ne=1, flag_le=2, flag_lt=3, flag_ge=4, flag_gt=5, flag_overflow=6, flag_no_overflow=7, flag_signbit=8, flag_no_signbit=9 }


decompiled_code:
__int64 curtok_to_type_primitive()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 19;
v1 = (unsigned int)(curtok - 27);
if ( (unsigned int)v1 <= 7 )
v0 = CSWTCH_23[v1];
return v0;
}

canonical_decompiled_code:
__int64 func0()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 19;
v1 = (unsigned int)(curtok - 27);
if ( (unsigned int)v1 <= 7 )
v0 = CSWTCH_23[v1];
return v0;
}

original_code:
enum type_primitive curtok_to_type_primitive(void)
{
 switch(curtok){
  case token_void: return type_void;
  case token__Bool: return type__Bool;
  case token_char: return type_nchar;
  case token_short: return type_short;
  case token_int: return type_int;
  case token_long: return type_long;
  case token_float: return type_float;
  case token_double: return type_double;
  default: break;
 }
 return type_unknown;
}

canonical_original_code:
enum type_primitive curtok_to_type_primitive()
{
 switch(curtok){
  case token_void: return type_void;
  case token__Bool: return type__Bool;
  case token_char: return type_nchar;
  case token_short: return type_short;
  case token_int: return type_int;
  case token_long: return type_long;
  case token_float: return type_float;
  case token_double: return type_double;
  default: break;
 }
 return type_unknown;
}

return_type: enum type_primitive { type_void=0, type__Bool=1, type_nchar=2, type_schar=3, type_uchar=4, type_int=5, type_uint=6, type_short=7, type_ushort=8, type_long=9, type_ulong=10, type_llong=11, type_ullong=12, type_float=13, type_double=14, type_ldouble=15, type_struct=16, type_union=17, type_enum=18, type_unknown=19 }


decompiled_code:
__int64 curtok_to_type_qualifier()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 0;
v1 = (unsigned int)(curtok - 38);
if ( (unsigned int)v1 <= 2 )
v0 = CSWTCH_25[v1];
return v0;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 0;
v1 = (unsigned int)(curtok - 38);
if ( (unsigned int)v1 <= 2 )
v0 = CSWTCH_25[v1];
return v0;
}

original_code:
enum type_qualifier curtok_to_type_qualifier(void)
{
 switch(curtok){
  case token_const: return qual_const;
  case token_volatile: return qual_volatile;
  case token_restrict: return qual_restrict;
  default: return qual_none;
 }
}

canonical_original_code:
enum type_qualifier curtok_to_type_qualifier()
{
 switch(curtok){
  case token_const: return qual_const;
  case token_volatile: return qual_volatile;
  case token_restrict: return qual_restrict;
  default: return qual_none;
 }
}

return_type: enum type_qualifier { qual_none=0, qual_const=expr, qual_volatile=expr, qual_restrict=expr }


decompiled_code:
__int64 curtok_to_decl_storage()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = -1;
v1 = (unsigned int)(curtok - 43);
if ( (unsigned int)v1 <= 7 )
v0 = CSWTCH_27[v1];
return v0;
}

canonical_decompiled_code:
__int64 func2()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = -1;
v1 = (unsigned int)(curtok - 43);
if ( (unsigned int)v1 <= 7 )
v0 = CSWTCH_27[v1];
return v0;
}

original_code:
enum decl_storage curtok_to_decl_storage(void)
{
 switch(curtok){
  case token_auto: return store_auto;
  case token_extern: return store_extern;
  case token_static: return store_static;
  case token_typedef: return store_typedef;
  case token_register: return store_register;
  default: return -1;
 }
}

canonical_original_code:
enum decl_storage curtok_to_decl_storage()
{
 switch(curtok){
  case token_auto: return store_auto;
  case token_extern: return store_extern;
  case token_static: return store_static;
  case token_typedef: return store_typedef;
  case token_register: return store_register;
  default: return -1;
 }
}

return_type: enum decl_storage { store_default=0, store_auto=1, store_static=2, store_extern=3, store_register=4, store_typedef=5, store_inline=expr }


decompiled_code:
__int64 curtok_to_op()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 22;
v1 = (unsigned int)(curtok - 64);
if ( (unsigned int)v1 <= 0x24 )
v0 = (unsigned __int8)CSWTCH_29[v1];
return v0;
}

canonical_decompiled_code:
__int64 func3()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 22;
v1 = (unsigned int)(curtok - 64);
if ( (unsigned int)v1 <= 0x24 )
v0 = (unsigned __int8)CSWTCH_29[v1];
return v0;
}

original_code:
enum op_type curtok_to_op(void)
{
 switch(curtok){
  case token_multiply: return op_multiply;
  case token_divide: return op_divide;
  case token_plus: return op_plus;
  case token_minus: return op_minus;
  case token_modulus: return op_modulus;
  case token_eq: return op_eq;
  case token_ne: return op_ne;
  case token_le: return op_le;
  case token_lt: return op_lt;
  case token_ge: return op_ge;
  case token_gt: return op_gt;
  case token_xor: return op_xor;
  case token_or: return op_or;
  case token_and: return op_and;
  case token_orsc: return op_orsc;
  case token_andsc: return op_andsc;
  case token_not: return op_not;
  case token_bnot: return op_bnot;
  case token_shiftl: return op_shiftl;
  case token_shiftr: return op_shiftr;
  default: break;
 }
 return op_unknown;
}

canonical_original_code:
enum op_type curtok_to_op()
{
 switch(curtok){
  case token_multiply: return op_multiply;
  case token_divide: return op_divide;
  case token_plus: return op_plus;
  case token_minus: return op_minus;
  case token_modulus: return op_modulus;
  case token_eq: return op_eq;
  case token_ne: return op_ne;
  case token_le: return op_le;
  case token_lt: return op_lt;
  case token_ge: return op_ge;
  case token_gt: return op_gt;
  case token_xor: return op_xor;
  case token_or: return op_or;
  case token_and: return op_and;
  case token_orsc: return op_orsc;
  case token_andsc: return op_andsc;
  case token_not: return op_not;
  case token_bnot: return op_bnot;
  case token_shiftl: return op_shiftl;
  case token_shiftr: return op_shiftr;
  default: break;
 }
 return op_unknown;
}

return_type: enum op_type { op_multiply=0, op_divide=1, op_modulus=2, op_plus=3, op_minus=4, op_xor=5, op_or=6, op_and=7, op_orsc=8, op_andsc=9, op_shiftl=10, op_shiftr=11, op_not=12, op_bnot=13, op_eq=14, op_ne=15, op_le=16, op_lt=17, op_ge=18, op_gt=19, op_signbit=20, op_no_signbit=21, op_unknown=22 }


decompiled_code:
_BOOL8 curtok_is_type_primitive()
{
return (unsigned int)curtok_to_type_primitive() != 19;
}

canonical_decompiled_code:
_BOOL8 func4()
{
return (unsigned int)func0() != 19;
}

original_code:
int curtok_is_type_primitive(void)
{
 return curtok_to_type_primitive() != type_unknown;
}

canonical_original_code:
int curtok_is_type_primitive()
{
 return curtok_to_type_primitive() != type_unknown;
}


decompiled_code:
_BOOL8 curtok_is_type_qual()
{
return (unsigned int)curtok_to_type_qualifier() != 0;
}

canonical_decompiled_code:
_BOOL8 func5()
{
return (unsigned int)func1() != 0;
}

original_code:
int curtok_is_type_qual(void)
{
 return curtok_to_type_qualifier() != qual_none;
}

canonical_original_code:
int curtok_is_type_qual()
{
 return curtok_to_type_qualifier() != qual_none;
}


decompiled_code:
_BOOL8 curtok_is_decl_store()
{
return (unsigned int)curtok_to_decl_storage() != -1;
}

canonical_decompiled_code:
_BOOL8 func6()
{
return (unsigned int)func2() != -1;
}

original_code:
int curtok_is_decl_store(void)
{
 return curtok_to_decl_storage() != (enum decl_storage)-1;
}

canonical_original_code:
int curtok_is_decl_store()
{
 return curtok_to_decl_storage() != (enum decl_storage)-1;
}

user_defined_types: enum decl_storage { store_default=0, store_auto=1, store_static=2, store_extern=3, store_register=4, store_typedef=5, store_inline=expr }


decompiled_code:
__int64 curtok_to_compound_op()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 22;
v1 = (unsigned int)(curtok - 65);
if ( (unsigned int)v1 <= 0x16 )
v0 = CSWTCH_34[v1];
return v0;
}

canonical_decompiled_code:
__int64 func7()
{
unsigned int v0; // er8
__int64 v1; // rax

v0 = 22;
v1 = (unsigned int)(curtok - 65);
if ( (unsigned int)v1 <= 0x16 )
v0 = CSWTCH_34[v1];
return v0;
}

original_code:
enum op_type curtok_to_compound_op(void)
{
 switch(curtok){
  case token_plus_assign: return op_plus;
  case token_minus_assign: return op_minus;
  case token_multiply_assign: return op_multiply;
  case token_divide_assign: return op_divide;
  case token_modulus_assign: return op_modulus;
  case token_not_assign: return op_not;
  case token_bnot_assign: return op_bnot;
  case token_and_assign: return op_and;
  case token_or_assign: return op_or;
  case token_xor_assign: return op_xor;
  case token_shiftl_assign: return op_shiftl;
  case token_shiftr_assign: return op_shiftr;
  default:
   break;
 }
 return op_unknown;
}

canonical_original_code:
enum op_type curtok_to_compound_op()
{
 switch(curtok){
  case token_plus_assign: return op_plus;
  case token_minus_assign: return op_minus;
  case token_multiply_assign: return op_multiply;
  case token_divide_assign: return op_divide;
  case token_modulus_assign: return op_modulus;
  case token_not_assign: return op_not;
  case token_bnot_assign: return op_bnot;
  case token_and_assign: return op_and;
  case token_or_assign: return op_or;
  case token_xor_assign: return op_xor;
  case token_shiftl_assign: return op_shiftl;
  case token_shiftr_assign: return op_shiftr;
  default:
   break;
 }
 return op_unknown;
}

user_defined_types: enum op_type { op_multiply=0, op_divide=1, op_modulus=2, op_plus=3, op_minus=4, op_xor=5, op_or=6, op_and=7, op_orsc=8, op_andsc=9, op_shiftl=10, op_shiftr=11, op_not=12, op_bnot=13, op_eq=14, op_ne=15, op_le=16, op_lt=17, op_ge=18, op_gt=19, op_signbit=20, op_no_signbit=21, op_unknown=22 }


decompiled_code:
_BOOL8 curtok_is_compound_assignment()
{
return (unsigned int)curtok_to_compound_op() != 22;
}

canonical_decompiled_code:
_BOOL8 func8()
{
return (unsigned int)func7() != 22;
}

original_code:
int curtok_is_compound_assignment(void)
{
 return curtok_to_compound_op() != op_unknown;
}

canonical_original_code:
int curtok_is_compound_assignment()
{
 return curtok_to_compound_op() != op_unknown;
}


decompiled_code:
char *__fastcall token_to_str(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 0x66 )
result = CSWTCH_37[a1];
return result;
}

canonical_decompiled_code:
char *__fastcall func9(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 0x66 )
result = CSWTCH_37[a1];
return result;
}

original_code:
char *token_to_str(enum token t)
{
 switch(t){
  case token_do: return "do";
  case token_if: return "if";
  case token_else: return "else";
  case token_while: return "while";
  case token_for: return "for";
  case token_break: return "break";
  case token_return: return "return";
  case token_switch: return "switch";
  case token_case: return "case";
  case token_default: return "default";
  case token_continue: return "continue";
  case token_goto: return "goto";
  case token_asm: return "asm";
  case token_sizeof: return "sizeof";
  case token_typeof: return "typeof";
    case token__Generic: return "_Generic";
    case token__Static_assert: return "_Static_assert";
  case token_extern: return "extern";
  case token_static: return "static";
  case token_auto: return "auto";
  case token_register: return "register";
  case token__Alignof: return "_Alignof";
  case token___alignof: return "__alignof";
  case token__Alignas: return "_Alignas";
  case token_inline: return "inline";
  case token__Noreturn: return "_Noreturn";
  case token_const: return "const";
  case token_volatile: return "volatile";
  case token_restrict: return "restrict";
  case token_void: return "void";
  case token_char: return "char";
  case token_short: return "short";
  case token_int: return "int";
  case token_long: return "long";
  case token_float: return "float";
  case token_double: return "double";
  case token__Bool: return "_Bool";
  case token_signed: return "signed";
  case token_unsigned: return "unsigned";
  case token_typedef: return "typedef";
  case token_struct: return "struct";
  case token_union: return "union";
  case token_enum: return "enum";
  case token___builtin_va_list: return "__builtin_va_list";
  case token_identifier: return "identifier";
  case token_character: return "character";
  case token_string: return "string";
  case token___extension__: return "__extension__";
  case token___auto_type: return "__auto_type";
  case token___label__: return "__label__";
  case token_integer: return "integer-literal";
  case token_floater: return "float-literal";
  case token_attribute: return "__attribute__";
  case token_elipsis: return "'...'";
  case token_open_paren: return "'('";
  case token_open_block: return "'{'";
  case token_open_square: return "'['";
  case token_close_paren: return "')'";
  case token_close_block: return "'}'";
  case token_close_square: return "']'";
  case token_comma: return "','";
  case token_semicolon: return "';'";
  case token_colon: return "':'";
  case token_plus: return "'+'";
  case token_minus: return "'-'";
  case token_multiply: return "'*'";
  case token_divide: return "'/'";
  case token_modulus: return "'%'";
  case token_increment: return "'++'";
  case token_decrement: return "'--'";
  case token_assign: return "'='";
  case token_dot: return "'.'";
  case token_eq: return "'=='";
  case token_le: return "'<='";
  case token_lt: return "'<'";
  case token_ge: return "'>='";
  case token_gt: return "'>'";
  case token_ne: return "'!='";
  case token_not: return "'!'";
  case token_bnot: return "'~'";
  case token_andsc: return "'&&'";
  case token_and: return "'&'";
  case token_orsc: return "'||'";
  case token_or: return "'|'";
  case token_xor: return "'^'";
  case token_question: return "'?'";
  case token_plus_assign: return "'+='";
  case token_minus_assign: return "'-='";
  case token_multiply_assign: return "'*='";
  case token_divide_assign: return "'/='";
  case token_modulus_assign: return "'%='";
  case token_not_assign: return "'!='";
  case token_bnot_assign: return "'~='";
  case token_and_assign: return "'&='";
  case token_or_assign: return "'|='";
  case token_xor_assign: return "'^='";
  case token_shiftl: return "'<<'";
  case token_shiftr: return "'>>'";
  case token_shiftl_assign: return "'<<='";
  case token_shiftr_assign: return "'>>='";
  case token_ptr: return "'->'";
  case token_eof: return "eof";
  case token_unknown: return ((void *)0);
 }
 return ((void *)0);
}

variable_types: enum token { token_do=0, token_if=1, token_else=2, token_while=3, token_for=4, token_break=5, token_continue=6, token_return=7, token_switch=8, token_case=9, token_default=10, token_goto=11, token__Generic=12, token_sizeof=13, token_typeof=14, token___auto_type=15, token__Static_assert=16, token_asm=17, token_attribute=18, token___extension__=19, token___label__=20, token_identifier=21, token_integer=22, token_floater=23, token_character=24, token_elipsis=25, token_string=26, token_void=27, token_char=28, token_short=29, token_int=30, token_long=31, token_float=32, token_double=33, token__Bool=34, token___builtin_va_list=35, token_inline=36, token__Noreturn=37, token_const=38, token_volatile=39, token_restrict=40, token_signed=41, token_unsigned=42, token_auto=43, token_static=44, token_extern=45, token_register=46, token__Alignof=47, token___alignof=48, token__Alignas=49, token_typedef=50, token_struct=51, token_union=52, token_enum=53, token_open_paren=54, token_open_block=55, token_open_square=56, token_close_paren=57, token_close_block=58, token_close_square=59, token_comma=60, token_semicolon=61, token_colon=62, token_question=63, token_plus=64, token_plus_assign=65, token_minus=66, token_minus_assign=67, token_multiply=68, token_multiply_assign=69, token_divide=70, token_divide_assign=71, token_modulus=72, token_modulus_assign=73, token_not=74, token_not_assign=75, token_bnot=76, token_bnot_assign=77, token_and=78, token_and_assign=79, token_or=80, token_or_assign=81, token_xor=82, token_xor_assign=83, token_shiftl=84, token_shiftl_assign=85, token_shiftr=86, token_shiftr_assign=87, token_increment=88, token_decrement=89, token_assign=90, token_dot=91, token_ptr=92, token_eq=93, token_le=94, token_lt=95, token_ge=96, token_gt=97, token_ne=98, token_andsc=99, token_orsc=100, token_eof=101, token_unknown=102 }


decompiled_code:
__int64 __fastcall eat_curtok_to_identifier(_DWORD *a1, __int64 a2)
{
char *v2; // rax
_DWORD *v3; // rdx
char *v4; // r12
__int64 result; // rax

if ( curtok == 21 )
{
*a1 = 1;
result = token_eat_identifier(0LL);
}
else if ( curtok > 0x15u && (unsigned int)(curtok - 27) > 0x1A )
{
*a1 = 0;
where_cc1_current(a2);
result = 0LL;
}
else
{
v2 = token_to_str(curtok);
*v3 = 0;
v4 = v2;
where_cc1_current(a2);
where_cc1_adj_identifier(a2, v4);
nexttoken();
result = (__int64)v4;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func10(_DWORD *a1, __int64 a2)
{
char *v2; // rax
_DWORD *v3; // rdx
char *v4; // r12
__int64 result; // rax

if ( curtok == 21 )
{
*a1 = 1;
result = token_eat_identifier(0LL);
}
else if ( curtok > 0x15u && (unsigned int)(curtok - 27) > 0x1A )
{
*a1 = 0;
where_cc1_current(a2);
result = 0LL;
}
else
{
v2 = func9(curtok);
*v3 = 0;
v4 = v2;
where_cc1_current(a2);
where_cc1_adj_identifier(a2, v4);
nexttoken();
result = (__int64)v4;
}
return result;
}

original_code:
char *eat_curtok_to_identifier(int *alloc, where *loc)
{
 switch(curtok){
  case token_do:
  case token_if:
  case token_else:
  case token_while:
  case token_for:
  case token_break:
  case token_return:
  case token_switch:
  case token_case:
  case token_default:
  case token_continue:
  case token_goto:
  case token_asm:
  case token_sizeof:
  case token_typeof:
  case token__Generic:
  case token__Static_assert:
  case token_extern:
  case token_static:
  case token_auto:
  case token_register:
  case token__Alignof:
  case token___alignof:
  case token__Alignas:
  case token_inline:
  case token__Noreturn:
  case token_const:
  case token_volatile:
  case token_restrict:
  case token_void:
  case token_char:
  case token_short:
  case token_int:
  case token_long:
  case token_float:
  case token_double:
  case token__Bool:
  case token_signed:
  case token_unsigned:
  case token_typedef:
  case token_struct:
  case token_union:
  case token_enum:
  case token___builtin_va_list:
  case token_attribute:
  case token___extension__:
  case token___auto_type:
  case token___label__:
  {
   char *str = token_to_str(curtok);
   *alloc = 0;
   where_cc1_current(loc);
   where_cc1_adj_identifier(loc, str);
   nexttoken();
   return str;
  }
  case token_identifier:
   *alloc = 1;
   return token_eat_identifier(((void *)0), loc);
  case token_integer:
  case token_floater:
  case token_character:
  case token_string:
  case token_elipsis:
  case token_open_paren:
  case token_open_block:
  case token_open_square:
  case token_close_paren:
  case token_close_block:
  case token_close_square:
  case token_comma:
  case token_semicolon:
  case token_colon:
  case token_plus:
  case token_minus:
  case token_multiply:
  case token_divide:
  case token_modulus:
  case token_increment:
  case token_decrement:
  case token_assign:
  case token_dot:
  case token_eq:
  case token_le:
  case token_lt:
  case token_ge:
  case token_gt:
  case token_ne:
  case token_not:
  case token_bnot:
  case token_andsc:
  case token_and:
  case token_orsc:
  case token_or:
  case token_xor:
  case token_question:
  case token_plus_assign:
  case token_minus_assign:
  case token_multiply_assign:
  case token_divide_assign:
  case token_modulus_assign:
  case token_not_assign:
  case token_bnot_assign:
  case token_and_assign:
  case token_or_assign:
  case token_xor_assign:
  case token_shiftl:
  case token_shiftr:
  case token_shiftl_assign:
  case token_shiftr_assign:
  case token_ptr:
  case token_eof:
  case token_unknown:
   break;
 }
 *alloc = 0;
 where_cc1_current(loc);
 return ((void *)0);
}

canonical_original_code:
char *eat_curtok_to_identifier(int *alloc, struct where *loc)
{
 switch(curtok){
  case token_do:
  case token_if:
  case token_else:
  case token_while:
  case token_for:
  case token_break:
  case token_return:
  case token_switch:
  case token_case:
  case token_default:
  case token_continue:
  case token_goto:
  case token_asm:
  case token_sizeof:
  case token_typeof:
  case token__Generic:
  case token__Static_assert:
  case token_extern:
  case token_static:
  case token_auto:
  case token_register:
  case token__Alignof:
  case token___alignof:
  case token__Alignas:
  case token_inline:
  case token__Noreturn:
  case token_const:
  case token_volatile:
  case token_restrict:
  case token_void:
  case token_char:
  case token_short:
  case token_int:
  case token_long:
  case token_float:
  case token_double:
  case token__Bool:
  case token_signed:
  case token_unsigned:
  case token_typedef:
  case token_struct:
  case token_union:
  case token_enum:
  case token___builtin_va_list:
  case token_attribute:
  case token___extension__:
  case token___auto_type:
  case token___label__:
  {
   char *str = token_to_str(curtok);
   *alloc = 0;
   where_cc1_current(loc);
   where_cc1_adj_identifier(loc, str);
   nexttoken();
   return str;
  }
  case token_identifier:
   *alloc = 1;
   return token_eat_identifier(((void *)0), loc);
  case token_integer:
  case token_floater:
  case token_character:
  case token_string:
  case token_elipsis:
  case token_open_paren:
  case token_open_block:
  case token_open_square:
  case token_close_paren:
  case token_close_block:
  case token_close_square:
  case token_comma:
  case token_semicolon:
  case token_colon:
  case token_plus:
  case token_minus:
  case token_multiply:
  case token_divide:
  case token_modulus:
  case token_increment:
  case token_decrement:
  case token_assign:
  case token_dot:
  case token_eq:
  case token_le:
  case token_lt:
  case token_ge:
  case token_gt:
  case token_ne:
  case token_not:
  case token_bnot:
  case token_andsc:
  case token_and:
  case token_orsc:
  case token_or:
  case token_xor:
  case token_question:
  case token_plus_assign:
  case token_minus_assign:
  case token_multiply_assign:
  case token_divide_assign:
  case token_modulus_assign:
  case token_not_assign:
  case token_bnot_assign:
  case token_and_assign:
  case token_or_assign:
  case token_xor_assign:
  case token_shiftl:
  case token_shiftr:
  case token_shiftl_assign:
  case token_shiftr_assign:
  case token_ptr:
  case token_eof:
  case token_unknown:
   break;
 }
 *alloc = 0;
 where_cc1_current(loc);
 return ((void *)0);
}

variable_types:
alloc
int *

variable_types: struct where { char *fname; unsigned int line; unsigned short chr; unsigned char is_sysh; } *

variable_types:
str
char *


decompiled_code:
__int64 __fastcall eat2(unsigned int a1, unsigned int a2)
{
unsigned int v3; // edi
unsigned int v4; // er12
char *v5; // rax

v3 = curtok;
if ( curtok != a1 )
{
parse_had_error = 1;
v4 = a2;
if ( curtok == 21 )
{
token_current_spel_peek();
v3 = curtok;
}
token_to_str(v3);
v5 = token_to_str(a1);
warn_at_print_error(0LL, "expecting token %s, got %s %s%s%s", v5);
if ( a2 == 2 )
_assert_fail("0 && \"invalid token parse state\"", "tokconv.c", 0x199u, "eat2");
if ( a2 || (--cc1_error_limit, cc1_error_limit <= 0) )
exit(1);
return v4;
}
if ( curtok_save == 102 )
{
nexttoken();
return 1;
}
curtok = curtok_save;
curtok_save = 102;
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func11(unsigned int a1, unsigned int a2)
{
unsigned int v3; // edi
unsigned int v4; // er12
char *v5; // rax

v3 = curtok;
if ( curtok != a1 )
{
parse_had_error = 1;
v4 = a2;
if ( curtok == 21 )
{
token_current_spel_peek();
v3 = curtok;
}
func9(v3);
v5 = func9(a1);
warn_at_print_error(0LL, "expecting token %s, got %s %s%s%s", v5);
if ( a2 == 2 )
_assert_fail("0 && \"invalid token parse state\"", "tokconv.c", 0x199u, "eat2");
if ( a2 || (--cc1_error_limit, cc1_error_limit <= 0) )
exit(1);
return v4;
}
if ( curtok_save == 102 )
{
nexttoken();
return 1;
}
curtok = curtok_save;
curtok_save = 102;
return 1LL;
}

original_code:
int eat2(enum token t, int die)
{
 if(t != curtok){
  const int ident = curtok == token_identifier;
  parse_had_error = 1;
  warn_at_print_error(((void *)0),
    "expecting token %s, got %s %s%s%s",
    token_to_str(t), token_to_str(curtok),
    ident ? "\"" : "",
    ident ? token_current_spel_peek() : "",
    ident ? "\"" : "");
  if(die == 2)
   ((0 && "invalid token parse state") ? (void) (0) : __assert_fail ("0 && \"invalid token parse state\"", "tokconv.c", 409, __extension__ __PRETTY_FUNCTION__));
  if(die || --cc1_error_limit <= 0)
   exit(1);
  return 0;
 }
 if(curtok_save != token_unknown){
  curtok = curtok_save;
  curtok_save = token_unknown;
 }else{
  nexttoken();
 }
 return 1;
}

canonical_original_code:
int eat2(enum token t, int die)
{
 if(t != curtok){
  int ident = curtok == token_identifier;
  parse_had_error = 1;
  warn_at_print_error(((void *)0),
    "expecting token %s, got %s %s%s%s",
    token_to_str(t), token_to_str(curtok),
    ident ? "\"" : "",
    ident ? token_current_spel_peek() : "",
    ident ? "\"" : "");
  if(die == 2)
   ((0 && "invalid token parse state") ? (void) (0) : __assert_fail ("0 && \"invalid token parse state\"", "tokconv.c", 409, __extension__ __PRETTY_FUNCTION__));
  if(die || --cc1_error_limit <= 0)
   exit(1);
  return 0;
 }
 if(curtok_save != token_unknown){
  curtok = curtok_save;
  curtok_save = token_unknown;
 }else{
  nexttoken();
 }
 return 1;
}

variable_types: die int

variable_types: ident int

user_defined_types: enum token { token_do=0, token_if=1, token_else=2, token_while=3, token_for=4, token_break=5, token_continue=6, token_return=7, token_switch=8, token_case=9, token_default=10, token_goto=11, token__Generic=12, token_sizeof=13, token_typeof=14, token___auto_type=15, token__Static_assert=16, token_asm=17, token_attribute=18, token___extension__=19, token___label__=20, token_identifier=21, token_integer=22, token_floater=23, token_character=24, token_elipsis=25, token_string=26, token_void=27, token_char=28, token_short=29, token_int=30, token_long=31, token_float=32, token_double=33, token__Bool=34, token___builtin_va_list=35, token_inline=36, token__Noreturn=37, token_const=38, token_volatile=39, token_restrict=40, token_signed=41, token_unsigned=42, token_auto=43, token_static=44, token_extern=45, token_register=46, token__Alignof=47, token___alignof=48, token__Alignas=49, token_typedef=50, token_struct=51, token_union=52, token_enum=53, token_open_paren=54, token_open_block=55, token_open_square=56, token_close_paren=57, token_close_block=58, token_close_square=59, token_comma=60, token_semicolon=61, token_colon=62, token_question=63, token_plus=64, token_plus_assign=65, token_minus=66, token_minus_assign=67, token_multiply=68, token_multiply_assign=69, token_divide=70, token_divide_assign=71, token_modulus=72, token_modulus_assign=73, token_not=74, token_not_assign=75, token_bnot=76, token_bnot_assign=77, token_and=78, token_and_assign=79, token_or=80, token_or_assign=81, token_xor=82, token_xor_assign=83, token_shiftl=84, token_shiftl_assign=85, token_shiftr=86, token_shiftr_assign=87, token_increment=88, token_decrement=89, token_assign=90, token_dot=91, token_ptr=92, token_eq=93, token_le=94, token_lt=95, token_ge=96, token_gt=97, token_ne=98, token_andsc=99, token_orsc=100, token_eof=101, token_unknown=102 }


uneat

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

if ( curtok_save == 102 )
{
result = curtok;
curtok = a1;
curtok_save = result;
}
else
{
ice("tokconv.c", 445LL, "uneat", "curtok regurgitate buffer full");
result = eat();
}
return result;
}

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

if ( curtok_save == 102 )
{
result = curtok;
curtok = a1;
curtok_save = result;
}
else
{
ice("tokconv.c", 445LL, "uneat", "curtok regurgitate buffer full");
result = func13();
}
return result;
}

original_code:
void uneat(enum token t)
{
 do if(!(curtok_save == token_unknown)) ice("tokconv.c", 445, __func__, "curtok regurgitate buffer full"); while(0);
 do if(!(curtok_save == token_identifier ? t != token_identifier : 1)) ice("tokconv.c", 449, __func__, "can't save another identifier"); while(0);
 curtok_save = curtok;
 curtok = t;
}


eat

decompiled_code:
__int64 __fastcall eat(unsigned int a1)
{
return eat2(a1, 0);
}

canonical_decompiled_code:
__int64 __fastcall func13(unsigned int a1)
{
return func11(a1, 0);
}

original_code:
int eat(enum token t)
{
 return eat2(t, 0);
}


decompiled_code:
__int64 __fastcall accept_where(unsigned int a1, __int64 a2)
{
if ( curtok != a1 )
return 0LL;
if ( a2 )
where_cc1_current(a2);
eat(a1);
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func14(unsigned int a1, __int64 a2)
{
if ( curtok != a1 )
return 0LL;
if ( a2 )
where_cc1_current(a2);
func13(a1);
return 1LL;
}

original_code:
int accept_where(enum token t, where *w)
{
 if(t == curtok){
  if(w)
   where_cc1_current(w);
  eat(t);
  return 1;
 }
 return 0;
}

canonical_original_code:
int accept_where(enum token t, struct where *w)
{
 if(t == curtok){
  if(w)
   where_cc1_current(w);
  eat(t);
  return 1;
 }
 return 0;
}


accept

decompiled_code:
__int64 __fastcall accept(unsigned int a1)
{
return accept_where(a1, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func15(unsigned int a1)
{
return func14(a1, 0LL);
}

original_code:
int accept(enum token t)
{
 return accept_where(t, ((void *)0));
}


decompiled_code:
__int64 __fastcall curtok_in_list(unsigned int *a1)
{
int v1; // ecx
int *v2; // rdx
int v3; // eax
unsigned int v4; // eax
int *v5; // rdx

v1 = curtok;
do
{
v4 = *a1;
if ( *a1 <= 0x2F )
{
v2 = (int *)(*((_QWORD *)a1 + 2) + v4);
*a1 = v4 + 8;
v3 = *v2;
if ( *v2 == 102 )
return 0LL;
}
else
{
v5 = (int *)*((_QWORD *)a1 + 1);
*((_QWORD *)a1 + 1) = v5 + 2;
v3 = *v5;
if ( *v5 == 102 )
return 0LL;
}
}
while ( v1 != v3 );
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func16(unsigned int *a1)
{
int v1; // ecx
int *v2; // rdx
int v3; // eax
unsigned int v4; // eax
int *v5; // rdx

v1 = curtok;
do
{
v4 = *a1;
if ( *a1 <= 0x2F )
{
v2 = (int *)(*((_QWORD *)a1 + 2) + v4);
*a1 = v4 + 8;
v3 = *v2;
if ( *v2 == 102 )
return 0LL;
}
else
{
v5 = (int *)*((_QWORD *)a1 + 1);
*((_QWORD *)a1 + 1) = v5 + 2;
v3 = *v5;
if ( *v5 == 102 )
return 0LL;
}
}
while ( v1 != v3 );
return 1LL;
}

original_code:
int curtok_in_list(va_list l)
{
 enum token t;
 while((enum token)(t = __builtin_va_arg(l,int)) != token_unknown)
  if(curtok == t)
   return 1;
 return 0;
}

canonical_original_code:
int curtok_in_list(__builtin_va_list l)
{
 enum token t;
 while((enum token)(t = __builtin_va_arg(l,int)) != token_unknown)
  if(curtok == t)
   return 1;
 return 0;
}


decompiled_code:
const char *str_stmt_continue()
{
return "continue";
}

canonical_decompiled_code:
const char *func0()
{
return "continue";
}

original_code:
const char *str_stmt_continue(void)
{
 return "continue";
}


decompiled_code:
const char *str_expr_addr()
{
return "address-of";
}

canonical_decompiled_code:
const char *func0()
{
return "address-of";
}

original_code:
const char *str_expr_addr(void)
{
 return "address-of";
}


decompiled_code:
char *__fastcall str_spc_skip(char *a1)
{
const unsigned __int16 *v2; // rdx

v2 = *_ctype_b_loc();
while ( (v2[*a1] & 0x2000) != 0 )
++a1;
return a1;
}

canonical_decompiled_code:
char *__fastcall func0(char *a1)
{
const unsigned __int16 *v2; // rdx

v2 = *_ctype_b_loc();
while ( (v2[*a1] & 0x2000) != 0 )
++a1;
return a1;
}

original_code:
char *str_spc_skip(const char *s)
{
 for(; ((*__ctype_b_loc ())[(int) ((*s))] & (unsigned short int) _ISspace); s++);
 return (char *)s;
}

canonical_original_code:
char *str_spc_skip(char *s)
{
 for(; ((*__ctype_b_loc ())[(int) ((*s))] & (unsigned short) _ISspace); s++);
 return (char *)s;
}

variable_types:
s
char *


decompiled_code:
_BOOL8 __fastcall str_endswith(const char *a1, const char *a2)
{
size_t v2; // rbp
size_t v3; // rax
_BOOL4 v4; // er8

v2 = strlen(a1);
v3 = strlen(a2);
v4 = 0;
if ( v2 >= v3 )
v4 = strcmp(&a1[v2 - v3], a2) == 0;
return v4;
}

canonical_decompiled_code:
_BOOL8 __fastcall func1(const char *a1, const char *a2)
{
size_t v2; // rbp
size_t v3; // rax
_BOOL4 v4; // er8

v2 = strlen(a1);
v3 = strlen(a2);
v4 = 0;
if ( v2 >= v3 )
v4 = strcmp(&a1[v2 - v3], a2) == 0;
return v4;
}

original_code:
int str_endswith(const char *haystack, const char *needle)
{
 size_t h_l = strlen(haystack);
 size_t n_l = strlen(needle);
 if(n_l > h_l)
  return 0;
 return !strcmp(haystack + h_l - n_l, needle);
}

canonical_original_code:
int str_endswith(char *haystack, char *needle)
{
 unsigned long h_l = strlen(haystack);
 unsigned long n_l = strlen(needle);
 if(n_l > h_l)
  return 0;
 return !strcmp(haystack + h_l - n_l, needle);
}

variable_types:
haystack
char *

variable_types:
needle
char *


xsnprintf

decompiled_code:
int xsnprintf(char *a1, size_t a2, const char *a3, ...)
{
int result; // eax
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a3);
result = vsnprintf(a1, a2, a3, arg);
if ( result < 0 || result >= (int)a2 )
{
fwrite("snprintf() overflow\n", 1uLL, 0x14uLL, stderr);
abort();
}
return result;
}

canonical_decompiled_code:
int func2(char *a1, size_t a2, const char *a3, ...)
{
int result; // eax
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a3);
result = vsnprintf(a1, a2, a3, arg);
if ( result < 0 || result >= (int)a2 )
{
fwrite("snprintf() overflow\n", 1uLL, 0x14uLL, stderr);
abort();
}
return result;
}

original_code:
int xsnprintf(char *buf, size_t len, const char *fmt, ...)
{
 va_list l;
 int desired_space;
 __builtin_va_start(l,fmt);
 desired_space = vsnprintf(buf, len, fmt, l);
 __builtin_va_end(l);
 if(desired_space < 0 || desired_space >= (int)len){
  fprintf(stderr, "snprintf() overflow\n");
  abort();
 }
 return desired_space;
}

canonical_original_code:
int xsnprintf(char *buf, unsigned long len, char *fmt, ...)
{
 __builtin_va_list l;
 int desired_space;
 __builtin_va_start(l,fmt);
 desired_space = vsnprintf(buf, len, fmt, l);
 __builtin_va_end(l);
 if(desired_space < 0 || desired_space >= (int)len){
  fprintf(stderr, "snprintf() overflow\n");
  abort();
 }
 return desired_space;
}

variable_types:
buf
char *

variable_types:
fmt
char *


decompiled_code:
__int64 __fastcall target_details_from_triple(__int64 a1, __int64 a2)
{
__int64 v2; // rax
int v3; // edx
__int64 result; // rax

v2 = *(unsigned int *)(a1 + 8);
*(_QWORD *)a2 = &section_names[10 * v2];
*(_QWORD *)(a2 + 8) = asconfig[v2];
*(_DWORD *)(a2 + 16) = ld_indirect_call_via_plts[v2];
*(_DWORD *)(a2 + 20) = ld_indirect_call_via_plts[v2];
v3 = ld_indirect_call_via_plts[v2];
result = (unsigned int)dtor_via_ctor_atexit[v2];
*(_DWORD *)(a2 + 24) = v3;
*(_DWORD *)(a2 + 28) = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2)
{
__int64 v2; // rax
int v3; // edx
__int64 result; // rax

v2 = *(unsigned int *)(a1 + 8);
*(_QWORD *)a2 = &section_names[10 * v2];
*(_QWORD *)(a2 + 8) = asconfig[v2];
*(_DWORD *)(a2 + 16) = ld_indirect_call_via_plts[v2];
*(_DWORD *)(a2 + 20) = ld_indirect_call_via_plts[v2];
v3 = ld_indirect_call_via_plts[v2];
result = (unsigned int)dtor_via_ctor_atexit[v2];
*(_DWORD *)(a2 + 24) = v3;
*(_DWORD *)(a2 + 28) = result;
return result;
}

original_code:
void target_details_from_triple(const struct triple *triple, struct target_details *details)
{
 details->section_names = &section_names[triple->sys];
 details->as = asconfig[triple->sys];
 details->dwarf_link_stmt_list = dwarf_link_stmt_list[triple->sys];
 details->ld_indirect_call_via_plt = ld_indirect_call_via_plts[triple->sys];
 details->alias_variables = alias_variables[triple->sys];
 details->dtor_via_ctor_atexit = dtor_via_ctor_atexit[triple->sys];
}

canonical_original_code:
void target_details_from_triple(struct triple *triple, struct target_details *details)
{
 details->section_names = &section_names[triple->sys];
 details->as = asconfig[triple->sys];
 details->dwarf_link_stmt_list = dwarf_link_stmt_list[triple->sys];
 details->ld_indirect_call_via_plt = ld_indirect_call_via_plts[triple->sys];
 details->alias_variables = alias_variables[triple->sys];
 details->dtor_via_ctor_atexit = dtor_via_ctor_atexit[triple->sys];
}

variable_types: struct triple { enum arch { ARCH_x86_64=0, ARCH_i386=1 } arch; enum vendor { VENDOR_pc=0, VENDOR_apple=1 } vendor; enum sys { SYS_linux=0, SYS_freebsd=1, SYS_darwin=2, SYS_cygwin=3 } sys; enum abi { ABI_gnu=0, ABI_macho=1, ABI_elf=2 } abi; } *

variable_types: struct target_details { struct target_section_names { char *section_name_text; char *section_name_data; char *section_name_bss; char *section_name_rodata; char *section_name_relro; char *section_name_ctors; char *section_name_dtors; char *section_name_dbg_abbrev; char *section_name_dbg_info; char *section_name_dbg_line; } *section_names; struct target_as { struct { char *weak; char *visibility_hidden; char *no_dead_strip; } directives; char *privatelbl_prefix; int supports_visibility_protected; int supports_local_common; int stack_protector_via_tls; int supports_type_and_size; int supports_section_flags; int expr_inline; } *as; int dwarf_link_stmt_list; int ld_indirect_call_via_plt; int alias_variables; int dtor_via_ctor_atexit; } *

user_defined_types: struct triple { enum arch arch; enum vendor vendor; enum sys sys; enum abi abi; }

user_defined_types: struct target_details { struct target_section_names *section_names; struct target_as *as; int dwarf_link_stmt_list; int ld_indirect_call_via_plt; int alias_variables; int dtor_via_ctor_atexit; }


decompiled_code:
_BOOL8 __fastcall should_use_libc(unsigned __int64 a1)
{
if ( cc1_fopt[2] || cc1_mstringop_strategy == 1 )
return 0LL;
if ( cc1_mstringop_strategy == 2 )
return cc1_mstringop_threshold <= a1;
if ( cc1_mstringop_strategy )
_assert_fail("0 && \"unreachable\"", "out/mem.c", 0x2Cu, "should_use_libc");
return 1LL;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(unsigned __int64 a1)
{
if ( cc1_fopt[2] || cc1_mstringop_strategy == 1 )
return 0LL;
if ( cc1_mstringop_strategy == 2 )
return cc1_mstringop_threshold <= a1;
if ( cc1_mstringop_strategy )
_assert_fail("0 && \"unreachable\"", "out/mem.c", 0x2Cu, "should_use_libc");
return 1LL;
}

original_code:
static int should_use_libc(unsigned long nbytes)
{
 if(cc1_fopt.freestanding)
  return 0;
 switch(cc1_mstringop_strategy){
  case STRINGOP_STRATEGY_LIBCALL:
   return 1;
  case STRINGOP_STRATEGY_LOOP:
   return 0;
  case STRINGOP_STRATEGY_THRESHOLD:
   return nbytes >= cc1_mstringop_threshold;
 }
 ((0 && "unreachable") ? (void) (0) : __assert_fail ("0 && \"unreachable\"", "out/mem.c", 44, __extension__ __PRETTY_FUNCTION__));
}

variable_types:
nbytes
unsigned long


decompiled_code:
int __fastcall ice_msg(const char *a1, const char *a2, unsigned int a3, const char *a4, const char *a5, void *a6)
{
__int64 v10; // rax
const char *v11; // rax

v10 = default_where(0LL);
v11 = (const char *)where_str(v10);
fprintf(stderr, "%s: %s %s:%d (%s): ", v11, a1, a2, a3, a4);
vfprintf(stderr, a5, a6);
return fputc(10, stderr);
}

canonical_decompiled_code:
int __fastcall func0(const char *a1, const char *a2, unsigned int a3, const char *a4, const char *a5, void *a6)
{
__int64 v10; // rax
const char *v11; // rax

v10 = default_where(0LL);
v11 = (const char *)where_str(v10);
fprintf(stderr, "%s: %s %s:%d (%s): ", v11, a1, a2, a3, a4);
vfprintf(stderr, a5, a6);
return fputc(10, stderr);
}

original_code:
static void ice_msg(const char *pre,
  const char *f, int line, const char *fn, const char *fmt, va_list l)
{
 const struct where *w = default_where(((void *)0));
 fprintf(stderr, "%s: %s %s:%d (%s): ",
   where_str(w), pre, f, line, fn);
 vfprintf(stderr, fmt, l);
 fputc('\n', stderr);
}

canonical_original_code:
static void ice_msg(char *pre, char *f, int line, char *fn, char *fmt, __builtin_va_list l)
{
 struct where *w = default_where(((void *)0));
 fprintf(stderr, "%s: %s %s:%d (%s): ",
   where_str(w), pre, f, line, fn);
 vfprintf(stderr, fmt, l);
 fputc('\n', stderr);
}

variable_types:
pre
char *

variable_types:
f
char *

variable_types: line int

variable_types:
fn
char *


icw

decompiled_code:
int icw(const char *a1, unsigned int a2, const char *a3, const char *a4, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a4);
return ice_msg("ICW", a1, a2, a3, a4, va);
}

canonical_decompiled_code:
int func2(const char *a1, unsigned int a2, const char *a3, const char *a4, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a4);
return func0("ICW", a1, a2, a3, a4, va);
}

original_code:
void icw(const char *f, int line, const char *fn, const char *fmt, ...)
{
 va_list l;
 __builtin_va_start(l,fmt);
 ice_msg("ICW", f, line, fn, fmt, l);
 __builtin_va_end(l);
}

canonical_original_code:
void icw(char *f, int line, char *fn, char *fmt, ...)
{
 __builtin_va_list l;
 __builtin_va_start(l,fmt);
 ice_msg("ICW", f, line, fn, fmt, l);
 __builtin_va_end(l);
}


udirname

decompiled_code:
__int64 __fastcall udirname(const char *a1)
{
char *v1; // rax
char *v2; // rbx
__int64 result; // rax

v1 = strrchr(a1, 47);
if ( !v1 )
return ustrdup("./");
v2 = v1;
result = ustrdup(a1);
*(_BYTE *)(result + v2 - a1) = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(const char *a1)
{
char *v1; // rax
char *v2; // rbx
__int64 result; // rax

v1 = strrchr(a1, 47);
if ( !v1 )
return ustrdup("./");
v2 = v1;
result = ustrdup(a1);
*(_BYTE *)(result + v2 - a1) = 0;
return result;
}

original_code:
char *udirname(const char *f)
{
 const char *fin;
 fin = strrchr(f, '/');
 if(fin){
  char *dup = ustrdup(f);
  dup[fin - f] = '\0';
  return dup;
 }else{
  return ustrdup("./");
 }
}

canonical_original_code:
char *udirname(char *f)
{
 char *fin;
 fin = strrchr(f, '/');
 if(fin){
  char *dup = ustrdup(f);
  dup[fin - f] = '\0';
  return dup;
 }else{
  return ustrdup("./");
 }
}

variable_types:
fin
char *

variable_types:
dup
char *


decompiled_code:
char *__fastcall ext_replace(char *src, char *s)
{
char *v2; // rax
char *v3; // rbx
size_t v4; // r13
size_t v5; // rax
char *v6; // r13

v2 = strrchr(src, 46);
if ( !v2 )
return (char *)ustrdup(src);
v3 = v2;
v4 = strlen(s);
v5 = strlen(src);
v6 = (char *)umalloc(v4 + v5);
strcpy(v6, src);
sprintf(&v6[v3 - src], ".%s", s);
return v6;
}

canonical_decompiled_code:
char *__fastcall func4(char *src, char *s)
{
char *v2; // rax
char *v3; // rbx
size_t v4; // r13
size_t v5; // rax
char *v6; // r13

v2 = strrchr(src, 46);
if ( !v2 )
return (char *)ustrdup(src);
v3 = v2;
v4 = strlen(s);
v5 = strlen(src);
v6 = (char *)umalloc(v4 + v5);
strcpy(v6, src);
sprintf(&v6[v3 - src], ".%s", s);
return v6;
}

original_code:
char *ext_replace(const char *str, const char *ext)
{
 char *dot;
 dot = strrchr(str, '.');
 if(dot){
  char *dup;
  dup = umalloc(strlen(ext) + strlen(str));
  strcpy(dup, str);
  sprintf(dup + (dot - str), ".%s", ext);
  return dup;
 }else{
  return ustrdup(str);
 }
}

canonical_original_code:
char *ext_replace(char *str, char *ext)
{
 char *dot;
 dot = strrchr(str, '.');
 if(dot){
  char *dup;
  dup = umalloc(strlen(ext) + strlen(str));
  strcpy(dup, str);
  sprintf(dup + (dot - str), ".%s", ext);
  return dup;
 }else{
  return ustrdup(str);
 }
}

variable_types:
str
char *

variable_types:
ext
char *

variable_types:
dot
char *


ice

decompiled_code:
void __noreturn ice(const char *a1, unsigned int a2, const char *a3, const char *a4, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a4);
ice_msg("ICE", a1, a2, a3, a4, va);
abort();
}

canonical_decompiled_code:
void __noreturn func1(const char *a1, unsigned int a2, const char *a3, const char *a4, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a4);
func0("ICE", a1, a2, a3, a4, va);
abort();
}

original_code:
void ice(const char *f, int line, const char *fn, const char *fmt, ...)
{
 va_list l;
 __builtin_va_start(l,fmt);
 ice_msg("ICE", f, line, fn, fmt, l);
 __builtin_va_end(l);
 abort();
}

canonical_original_code:
void ice(char *f, int line, char *fn, char *fmt, ...)
{
 __builtin_va_list l;
 __builtin_va_start(l,fmt);
 ice_msg("ICE", f, line, fn, fmt, l);
 __builtin_va_end(l);
 abort();
}


decompiled_code:
__int64 __fastcall decl_cmp_ctor_pri(_QWORD *a1, __int64 *a2)
{
return decl_cmp_ctor_dtor_pri(a1, a2, 0x13u);
}

canonical_decompiled_code:
__int64 __fastcall func1(_QWORD *a1, __int64 *a2)
{
return func0(a1, a2, 0x13u);
}

original_code:
static int decl_cmp_ctor_pri(const void *a, const void *b)
{
 return decl_cmp_ctor_dtor_pri(a, b, attr_constructor);
}

canonical_original_code:
static int decl_cmp_ctor_pri(void *a, void *b)
{
 return decl_cmp_ctor_dtor_pri(a, b, attr_constructor);
}

variable_types:
a
void *

variable_types:
b
void *


decompiled_code:
__int64 __fastcall decl_cmp_dtor_pri(_QWORD *a1, __int64 *a2)
{
return decl_cmp_ctor_dtor_pri(a1, a2, 0x14u);
}

canonical_decompiled_code:
__int64 __fastcall func2(_QWORD *a1, __int64 *a2)
{
return func0(a1, a2, 0x14u);
}

original_code:
static int decl_cmp_dtor_pri(const void *a, const void *b)
{
 return decl_cmp_ctor_dtor_pri(a, b, attr_destructor);
}

canonical_original_code:
static int decl_cmp_dtor_pri(void *a, void *b)
{
 return decl_cmp_ctor_dtor_pri(a, b, attr_destructor);
}


decompiled_code:
const char *str_expr_assign_compound()
{
return "compound-assignment";
}

canonical_decompiled_code:
const char *func0()
{
return "compound-assignment";
}

original_code:
const char *str_expr_assign_compound(void)
{
 return "compound-assignment";
}


decompiled_code:
__int64 __fastcall in_array(char *s1, const char **a2)
{
const char **v2; // rbx
const char *v3; // rsi

v2 = a2;
v3 = *a2;
if ( !v3 )
return 0LL;
while ( strcmp(s1, v3) )
{
v3 = v2[1];
++v2;
if ( !v3 )
return 0LL;
}
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(char *s1, const char **a2)
{
const char **v2; // rbx
const char *v3; // rsi

v2 = a2;
v3 = *a2;
if ( !v3 )
return 0LL;
while ( strcmp(s1, v3) )
{
v3 = v2[1];
++v2;
if ( !v3 )
return 0LL;
}
return 1LL;
}

original_code:
static int in_array(const char *needle, const char *haystack[])
{
 const char **i;
 for(i = haystack; *i; i++)
  if(!strcmp(needle, *i))
   return 1;
 return 0;
}

canonical_original_code:
static int in_array(char *needle, char *haystack[])
{
 char **i;
 for(i = haystack; *i; i++)
  if(!strcmp(needle, *i))
   return 1;
 return 0;
}

variable_types:
needle
char *

variable_types:
haystack
char *[]

variable_types:
i
char **


decompiled_code:
__int64 __fastcall warning_owner(char *s1)
{
char *v1; // rbp
int v2; // edx
unsigned int v3; // er12
unsigned int v4; // er12

v1 = s1;
if ( *s1 == 110 && s1[1] == 111 && s1[2] == 45 )
v1 = s1 + 3;
v2 = 0;
if ( !memcmp(v1, "error=", 6uLL) )
{
v1 += 6;
v2 = 1;
}
if ( !strcmp(v1, "all") || !strcmp(v1, "everything") )
return (unsigned int)(3 - v2);
v3 = 2;
if ( !strcmp(v1, "extra") || !strcmp(v1, "error") || !*v1 || !strcmp(v1, "gnu") )
return v3;
v4 = 0;
if ( !v2 )
v4 = in_array(v1, (const char **)wcpp) != 0;
if ( (unsigned int)in_array(v1, (const char **)wcc1) )
v4 |= 2u;
return v4;
}

canonical_decompiled_code:
__int64 __fastcall func1(char *s1)
{
char *v1; // rbp
int v2; // edx
unsigned int v3; // er12
unsigned int v4; // er12

v1 = s1;
if ( *s1 == 110 && s1[1] == 111 && s1[2] == 45 )
v1 = s1 + 3;
v2 = 0;
if ( !memcmp(v1, "error=", 6uLL) )
{
v1 += 6;
v2 = 1;
}
if ( !strcmp(v1, "all") || !strcmp(v1, "everything") )
return (unsigned int)(3 - v2);
v3 = 2;
if ( !strcmp(v1, "extra") || !strcmp(v1, "error") || !*v1 || !strcmp(v1, "gnu") )
return v3;
v4 = 0;
if ( !v2 )
v4 = func0(v1, (const char **)wcpp) != 0;
if ( (unsigned int)func0(v1, (const char **)wcc1) )
v4 |= 2u;
return v4;
}

original_code:
enum warning_owner warning_owner(const char *arg)
{
 enum warning_owner owner = 0;
 int is_werror = 0;
 if(!strncmp(arg, "no-", 3))
  arg += 3;
 if(!strncmp(arg, "error=", 6)){
  is_werror = 1;
  arg += 6;
 }
 if(!strcmp(arg, "all")
 || !strcmp(arg, "everything"))
 {
  return W_OWNER_CC1 | (is_werror ? 0 : W_OWNER_CPP);
 }
 if(!strcmp(arg, "extra")
 || !strcmp(arg, "error")
 || !*arg )
 {
  return W_OWNER_CC1;
 }
 if(!strcmp(arg, "gnu"))
  return W_OWNER_CC1;
 if(!is_werror && in_array(arg, wcpp))
  owner |= W_OWNER_CPP;
 if(in_array(arg, wcc1))
  owner |= W_OWNER_CC1;
 return owner;
}

canonical_original_code:
enum warning_owner warning_owner(char *arg)
{
 enum warning_owner owner = 0;
 int is_werror = 0;
 if(!strncmp(arg, "no-", 3))
  arg += 3;
 if(!strncmp(arg, "error=", 6)){
  is_werror = 1;
  arg += 6;
 }
 if(!strcmp(arg, "all")
 || !strcmp(arg, "everything"))
 {
  return W_OWNER_CC1 | (is_werror ? 0 : W_OWNER_CPP);
 }
 if(!strcmp(arg, "extra")
 || !strcmp(arg, "error")
 || !*arg )
 {
  return W_OWNER_CC1;
 }
 if(!strcmp(arg, "gnu"))
  return W_OWNER_CC1;
 if(!is_werror && in_array(arg, wcpp))
  owner |= W_OWNER_CPP;
 if(in_array(arg, wcc1))
  owner |= W_OWNER_CC1;
 return owner;
}

variable_types:
arg
char *

variable_types: enum warning_owner { W_OWNER_CPP=expr, W_OWNER_CC1=expr }


decompiled_code:
const char *str_expr_deref()
{
return "dereference";
}

canonical_decompiled_code:
const char *func0()
{
return "dereference";
}

original_code:
const char *str_expr_deref(void)
{
 return "dereference";
}


decompiled_code:
void *str_stmt_if()
{
return &unk_41B;
}

canonical_decompiled_code:
void *func1()
{
return &unk_41B;
}

original_code:
const char *str_stmt_if(void)
{
 return "if";
}

canonical_original_code:
char *str_stmt_if()
{
 return "if";
}


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

result = umalloc(32LL);
*(_DWORD *)result = 1;
*(_QWORD *)(result + 8) = out_dbg_label_free;
*(_QWORD *)(result + 16) = a1;
return result;
}

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

result = umalloc(32LL);
*(_DWORD *)result = 1;
*(_QWORD *)(result + 8) = out_dbg_label_free;
*(_QWORD *)(result + 16) = a1;
return result;
}

original_code:
static struct out_dbg_lbl *dbg_lbl_new(char *strlbl)
{
 struct out_dbg_lbl *lbl = umalloc(sizeof *lbl);
 (lbl)->rc.retains = 1, (lbl)->rc.pfree = (retain_free_f *)(&out_dbg_label_free);
 lbl->lbl = strlbl;
 return lbl;
}

canonical_original_code:
static struct out_dbg_lbl *dbg_lbl_new(char *strlbl)
{
 struct out_dbg_lbl *lbl = umalloc(sizeof *lbl);
 (lbl)->rc.retains = 1, (lbl)->rc.pfree = (void (*)(void *))(&out_dbg_label_free);
 lbl->lbl = strlbl;
 return lbl;
}

variable_types:
strlbl
char *

variable_types: struct out_dbg_lbl { struct retain { unsigned int retains; void (*pfree)(void *); } rc; char *lbl; int emitted; } *

user_defined_types: struct out_dbg_lbl { struct retain rc; char *lbl; int emitted; }


decompiled_code:
void __fastcall out_dbg_label_free(void *ptr)
{
free(*((void **)ptr + 2));
free(ptr);
}

canonical_decompiled_code:
void __fastcall func2(void *ptr)
{
free(*((void **)ptr + 2));
free(ptr);
}

original_code:
static void out_dbg_label_free(struct out_dbg_lbl *lbl)
{
 free(lbl->lbl);
 free(lbl);
}

user_defined_types: struct retain { unsigned int retains; void (*pfree)(void *); }


decompiled_code:
__int64 __fastcall out_dbg_label_emitted(__int64 a1, _QWORD *a2)
{
if ( a2 )
*a2 = *(_QWORD *)(a1 + 16);
return *(unsigned int *)(a1 + 24);
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, _QWORD *a2)
{
if ( a2 )
*a2 = *(_QWORD *)(a1 + 16);
return *(unsigned int *)(a1 + 24);
}

original_code:
int out_dbg_label_emitted(struct out_dbg_lbl *lbl, const char **out_lbl)
{
 if(out_lbl)
  *out_lbl = lbl->lbl;
 return lbl->emitted;
}

canonical_original_code:
int out_dbg_label_emitted(struct out_dbg_lbl *lbl, char **out_lbl)
{
 if(out_lbl)
  *out_lbl = lbl->lbl;
 return lbl->emitted;
}


decompiled_code:
_BOOL8 __fastcall out_dbg_label_shouldemit(__int64 a1, _QWORD *a2)
{
return (unsigned int)out_dbg_label_emitted(a1, a2) == 0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func6(__int64 a1, _QWORD *a2)
{
return (unsigned int)func5(a1, a2) == 0;
}

original_code:
int out_dbg_label_shouldemit(struct out_dbg_lbl *lbl, const char **out_lbl)
{
 return !out_dbg_label_emitted(lbl, out_lbl);
}

canonical_original_code:
int out_dbg_label_shouldemit(struct out_dbg_lbl *lbl, char **out_lbl)
{
 return !out_dbg_label_emitted(lbl, out_lbl);
}


decompiled_code:
__int64 __fastcall emit_lbl(__int64 a1)
{
__int64 result; // rax
__int64 v2; // r8
bool v3; // zf

result = out_dbg_label_shouldemit(a1, 0LL);
if ( (_DWORD)result )
{
result = asm_out_section(v2, "%s:\n", *(const char **)(a1 + 16));
v3 = (*(_DWORD *)a1)-- == 1;
*(_DWORD *)(a1 + 24) = 1;
if ( v3 )
return (*(__int64 (__fastcall **)(__int64))(a1 + 8))(a1);
}
else if ( a1 )
{
v3 = (*(_DWORD *)a1)-- == 1;
if ( v3 )
return (*(__int64 (__fastcall **)(__int64))(a1 + 8))(a1);
}
return result;
}

original_code:
static void emit_lbl(struct out_dbg_lbl *lbl, const struct section *sec)
{
 if(out_dbg_label_shouldemit(lbl, ((void *)0))){
  asm_out_section(sec, "%s:\n", lbl->lbl);
  lbl->emitted = 1;
 }
 do{ if(lbl && --(lbl)->rc.retains == 0) (lbl)->rc.pfree(lbl); }while(0);
}

canonical_original_code:
static void emit_lbl(struct out_dbg_lbl *lbl, struct section *sec)
{
 if(out_dbg_label_shouldemit(lbl, ((void *)0))){
  asm_out_section(sec, "%s:\n", lbl->lbl);
  lbl->emitted = 1;
 }
 do{ if(lbl && --(lbl)->rc.retains == 0) (lbl)->rc.pfree(lbl); }while(0);
}

variable_types: struct section { char *name; int builtin; enum section_flags { SECTION_FLAG_EXECUTABLE=expr, SECTION_FLAG_RO=expr } flags; } *

user_defined_types: struct section { char *name; int builtin; enum section_flags flags; }


decompiled_code:
const char *str_expr_comma()
{
return "comma";
}

canonical_decompiled_code:
const char *func0()
{
return "comma";
}

original_code:
const char *str_expr_comma(void)
{
 return "comma";
}