decompiled_code:
void *child_struc_create()
{
return calloc(1uLL, 0x20uLL);
}

canonical_decompiled_code:
void *func7()
{
return calloc(1uLL, 0x20uLL);
}

original_code:
child_struc_ptr
child_struc_create(void)
{
        child_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(child_data));
        return this_struc;
}

canonical_original_code:
struct child_struc *child_struc_create()
{
        struct child_struc *this_struc;
 this_struc = calloc(1, sizeof(child_data));
        return this_struc;
}

variable_types: struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc { struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; } *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *this_sample; unsigned long this_rva; struct hash_struc *next; } *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *rva_list; struct function_struc *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *first_module; struct pointer_struc *module_list; struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *first_mmap; struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct process_struc *parent; } *

user_defined_types: struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; }


repo: pwaller/gooda

decompiled_code:
_QWORD *sample_struc_create()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x90uLL);
if ( v0 )
{
v1 = get_count(1LL, 144LL);
v2 = calloc(v1, 4uLL);
v0[10] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

canonical_decompiled_code:
_QWORD *func8()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x90uLL);
if ( v0 )
{
v1 = func0(1LL, 144LL);
v2 = calloc(v1, 4uLL);
v0[10] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

original_code:
sample_struc_ptr
sample_struc_create(void)
{
        sample_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(sample_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
        return this_struc;
}

canonical_original_code:
struct sample_struc *sample_struc_create()
{
        struct sample_struc *this_struc;
 this_struc = calloc(1, sizeof(sample_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
        return this_struc;
}

variable_types: struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; } *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc { struct sample_struc *this_sample; unsigned long this_rva; struct hash_struc *next; } *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *rva_list; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; } *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *first_module; struct pointer_struc *module_list; struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *first_mmap; struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *

user_defined_types: struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; }

user_defined_types: struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc *first_child; struct thread_struc *first_thread; struct module_struc *first_module; struct pointer_struc *module_list; struct mmap_struc *first_mmap; struct comm_struc *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; }

user_defined_types: struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc *this_table; struct sample_struc *first_sample; struct pointer_struc *rva_list; struct function_struc *first_function; struct function_struc *current_function; struct functionlist_struc *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; }

user_defined_types: struct rva_hash_struc { int size; int entries; struct hash_struc *this_array; }

user_defined_types: struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc *first_asm; struct basic_block_struc *first_bb; struct source_line_struc *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc *source_file; struct principal_file_struc *principal_file; struct file_list_struc *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; }

user_defined_types: struct functionlist_struc { struct function_location *list; int size; }

user_defined_types: struct func_branch_struc { struct func_branch_struc *next; struct branch_struc *this_branch_target; struct branch_site_struc *branch_site_stack; }


decompiled_code:
void *branch_struc_create()
{
return calloc(1uLL, 0x40uLL);
}

canonical_decompiled_code:
void *func9()
{
return calloc(1uLL, 0x40uLL);
}

original_code:
branch_struc_ptr
branch_struc_create(void)
{
 branch_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(branch_data));
 return this_struc;
}

canonical_original_code:
struct branch_struc *branch_struc_create()
{
 struct branch_struc *this_struc;
 this_struc = calloc(1,sizeof(branch_data));
 return this_struc;
}

variable_types: struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc { struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; } *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc *first_module; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *module_list; struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *first_mmap; struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *this_sample; unsigned long this_rva; struct hash_struc *next; } *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc *rva_list; struct function_struc *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *this_module; struct function_struc *this_function; int count; } *

user_defined_types: struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; }

user_defined_types: struct hash_struc { struct sample_struc *this_sample; unsigned long this_rva; struct hash_struc *next; }


decompiled_code:
void *hash_struc_create()
{
return calloc(1uLL, 0x18uLL);
}

canonical_decompiled_code:
void *func10()
{
return calloc(1uLL, 0x18uLL);
}

original_code:
hash_struc_ptr
hash_struc_create(void)
{
 hash_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(hash_data));
 return this_struc;
}

canonical_original_code:
struct hash_struc *hash_struc_create()
{
 struct hash_struc *this_struc;
 this_struc = calloc(1, sizeof(hash_data));
 return this_struc;
}

variable_types: struct hash_struc { struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; } *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *rva_list; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; } *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *first_module; struct pointer_struc *module_list; struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *first_mmap; struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *this_sample; unsigned long this_rva; struct hash_struc *next; } *


decompiled_code:
// attributes: thunk
void *branch_site_struc_create()
{
return hash_struc_create();
}

canonical_decompiled_code:
void *func11()
{
return func10();
}

original_code:
branch_site_struc_ptr
branch_site_struc_create(void)
{
 branch_site_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(branch_site_data));
 return this_struc;
}

canonical_original_code:
struct branch_site_struc *branch_site_struc_create()
{
 struct branch_site_struc *this_struc;
 this_struc = calloc(1,sizeof(branch_site_data));
 return this_struc;
}

variable_types: struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *


decompiled_code:
void *function_location_stack_create()
{
return calloc(1uLL, 0x30uLL);
}

canonical_decompiled_code:
void *func12()
{
return calloc(1uLL, 0x30uLL);
}

original_code:
function_location_stack_ptr
function_location_stack_create(void)
{
 function_location_stack_ptr this_struc;
 this_struc = calloc(1, sizeof(function_loc_stack_data));
 return this_struc;
}

canonical_original_code:
struct function_location_stack *function_location_stack_create()
{
 struct function_location_stack *this_struc;
 this_struc = calloc(1, sizeof(function_loc_stack_data));
 return this_struc;
}

variable_types: struct function_location_stack { struct function_location_stack *next; struct function_location_stack *previous; char *name; char *bind; unsigned long base; unsigned int len; } *


