LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: register_module_tree
int register_module_tree(char *module_name)
{
	MODULE_TREE *now_module_tree = NULL;
	MODULE_TREE *old_module_tree = NULL;

	// モジュールツリーに存在しなければ新規登録
	now_module_tree = module_tree_top;
	while(now_module_tree != NULL){
		old_module_tree = now_module_tree;
		now_module_tree = now_module_tree->next_ptr;
	}

	now_module_tree				= (MODULE_TREE *)calloc(sizeof(MODULE_TREE),1);
	now_module_tree->prev_ptr	= old_module_tree;
	now_module_tree->next_ptr	= NULL;

	if(module_tree_top == NULL){
		module_tree_top				= now_module_tree;
	}else{
		old_module_tree->next_ptr	= now_module_tree;
	}

	now_module_tree->module_name = calloc(strlen(module_name)+1,1);
	strcpy(now_module_tree->module_name, module_name);
	now_module_tree->memory_tree_ptr	= memory_tree_top;
	now_module_tree->call_tree_ptr		= call_tree_top;
	now_module_tree->is_module_gm_if	= is_module_gm_if;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xcbe2(%rip), %rax      # 0x13570
xorl %ecx, %ecx
movq %rcx, %r12
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0x6990
pushq $0x30
popq %rdi
pushq $0x1
popq %r15
movq %r15, %rsi
callq 0x10f0
movq %rax, %r14
movq %r12, (%rax)
addq $0x8, %r12
cmpq $0x0, 0xcbb0(%rip)      # 0x13570
leaq 0xcba9(%rip), %rax      # 0x13570
cmoveq %rax, %r12
movq %r14, (%r12)
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movq %r15, %rsi
callq 0x10f0
movq %rax, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
movq 0xcb6f(%rip), %rax      # 0x13568
movq %rax, 0x18(%r14)
leaq 0xcb4c(%rip), %rax      # 0x13550
movq (%rax), %rax
movq %rax, 0x20(%r14)
leaq 0xcb8e(%rip), %rax      # 0x135a0
movl (%rax), %eax
movl %eax, 0x28(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: print_module_tree
int print_module_tree(FILE *fp)
{
	MODULE_TREE *now_module_tree;

	printf(" -> Output Module List\n");

	fprintf(fp, "======================================================================\n");
	fprintf(fp, "Module List\n");
	fprintf(fp, "======================================================================\n");

    now_module_tree = module_tree_top;
    while(now_module_tree != NULL){
		fprintf(fp, "%s:\n", now_module_tree->module_name);
        now_module_tree = now_module_tree->next_ptr;
    }
	fprintf(fp, "======================================================================\n");
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6f7c(%rip), %rdi      # 0xd9b4
callq 0x1070
leaq 0x6c3f(%rip), %r14      # 0xd683
pushq $0x47
popq %r15
pushq $0x1
popq %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x6edf(%rip), %rdi      # 0xd943
pushq $0xc
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x11c0
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0xcae6(%rip), %r15      # 0x13570
leaq 0x6ebf(%rip), %r14      # 0xd950
movq (%r15), %r15
testq %r15, %r15
je 0x6ab0
movq 0x10(%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1110
addq $0x8, %r15
jmp 0x6a91
leaq 0x6bcc(%rip), %rdi      # 0xd683
pushq $0x47
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x11c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: clean_proc_tree
int clean_proc_tree()
{
	PROC_TREE *now_proc_tree;
	PROC_TREE *new_proc_tree;

    now_proc_tree = proc_tree_top;
    while(now_proc_tree != NULL){
        new_proc_tree = now_proc_tree->next_ptr;
        if(now_proc_tree->seq_req.state != NULL)		free(now_proc_tree->seq_req.state);
        if(now_proc_tree->seq_req.condision != NULL)	free(now_proc_tree->seq_req.condision);
        if(now_proc_tree->seq_req.body != NULL)			free(now_proc_tree->seq_req.body);
        if(now_proc_tree->seq_wait.state != NULL)		free(now_proc_tree->seq_wait.state);
        if(now_proc_tree->seq_wait.condision != NULL)	free(now_proc_tree->seq_wait.condision);
        if(now_proc_tree->seq_wait.body != NULL)		free(now_proc_tree->seq_wait.body);
        if(now_proc_tree->seq_exec.state != NULL)		free(now_proc_tree->seq_exec.state);
        if(now_proc_tree->seq_exec.condision != NULL)	free(now_proc_tree->seq_exec.condision);
        if(now_proc_tree->seq_exec.body != NULL)		free(now_proc_tree->seq_exec.body);
        free(now_proc_tree);
        now_proc_tree = new_proc_tree;
    }
    proc_tree_top = NULL;

	if(verilog_wire != NULL){
		free(verilog_wire);
		verilog_wire = NULL;
	}
	if(verilog_module != NULL){
		free(verilog_module);
		verilog_module = NULL;
	}
	if(verilog_state != NULL){
		free(verilog_state);
		verilog_state = NULL;
	}

	is_module_gm_if = 0;

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xca14(%rip), %rbx      # 0x13580
testq %rbx, %rbx
je 0x6bd3
movq 0x8(%rbx), %r14
movq 0x20(%rbx), %rdi
callq 0x1030
movq 0x28(%rbx), %rdi
callq 0x1030
movq 0x30(%rbx), %rdi
callq 0x1030
movq 0x40(%rbx), %rdi
callq 0x1030
movq 0x48(%rbx), %rdi
callq 0x1030
movq 0x50(%rbx), %rdi
callq 0x1030
movq 0x60(%rbx), %rdi
callq 0x1030
movq 0x68(%rbx), %rdi
callq 0x1030
movq 0x70(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
jmp 0x6b6c
andq $0x0, 0xc9a5(%rip)      # 0x13580
movq 0xc9a6(%rip), %rdi      # 0x13588
testq %rdi, %rdi
je 0x6bf4
callq 0x1030
andq $0x0, 0xc994(%rip)      # 0x13588
movq 0xc995(%rip), %rdi      # 0x13590
testq %rdi, %rdi
je 0x6c0d
callq 0x1030
andq $0x0, 0xc983(%rip)      # 0x13590
movq 0xc984(%rip), %rdi      # 0x13598
testq %rdi, %rdi
je 0x6c26
callq 0x1030
andq $0x0, 0xc972(%rip)      # 0x13598
andl $0x0, 0xc973(%rip)      # 0x135a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: regalloc
char *regalloc(char *name)
{
	char *buf;
	int i;
	int ret;

	// 確保している容量は暫定です
	buf=calloc(strlen(name)+20,1);
	if(!strcmp(name, "false")){
		sprintf(buf, "(0)");
	}else if(!strcmp(name, "true")){
		sprintf(buf, "(1)");
	}else if(name[0] == '%'){
		ret = is_memmap_tree(module_name, name);
		if(ret){
			// ポインターで固定アドレスを解けた場合
			ret = get_adrs_memmap(module_name, name);
			sprintf(buf, "(%d)", ret);
		}else{
			// 変数
			sprintf(buf, "__sig_%s", &name[1]);
		}
	}else if(name[0] == '@'){
		// メモリ
		ret = is_memmap_tree(module_name, name);
		if(ret){
			// メモリで固定アドレスを解けた場合
			ret = get_adrs_memmap(module_name, name);
			sprintf(buf, "(%d)", ret);
		}else{
			sprintf(buf, "__sig_%s", &name[1]);
		}
	}else{
		sprintf(buf, "(%s)", name);
	}

	for(i=0;i<strlen(buf);i++){
		if(buf[i] == '.') buf[i] = '_';
	}

	return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x1090
leaq 0x14(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, %rbx
leaq 0x69c4(%rip), %rsi      # 0xe0ed
movq %r14, %rdi
callq 0x1100
testl %eax, %eax
je 0x778c
leaq 0x69b7(%rip), %rsi      # 0xe0f3
movq %r14, %rdi
callq 0x1100
testl %eax, %eax
je 0x7794
movzbl (%r14), %eax
cmpl $0x40, %eax
je 0x7756
cmpl $0x25, %eax
jne 0x779c
leaq 0xb9eb(%rip), %r15      # 0x13148
movq (%r15), %rdi
movq %r14, %rsi
callq 0x5385
testl %eax, %eax
je 0x77a5
movq (%r15), %rdi
movq %r14, %rsi
callq 0x53de
leaq 0x6163(%rip), %rsi      # 0xd8e1
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x11a0
jmp 0x77bc
movl $0x293028, (%rbx)       # imm = 0x293028
jmp 0x77bc
movl $0x293128, (%rbx)       # imm = 0x293128
jmp 0x77bc
leaq 0x695e(%rip), %rsi      # 0xe101
jmp 0x77af
incq %r14
leaq 0x6949(%rip), %rsi      # 0xe0f8
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x11a0
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1090
cmpq %r14, %rax
jbe 0x77dd
cmpb $0x2e, (%rbx,%r14)
jne 0x77d8
movb $0x5f, (%rbx,%r14)
incq %r14
jmp 0x77bf
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: labelalloc
char *labelalloc(char *name)
{
	char *buf;
	int i;

	if(name[0] == '%'){
		buf=calloc(strlen(name)+1+8,1);
		sprintf(buf, "__label_%s", &name[1]);
	}else{
		buf=calloc(strlen(name)+1+8,1);
		sprintf(buf, "__label_%s", name);
	}

	for(i=0;i<strlen(buf);i++){
		if(buf[i] == '.') buf[i] = '_';
	}

	return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpb $0x25, (%rdi)
sete %r15b
callq 0x1090
leaq 0x9(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, %rbx
addq %r14, %r15
leaq 0x68f0(%rip), %rsi      # 0xe106
xorl %r14d, %r14d
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x11a0
movq %rbx, %rdi
callq 0x1090
cmpq %r14, %rax
jbe 0x7844
cmpb $0x2e, (%rbx,%r14)
jne 0x783f
movb $0x5f, (%rbx,%r14)
incq %r14
jmp 0x7826
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: create_verilog_call_result
int create_verilog_call_result(char *name, char *reg, char *type, char *buf, int is_call)
{
	char *temp;
	char *str;
	int width;

	temp = calloc(STR_MAX, 1);
	strcpy(buf, "");

		str = regalloc(reg);
		sprintf(temp, "\t\t\t%s <= __call_%s_result;\n", str, name);
		free(str);
		strcat(buf, temp);

		// インターフェースの作成
		if(!strcmp(type, "i8")){
			width = 8;
		}else if(!strcmp(type, "i16")){
			width = 16;
		}else if(
			!strcmp(type, "i32") ||
			!strcmp(type, "i8*") || !strcmp(type, "i16*") || !strcmp(type, "i32*")
		){
			width = 32;
		}else{
			// ポインタの場合はここに入る
			width = 32;
		}
		// call_sianal_treeへ登録
		if(!is_call) register_call_signal_tree(name, "result", 0, width, 0);

	free(temp);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x10f0
movq %rax, %rbx
movb $0x0, (%r12)
movq %r13, %rdi
callq 0x7706
movq %rax, %r13
leaq 0x62c3(%rip), %rsi      # 0xe143
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x11a0
movq %r13, %rdi
callq 0x1030
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1190
cmpb $0x69, (%r15)
jne 0x7eb7
cmpb $0x38, 0x1(%r15)
jne 0x7eb7
cmpb $0x0, 0x2(%r15)
je 0x7f04
leaq 0x514b(%rip), %rsi      # 0xd009
movq %r15, %rdi
callq 0x1100
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
shll $0x4, %ecx
addl $0x10, %ecx
testl %ebp, %ebp
jne 0x7eeb
leaq 0x6ed4(%rip), %rsi      # 0xedb2
movq %r14, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x4f40
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rcx
jmp 0x7ed3
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: get_getelement_type
int get_getelement_type(char *line, char *result)
{
	char *token;
	char *buf;

	token = calloc(STR_MAX, 1);
	buf = charalloc(line);

	get_token_llvm(buf, token);		// getelementptr
	get_token_llvm(buf, token);		// inbounds
	get_irtype_llvm(buf, token);	// Type
	strcpy(result, token);

	free(token);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x10f0
movq %rax, %r15
movq %r14, %rdi
callq 0x1372
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0xc4ad
movq %r14, %rdi
movq %r15, %rsi
callq 0xc4ad
movq %r14, %rdi
movq %r15, %rsi
callq 0x1ec1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1060
movq %r15, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: register_verilog
char * register_verilog(char *body, char *buf)
{
    char *temp = NULL;

	// Verilogコード登録
	if(body != NULL){
		temp = charalloc(body);
		free(body);
		body = calloc(strlen(temp) + strlen(buf) + 1, 1);
		sprintf(body, "%s%s", temp, buf);
		free(temp);
	}else{
		body = charalloc(buf);
	}

	return body;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x7fd8
movq %rdi, %r15
callq 0x1372
movq %rax, %r14
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1090
movq %rax, %r15
movq %rbx, %rdi
callq 0x1090
leaq (%r15,%rax), %rdi
incq %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, %r15
leaq 0x5289(%rip), %rsi      # 0xd240
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x11a0
movq %r14, %rdi
callq 0x1030
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1372
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: create_verilog_label
int create_verilog_label()
{
	PARSER_TREE_IR *now_parser_tree_ir = parser_tree_ir_top;
    char *buf;
    char *str;
	int count = 1;

	buf = calloc(STR_MAX, 1);

	sprintf(buf, "localparam __label_0 = 0;\n");
	verilog_state = register_verilog(verilog_state, buf);

    while(now_parser_tree_ir != NULL){
		if(now_parser_tree_ir->flag == PARSER_IR_FLAG_LABEL){
			str = labelalloc(now_parser_tree_ir->label);
			sprintf(buf, "localparam %s = %d;\n", str, now_parser_tree_ir->stage);
			verilog_state = register_verilog(verilog_state, buf);
			free(str);
			count++;
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
	}

	sprintf(buf, "integer __label_pre;\n");
	verilog_state = register_verilog(verilog_state, buf);
	sprintf(buf, "integer __label;\n");
	verilog_state = register_verilog(verilog_state, buf);

	free(buf);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x9bc2(%rip), %rax      # 0x13130
movq (%rax), %r13
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x10f0
movq %rax, %rbx
movups 0x51dd(%rip), %xmm0     # 0xe765
movups %xmm0, (%rax)
movups 0x51de(%rip), %xmm0     # 0xe770
movups %xmm0, 0xb(%rax)
movq 0x9ffb(%rip), %rdi      # 0x13598
movq %rax, %rsi
callq 0x7f6b
movq %rax, %r15
movq %rax, 0x9fe9(%rip)      # 0x13598
leaq 0x51ca(%rip), %r14      # 0xe780
testq %r13, %r13
je 0x9609
cmpl $0xe, 0x10(%r13)
jne 0x9603
leaq 0x30(%r13), %rdi
callq 0x77e6
movq %rax, %r12
movl 0x1c(%r13), %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11a0
movq 0x9faf(%rip), %rdi      # 0x13598
movq %rbx, %rsi
callq 0x7f6b
movq %rax, %r15
movq %rax, 0x9f9d(%rip)      # 0x13598
movq %r12, %rdi
callq 0x1030
movq 0x8(%r13), %r13
jmp 0x95b6
movups 0x5185(%rip), %xmm0     # 0xe795
movups %xmm0, (%rbx)
movabsq $0xa3b6572705f6c, %rax  # imm = 0xA3B6572705F6C
movq %rax, 0xe(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7f6b
movq %rax, 0x9f65(%rip)      # 0x13598
movups 0x5171(%rip), %xmm0     # 0xe7ab
movups %xmm0, (%rbx)
movw $0xa, 0x10(%rbx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x7f6b
movq %rax, 0x9f43(%rip)      # 0x13598
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: output_verilog_return
int output_verilog_return(FILE *fp)
{
	PARSER_TREE_IR *now_parser_tree_ir = parser_tree_ir_top;

	int width;

    while(now_parser_tree_ir != NULL){
		if(now_parser_tree_ir->flag == PARSER_IR_FLAG_RETURN){
			if(strcmp(now_parser_tree_ir->ret.type, "void")){
				width = get_width(now_parser_tree_ir->ret.type);
				fprintf(fp, "\toutput reg [%d:0] __func_result,\n", (width-1));
			}
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
	}

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x9ab4(%rip), %r13      # 0x13130
leaq 0x3981(%rip), %r14      # 0xd004
leaq 0x534b(%rip), %r15      # 0xe9d5
movq (%r13), %r13
testq %r13, %r13
je 0x96ce
cmpl $0x12, 0x10(%r13)
jne 0x96c8
leaq 0x6434(%r13), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
je 0x96c8
movq %r12, %rdi
callq 0x12dc
leal -0x1(%rax), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1110
addq $0x8, %r13
jmp 0x968a
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_signal.c
// Function: clean_signal_tree
int clean_signal_tree()
{
	SIGNAL_TREE *now_signal_tree;
	SIGNAL_TREE *new_signal_tree;

    now_signal_tree = signal_tree_top;
    while(now_signal_tree != NULL){
        new_signal_tree = now_signal_tree->next_ptr;
        if(now_signal_tree->label != NULL) free(now_signal_tree->label);
        if(now_signal_tree->verilog != NULL) free(now_signal_tree->verilog);
        free(now_signal_tree);
        now_signal_tree = new_signal_tree;
    }
    signal_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x9ec1(%rip), %rbx      # 0x135a8
testq %rbx, %rbx
je 0x970f
movq 0x8(%rbx), %r14
movq 0x18(%rbx), %rdi
callq 0x1030
movq 0x30(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
jmp 0x96e7
andq $0x0, 0x9e91(%rip)      # 0x135a8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_signal.c
// Function: create_verilog_signal
int create_verilog_signal()
{
	SIGNAL_TREE *now_signal_tree;
	char *buf;
	char *str;

	buf = calloc(STR_MAX, 1);

    now_signal_tree = signal_tree_top;
    while(now_signal_tree != NULL){
		strcpy(buf ,"");
		if(
			(now_signal_tree->flag == SIGNAL_FLAG_REG) ||
			(now_signal_tree->flag == SIGNAL_FLAG_WIRE)
		){
			switch(now_signal_tree->flag){
				case SIGNAL_FLAG_REG:
					sprintf(buf, "reg ");
					break;
				case SIGNAL_FLAG_WIRE:
					sprintf(buf, "wire ");
					break;
				default:
					break;
			}
			if(now_signal_tree->width > 0){
				sprintf(buf, "%s[%d:0] ", buf, now_signal_tree->width-1);
			}
			str = regalloc(now_signal_tree->label);
			sprintf(buf, "%s%s;", buf, str);
			free(str);
			now_signal_tree->verilog = charalloc(buf);
		}

        now_signal_tree = now_signal_tree->next_ptr;
    }

    free(buf);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x10f0
movq %rax, %rbx
leaq 0x9de0(%rip), %r13      # 0x135a8
leaq 0x3e6c(%rip), %r14      # 0xd63b
leaq 0x5278(%rip), %r15      # 0xea4e
movq (%r13), %r13
testq %r13, %r13
je 0x9865
movb $0x0, (%rbx)
movl 0x10(%r13), %eax
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0x985c
cmpl $0x1, %eax
jne 0x9803
movb $0x0, 0x4(%rbx)
movl $0x20676572, (%rbx)     # imm = 0x20676572
jmp 0x980f
movw $0x20, 0x4(%rbx)
movl $0x65726977, (%rbx)     # imm = 0x65726977
movl 0x20(%r13), %ecx
testl %ecx, %ecx
jle 0x9829
decl %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x11a0
movq 0x18(%r13), %rdi
callq 0x7706
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x11a0
movq %r12, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1372
movq %rax, 0x30(%r13)
addq $0x8, %r13
jmp 0x97d6
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_signal.c
// Function: output_signal_tree
int output_signal_tree(FILE *fp)
{
	SIGNAL_TREE *now_signal_tree;

    now_signal_tree = signal_tree_top;
    while(now_signal_tree != NULL){
		switch(now_signal_tree->flag){
			case SIGNAL_FLAG_REG:
			case SIGNAL_FLAG_WIRE:
				fprintf(fp, "%s\n", now_signal_tree->verilog);
				break;
			case SIGNAL_FLAG_RAM:
				/*
				 * RAMの直接的なVerilog HDLコードは存在しない。
				 */
				break;
			default:
				break;
		}

        now_signal_tree = now_signal_tree->next_ptr;
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x9d20(%rip), %r15      # 0x135a8
leaq 0x4217(%rip), %r14      # 0xdaa6
movq (%r15), %r15
testq %r15, %r15
je 0x98b9
movl 0x10(%r15), %eax
decl %eax
cmpl $0x1, %eax
ja 0x98b3
movq 0x30(%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1110
addq $0x8, %r15
jmp 0x988f
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_signal.c
// Function: print_signal_tree
int print_signal_tree(FILE *fp)
{
	SIGNAL_TREE *now_signal_tree;

    fprintf(fp,"==============================\n");
    fprintf(fp,"Print Signal\n");
    fprintf(fp,"==============================\n");
    now_signal_tree = signal_tree_top;
    while(now_signal_tree != NULL){
		fprintf(fp, "%s: ", now_signal_tree->label);
		switch(now_signal_tree->flag){
			case SIGNAL_FLAG_REG:
				fprintf(fp, "Reg, ");
				fprintf(fp, "width=%d,", now_signal_tree->width);
				fprintf(fp, "verilog=%s", now_signal_tree->verilog);
				break;
			case SIGNAL_FLAG_WIRE:
				fprintf(fp, "Wire, ");
				fprintf(fp, "width=%d,", now_signal_tree->width);
				fprintf(fp, "verilog=%s", now_signal_tree->verilog);
				break;
			case SIGNAL_FLAG_RAM:
				fprintf(fp, "RAM, ");
				fprintf(fp, "type=%s,", now_signal_tree->type);
				fprintf(fp, "verilog=%s", now_signal_tree->verilog);
				break;
			default:
				break;
		}
		fprintf(fp, "\n");

        now_signal_tree = now_signal_tree->next_ptr;
    }

    fprintf(fp,"==============================\n");

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3dd5(%rip), %r15      # 0xd6ab
pushq $0x1f
popq %r12
pushq $0x1
popq %r14
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x515e(%rip), %rdi      # 0xea54
pushq $0xd
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x9c8c(%rip), %r13      # 0x135a8
leaq 0x3e56(%rip), %r15      # 0xd779
leaq 0x5148(%rip), %r12      # 0xea72
pushq $0xa
popq %rbp
movq (%r13), %r13
testq %r13, %r13
je 0x99e3
movq 0x18(%r13), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1110
movl 0x10(%r13), %eax
cmpl $0x3, %eax
je 0x9995
cmpl $0x2, %eax
je 0x9969
cmpl $0x1, %eax
jne 0x99d0
leaq 0x50fd(%rip), %rdi      # 0xea62
pushq $0x5
jmp 0x9972
leaq 0x510d(%rip), %rdi      # 0xea7d
pushq $0x6
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl 0x20(%r13), %edx
movq %rbx, %rdi
leaq 0x50dc(%rip), %rsi      # 0xea68
xorl %eax, %eax
callq 0x1110
jmp 0x99bf
leaq 0x50e8(%rip), %rdi      # 0xea84
pushq $0x5
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movq 0x28(%r13), %rdx
movq %rbx, %rdi
leaq 0x50d2(%rip), %rsi      # 0xea8a
xorl %eax, %eax
callq 0x1110
movq 0x30(%r13), %rdx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1110
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10d0
addq $0x8, %r13
jmp 0x992d
leaq 0x3cc1(%rip), %rdi      # 0xd6ab
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x11c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: register_top_module_decl
int register_top_module_decl(char *line)
{
	char *temp = NULL;

	if(top_module_decl == NULL){
		top_module_decl = calloc(strlen(line)+1, 1);
		sprintf(top_module_decl, "%s", line);
	}else{
		temp = calloc(strlen(top_module_decl)+1, 1);
		strcpy(temp, top_module_decl);
		free(top_module_decl);
		top_module_decl = calloc(strlen(temp)+strlen(line)+1, 1);
		sprintf(top_module_decl, "%s%s", temp, line);
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x9ba2(%rip), %r15      # 0x135c0
testq %r15, %r15
je 0x9a93
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
pushq $0x1
popq %r12
movq %r12, %rsi
callq 0x10f0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1090
movq %rax, %r15
movq %rbx, %rdi
callq 0x1090
leaq (%r15,%rax), %rdi
incq %rdi
movq %r12, %rsi
callq 0x10f0
movq %rax, 0x9b46(%rip)      # 0x135c0
leaq 0x37bf(%rip), %rsi      # 0xd240
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x11a0
jmp 0x9ab9
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, 0x9b12(%rip)      # 0x135c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: register_top_module_assign
int register_top_module_assign(char *line)
{
	char *temp = NULL;

	if(top_module_assign == NULL){
		top_module_assign = calloc(strlen(line)+1, 1);
		sprintf(top_module_assign, "%s", line);
	}else{
		temp = calloc(strlen(top_module_assign)+1, 1);
		strcpy(temp, top_module_assign);
		free(top_module_assign);
		top_module_assign = calloc(strlen(temp)+strlen(line)+1, 1);
		sprintf(top_module_assign, "%s%s", temp, line);
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x9aef(%rip), %r15      # 0x135c8
testq %r15, %r15
je 0x9b4e
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
pushq $0x1
popq %r12
movq %r12, %rsi
callq 0x10f0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1090
movq %rax, %r15
movq %rbx, %rdi
callq 0x1090
leaq (%r15,%rax), %rdi
incq %rdi
movq %r12, %rsi
callq 0x10f0
movq %rax, 0x9a93(%rip)      # 0x135c8
leaq 0x3704(%rip), %rsi      # 0xd240
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x11a0
jmp 0x9b74
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, 0x9a5f(%rip)      # 0x135c8
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: search_top_signal_call_args
char *search_top_signal_call_args(char *call_name, int args_num)
{
	TOP_SIGNAL_TREE *now_top_signal_tree = NULL;
	char *result = NULL;
	char *label = NULL;
	char *signal_name = NULL;
	char *verilog = NULL;

	result = calloc(STR_MAX, 1);
//printf("call_name: %s_%s(%d)\n", call_name, name, args_num);

	signal_name = calloc(STR_MAX, 1);
	label = calloc(STR_MAX, 1);

	sprintf(label, "__call_%s_%s_%d", call_name, "args", args_num);
	sprintf(signal_name, "%s", label);
//printf("call_name: %s\n", signal_name);

	now_top_signal_tree = top_signal_tree_top;
    while(now_top_signal_tree != NULL){
		if(now_top_signal_tree->flag == FLAG_CALL){
			if(!strcmp(now_top_signal_tree->label, label)){
				sprintf(result, "%s %s |", result, now_top_signal_tree->verilog_signal);
				now_top_signal_tree->used = 1;
//printf("    call_name: %s <> %s\n", now_top_signal_tree->label, label);
			}
		}
        now_top_signal_tree = now_top_signal_tree->next_ptr;
	}

	if(strlen(result) > 0){
		result[strlen(result)-1] = ';';
		verilog = calloc(strlen(result)+1, 1);
		strcpy(verilog, result);
//printf("    result: %s,%s\n", result, verilog);
	}

	free(result);

	return verilog;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r15
pushq $0x1
popq %r14
movl $0x400, %edi            # imm = 0x400
movq %r14, %rsi
callq 0x10f0
movq %rax, %rbx
movl $0x400, %edi            # imm = 0x400
movq %r14, %rsi
callq 0x10f0
movq %rax, %r14
leaq 0x4d74(%rip), %rsi      # 0xeac0
leaq 0x43eb(%rip), %rcx      # 0xe13e
movq %rax, %rdi
movq %r15, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x11a0
leaq 0x9846(%rip), %r12      # 0x135b0
leaq 0x4d5f(%rip), %r15      # 0xead0
movq (%r12), %r12
testq %r12, %r12
je 0x9db7
cmpl $0x5, 0x30(%r12)
jne 0x9db1
movq 0x10(%r12), %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
jne 0x9db1
movq 0x50(%r12), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x11a0
movl $0x1, 0x20(%r12)
addq $0x8, %r12
jmp 0x9d71
movq %rbx, %rdi
callq 0x1090
testq %rax, %rax
je 0x9ded
movb $0x3b, -0x1(%rbx,%rax)
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
jmp 0x9df0
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1030
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: create_top_wire
int create_top_wire(FILE *fp)
{
	TOP_SIGNAL_TREE *now_top_signal_tree;

	now_top_signal_tree = top_signal_tree_top;
    while(now_top_signal_tree != NULL){
		fprintf(fp, "%s\n", now_top_signal_tree->verilog_wire);
        now_top_signal_tree = now_top_signal_tree->next_ptr;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x91d0(%rip), %r15      # 0x135b0
leaq 0x36bf(%rip), %r14      # 0xdaa6
movq (%r15), %r15
testq %r15, %r15
je 0xa406
movq 0x58(%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1110
addq $0x8, %r15
jmp 0xa3e7
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: create_top_nowire
int create_top_nowire(FILE *fp)
{
	TOP_SIGNAL_TREE *now_top_signal_tree;

	now_top_signal_tree = top_signal_tree_top;
    while(now_top_signal_tree != NULL){
		if(now_top_signal_tree->used == 0){
			if(now_top_signal_tree->flag == FLAG_ARGS){
				if(now_top_signal_tree->inout == SIG_IN){
					fprintf(fp, "\tinput ");
				}else{
					fprintf(fp, "\toutput ");
				}
				if(now_top_signal_tree->size > 0){
					fprintf(fp, "[%d:0] ", now_top_signal_tree->size*8-1);
				}
				fprintf(fp, "%s,\n", now_top_signal_tree->label);
			}else if(now_top_signal_tree->flag == FLAG_RETURN){
				fprintf(fp, "\toutput ");
				if(now_top_signal_tree->size > 0){
					fprintf(fp, "[%d:0] ", now_top_signal_tree->size*8-1);
				}
				fprintf(fp, "%s\n", now_top_signal_tree->label);
			}
		}
        now_top_signal_tree = now_top_signal_tree->next_ptr;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x918d(%rip), %r13      # 0x135b0
leaq 0x4802(%rip), %r14      # 0xec2c
pushq $0x8
popq %r15
pushq $0x1
popq %r12
movq (%r13), %r13
testq %r13, %r13
je 0xa4db
cmpl $0x0, 0x20(%r13)
jne 0xa4d2
movl 0x30(%r13), %eax
cmpl $0x6, %eax
je 0xa467
cmpl $0x3, %eax
jne 0xa4d2
cmpl $0x0, 0x1c(%r13)
je 0xa485
movq %r14, %rdi
movq %r15, %rsi
jmp 0xa48f
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x11c0
movl 0x18(%r13), %eax
leaq 0x3623(%rip), %rbp      # 0xdaa6
jmp 0xa4a5
leaq 0x4798(%rip), %rdi      # 0xec24
pushq $0x7
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x11c0
movl 0x18(%r13), %eax
leaq 0x47a5(%rip), %rbp      # 0xec4a
testl %eax, %eax
jle 0xa4c1
leal -0x1(,%rax,8), %edx
movq %rbx, %rdi
leaq 0x3183(%rip), %rsi      # 0xd63d
xorl %eax, %eax
callq 0x1110
movq 0x10(%r13), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1110
addq $0x8, %r13
jmp 0xa432
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: create_top_nofunc
int create_top_nofunc(FILE *fp)
{
	TOP_SIGNAL_TREE *now_top_signal_tree;

	now_top_signal_tree = top_signal_tree_top;
    while(now_top_signal_tree != NULL){
		if((now_top_signal_tree->used == 0) && (
			(now_top_signal_tree->flag == FLAG_CTRL) ||
			(now_top_signal_tree->flag == FLAG_ARGS) ||
			(now_top_signal_tree->flag == FLAG_RETURN)
			)
		){
			if(now_top_signal_tree->inout == SIG_IN){
				fprintf(fp, "assign %s = %s;\n", now_top_signal_tree->verilog_signal, now_top_signal_tree->label);
			}else{
				fprintf(fp, "assign %s = %s;\n", now_top_signal_tree->label, now_top_signal_tree->verilog_signal);
			}
		}
        now_top_signal_tree = now_top_signal_tree->next_ptr;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x90b3(%rip), %r15      # 0x135b0
pushq $0x4a
popq %rbp
leaq 0x3fd0(%rip), %r14      # 0xe4d7
movq (%r15), %r15
testq %r15, %r15
je 0xa556
cmpl $0x0, 0x20(%r15)
jne 0xa550
movl 0x30(%r15), %eax
cmpl $0x6, %eax
ja 0xa550
btl %eax, %ebp
jae 0xa550
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x0, 0x1c(%r15)
setne %al
sete %cl
shll $0x6, %ecx
shll $0x6, %eax
movq 0x10(%r15,%rcx), %rdx
movq 0x10(%r15,%rax), %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1110
addq $0x8, %r15
jmp 0xa507
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_ir_top.c
// Function: create_top_global
int create_top_global(FILE *fp)
{
	MODULE_TREE *now_module_tree = NULL;
	MEMORY_TREE *now_memory_tree = NULL;

	char *label;
	label				= calloc(STR_MAX, 1);

    now_module_tree = module_tree_top;
    while(now_module_tree != NULL){
			now_memory_tree = now_module_tree->memory_tree_ptr;
			while(now_memory_tree != NULL){
				if(now_memory_tree->flag == MEMORY_FLAG_GLOBAL){
					sprintf(label, "%s", convname(sep_p(now_memory_tree->label)));
					fprintf(fp, "\tinput [31:0] __base_%s,\n", label);
				}
				now_memory_tree = now_memory_tree->next_ptr;
			}
        now_module_tree = now_module_tree->next_ptr;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x10f0
movq %rax, %r14
leaq 0x8fea(%rip), %r12      # 0x13570
leaq 0x46a8(%rip), %r15      # 0xec35
movq (%r12), %r12
testq %r12, %r12
je 0xa5eb
leaq 0x18(%r12), %r13
movq (%r13), %r13
testq %r13, %r13
je 0xa5e5
cmpl $0x1, 0x10(%r13)
jne 0xa5df
movq 0x18(%r13), %rdi
movzbl (%rdi), %eax
cmpl $0x40, %eax
je 0xa5bc
cmpl $0x25, %eax
jne 0xa5bf
incq %rdi
callq 0x1393
movq %r14, %rdi
movq %rax, %rsi
callq 0x1060
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1110
addq $0x8, %r13
jmp 0xa59b
addq $0x8, %r12
jmp 0xa58d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_struct.c
// Function: clean_struct_tree
int clean_struct_tree()
{
	STRUCT_TREE *now_struct_tree;
	STRUCT_TREE *new_struct_tree;

    now_struct_tree = struct_tree_top;
    while(now_struct_tree != NULL){
        new_struct_tree = now_struct_tree->next_ptr;
        if(now_struct_tree->label != NULL) free(now_struct_tree->label);
        if(now_struct_tree->argument != NULL) free(now_struct_tree->argument);
        free(now_struct_tree);
        now_struct_tree = new_struct_tree;
    }
    struct_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x7f81(%rip), %rbx      # 0x135d0
testq %rbx, %rbx
je 0xb677
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rdi
callq 0x1030
movq 0x18(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
jmp 0xb64f
andq $0x0, 0x7f51(%rip)      # 0x135d0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_struct.c
// Function: register_struct_tree
int register_struct_tree(char *label, char *argument)
{
	STRUCT_TREE *now_struct_tree = NULL;
	STRUCT_TREE *old_struct_tree = NULL;

	now_struct_tree = struct_tree_top;
	while(now_struct_tree != NULL){
		old_struct_tree = now_struct_tree;
		now_struct_tree = now_struct_tree->next_ptr;
	}

	now_struct_tree				= (STRUCT_TREE *)calloc(sizeof(STRUCT_TREE),1);
	now_struct_tree->prev_ptr	= old_struct_tree;
	now_struct_tree->next_ptr	= NULL;

	if(struct_tree_top == NULL){
		struct_tree_top				= now_struct_tree;
	}else{
		old_struct_tree->next_ptr	= now_struct_tree;
	}


	now_struct_tree->label = charalloc(label);
	now_struct_tree->argument = charalloc(argument);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7f32(%rip), %rax      # 0x135d0
xorl %ecx, %ecx
movq %rcx, %r12
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0xb6a0
pushq $0x28
popq %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, %r15
movq %r12, (%rax)
addq $0x8, %r12
cmpq $0x0, 0x7f04(%rip)      # 0x135d0
leaq 0x7efd(%rip), %rax      # 0x135d0
cmoveq %rax, %r12
movq %r15, (%r12)
movq %r14, %rdi
callq 0x1372
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x1372
movq %rax, 0x18(%r15)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_struct.c
// Function: parser_struct_tree
int parser_struct_tree()
{
	PARSER_TREE_IR *now_parser_tree_ir;

    printf("[Parsing struct type for LLCM-IR]\n");

    now_parser_tree_ir = parser_tree_ir_top;
    while(now_parser_tree_ir != NULL){
		if(now_parser_tree_ir->flag == PARSER_IR_FLAG_TYPE){
			register_struct_tree(now_parser_tree_ir->label, now_parser_tree_ir->type.name);
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
    }

    return 0;
}

// Assembly:
pushq %rbx
leaq 0x38f8(%rip), %rdi      # 0xf001
callq 0x1070
leaq 0x7a1b(%rip), %rbx      # 0x13130
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xb739
cmpl $0x4, 0x10(%rbx)
jne 0xb733
leaq 0x30(%rbx), %rdi
leaq 0x1830(%rbx), %rsi
callq 0xb689
addq $0x8, %rbx
jmp 0xb715
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_struct.c
// Function: get_struct_argument
int get_struct_argument(char *label, char *argument)
{
	STRUCT_TREE *now_struct_tree;

	strcpy(argument, "");

    now_struct_tree = struct_tree_top;
    while(now_struct_tree != NULL){
		if(!strcmp(now_struct_tree->label, label)){
			strcpy(argument, now_struct_tree->argument);
			break;
		}
		now_struct_tree = now_struct_tree->next_ptr;
    }

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, (%rsi)
leaq 0x7e7e(%rip), %r15      # 0x135d0
movq (%r15), %r15
testq %r15, %r15
je 0xb77c
movq 0x10(%r15), %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
je 0xb770
addq $0x8, %r15
jmp 0xb752
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x1060
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/parser_struct.c
// Function: is_struct_name
int is_struct_name(char *label)
{
	STRUCT_TREE *now_struct_tree;

    now_struct_tree = struct_tree_top;
    while(now_struct_tree != NULL){
		if(!strcmp(now_struct_tree->label, label)) break;
		now_struct_tree = now_struct_tree->next_ptr;
    }
    if(now_struct_tree == NULL) return 0;

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x7e3d(%rip), %r15      # 0x135d0
pushq $0x1
popq %rbx
movq (%r15), %r15
testq %r15, %r15
je 0xb7b4
movq 0x10(%r15), %rdi
movq %r14, %rsi
callq 0x1100
addq $0x8, %r15
testl %eax, %eax
jne 0xb796
jmp 0xb7b6
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/synverll.c
// Function: split_c_source
int split_c_source(char *filename)
{
    int function_count;
	int i;
	char *llvm_command;

	printf("[C Source Parser Start]\n");

    read_file(filename);								// ファイルの読み込みとトークン取得
    set_token_order_current(get_token_order_top());	// トークンのポインタをトップへ戻す

    parser_c_source();									// 構文解析
    function_count = create_proc_source();				// Processの処理
    create_header_source();								// Lineの処理

	// トークンオーダーをクリーンナップする
	clean_token_order();

	printf(" -> Function Count: %d\n", function_count);

	/*
	 * 分離したCソースコードをLLVMでコンパイルする
	 */
	printf("[LLVM Compile Start]\n");
	llvm_command = malloc(256);

	for(i = 0; i < function_count; i++){
		sprintf(llvm_command, "clang -S -m32 -O3 -emit-llvm __%03d.c", i);
		system(llvm_command);
	}

	free(llvm_command);

	return function_count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x390c(%rip), %rdi      # 0xf0de
callq 0x1070
movq %rbx, %rdi
callq 0xc3e9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xc3b5
movq %rax, %rdi
callq 0xc3c5
xorl %eax, %eax
callq 0x19d5
xorl %eax, %eax
callq 0x1491
movl %eax, %ebx
xorl %eax, %eax
callq 0x1580
xorl %eax, %eax
callq 0xc344
leaq 0x380e(%rip), %rdi      # 0xf023
movl %ebx, %esi
xorl %eax, %eax
callq 0x10b0
leaq 0x38d1(%rip), %rdi      # 0xf0f6
callq 0x1070
movl $0x100, %edi            # imm = 0x100
callq 0x1130
movq %rax, %r14
testl %ebx, %ebx
movl %ebx, %r12d
cmovlel %ebp, %r12d
leaq 0x37f4(%rip), %r15      # 0xf03b
xorl %ebp, %ebp
cmpl %ebp, %r12d
je 0xb869
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x11a0
movq %r14, %rdi
callq 0x10a0
incl %ebp
jmp 0xb849
movq %r14, %rdi
callq 0x1030
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/synverll.c
// Function: help
void help()
{
    printf("Synverll Rev %d.%02d\n", REVISION_MAIN, REVISION_MANOR);
    printf(" Synthesis for Verilog HDL using LLVM\n");
    printf(" C Source to Verilog-HDL Convertor\n");
    printf(" Hidemi Ishihara <hidemi(at)aquaxis.com>\n");
    printf("\n");
    printf("Usage:\n");
//    printf(" synverll C_SOURCE_FILENAME TOP_MODULE_NAME\n");
    printf(" synverll [-d] C_SOURCE_FILENAME\n");
    printf("  -d: Debug Mode(output a debug file)\n");
}

// Assembly:
pushq %rax
leaq 0x3422(%rip), %rdi      # 0xf0af
pushq $0x1
popq %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x10b0
leaq 0x349c(%rip), %rdi      # 0xf13c
callq 0x1070
leaq 0x34b6(%rip), %rdi      # 0xf162
callq 0x1070
leaq 0x34cd(%rip), %rdi      # 0xf185
callq 0x1070
pushq $0xa
popq %rdi
callq 0x1040
leaq 0x34e2(%rip), %rdi      # 0xf1ae
callq 0x1070
leaq 0x34dd(%rip), %rdi      # 0xf1b5
callq 0x1070
leaq 0x34f2(%rip), %rdi      # 0xf1d6
popq %rax
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/synverll.c
// Function: main
int main(int argc,char *argv[])
{
    char *filename;
    unsigned int i;

    if(argc > 1){
        // 引数の解析
        for(i = 1; i < argc; i++){
            if(!strcmp(argv[i],"--help")){
                help(); // ヘルプの表示
                exit(0);
            }else if(!strcmp(argv[i],"-d")){
				debug_mode = 1;
			}
        }

		if(argc < 2){
            help(); // ヘルプの表示
            exit(0);
		}

		filename = argv[1];
//		topname  = argv[2];

		topname = calloc(strlen(filename) +10, 1);
		strcpy(topname, filename);
		topname[strlen(topname)-2] = 0;
		strcat(topname, "_top");
		printf("topname: %s\n", topname);

        process(filename);
    }else{
        help(); // ヘルプの表示
    }
    exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jl 0xbd46
movq %rsi, %rbx
movl %edi, %r12d
pushq $0x1
popq %r13
leaq 0x33ba(%rip), %r14      # 0xf0c5
cmpq %r13, %r12
je 0xbd4d
movq (%rbx,%r13,8), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
je 0xbd46
cmpb $0x2d, (%r15)
jne 0xbd41
cmpb $0x64, 0x1(%r15)
jne 0xbd41
cmpb $0x0, 0x2(%r15)
jne 0xbd41
movl $0x1, 0x7897(%rip)      # 0x135d8
incq %r13
jmp 0xbd0b
callq 0xbc85
jmp 0xbdb7
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x1090
leaq 0xa(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x10f0
movq %rax, %r14
movq %rax, 0x7871(%rip)      # 0x135e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
movq %r14, %rdi
callq 0x1090
xorl %ebp, %ebp
movb %bpl, -0x2(%r14,%rax)
movq %r14, %rdi
callq 0x1090
movb %bpl, 0x4(%r14,%rax)
movl $0x706f745f, (%r14,%rax) # imm = 0x706F745F
leaq 0x332c(%rip), %rdi      # 0xf0d1
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
movq %rbx, %rdi
callq 0xbaf2
xorl %edi, %edi
callq 0x11b0
nop
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/token.c
// Function: insert_token_order
int insert_token_order(char *line, char *token, FILE *fp)
{
//    TOKEN_ORDER *new_token_order;

    if(!strcmp(token,"//")){
        // //のコメント行は行末までコメントなので読み飛ばす
        do{
            get_line(line, fp);
            get_token(line, token);
        }while(strcmp(token,"\n"));
    }else if(!strcmp(token,"/*")){
        // /*のコメント行は*/までコメントなので読み飛ばす
        do{
            get_line(line, fp);
            get_token(line, token);
        }while(strcmp(token,"*/"));
        // 改行の場合は何もしない
    }else if(!strcmp(token,"\r")){
        // 改行の場合は何もしない
    }else if(!strcmp(token,"")){
        // トークンに何もない場合は何も処理しない
    }else{
        // トークンオーダーの新規取得
        create_token_order();

        // トークンオーダーにトークンを登録する
        token_order_current->str = (char *)malloc(strlen(token)+1);
        strcpy(token_order_current->str, token);
    }
    return 0;
}

// Assembly:
movzbl (%rsi), %eax
testl %eax, %eax
je 0xc2ed
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpl $0xd, %eax
je 0xc2b6
cmpl $0x2f, %eax
jne 0xc2bc
movq %rdx, %r14
movq %rdi, %r15
cmpb $0x2f, 0x1(%rbx)
jne 0xc25e
cmpb $0x0, 0x2(%rbx)
je 0xc293
cmpb $0x2a, 0x1(%rbx)
jne 0xc2bc
cmpb $0x0, 0x2(%rbx)
jne 0xc2bc
movq %r15, %rdi
movq %r14, %rsi
callq 0xbdde
movq %r15, %rdi
movq %rbx, %rsi
callq 0xbe02
cmpb $0x2a, (%rbx)
jne 0xc26a
cmpb $0x2f, 0x1(%rbx)
jne 0xc26a
cmpb $0x0, 0x2(%rbx)
jne 0xc26a
jmp 0xc2e8
movq %r15, %rdi
movq %r14, %rsi
callq 0xbdde
movq %r15, %rdi
movq %rbx, %rsi
callq 0xbe02
cmpb $0xa, (%rbx)
jne 0xc293
cmpb $0x0, 0x1(%rbx)
jne 0xc293
jmp 0xc2e8
cmpb $0x0, 0x1(%rbx)
je 0xc2e8
callq 0xc2f0
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
callq 0x1130
movq 0x7317(%rip), %rcx      # 0x135f0
movq %rax, 0x10(%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/token.c
// Function: create_token_order
int create_token_order()
{
    // トークンオーダーの生成
    if(token_order_top == NULL){
        // 先頭トークンオーダーが空の場合、新規取得したトークンオーダーをセットする
        token_order_top = (TOKEN_ORDER *)malloc(sizeof(TOKEN_ORDER));
        token_order_current = token_order_top;
    }else{
        token_order_current->next_ptr = (TOKEN_ORDER *)malloc(sizeof(TOKEN_ORDER));
        token_order_prev    = token_order_current;
        token_order_current = token_order_prev->next_ptr;
    }
    token_order_current->next_ptr   = NULL;
    token_order_current->str        = NULL;
    return 0;
}

// Assembly:
pushq %rbx
movq 0x72f0(%rip), %rbx      # 0x135e8
pushq $0x18
popq %rdi
callq 0x1130
testq %rbx, %rbx
je 0xc322
movq 0x72e4(%rip), %rcx      # 0x135f0
movq %rax, (%rcx)
movq 0x72da(%rip), %rax      # 0x135f0
movq %rax, 0x72db(%rip)      # 0x135f8
movq (%rax), %rax
jmp 0xc329
movq %rax, 0x72bf(%rip)      # 0x135e8
movq %rax, 0x72c0(%rip)      # 0x135f0
andq $0x0, (%rax)
movq 0x72b5(%rip), %rax      # 0x135f0
andq $0x0, 0x10(%rax)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/token.c
// Function: clean_token_order
int clean_token_order()
{
    TOKEN_ORDER *new_token_order;

    token_order_current = token_order_top;
    while(1){
        if(token_order_current == NULL) break;
        new_token_order = token_order_current->next_ptr;
        free(token_order_current);
        token_order_current = new_token_order;
    }
    token_order_top = NULL;
    return 0;
}

// Assembly:
pushq %rbx
movq 0x729c(%rip), %rdi      # 0x135e8
movq %rdi, 0x729d(%rip)      # 0x135f0
testq %rdi, %rdi
je 0xc365
movq (%rdi), %rbx
callq 0x1030
movq %rbx, %rdi
jmp 0xc34c
andq $0x0, 0x727b(%rip)      # 0x135e8
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/token.c
// Function: read_token
int read_token(char *token)
{
    if(token_order_current != NULL){
        strcpy(token, token_order_current->str);
        token_order_prev    = token_order_current;
        token_order_current = token_order_current->next_ptr;
        return 0;
    }else{
        *token = '\0';
        return 1;
    }
}

// Assembly:
movq 0x7278(%rip), %rax      # 0x135f0
testq %rax, %rax
je 0xc3a6
pushq %rax
movq 0x10(%rax), %rsi
callq 0x1060
movq 0x7262(%rip), %rax      # 0x135f0
movq %rax, 0x7263(%rip)      # 0x135f8
movq (%rax), %rax
movq %rax, 0x7251(%rip)      # 0x135f0
xorl %eax, %eax
addq $0x8, %rsp
retq
movb $0x0, (%rdi)
pushq $0x1
popq %rax
retq