decompiled_code:
_QWORD *asm_struc_create()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x70uLL);
if ( v0 )
{
v1 = get_count(1LL, 112LL);
v2 = calloc(v1, 4uLL);
v0[10] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

canonical_decompiled_code:
_QWORD *func13()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x70uLL);
if ( v0 )
{
v1 = func0(1LL, 112LL);
v2 = calloc(v1, 4uLL);
v0[10] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

original_code:
asm_struc_ptr
asm_struc_create(void)
{
        asm_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(asm_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
        return this_struc;
}

canonical_original_code:
struct asm_struc *asm_struc_create()
{
        struct asm_struc *this_struc;
 this_struc = calloc(1, sizeof(asm_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
        return this_struc;
}

variable_types: struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *


decompiled_code:
_QWORD *basic_block_struc_create()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x60uLL);
if ( v0 )
{
v1 = get_count(1LL, 96LL);
v2 = calloc(v1, 4uLL);
v0[8] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

canonical_decompiled_code:
_QWORD *func14()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x60uLL);
if ( v0 )
{
v1 = func0(1LL, 96LL);
v2 = calloc(v1, 4uLL);
v0[8] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

original_code:
basic_block_struc_ptr
basic_block_struc_create(void)
{
        basic_block_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(basic_block_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
        return this_struc;
}

canonical_original_code:
struct basic_block_struc *basic_block_struc_create()
{
        struct basic_block_struc *this_struc;
 this_struc = calloc(1, sizeof(basic_block_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
        return this_struc;
}

variable_types: struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *


decompiled_code:
_QWORD *source_line_create()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x28uLL);
if ( v0 )
{
v1 = get_count(1LL, 40LL);
v2 = calloc(v1, 4uLL);
v0[3] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

canonical_decompiled_code:
_QWORD *func15()
{
_QWORD *v0; // r12
int v1; // eax
void *v2; // rax
void *v4; // rdi

v0 = calloc(1uLL, 0x28uLL);
if ( v0 )
{
v1 = func0(1LL, 40LL);
v2 = calloc(v1, 4uLL);
v0[3] = v2;
if ( !v2 )
{
v4 = v0;
v0 = 0LL;
free(v4);
}
}
return v0;
}

original_code:
source_line_struc_ptr
source_line_create(void)
{
 source_line_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(source_line_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
 return this_struc;
}

canonical_original_code:
struct source_line_struc *source_line_create()
{
 struct source_line_struc *this_struc;
 this_struc = calloc(1, sizeof(source_line_data));
 if(this_struc == ((void *)0))return this_struc;
 this_struc->sample_count = calloc(get_count(), sizeof(int));
 if(this_struc->sample_count == ((void *)0))
  {
  free(this_struc);
  return ((void *)0);
  }
 return this_struc;
}

variable_types: struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *


decompiled_code:
void *file_list_create()
{
return calloc(1uLL, 0x28uLL);
}

canonical_decompiled_code:
void *func16()
{
return calloc(1uLL, 0x28uLL);
}

original_code:
file_list_struc_ptr
file_list_create(void)
{
 file_list_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(source_line_data));
 return this_struc;
}

canonical_original_code:
struct file_list_struc *file_list_create()
{
 struct file_list_struc *this_struc;
 this_struc = calloc(1, sizeof(source_line_data));
 return this_struc;
}

variable_types: struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *


decompiled_code:
// attributes: thunk
void *addr_list_create()
{
return file_list_create();
}

canonical_decompiled_code:
void *func17()
{
return func16();
}

original_code:
addr_list_struc_ptr
addr_list_create(void)
{
 addr_list_struc_ptr this_struc;
 this_struc = calloc(1, sizeof(source_line_data));
 return this_struc;
}

canonical_original_code:
struct addr_list_struc *addr_list_create()
{
 struct addr_list_struc *this_struc;
 this_struc = calloc(1, sizeof(source_line_data));
 return this_struc;
}

variable_types: struct addr_list_struc { unsigned long base; unsigned long len; void *struc_ptr; } *


decompiled_code:
void *mmap_struc_create()
{
return calloc(1uLL, 0x70uLL);
}

canonical_decompiled_code:
void *func0()
{
return calloc(1uLL, 0x70uLL);
}

original_code:
mmap_struc_ptr
mmap_struc_create(void)
{
        mmap_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(mmap_data));
        return this_struc;
}

canonical_original_code:
struct mmap_struc *mmap_struc_create()
{
        struct mmap_struc *this_struc;
 this_struc = calloc(1,sizeof(mmap_data));
        return this_struc;
}

variable_types: struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc { struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; } *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc *first_module; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *module_list; struct mmap_struc *first_mmap; struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; } *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *this_sample; unsigned long this_rva; struct hash_struc *next; } *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc *rva_list; struct function_struc *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *

user_defined_types: struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; }


decompiled_code:
void *lost_struc_create()
{
return calloc(1uLL, 0x28uLL);
}

canonical_decompiled_code:
void *func1()
{
return calloc(1uLL, 0x28uLL);
}

original_code:
lost_struc_ptr
lost_struc_create(void)
{
        lost_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(lost_data));
        return this_struc;
}

canonical_original_code:
struct lost_struc *lost_struc_create()
{
        struct lost_struc *this_struc;
 this_struc = calloc(1,sizeof(lost_data));
        return this_struc;
}

variable_types: struct lost_struc { struct lost_struc *next; struct lost_struc *previous; unsigned long time; unsigned long id; unsigned long lost; } *


decompiled_code:
void *comm_struc_create()
{
return calloc(1uLL, 0x30uLL);
}

canonical_decompiled_code:
void *func2()
{
return calloc(1uLL, 0x30uLL);
}

original_code:
comm_struc_ptr
comm_struc_create(void)
{
        comm_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(comm_data));
        return this_struc;
}

canonical_original_code:
struct comm_struc *comm_struc_create()
{
        struct comm_struc *this_struc;
 this_struc = calloc(1,sizeof(comm_data));
        return this_struc;
}

variable_types: struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc { struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; } *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc *first_module; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *module_list; struct mmap_struc *first_mmap; struct comm_struc *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; } *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *this_sample; unsigned long this_rva; struct hash_struc *next; } *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc *rva_list; struct function_struc *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *

user_defined_types: struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; }


decompiled_code:
// attributes: thunk
void *exit_struc_create()
{
return lost_struc_create();
}

canonical_decompiled_code:
void *func3()
{
return func1();
}

original_code:
exit_struc_ptr
exit_struc_create(void)
{
        exit_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(exit_data));
        return this_struc;
}

canonical_original_code:
struct exit_struc *exit_struc_create()
{
        struct exit_struc *this_struc;
 this_struc = calloc(1,sizeof(exit_data));
        return this_struc;
}

variable_types: struct exit_struc { struct exit_struc *next; struct exit_struc *previous; unsigned long time; unsigned int pid; unsigned int ppid; unsigned int tid; unsigned int ptid; } *


decompiled_code:
// attributes: thunk
void *throttle_struc_create()
{
return lost_struc_create();
}

canonical_decompiled_code:
void *func4()
{
return func1();
}

original_code:
throttle_struc_ptr
throttle_struc_create(void)
{
        throttle_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(throttle_data));
        return this_struc;
}

canonical_original_code:
struct throttle_struc *throttle_struc_create()
{
        struct throttle_struc *this_struc;
 this_struc = calloc(1,sizeof(throttle_data));
        return this_struc;
}

variable_types: struct throttle_struc { struct throttle_struc *next; struct throttle_struc *previous; unsigned long time; unsigned long id; unsigned long stream_id; } *


decompiled_code:
// attributes: thunk
void *unthrottle_struc_create()
{
return lost_struc_create();
}

canonical_decompiled_code:
void *func5()
{
return func1();
}

original_code:
unthrottle_struc_ptr
unthrottle_struc_create(void)
{
        unthrottle_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(unthrottle_data));
        return this_struc;
}

canonical_original_code:
struct unthrottle_struc *unthrottle_struc_create()
{
        struct unthrottle_struc *this_struc;
 this_struc = calloc(1,sizeof(unthrottle_data));
        return this_struc;
}

variable_types: struct unthrottle_struc { struct unthrottle_struc *next; struct unthrottle_struc *previous; unsigned long time; unsigned long id; unsigned long stream_id; } *


decompiled_code:
void *fork_struc_create()
{
return calloc(1uLL, 0x18uLL);
}

canonical_decompiled_code:
void *func6()
{
return calloc(1uLL, 0x18uLL);
}

original_code:
fork_struc_ptr
fork_struc_create(void)
{
        fork_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(fork_data));
        return this_struc;
}

canonical_original_code:
struct fork_struc *fork_struc_create()
{
        struct fork_struc *this_struc;
 this_struc = calloc(1,sizeof(fork_data));
        return this_struc;
}

variable_types: struct fork_struc { unsigned int pid; unsigned int ppid; unsigned int tid; unsigned int ptid; unsigned long time; } *


decompiled_code:
// attributes: thunk
void *read_struc_create()
{
return lost_struc_create();
}

canonical_decompiled_code:
void *func7()
{
return func1();
}

original_code:
read_struc_ptr
read_struc_create(void)
{
        read_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(read_data));
        return this_struc;
}

canonical_original_code:
struct read_struc *read_struc_create()
{
        struct read_struc *this_struc;
 this_struc = calloc(1,sizeof(read_data));
        return this_struc;
}

variable_types: struct read_struc { struct read_struc *next; struct read_struc *previous; char *buffer; unsigned long time; unsigned int size; } *


decompiled_code:
void *raw_sample_struc_create()
{
return calloc(1uLL, 0x48uLL);
}

canonical_decompiled_code:
void *func8()
{
return calloc(1uLL, 0x48uLL);
}

original_code:
raw_sample_struc_ptr
raw_sample_struc_create(void)
{
        raw_sample_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(raw_sample_data));
        return this_struc;
}

canonical_original_code:
struct raw_sample_struc *raw_sample_struc_create()
{
        struct raw_sample_struc *this_struc;
 this_struc = calloc(1,sizeof(raw_sample_data));
        return this_struc;
}

variable_types: struct raw_sample_struc { struct raw_sample_struc *next; struct raw_sample_struc *previous; unsigned long time; unsigned long ip; unsigned long pebs_ip; unsigned long str_id; unsigned long sample_period; unsigned int pid; unsigned int tid; unsigned int cpu; } *


decompiled_code:
void *pmu_programming_struc_create()
{
return calloc(1uLL, 0x20uLL);
}

canonical_decompiled_code:
void *func9()
{
return calloc(1uLL, 0x20uLL);
}

original_code:
pmu_programming_struc_ptr
pmu_programming_struc_create(void)
{
        pmu_programming_struc_ptr this_struc;
 this_struc = calloc(1,sizeof(pmu_programming_data));
        return this_struc;
}

canonical_original_code:
struct pmu_programming_struc *pmu_programming_struc_create()
{
        struct pmu_programming_struc *this_struc;
 this_struc = calloc(1,sizeof(pmu_programming_data));
        return this_struc;
}

variable_types: struct pmu_programming_struc { struct sample_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long rva; struct process_struc { struct process_struc *next; struct process_struc *previous; struct process_struc *principal_next; struct process_struc *principal_previous; struct process_struc *principal_process; struct process_struc *parent; struct child_struc { struct child_struc *next; struct child_struc *previous; struct process_struc *this_process; struct process_struc *parent; } *first_child; struct thread_struc { struct thread_struc *next; struct thread_struc *previous; int *sample_count; int *sample_order; unsigned int tid; int cycle_count; int inst_count; int total_sample_count; } *first_thread; struct module_struc { struct module_struc *next; struct module_struc *previous; struct rva_hash_struc { int size; int entries; struct hash_struc { struct sample_struc *this_sample; unsigned long this_rva; struct hash_struc *next; } *this_array; } *this_table; struct sample_struc *first_sample; struct pointer_struc { struct sample_struc *ptr; unsigned long val; } *rva_list; struct function_struc { struct function_struc *next; struct function_struc *previous; struct func_branch_struc { struct func_branch_struc *next; struct branch_struc { struct branch_struc *next; struct branch_struc *previous; unsigned long address; char *module_name; char *function_name; struct module_struc *this_module; struct function_struc *this_function; int count; } *this_branch_target; struct branch_site_struc { struct branch_site_struc *next; unsigned long address; int count; } *branch_site_stack; } *sources; struct func_branch_struc *targets; struct sample_struc *first_rva; struct asm_struc { struct asm_struc *next; struct asm_struc *previous; unsigned long address; unsigned long target; char *asm_text; char *encoding; char *principal_source_file; char *principal_source_name; char *initial_source_file; char *initial_source_name; int *sample_count; int principal_source_line; int initial_source_line; int branch; int call; int total_sample_count; } *first_asm; struct basic_block_struc { struct basic_block_struc *next; struct basic_block_struc *previous; unsigned long address; unsigned long end_address; unsigned long target1; unsigned long target2; char *text; char *encoding; int *sample_count; int source_line; int block_count; int branch; int call; int total_sample_count; } *first_bb; struct source_line_struc { struct source_line_struc *next; struct source_line_struc *previous; char *source_text; int *sample_count; int line; } *first_source_line; char *function_name; unsigned long function_rva_start; unsigned long function_length; struct source_struc { struct source_struc *next; struct source_struc *previous; char *source_file; char *source_name; char *path; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *source_file; struct principal_file_struc { struct principal_file_struc *next; struct principal_file_struc *previous; char *principal_file_name; char *path; char *compile_options; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; } *principal_file; struct file_list_struc { struct file_list_struc *next; struct file_list_struc *previous; char *principal_source_file; char *principal_source_name; int count; } *principal_file_list; struct module_struc *this_module; struct process_struc *this_process; int *sample_count; void *sample_order; int cycle_count; int inst_count; int total_sample_count; int total_branches; int total_targets; int total_sources; int func_sources; int func_targets; int funclist_index; } *first_function; struct function_struc *current_function; struct functionlist_struc { struct function_location { struct function_struc *this_function; char *name; char *bind; unsigned long base; unsigned int len; } *list; int size; } *function_list; struct source_struc *first_source; struct source_struc *current_source; char *module_name; char *path; char *local_path; unsigned long starting_ip; unsigned long length; unsigned long time; unsigned long load_tsc; unsigned long unload_tsc; int *sample_count; int *sample_order; int cycle_count; int inst_count; int total_sample_count; int rva_count; int total_branches; int total_sources; int total_targets; int local_calls; int remote_calls; int set_starting_ip; } *first_module; struct pointer_struc *module_list; struct mmap_struc { struct mmap_struc *next; struct mmap_struc *previous; char *filename; unsigned long addr; unsigned long len; unsigned long time; struct module_struc *this_module; struct process_struc *this_process; struct process_struc *principal_process; unsigned int pid; unsigned int tid; unsigned long pgoff; unsigned long tsc_start; unsigned long tsc_end; unsigned long last_pgoff; } *first_mmap; struct comm_struc { struct comm_struc *next; struct comm_struc *previous; struct mmap_struc *first_mmap; char *name; unsigned long time; unsigned int pid; unsigned int tid; } *first_comm; struct module_struc *current_module; char *name; int *sample_count; int *sample_order; int module_count; unsigned int pid; int cycle_count; int inst_count; int total_sample_count; } *this_process; struct thread_struc *this_thread; struct module_struc *this_module; struct function_struc *this_function; struct branch_struc *return_list; struct branch_struc *call_list; char *asm_string; int *sample_count; int *sample_order; float *ratios; int *ratio_order; unsigned long ip; int source_file_line; int compilation_file_line; int total_sample_count; int total_sources; int total_targets; } *next; struct sample_struc *previous; unsigned long str_id; unsigned int cpu; } *

user_defined_types: struct pmu_programming_struc { struct sample_struc *next; struct sample_struc *previous; unsigned long str_id; unsigned int cpu; }


decompiled_code:
void asm_2_src_close()
{
if ( syms )
{
free(syms);
syms = 0LL;
}
if ( abfd )
bfd_close(abfd);
if ( dbg_bfd )
bfd_close(dbg_bfd);
found = 0;
line = 0;
}

canonical_decompiled_code:
void func3()
{
if ( syms )
{
free(syms);
syms = 0LL;
}
if ( abfd )
bfd_close(abfd);
if ( dbg_bfd )
bfd_close(dbg_bfd);
found = 0;
line = 0;
}

original_code:
void
asm_2_src_close(void)
{
 if (syms != ((void *)0)) {
  free(syms);
  syms = ((void *)0);
 }
 if(abfd != ((void *)0))bfd_close(abfd);
 if(dbg_bfd != ((void *)0))bfd_close(dbg_bfd);
 line = found = 0;
}

canonical_original_code:
void asm_2_src_close()
{
 if (syms != ((void *)0)) {
  free(syms);
  syms = ((void *)0);
 }
 if(abfd != ((void *)0))bfd_close(abfd);
 if(dbg_bfd != ((void *)0))bfd_close(dbg_bfd);
 line = found = 0;
}

return_type: void


decompiled_code:
__int64 __fastcall asm_2_src_inline(_QWORD *a1, _DWORD *a2)
{
__int64 result; // rax

result = (*(__int64 (__fastcall **)(__int64, __int64 *, void *, int *))(*(_QWORD *)(active_bfd + 8) + 584LL))(
active_bfd,
&filename,
&functionname,
&line);
found = result;
*a1 = filename;
*a2 = line;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(_QWORD *a1, _DWORD *a2)
{
__int64 result; // rax

result = (*(__int64 (__fastcall **)(__int64, __int64 *, void *, int *))(*(_QWORD *)(active_bfd + 8) + 584LL))(
active_bfd,
&filename,
&functionname,
&line);
found = result;
*a1 = filename;
*a2 = line;
return result;
}

original_code:
int
asm_2_src_inline(const char **file, unsigned *line_nr)
{
 found = ((*((active_bfd)->xvec->_bfd_find_inliner_info)) (active_bfd, &filename, &functionname, &line));
 *file = filename;
 *line_nr = line;
 return found;
}

canonical_original_code:
int asm_2_src_inline(char **file, unsigned int *line_nr)
{
 found = ((*((active_bfd)->xvec->_bfd_find_inliner_info)) (active_bfd, &filename, &functionname, &line));
 *file = filename;
 *line_nr = line;
 return found;
}

variable_types:
file
char **

return_type: int


decompiled_code:
__int64 __fastcall asm_2_src(__int64 a1, _QWORD *a2, _DWORD *a3)
{
qword_530 = a1;
found = 0;
bfd_map_over_sections(active_bfd, locate_function, 0LL);
*a2 = filename;
*a3 = line;
return (unsigned int)found;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, _QWORD *a2, _DWORD *a3)
{
qword_530 = a1;
found = 0;
bfd_map_over_sections(active_bfd, locate_function, 0LL);
*a2 = filename;
*a3 = line;
return (unsigned int)found;
}

original_code:
int asm_2_src(unsigned long addr, const char **file, unsigned *line_nr)
{
 found = 0;
 ip = addr;
 bfd_map_over_sections(active_bfd, locate_function, ((void *)0));
 *file = filename;
 *line_nr = line;
 return found;
}

canonical_original_code:
int asm_2_src(unsigned long addr, char **file, unsigned int *line_nr)
{
 found = 0;
 ip = addr;
 bfd_map_over_sections(active_bfd, locate_function, ((void *)0));
 *file = filename;
 *line_nr = line;
 return found;
}

variable_types:
addr
unsigned long


qsindex

original_code:
void
qsindex(index_data *data, int left, int right)
{
        int l_old, r_old, piv_index;
        int piv,index;
        l_old = left;
        r_old = right;
        piv = data[left].val;
        index = data[left].index;
        while(left < right)
                {
                while( (data[right].val >= piv) && (left < right))
                        right--;
                if(left != right)
                        {
                        data[left].val = data[right].val;
                        data[left].index = data[right].index;
                        left++;
                        }
                while( ( data[left].val <= piv) && (left < right))
                        left++;
                if(left != right)
                        {
                        data[right].val = data[left].val;
                        data[right].index = data[left].index;
                        right--;
                        }
                }
        data[left].val = piv;
        data[left].index = index;
        piv_index = left;
        left = l_old;
        right = r_old;
        if(left < piv_index)
                qsindex(data, left, piv_index-1);
        if(right > piv_index)
                qsindex(data, piv_index+1, right);
}

canonical_original_code:
void qsindex(struct index_data_struc *data, int left, int right)
{
        int l_old; int r_old; int piv_index;
        int piv; int index;
        l_old = left;
        r_old = right;
        piv = data[left].val;
        index = data[left].index;
        while(left < right)
                {
                while( (data[right].val >= piv) && (left < right))
                        right--;
                if(left != right)
                        {
                        data[left].val = data[right].val;
                        data[left].index = data[right].index;
                        left++;
                        }
                while( ( data[left].val <= piv) && (left < right))
                        left++;
                if(left != right)
                        {
                        data[right].val = data[left].val;
                        data[right].index = data[left].index;
                        right--;
                        }
                }
        data[left].val = piv;
        data[left].index = index;
        piv_index = left;
        left = l_old;
        right = r_old;
        if(left < piv_index)
                qsindex(data, left, piv_index-1);
        if(right > piv_index)
                qsindex(data, piv_index+1, right);
}

variable_types: struct index_data_struc { int val; int index; } *

variable_types: left int

variable_types: right int

variable_types: piv int

variable_types: index int


quickSortIndex

decompiled_code:
int *__fastcall quickSortIndex(__int64 a1, int a2)
{
return qsindex(a1, 0, a2 - 1);
}

canonical_decompiled_code:
int *__fastcall func1(__int64 a1, int a2)
{
return func0(a1, 0, a2 - 1);
}

original_code:
void
quickSortIndex(index_data *arr, int elements)
{
        qsindex(arr, 0, elements-1);
}

canonical_original_code:
void quickSortIndex(struct index_data_struc *arr, int elements)
{
        qsindex(arr, 0, elements-1);
}

variable_types: elements int

user_defined_types: struct index_data_struc { int val; int index; }


decompiled_code:
__int64 init_order()
{
if ( family != 6 )
return init_order_def();
if ( model == 44 )
return init_order_intel(1LL);
if ( model != 42 && model != 45 )
return init_order_def();
return init_order_intel(4LL);
}

canonical_decompiled_code:
__int64 func2()
{
if ( family != 6 )
return init_order_def();
if ( model == 44 )
return init_order_intel(1LL);
if ( model != 42 && model != 45 )
return init_order_def();
return init_order_intel(4LL);
}

original_code:
void
init_order(void)
{
 int arch_val;
 if((family == 6) && (model == 44))
  {
  arch_val = 1;
  init_order_intel(arch_val);
  return;
  }
 else if ((family == 6) && (model == 42))
  {
  arch_val = 4;
  init_order_intel(arch_val);
  return;
  }
 else if ((family == 6) && (model == 45))
  {
  arch_val = 4;
  init_order_intel(arch_val);
  return;
  }
 else
  {
  init_order_def();
  return;
  }
}

canonical_original_code:
void init_order()
{
 int arch_val;
 if((family == 6) && (model == 44))
  {
  arch_val = 1;
  init_order_intel(arch_val);
  return;
  }
 else if ((family == 6) && (model == 42))
  {
  arch_val = 4;
  init_order_intel(arch_val);
  return;
  }
 else if ((family == 6) && (model == 45))
  {
  arch_val = 4;
  init_order_intel(arch_val);
  return;
  }
 else
  {
  init_order_def();
  return;
  }
}


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

if ( family == 6 && ((unsigned int)(model - 44) <= 1 || model == 42) )
result = branch_eval_intel();
else
result = branch_eval_def();
return result;
}

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

if ( family == 6 && ((unsigned int)(model - 44) <= 1 || model == 42) )
result = branch_eval_intel();
else
result = branch_eval_def();
return result;
}

original_code:
void
branch_eval(int* sample_count)
{
 if((family == 6) && (model == 44))
  {
  branch_eval_intel();
  return;
  }
 else if ((family == 6) && (model == 42))
  {
  branch_eval_intel();
  return;
  }
 else if ((family == 6) && (model == 45))
  {
  branch_eval_intel();
  return;
  }
 else
  {
  branch_eval_def();
  return;
  }
}

canonical_original_code:
void branch_eval(int *sample_count)
{
 if((family == 6) && (model == 44))
  {
  branch_eval_intel();
  return;
  }
 else if ((family == 6) && (model == 42))
  {
  branch_eval_intel();
  return;
  }
 else if ((family == 6) && (model == 45))
  {
  branch_eval_intel();
  return;
  }
 else
  {
  branch_eval_def();
  return;
  }
}


decompiled_code:
__int64 __fastcall set_order(__int64 a1)
{
if ( family != 6 )
return set_order_def();
if ( model == 44 )
return set_order_intel(a1, 1LL);
if ( model != 42 && model != 45 )
return set_order_def();
return set_order_intel(a1, 4LL);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
if ( family != 6 )
return set_order_def();
if ( model == 44 )
return set_order_intel(a1, 1LL);
if ( model != 42 && model != 45 )
return set_order_def();
return set_order_intel(a1, 4LL);
}

original_code:
event_order_struc_ptr
set_order(int* sample_count)
{
 event_order_struc_ptr retval;
 if((family == 6) && (model == 44))
  {
  retval = set_order_intel(sample_count, 1);
  return retval;
  }
 else if ((family == 6) && (model == 42))
  {
  retval = set_order_intel(sample_count, 4);
  return retval;
  }
 else if ((family == 6) && (model == 45))
  {
  retval = set_order_intel(sample_count, 4);
  return retval;
  }
 else
  {
  retval = set_order_def(sample_count);
  return retval;
  }
}

canonical_original_code:
struct event_order_struc *set_order(int *sample_count)
{
 struct event_order_struc *retval;
 if((family == 6) && (model == 44))
  {
  retval = set_order_intel(sample_count, 1);
  return retval;
  }
 else if ((family == 6) && (model == 42))
  {
  retval = set_order_intel(sample_count, 4);
  return retval;
  }
 else if ((family == 6) && (model == 45))
  {
  retval = set_order_intel(sample_count, 4);
  return retval;
  }
 else
  {
  retval = set_order_def(sample_count);
  return retval;
  }
}

variable_types: struct event_order_struc { struct order_struc { char *name; char *ctrl_string; unsigned long config; unsigned long Period; double multiplex; int index; int base_col; int penalty; int cycle; int branch; int sub_branch; int derived; int sum; int sub_branch_sum; int ratio; int num_branch; } *order; int num_fixed; int num_ordered; int num_branch; int num_sub_branch; int num_derived; } *

user_defined_types: struct event_order_struc { struct order_struc *order; int num_fixed; int num_ordered; int num_branch; int num_sub_branch; int num_derived; }


decompiled_code:
__int64 __fastcall get_load_addr_32(int fd)
{
unsigned int v1; // ebp
__int64 result; // rax
int v3[6]; // [rsp+0h] [rbp-78h] BYREF
int v4; // [rsp+18h] [rbp-60h]
char buf[28]; // [rsp+20h] [rbp-58h] BYREF
__off_t offset; // [rsp+3Ch] [rbp-3Ch]
unsigned __int16 v7; // [rsp+4Ch] [rbp-2Ch]

if ( read(fd, buf, 0x34uLL) == 52 )
{
if ( (unsigned int)offset == lseek(fd, (unsigned int)offset, 0) )
{
v1 = 0;
if ( v7 )
{
while ( read(fd, v3, 0x20uLL) == 32 )
{
if ( v3[0] == 1 && (v4 & 5) == 5 )
return (unsigned int)v3[2];
if ( v7 <= (int)++v1 )
goto LABEL_9;
}
warnx("cannot read phdr %d", v1);
result = -1LL;
}
else
{
LABEL_9:
result = -1LL;
}
}
else
{
warnx("cannot get to program header start");
result = -1LL;
}
}
else
{
warnx("cannot read ehdr");
result = -1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int fd)
{
unsigned int v1; // ebp
__int64 result; // rax
int v3[6]; // [rsp+0h] [rbp-78h] BYREF
int v4; // [rsp+18h] [rbp-60h]
char buf[28]; // [rsp+20h] [rbp-58h] BYREF
__off_t offset; // [rsp+3Ch] [rbp-3Ch]
unsigned __int16 v7; // [rsp+4Ch] [rbp-2Ch]

if ( read(fd, buf, 0x34uLL) == 52 )
{
if ( (unsigned int)offset == lseek(fd, (unsigned int)offset, 0) )
{
v1 = 0;
if ( v7 )
{
while ( read(fd, v3, 0x20uLL) == 32 )
{
if ( v3[0] == 1 && (v4 & 5) == 5 )
return (unsigned int)v3[2];
if ( v7 <= (int)++v1 )
goto LABEL_9;
}
warnx("cannot read phdr %d", v1);
result = -1LL;
}
else
{
LABEL_9:
result = -1LL;
}
}
else
{
warnx("cannot get to program header start");
result = -1LL;
}
}
else
{
warnx("cannot read ehdr");
result = -1LL;
}
return result;
}

original_code:
static uint64_t
get_load_addr_32(int fd)
{
 Elf32_Ehdr hdr;
 Elf32_Phdr phdr;
 ssize_t s;
 size_t sz;
 off_t o;
 int i;
 s = read(fd, &hdr, sizeof(hdr));
 if (s != (ssize_t)sizeof(hdr)) {
  warnx("cannot read ehdr");
  return -1;
 }
 o = lseek(fd, (off_t)hdr.e_phoff, 0);
 if (o != (off_t)hdr.e_phoff) {
  warnx("cannot get to program header start");
  return -1;
 }
 for (i = 0 ; i < hdr.e_phnum; i++) {
  s = read(fd, &phdr, sizeof(phdr));
  if (s != (ssize_t)sizeof(phdr)) {
   warnx("cannot read phdr %d", i);
   return -1;
  }
  if (phdr.p_type != 1)
   continue;
  if ((phdr.p_flags & ((1 << 0)|(1 << 2))) != ((1 << 0)|(1 << 2)))
   continue;
  return (uint64_t)phdr.p_vaddr;
 }
 return -1;
}

canonical_original_code:
static unsigned long get_load_addr_32(int fd)
{
 struct Elf32_Ehdr hdr;
 struct Elf32_Phdr phdr;
 long s;
 unsigned long sz;
 long o;
 int i;
 s = read(fd, &hdr, sizeof(hdr));
 if (s != (long)sizeof(hdr)) {
  warnx("cannot read ehdr");
  return -1;
 }
 o = lseek(fd, (long)hdr.e_phoff, 0);
 if (o != (long)hdr.e_phoff) {
  warnx("cannot get to program header start");
  return -1;
 }
 for (i = 0 ; i < hdr.e_phnum; i++) {
  s = read(fd, &phdr, sizeof(phdr));
  if (s != (long)sizeof(phdr)) {
   warnx("cannot read phdr %d", i);
   return -1;
  }
  if (phdr.p_type != 1)
   continue;
  if ((phdr.p_flags & ((1 << 0)|(1 << 2))) != ((1 << 0)|(1 << 2)))
   continue;
  return (unsigned long)phdr.p_vaddr;
 }
 return -1;
}

variable_types: fd int

variable_types: struct Elf32_Ehdr { unsigned char e_ident[16]; unsigned short e_type; unsigned short e_machine; unsigned int e_version; unsigned int e_entry; unsigned int e_phoff; unsigned int e_shoff; unsigned int e_flags; unsigned short e_ehsize; unsigned short e_phentsize; unsigned short e_phnum; unsigned short e_shentsize; unsigned short e_shnum; unsigned short e_shstrndx; }

variable_types: struct Elf32_Phdr { unsigned int p_type; unsigned int p_offset; unsigned int p_vaddr; unsigned int p_paddr; unsigned int p_filesz; unsigned int p_memsz; unsigned int p_flags; unsigned int p_align; }

variable_types: s long

variable_types:
sz
unsigned long

variable_types: o long

variable_types: i int

return_type: unsigned long


decompiled_code:
__int64 __fastcall get_load_addr_64(int fd)
{
__off_t v1; // rax
unsigned int v2; // ebp
__int64 result; // rax
int v4; // [rsp+0h] [rbp-98h] BYREF
int v5; // [rsp+4h] [rbp-94h]
__int64 v6; // [rsp+10h] [rbp-88h]
char buf[32]; // [rsp+40h] [rbp-58h] BYREF
__off_t offset; // [rsp+60h] [rbp-38h]
unsigned __int16 v9; // [rsp+78h] [rbp-20h]

if ( read(fd, buf, 0x40uLL) == 64 )
{
v1 = lseek(fd, offset, 0);
if ( offset == v1 )
{
v2 = 0;
if ( v9 )
{
while ( read(fd, &v4, 0x38uLL) == 56 )
{
if ( v4 == 1 && (v5 & 5) == 5 )
return v6;
if ( v9 <= (int)++v2 )
goto LABEL_9;
}
warnx("cannot read phdr %d", v2);
result = -1LL;
}
else
{
LABEL_9:
result = -1LL;
}
}
else
{
warnx("cannot get to program header start");
result = -1LL;
}
}
else
{
warnx("cannot read ehdr");
result = -1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(int fd)
{
__off_t v1; // rax
unsigned int v2; // ebp
__int64 result; // rax
int v4; // [rsp+0h] [rbp-98h] BYREF
int v5; // [rsp+4h] [rbp-94h]
__int64 v6; // [rsp+10h] [rbp-88h]
char buf[32]; // [rsp+40h] [rbp-58h] BYREF
__off_t offset; // [rsp+60h] [rbp-38h]
unsigned __int16 v9; // [rsp+78h] [rbp-20h]

if ( read(fd, buf, 0x40uLL) == 64 )
{
v1 = lseek(fd, offset, 0);
if ( offset == v1 )
{
v2 = 0;
if ( v9 )
{
while ( read(fd, &v4, 0x38uLL) == 56 )
{
if ( v4 == 1 && (v5 & 5) == 5 )
return v6;
if ( v9 <= (int)++v2 )
goto LABEL_9;
}
warnx("cannot read phdr %d", v2);
result = -1LL;
}
else
{
LABEL_9:
result = -1LL;
}
}
else
{
warnx("cannot get to program header start");
result = -1LL;
}
}
else
{
warnx("cannot read ehdr");
result = -1LL;
}
return result;
}

original_code:
static uint64_t
get_load_addr_64(int fd)
{
 Elf64_Ehdr hdr;
 Elf64_Phdr phdr;
 ssize_t s;
 size_t sz;
 off_t o;
 int i;
 s = read(fd, &hdr, sizeof(hdr));
 if (s != (ssize_t)sizeof(hdr)) {
  warnx("cannot read ehdr");
  return -1;
 }
 o = lseek(fd, (off_t)hdr.e_phoff, 0);
 if (o != (off_t)hdr.e_phoff) {
  warnx("cannot get to program header start");
  return -1;
 }
 for (i = 0 ; i < hdr.e_phnum; i++) {
  s = read(fd, &phdr, sizeof(phdr));
  if (s != (ssize_t)sizeof(phdr)) {
   warnx("cannot read phdr %d", i);
   return -1;
  }
  if (phdr.p_type != 1)
   continue;
  if ((phdr.p_flags & ((1 << 0)|(1 << 2))) != ((1 << 0)|(1 << 2)))
   continue;
  return (uint64_t)phdr.p_vaddr;
 }
 return -1;
}

canonical_original_code:
static unsigned long get_load_addr_64(int fd)
{
 struct Elf64_Ehdr hdr;
 struct Elf64_Phdr phdr;
 long s;
 unsigned long sz;
 long o;
 int i;
 s = read(fd, &hdr, sizeof(hdr));
 if (s != (long)sizeof(hdr)) {
  warnx("cannot read ehdr");
  return -1;
 }
 o = lseek(fd, (long)hdr.e_phoff, 0);
 if (o != (long)hdr.e_phoff) {
  warnx("cannot get to program header start");
  return -1;
 }
 for (i = 0 ; i < hdr.e_phnum; i++) {
  s = read(fd, &phdr, sizeof(phdr));
  if (s != (long)sizeof(phdr)) {
   warnx("cannot read phdr %d", i);
   return -1;
  }
  if (phdr.p_type != 1)
   continue;
  if ((phdr.p_flags & ((1 << 0)|(1 << 2))) != ((1 << 0)|(1 << 2)))
   continue;
  return (unsigned long)phdr.p_vaddr;
 }
 return -1;
}

variable_types: struct Elf64_Ehdr { unsigned char e_ident[16]; unsigned short e_type; unsigned short e_machine; unsigned int e_version; unsigned long e_entry; unsigned long e_phoff; unsigned long e_shoff; unsigned int e_flags; unsigned short e_ehsize; unsigned short e_phentsize; unsigned short e_phnum; unsigned short e_shentsize; unsigned short e_shnum; unsigned short e_shstrndx; }

variable_types: struct Elf64_Phdr { unsigned int p_type; unsigned int p_flags; unsigned long p_offset; unsigned long p_vaddr; unsigned long p_paddr; unsigned long p_filesz; unsigned long p_memsz; unsigned long p_align; }


decompiled_code:
__int64 __fastcall parse_elf_header(int fd)
{
__int64 result; // rax
char v2[4]; // [rsp+0h] [rbp-18h] BYREF
unsigned __int8 v3; // [rsp+4h] [rbp-14h]

if ( read(fd, v2, 0x10uLL) == 16 )
{
if ( v2[0] == 127 && v2[1] == 69 && v2[2] == 76 && v2[3] == 70 )
{
if ( lseek(fd, 0LL, 0) )
{
warnx("cannot reset to ELF header start");
result = -1LL;
}
else if ( v3 == 1 )
{
result = get_load_addr_32(fd);
}
else if ( v3 == 2 )
{
result = get_load_addr_64(fd);
}
else
{
warnx("unknown ELF class %d", v3);
result = -1LL;
}
}
else
{
warnx("not an ELF file");
result = -1LL;
}
}
else
{
warnx("cannot read ELF ident");
result = -1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(int fd)
{
__int64 result; // rax
char v2[4]; // [rsp+0h] [rbp-18h] BYREF
unsigned __int8 v3; // [rsp+4h] [rbp-14h]

if ( read(fd, v2, 0x10uLL) == 16 )
{
if ( v2[0] == 127 && v2[1] == 69 && v2[2] == 76 && v2[3] == 70 )
{
if ( lseek(fd, 0LL, 0) )
{
warnx("cannot reset to ELF header start");
result = -1LL;
}
else if ( v3 == 1 )
{
result = func0(fd);
}
else if ( v3 == 2 )
{
result = func1(fd);
}
else
{
warnx("unknown ELF class %d", v3);
result = -1LL;
}
}
else
{
warnx("not an ELF file");
result = -1LL;
}
}
else
{
warnx("cannot read ELF ident");
result = -1LL;
}
return result;
}

original_code:
uint64_t
parse_elf_header(int fd)
{
   unsigned char ident[16];
 ssize_t s;
 off_t o;
 uint64_t addr;
 s = read(fd, ident, sizeof(ident));
 if (s != (ssize_t)sizeof(ident)) {
  warnx("cannot read ELF ident");
  return -1;
 }
 if ( ident[0] != 0x7f
     || ident[1] != 'E'
     || ident[2] != 'L'
     || ident[3] != 'F') {
  warnx("not an ELF file");
  return -1;
 }
 o = lseek(fd, 0, 0);
 if (o != 0) {
  warnx("cannot reset to ELF header start");
  return -1;
 }
 switch (ident[4]) {
 case 1:
   addr = get_load_addr_32(fd);
   break;
 case 2:
   addr = get_load_addr_64(fd);
   break;
 default:
  warnx("unknown ELF class %d", ident[4]);
  addr = -1;
 }
 return addr;
}

canonical_original_code:
unsigned long parse_elf_header(int fd)
{
   unsigned char ident[16];
 long s;
 long o;
 unsigned long addr;
 s = read(fd, ident, sizeof(ident));
 if (s != (long)sizeof(ident)) {
  warnx("cannot read ELF ident");
  return -1;
 }
 if ( ident[0] != 0x7f
     || ident[1] != 'E'
     || ident[2] != 'L'
     || ident[3] != 'F') {
  warnx("not an ELF file");
  return -1;
 }
 o = lseek(fd, 0, 0);
 if (o != 0) {
  warnx("cannot reset to ELF header start");
  return -1;
 }
 switch (ident[4]) {
 case 1:
   addr = get_load_addr_32(fd);
   break;
 case 2:
   addr = get_load_addr_64(fd);
   break;
 default:
  warnx("unknown ELF class %d", ident[4]);
  addr = -1;
 }
 return addr;
}

variable_types:
ident
unsigned char [16]

variable_types:
addr
unsigned long


fatal

repo: pxunl/myshell

decompiled_code:
void __fastcall __noreturn fatal(const char *a1, const char *a2, int a3)
{
fprintf(stderr, "Error: %s %s\n", a1, a2);
exit(a3);
}

canonical_decompiled_code:
void __fastcall __noreturn func0(const char *a1, const char *a2, int a3)
{
fprintf(stderr, "Error: %s %s\n", a1, a2);
exit(a3);
}

original_code:
void fatal(char *str_err, char *str_error, int exit_code)
{
 fprintf(stderr, "Error: %s %s\n", str_err, str_error);
 exit(exit_code);
}


emalloc

decompiled_code:
void *__fastcall emalloc(size_t a1)
{
void *result; // rax

result = malloc(a1);
if ( !result )
fatal("out of memory!\n", (const char *)&unk_2E8, 1);
return result;
}

canonical_decompiled_code:
void *__fastcall func1(size_t a1)
{
void *result; // rax

result = malloc(a1);
if ( !result )
func0("out of memory!\n", (const char *)&unk_2E8, 1);
return result;
}

original_code:
void *emalloc(size_t n)
{
 void *rv;
 if ((rv = malloc(n)) == ((void *)0))
  fatal("out of memory!\n", "", 1);
 return rv;
}

canonical_original_code:
void *emalloc(unsigned long n)
{
 void *rv;
 if ((rv = malloc(n)) == ((void *)0))
  fatal("out of memory!\n", "", 1);
 return rv;
}

variable_types:
n
unsigned long

variable_types:
rv
void *

return_type: void *


erealloc

decompiled_code:
void *__fastcall erealloc(void *a1, size_t a2)
{
void *result; // rax

result = realloc(a1, a2);
if ( !result )
fatal("realloc() fail!", (const char *)&unk_2E8, 1);
return result;
}

canonical_decompiled_code:
void *__fastcall func2(void *a1, size_t a2)
{
void *result; // rax

result = realloc(a1, a2);
if ( !result )
func0("realloc() fail!", (const char *)&unk_2E8, 1);
return result;
}

original_code:
void *erealloc(void *point, size_t n)
{
 void *rv;
 if ((rv = realloc(point, n)) == ((void *)0))
 {
  fatal("realloc() fail!", "" , 1);
 }
 return rv;
}

canonical_original_code:
void *erealloc(void *point, unsigned long n)
{
 void *rv;
 if ((rv = realloc(point, n)) == ((void *)0))
 {
  fatal("realloc() fail!", "" , 1);
 }
 return rv;
}

variable_types:
point
void *


decompiled_code:
char *__fastcall create_str(char *src, int a2)
{
char *v2; // rax
char *result; // rax

v2 = (char *)emalloc(a2 + 1);
result = strncpy(v2, src, a2);
result[a2] = 0;
return result;
}

canonical_decompiled_code:
char *__fastcall func4(char *src, int a2)
{
char *v2; // rax
char *result; // rax

v2 = (char *)func1(a2 + 1);
result = strncpy(v2, src, a2);
result[a2] = 0;
return result;
}

original_code:
char * create_str(char *begin, int len)
{
 char *new_str = emalloc(len+1);
 strncpy(new_str, begin, len);
 new_str[len] = '\0';
 return new_str;
}

canonical_original_code:
char *create_str(char *begin, int len)
{
 char *new_str = emalloc(len+1);
 strncpy(new_str, begin, len);
 new_str[len] = '\0';
 return new_str;
}

variable_types:
begin
char *

variable_types: len int

return_type: char *


spiltline

original_code:
char **spiltline(char *cmdline)
{
 if (cmdline == ((void *)0))
 {
  return ((void *)0);
 }
 char **args;
 int pots = 0;
 int buf_num = 0;
 int arg_num = 0;
 char *str = cmdline;
 char *start;
 int length;
 args = emalloc(128);
 buf_num = 128;
 pots = 128 / sizeof(char *);
 while (*str != '\0')
 {
  while (((*str)==' ' || (*str)=='\t'))
  {
   str++;
  }
  if (*str == '\0')
  {
   break;
  }
  if (arg_num+1 >= pots)
  {
   args = erealloc(args, buf_num + 128);
   buf_num += 128;
   pots += (128/sizeof(char*));
  }
  start = str;
  length = 1;
  while ((*(++str) != '\0') && (!((*str)==' ' || (*str)=='\t')))
  {
   length++;
  }
  args[arg_num++] = create_str(start, length);
 }
 args[arg_num] = ((void *)0);
 return args;
}

canonical_original_code:
char **spiltline(char *cmdline)
{
 if (cmdline == ((void *)0))
 {
  return ((void *)0);
 }
 char **args;
 int pots = 0;
 int buf_num = 0;
 int arg_num = 0;
 char *str = cmdline;
 char *start;
 int length;
 args = emalloc(128);
 buf_num = 128;
 pots = 128 / sizeof(char *);
 while (*str != '\0')
 {
  while (((*str)==' ' || (*str)=='\t'))
  {
   str++;
  }
  if (*str == '\0')
  {
   break;
  }
  if (arg_num+1 >= pots)
  {
   args = erealloc(args, buf_num + 128);
   buf_num += 128;
   pots += (128/sizeof(char *));
  }
  start = str;
  length = 1;
  while ((*(++str) != '\0') && (!((*str)==' ' || (*str)=='\t')))
  {
   length++;
  }
  args[arg_num++] = create_str(start, length);
 }
 args[arg_num] = ((void *)0);
 return args;
}

variable_types:
cmdline
char *

variable_types:
args
char **

variable_types: pots int

variable_types:
str
char *

variable_types:
start
char *

variable_types: length int

return_type: char **


decompiled_code:
void __fastcall free_list(void *ptr)
{
void *v2; // rdi
_QWORD *v3; // rbx

v2 = *(void **)ptr;
if ( v2 )
{
v3 = ptr;
do
{
free(v2);
v2 = (void *)v3[1];
++v3;
}
while ( v2 );
}
free(ptr);
}

canonical_decompiled_code:
void __fastcall func6(void *ptr)
{
void *v2; // rdi
_QWORD *v3; // rbx

v2 = *(void **)ptr;
if ( v2 )
{
v3 = ptr;
do
{
free(v2);
v2 = (void *)v3[1];
++v3;
}
while ( v2 );
}
free(ptr);
}

original_code:
void free_list(char **list)
{
 char **cp = list;
 while (*cp)
  free(*cp++);
 free(list);
 list = ((void *)0);
}

variable_types:
list
char **

variable_types:
cp
char **


decompiled_code:
int info_cpu()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/cpuinfo", 0);
if ( v0 == -1 )
{
perror("can't read /proc/cpuinfo, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func7()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/cpuinfo", 0);
if ( v0 == -1 )
{
perror("can't read /proc/cpuinfo, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_cpu()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/cpuinfo", 00)) == -1)
 {
  perror("can't read /proc/cpuinfo, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}

variable_types:
buf
char [64]

variable_types: fd int


decompiled_code:
int info_mem()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/meminfo", 0);
if ( v0 == -1 )
{
perror("can't read /proc/meminfo, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func8()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/meminfo", 0);
if ( v0 == -1 )
{
perror("can't read /proc/meminfo, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_mem()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/meminfo", 00)) == -1)
 {
  perror("can't read /proc/meminfo, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}


decompiled_code:
int info_mount()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/mounts", 0);
if ( v0 == -1 )
{
perror("can't read /proc/mounts, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func9()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/mounts", 0);
if ( v0 == -1 )
{
perror("can't read /proc/mounts, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_mount()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/mounts", 00)) == -1)
 {
  perror("can't read /proc/mounts, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}


decompiled_code:
int info_swap()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/swaps", 0);
if ( v0 == -1 )
{
perror("can't read /proc/swaps, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func10()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/swaps", 0);
if ( v0 == -1 )
{
perror("can't read /proc/swaps, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_swap()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/swaps", 00)) == -1)
 {
  perror("can't read /proc/swaps, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}


decompiled_code:
int info_kernel_version()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/version", 0);
if ( v0 == -1 )
{
perror("can't read /proc/version, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func11()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/version", 0);
if ( v0 == -1 )
{
perror("can't read /proc/version, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_kernel_version()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/version", 00)) == -1)
 {
  perror("can't read /proc/version, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}


decompiled_code:
int info_uptime()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/uptime", 0);
if ( v0 == -1 )
{
perror("can't read /proc/uptime, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func12()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/uptime", 0);
if ( v0 == -1 )
{
perror("can't read /proc/uptime, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_uptime()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/uptime", 00)) == -1)
 {
  perror("can't read /proc/uptime, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}


decompiled_code:
int info_devices()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/devices", 0);
if ( v0 == -1 )
{
perror("can't read /proc/devices, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

canonical_decompiled_code:
int func13()
{
int v0; // eax
int v1; // ebp
int v2; // eax
char v4[72]; // [rsp+0h] [rbp-48h] BYREF

v0 = open("/proc/devices", 0);
if ( v0 == -1 )
{
perror("can't read /proc/devices, please check it's permision\n");
exit(1);
}
v1 = v0;
while ( 1 )
{
v2 = read(v1, v4, 0x40uLL);
if ( !v2 )
break;
v4[v2] = 0;
printf("%s", v4);
}
return close(v1);
}

original_code:
void info_devices()
{
 int read_size = 0;
 char buf[64];
 int fd;
 if ((fd = open("/proc/devices", 00)) == -1)
 {
  perror("can't read /proc/devices, please check it's permision\n");
  exit(1);
 }
 while ((read_size = read(fd, buf, 64)) != 0)
 {
  buf[read_size] = '\0';
  printf("%s", buf);
 }
 close(fd);
}


main

canonical_name: main

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
__int64 v3; // rbx

v3 = 0LL;
if ( argc > 1 )
{
while ( 1 )
{
if ( !strcmp(argv[1], cmd_table[v3]) )
(*(__int64 (__fastcall **)())((char *)&action_table + v3 * 8))();
if ( ++v3 == 7 )
usage(1);
}
}
usage(0);
}

canonical_decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
__int64 v3; // rbx

v3 = 0LL;
if ( argc > 1 )
{
while ( 1 )
{
if ( !strcmp(argv[1], cmd_table[v3]) )
(*(__int64 (__fastcall **)())((char *)&action_table + v3 * 8))();
if ( ++v3 == 7 )
func14(1);
}
}
func14(0);
}

original_code:
int main(int argc, const char *argv[])
{
 if (argc < 2)
 {
  usage(0);
 }
 int i;
 int j;
 for (i = 1; i < argc; i++)
 {
  for (j = 0; j < 7; j++)
  {
   if (strcmp(argv[i], cmd_table[j]) == 0)
   {
    action_table[j]();
   }
  }
  if (j >= 7)
  {
   usage(1);
  }
 }
 return 0;
}

canonical_original_code:
int main(int argc, char *argv[])
{
 if (argc < 2)
 {
  usage(0);
 }
 int i;
 int j;
 for (i = 1; i < argc; i++)
 {
  for (j = 0; j < 7; j++)
  {
   if (strcmp(argv[i], cmd_table[j]) == 0)
   {
    action_table[j]();
   }
  }
  if (j >= 7)
  {
   usage(1);
  }
 }
 return 0;
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types: i int

variable_types: j int


usage

decompiled_code:
void __fastcall __noreturn usage(int status)
{
if ( status )
{
fprintf(stderr, "Try `%s --help' for more information.\n", "iproc");
}
else
{
printf("Usage: %s [OPTION]...\n", "iproc");
printf(
"%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
"\nprint information about current system\n",
"\t-c(--cpu: information about cpu",
"\t-m(--meninfo",
"\t-M(--mount -s(--swap",
"\t-v(--version: version of kernel",
"\t-u(--uptime: run time",
"\t-d(--devices: availabe devices");
}
exit(status);
}

canonical_decompiled_code:
void __fastcall __noreturn func14(int status)
{
if ( status )
{
fprintf(stderr, "Try `%s --help' for more information.\n", "iproc");
}
else
{
printf("Usage: %s [OPTION]...\n", "iproc");
printf(
"%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
"\nprint information about current system\n",
"\t-c(--cpu: information about cpu",
"\t-m(--meninfo",
"\t-M(--mount -s(--swap",
"\t-v(--version: version of kernel",
"\t-u(--uptime: run time",
"\t-d(--devices: availabe devices");
}
exit(status);
}

original_code:
void usage(int status)
{
 if (status != 0)
  fprintf (stderr, ("Try `%s --help' for more information.\n"),
    "iproc");
 else
 {
  printf (("Usage: %s [OPTION]...\n"), "iproc");
  printf(("%s\n%s\n%s\n%s\n%s\n%s\n%s\n"), "\nprint information about current system\n",
     "\t-c(--cpu: information about cpu",
     "\t-m(--meninfo",
     "\t-M(--mount -s(--swap",
     "\t-v(--version: version of kernel",
     "\t-u(--uptime: run time",
     "\t-d(--devices: availabe devices");
    }
 exit (status);
}

variable_types: status int


decompiled_code:
int __fastcall Shell_Main(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rbp

if ( a1 )
{
v1 = spiltline();
v2 = v1;
if ( v1 )
{
Process(v1);
LODWORD(v1) = free_list(v2);
}
}
else
{
LODWORD(v1) = printf("error, no commanline!");
}
return v1;
}

canonical_decompiled_code:
int __fastcall func0(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rbp

if ( a1 )
{
v1 = spiltline();
v2 = v1;
if ( v1 )
{
Process(v1);
LODWORD(v1) = free_list(v2);
}
}
else
{
LODWORD(v1) = printf("error, no commanline!");
}
return v1;
}

original_code:
void Shell_Main(char *command_line)
{
 if (!command_line)
 {
  printf("error, no commanline!");
  return;
 }
 char **arglist;
 int result = -1;
 if ((arglist = spiltline(command_line)) != ((void *)0))
 {
  result = Process(arglist);
  free_list(arglist);
 }
}

variable_types:
arglist
char **

variable_types: result int


decompiled_code:
__int64 do_redirect_double_output()
{
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 func0()
{
return 0xFFFFFFFFLL;
}

original_code:
int do_redirect_double_output(char **program, struct REDIRECT *redirection)
{
 return -1;
}

variable_types:
program
char **

variable_types: struct REDIRECT { char *word; enum Redirection_types { Re_singal_out=0, Re_singal_in=1, Re_double_out=2, Re_pipe=3 } red_type; char *re_file; struct REDIRECT *next; } *

user_defined_types: struct REDIRECT { char *word; enum Redirection_types red_type; char *re_file; struct REDIRECT *next; }