LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser.c
// Function: create_proc_source
int create_proc_source()
{
//    PARSER_TREE *now_parser_tree;
//    PARSER_TREE *parser_tree_process;
//    unsigned int now_level;
    char *token;
    char *line;
    int func_num = 0;
	char *filename;
	FILE *fp;
	int size;
	char *const_header = "#include \"__extern.h\"\n\n\0";

    printf(" -> Create Process Source\n");
	
	token = calloc(STR_MAX, 1);
	line = calloc(STR_MAX, 1);

	filename = (char *)malloc(128);
	memset(filename, 0, 128);

    parser_tree_current = parser_tree_top;
    while(parser_tree_current != NULL){
        if(parser_tree_current->flag == PARSER_FLAG_PROCESS){
			sprintf(filename, "__%03d.c", func_num);
			func_num++;
			fp = fopen(filename, "wb+");
			/*
			 * ToDo: fopenのエラー処理が必要
			 */
			size = strlen(parser_tree_current->line.body);
			fwrite(const_header, 1, strlen(const_header), fp);
			fwrite(parser_tree_current->line.body, 1, size, fp);
			fclose(fp);
        }
        parser_tree_current = parser_tree_current->next_ptr;
    }

	free(token);
	free(line);

	free(filename);

    return func_num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xcbe7(%rip), %rdi      # 0xe0ad
callq 0x1070
movl $0x1, %edi
movl $0x80, %esi
callq 0x10f0
movq %rax, %rbx
movq 0x12c2c(%rip), %rax     # 0x14110
movq %rax, 0x12c2d(%rip)     # 0x14118
testq %rax, %rax
je 0x159b
leaq 0xcb71(%rip), %r15      # 0xe06c
leaq 0xcb26(%rip), %r12      # 0xe028
xorl %ebp, %ebp
cmpl $0x19, 0x10(%rax)
jne 0x1585
movq %rbx, %rdi
leaq 0xeb64(%rip), %rsi      # 0x10078
movl %ebp, %edx
xorl %eax, %eax
callq 0x11a0
incl %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1160
movq %rax, %r13
movq 0x12be4(%rip), %rax     # 0x14118
movq 0x6c50(%rax), %rdi
callq 0x1090
movq %rax, %r14
movl $0x1, %esi
movl $0x17, %edx
movq %r12, %rdi
movq %r13, %rcx
callq 0x11c0
movq 0x12bb9(%rip), %rax     # 0x14118
movq 0x6c50(%rax), %rdi
movslq %r14d, %rdx
movl $0x1, %esi
movq %r13, %rcx
callq 0x11c0
movq %r13, %rdi
callq 0x1080
movq 0x12b93(%rip), %rax     # 0x14118
movq 0x8(%rax), %rax
movq %rax, 0x12b88(%rip)     # 0x14118
testq %rax, %rax
jne 0x1504
jmp 0x159d
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: insert_parser_tree_ir
int insert_parser_tree_ir(char *str)
{
    // パーサーツリーの新規登録
    if(parser_tree_ir_top == NULL){
        parser_tree_ir_top     = (PARSER_TREE_IR *)malloc(sizeof(PARSER_TREE_IR));
        memset(parser_tree_ir_top, 0, sizeof(PARSER_TREE_IR));
        parser_tree_ir_current = parser_tree_ir_top;
    }else{
        parser_tree_ir_current->next_ptr   = (PARSER_TREE_IR *)malloc(sizeof(PARSER_TREE_IR));
        memset(parser_tree_ir_current->next_ptr, 0, sizeof(PARSER_TREE_IR));
        parser_tree_ir_prev                = parser_tree_ir_current;
        parser_tree_ir_current             = parser_tree_ir_current->next_ptr;
        parser_tree_ir_current->prev_ptr   = parser_tree_ir_prev;
        parser_tree_ir_current->next_ptr   = NULL;
    }

    // 原文の保存
    parser_tree_ir_current->str = calloc(strlen(str)+1,1);
    strcpy(parser_tree_ir_current->str, str);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x12261(%rip), %r15     # 0x14130
movl $0x1, %edi
movl $0xb838, %esi           # imm = 0xB838
callq 0x10f0
movq %rax, %r14
testq %r15, %r15
je 0x1f04
movq 0x1224b(%rip), %rax     # 0x14138
movq %r14, 0x8(%rax)
movq %rax, 0x12248(%rip)     # 0x14140
movq %r14, 0x12239(%rip)     # 0x14138
movq %rax, (%r14)
jmp 0x1f12
movq %r14, 0x12225(%rip)     # 0x14130
movq %r14, 0x12226(%rip)     # 0x14138
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x28(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: clean_parser_tree_ir
int clean_parser_tree_ir()
{
	PARSER_TREE_IR *now_parser_tree_ir;
	PARSER_TREE_IR *new_parser_tree_ir;

    now_parser_tree_ir = parser_tree_ir_top;
    while(1){
        if(now_parser_tree_ir == NULL) break;
        new_parser_tree_ir = now_parser_tree_ir->next_ptr;
		if(now_parser_tree_ir->str != NULL) free(now_parser_tree_ir->str);
        free(now_parser_tree_ir);
        now_parser_tree_ir = new_parser_tree_ir;
    }
    parser_tree_ir_top = NULL;

	if(module_name != NULL){
		free(module_name);
		module_name = NULL;
	}

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x121e6(%rip), %rbx     # 0x14130
testq %rbx, %rbx
je 0x1f71
movq 0x8(%rbx), %r14
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x1f61
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x1f4f
movq $0x0, 0x121b4(%rip) # 0x14130
movq 0x121c5(%rip), %rdi     # 0x14148
testq %rdi, %rdi
je 0x1f98
callq 0x1030
movq $0x0, 0x121b0(%rip) # 0x14148
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: get_pointer_llvm
int get_pointer_llvm(char *line, char *token)
{
	char *result;
	char *line_org;

	result = calloc(STR_MAX,1 );

	line_org = charalloc(line);

	// getelementptr
	get_token_llvm(line_org, token);
	strcpy(result, "");

	// inbounds
	get_token_llvm(line_org, token);
	strcpy(result, "");

	if(!strcmp(token, "inbounds")){
		// inboundsは無視して良い
		// "("
		get_token_llvm(line_org, token);
	}else{
		/*
		 * %x,@xの場合
		 */
		strcpy(result, token);
		strcpy(token, result);

		free(line_org);
		return 0;
	}

	// Type
	get_irtype_llvm(line_org, token);
	// Name
	get_token_llvm(line_org, token);
	strcpy(result, token);
	strcpy(token, result);

	free(line_org);
	free(result);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10f0
movq %rax, %rbx
movq %r15, %rdi
callq 0x137c
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xcaa7
movq %r15, %rdi
movq %r14, %rsi
callq 0xcaa7
leaq 0xbda4(%rip), %rsi      # 0xe1b8
movq %r14, %rdi
callq 0x1100
testl %eax, %eax
je 0x243b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1060
movq %r15, %rdi
jmp 0x247d
movq %r15, %rdi
movq %r14, %rsi
callq 0xcaa7
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbb
movq %r15, %rdi
movq %r14, %rsi
callq 0xcaa7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1060
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: get_stage_label
int get_stage_label(char *label)
{
	PARSER_TREE_IR *now_parser_tree_ir;

    now_parser_tree_ir = parser_tree_ir_top;
    while(now_parser_tree_ir != NULL){
		/*
		 * 本当はフラグも一緒に判定しておかなかければいけないかもしれない
		 */
		if(now_parser_tree_ir->flag == PARSER_IR_FLAG_LABEL){
			if(!strcmp(now_parser_tree_ir->label, sep_p(label))){
				return now_parser_tree_ir->stage;
			}
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
	}

	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x102af(%rip), %r15     # 0x14130
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x3ec9
movq %rdi, %r14
leaq 0x1(%rdi), %r12
cmpl $0xe, 0x10(%r15)
jne 0x3eba
movzbl (%r14), %eax
cmpl $0x40, %eax
je 0x3eaa
movq %r14, %rsi
cmpl $0x25, %eax
jne 0x3ead
movq %r12, %rsi
leaq 0x30(%r15), %rdi
callq 0x1100
testl %eax, %eax
je 0x3ec5
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x3e92
jmp 0x3ec9
movl 0x1c(%r15), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: search_module_llvm
int search_module_llvm(char *name, char *args)
{
	char *line;
	char *token;

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

	while(strcmp(line, "")){
		get_token_llvm(line, token);

		if(!strcmp(token, name)){
			free(line);
			return 0;
		}
	}
	free(token);
	free(line);

	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10f0
movq %rax, %r15
movq %rbx, %rdi
callq 0x137c
movq %rax, %rbx
cmpb $0x0, (%rbx)
je 0x482d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcaa7
movq %r15, %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
jne 0x480a
xorl %ebp, %ebp
jmp 0x483a
movq %r15, %rdi
callq 0x1030
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: search_args_llvm
INST_STAGE search_args_llvm(PARSER_TREE_IR *now_parser_tree_ir, char *name, char *args)
{
	char *line;
	char *token;
	int max_parallel = 0;
	int max_stage = 0;
	INST_STAGE inst_stage;

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

	// "("
	get_token_llvm(line, token);

	while(strlen(line) > 0){
		// タイプ
		get_irtype_llvm(line, token);
		if(!strcmp(token, "")) break;
		// 変数名
		get_token_llvm(line, token);
		if(!strcmp(token, "zeroext")) get_token_llvm (line, token);
		inst_stage = search_reg_llvm(now_parser_tree_ir, name ,token , "");
		if((inst_stage.parallel > max_parallel) || (inst_stage.stage > max_stage)){
			max_parallel = inst_stage.parallel;
			max_stage = inst_stage.stage;
		}
		// ","
		get_token_llvm(line, token);
	}

	free(line);

	inst_stage.stage = max_stage;
	inst_stage.parallel = max_parallel;

	return inst_stage;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, (%rsp)
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10f0
movq %rax, %r15
movq %rbx, %rdi
callq 0x137c
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcaa7
xorl %r14d, %r14d
cmpb $0x0, (%rbx)
je 0x4a43
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fbb
cmpb $0x0, (%r15)
je 0x4a33
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcaa7
movq %r15, %rdi
leaq 0x9b9b(%rip), %rsi      # 0xe56b
callq 0x1100
testl %eax, %eax
jne 0x49e4
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcaa7
movq (%rsp), %rdi
movq %r15, %rdx
leaq 0xb5d1(%rip), %rcx      # 0xffc3
callq 0x484f
movq %rax, %r13
movq %rax, %r12
shrq $0x20, %r12
cmpl %r13d, %ebp
setl %al
cmpl %r12d, %r14d
setl %cl
orb %al, %cl
jne 0x4a17
movl %ebp, %r13d
movl %r14d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcaa7
cmpb $0x0, (%rbx)
movl %r12d, %r14d
movl %r13d, %ebp
jne 0x49aa
jmp 0x4a39
movl %ebp, %r13d
movl %r14d, %r12d
shlq $0x20, %r12
movl %r13d, %r14d
orq %r12, %r14
movq %rbx, %rdi
callq 0x1030
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir.c
// Function: is_register_name
int is_register_name(char *name)
{
	int ret = 1;
	int i = 0;

	if(name[0] == '@'){
		ret = 0;
		return ret;
	}

	i = 1;

	while(name[i] != '\0'){
		if(isalpha(name[i])){
			ret = 0;
		}
		i++;
	}

	return ret;
}

// Assembly:
xorl %eax, %eax
cmpb $0x40, (%rdi)
je 0x5016
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x1(%rdi), %bpl
testb %bpl, %bpl
je 0x500b
callq 0x11d0
movq (%rax), %rcx
addq $0x2, %rbx
movl $0x1, %eax
xorl %edx, %edx
movsbq %bpl, %rsi
testb $0x4, 0x1(%rcx,%rsi,2)
cmovnel %edx, %eax
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x4ff2
jmp 0x5010
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_call.c
// Function: clean_call_tree
int clean_call_tree()
{
	CALL_TREE *now_call_tree;
	CALL_TREE *new_call_tree;

    now_call_tree = call_tree_top;
    while(now_call_tree != NULL){
        new_call_tree = now_call_tree->next_ptr;
        if(now_call_tree->call_name != NULL)	free(now_call_tree->call_name);
        if(now_call_tree->verilog != NULL)	free(now_call_tree->verilog);
        free(now_call_tree);
        now_call_tree = new_call_tree;
    }
    call_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xf52d(%rip), %rbx      # 0x14550
testq %rbx, %rbx
je 0x5058
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x503a
callq 0x1030
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x5048
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x5028
movq $0x0, 0xf4ed(%rip) # 0x14550
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_call.c
// Function: register_call_tree
int register_call_tree(char *call_name)
{
	CALL_TREE *now_call_tree		= NULL;
	CALL_TREE *old_call_tree		= NULL;

	if(!is_call_tree(call_name)){
		now_call_tree = call_tree_top;
		while(now_call_tree != NULL){
			old_call_tree = now_call_tree;
			now_call_tree = now_call_tree->next_ptr;
		}

		now_call_tree				= (CALL_TREE *)calloc(sizeof(CALL_TREE),1);
		now_call_tree->prev_ptr	= old_call_tree;
		now_call_tree->next_ptr	= NULL;

		if(call_tree_top == NULL){
			call_tree_top				= now_call_tree;
		}else{
			old_call_tree->next_ptr	= now_call_tree;
		}
		now_call_tree->signal_top_ptr = NULL;

		now_call_tree->call_name = calloc(strlen(call_name)+1,1);
		strcpy(now_call_tree->call_name, call_name);
	}else{
		// 既に生成されている
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x506d
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x516a
leaq 0xf44d(%rip), %rax      # 0x14550
xorl %ecx, %ecx
movq %rcx, %r15
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0x5105
movl $0x28, %edi
movl $0x1, %esi
callq 0x10f0
movq %rax, %r14
movq %r15, (%rax)
addq $0x8, %r15
cmpq $0x0, 0xf41b(%rip)      # 0x14550
leaq 0xf414(%rip), %rax      # 0x14550
cmoveq %rax, %r15
movq %r14, (%r15)
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_call.c
// Function: register_call_signal_tree
int register_call_signal_tree(char *call_name, char *signal_name, int num, int size, int inout)
{
	CALL_TREE *now_call_tree;
	CALL_SIGNAL_TREE *now_call_signal_tree = NULL;
	CALL_SIGNAL_TREE *old_call_signal_tree = NULL;

	now_call_tree = search_call_tree(call_name);
	
	now_call_signal_tree = now_call_tree->signal_top_ptr;
	while(now_call_signal_tree != NULL){
		old_call_signal_tree = now_call_signal_tree;
		now_call_signal_tree = now_call_signal_tree->next_ptr;
	}

	now_call_signal_tree				= (CALL_SIGNAL_TREE *)calloc(sizeof(CALL_SIGNAL_TREE),1);
	now_call_signal_tree->prev_ptr	= old_call_signal_tree;
	now_call_signal_tree->next_ptr	= NULL;

	if(now_call_tree->signal_top_ptr == NULL){
		now_call_tree->signal_top_ptr				= now_call_signal_tree;
	}else{
		old_call_signal_tree->next_ptr	= now_call_signal_tree;
	}

	now_call_signal_tree->signal_name = calloc(strlen(signal_name)+1,1);
	strcpy(now_call_signal_tree->signal_name, signal_name);

	now_call_signal_tree->inout	= inout;
	now_call_signal_tree->num	= num;
	now_call_signal_tree->size	= size;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, 0x4(%rsp)
movl %edx, %r14d
movq %rsi, %r15
callq 0x50ab
movq %rax, %r12
addq $0x20, %r12
xorl %eax, %eax
movq %r12, %rcx
movq %rax, %rbx
movq (%rcx), %rax
leaq 0x8(%rax), %rcx
testq %rax, %rax
jne 0x5199
movl $0x30, %edi
movl $0x1, %esi
callq 0x10f0
movq %rax, %r13
movq %rbx, (%rax)
addq $0x8, %rbx
cmpq $0x0, (%r12)
cmoveq %r12, %rbx
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x10(%r13)
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movl %ebp, 0x20(%r13)
movl %r14d, 0x28(%r13)
movl 0x4(%rsp), %eax
movl %eax, 0x24(%r13)
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_O3/aquaxis[P]synverll/src/parser_ir_call.c
// Function: print_call_signal_tree
int print_call_signal_tree(CALL_SIGNAL_TREE *now_call_signal_tree, char *call_name)
{
	printf("    [CALL Signal Tree List]\n");

    while(now_call_signal_tree != NULL){
		if(
			!strcmp(now_call_signal_tree->signal_name, "req") ||
			!strcmp(now_call_signal_tree->signal_name, "ready") ||
			!strcmp(now_call_signal_tree->signal_name, "done")
		){
			printf("    __call_%s_%s\n", call_name, now_call_signal_tree->signal_name);
		}else{
			printf("    __call_%s_%s_%d\n", call_name, now_call_signal_tree->signal_name, now_call_signal_tree->num);
		}
        now_call_signal_tree = now_call_signal_tree->next_ptr;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9429(%rip), %rdi      # 0xe654
callq 0x1070
testq %r14, %r14
je 0x52b2
leaq 0xaae1(%rip), %r15      # 0xfd1d
leaq 0x93c4(%rip), %r12      # 0xe607
leaq 0xaaa8(%rip), %r13      # 0xfcf2
movq 0x10(%r14), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1100
testl %eax, %eax
je 0x5299
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1100
testl %eax, %eax
je 0x5299
movq %rbp, %rdi
leaq 0xaa70(%rip), %rsi      # 0xfce6
callq 0x1100
testl %eax, %eax
je 0x5299
movl 0x28(%r14), %ecx
leaq 0x938f(%rip), %rdi      # 0xe619
movq %rbx, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10b0
jmp 0x52a9
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10b0
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x524a
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_O3/aquaxis[P]synverll/src/parser_ir_call.c
// Function: print_call_tree
int print_call_tree(CALL_TREE *now_call_tree)
{
	printf("  [CALL Tree List]\n");

    while(now_call_tree != NULL){
		printf("  %s\n", now_call_tree->call_name);
		print_call_signal_tree(now_call_tree->signal_top_ptr, now_call_tree->call_name);
        now_call_tree = now_call_tree->next_ptr;
    }
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x939f(%rip), %rdi      # 0xe670
callq 0x1070
testq %rbx, %rbx
je 0x5306
leaq 0x9221(%rip), %r14      # 0xe503
movq 0x10(%rbx), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10b0
movq 0x10(%rbx), %rsi
movq 0x20(%rbx), %rdi
callq 0x5213
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x52e2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: clean_memmap_tree
int clean_memmap_tree()
{
	MEMMAP_TREE *now_memmap_tree;
	MEMMAP_TREE *new_memmap_tree;

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
        new_memmap_tree = now_memmap_tree->next_ptr;
        if(now_memmap_tree->label != NULL)	free(now_memmap_tree->label);
        if(now_memmap_tree->module != NULL)	free(now_memmap_tree->module);
        free(now_memmap_tree);
        now_memmap_tree = new_memmap_tree;
    }
    memmap_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xf0c1(%rip), %rbx      # 0x14560
testq %rbx, %rbx
je 0x54d4
movq 0x8(%rbx), %r14
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x54b6
callq 0x1030
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x54c4
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x54a4
movq $0x0, 0xf081(%rip) # 0x14560
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: register_memmap_tree
int register_memmap_tree(char *module, char *label, int size)
{
	MEMMAP_TREE *now_memmap_tree		= NULL;
	MEMMAP_TREE *old_memmap_tree		= NULL;

	unsigned int new_adrs = 0;

	if(!is_memmap_tree(module, label)){
		// メモリマップに存在しなければ新規登録
		now_memmap_tree = memmap_tree_top;
		while(now_memmap_tree != NULL){
			old_memmap_tree = now_memmap_tree;
			now_memmap_tree = now_memmap_tree->next_ptr;
		}

		now_memmap_tree				= (MEMMAP_TREE *)calloc(sizeof(MEMMAP_TREE),1);
		now_memmap_tree->prev_ptr	= old_memmap_tree;
		now_memmap_tree->next_ptr	= NULL;

		if(memmap_tree_top == NULL){
			memmap_tree_top				= now_memmap_tree;
		}else{
			old_memmap_tree->next_ptr	= now_memmap_tree;
		}

		// 新しいアドレスの作成
		if(old_memmap_tree != NULL){
			// アドレスは4Byteアライメントに揃える
			new_adrs = (old_memmap_tree->adrs + old_memmap_tree->size + 3) & 0xFFFFFFC;
		}else{
			new_adrs = 0;
		}

		now_memmap_tree->label = calloc(strlen(label)+1,1);
		strcpy(now_memmap_tree->label, label);
		now_memmap_tree->module = calloc(strlen(module)+1,1);
		strcpy(now_memmap_tree->module, module);
		now_memmap_tree->adrs = new_adrs;		// アドレスの登録
		now_memmap_tree->size = size;			// サイズの登録
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
callq 0x55d1
testl %eax, %eax
jne 0x55bc
leaq 0xf050(%rip), %rax      # 0x14560
xorl %ecx, %ecx
movq %rcx, %r13
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0x5512
movl $0x28, %edi
movl $0x1, %esi
callq 0x10f0
movq %rax, %r12
movq %r13, (%rax)
cmpq $0x0, 0xf022(%rip)      # 0x14560
je 0x5546
movq %r12, 0x8(%r13)
jmp 0x5552
movq %r12, 0xf013(%rip)      # 0x14560
testq %r13, %r13
je 0x55cd
movl 0x20(%r13), %eax
movl 0x24(%r13), %ecx
leal (%rax,%rcx), %ebp
addl $0x3, %ebp
andl $0xffffffc, %ebp        # imm = 0xFFFFFFC
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x18(%r12)
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %r14, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x10(%r12)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1060
movl %ebp, 0x20(%r12)
movl %ebx, 0x24(%r12)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x5566
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: get_adrs_memmap
unsigned int get_adrs_memmap(char *module, char *label)
{
	MEMMAP_TREE *now_memmap_tree;

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
		if(
			!strcmp(now_memmap_tree->module, module) &&
			!strcmp(now_memmap_tree->label, label) &&
			(now_memmap_tree->size > 0)
		){
			return now_memmap_tree->adrs;
		}
        now_memmap_tree = now_memmap_tree->next_ptr;
    }

    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0xef23(%rip), %r12      # 0x14560
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x5681
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x1100
testl %eax, %eax
jne 0x5677
movq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
jne 0x5677
cmpl $0x0, 0x24(%r12)
jne 0x568f
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x564d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0x20(%r12), %ebx
jmp 0x5681
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: get_size_memmap
unsigned int get_size_memmap(char *module, char *label)
{
	MEMMAP_TREE *now_memmap_tree;

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
		if(!strcmp(now_memmap_tree->module, module) && !strcmp(now_memmap_tree->label, label)){
			return now_memmap_tree->size;
		}
        now_memmap_tree = now_memmap_tree->next_ptr;
    }

    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0xeebb(%rip), %r12      # 0x14560
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x56e8
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x1100
testl %eax, %eax
jne 0x56d7
movq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
je 0x56e3
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x56b5
jmp 0x56e8
movl 0x24(%r12), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: print_memmap_tree
int print_memmap_tree(FILE *fp)
{
	MEMMAP_TREE *now_memmap_tree;

	printf(" -> Output Memory Map\n");

	fprintf(fp, "======================================================================\n");
	fprintf(fp, "Memory Map\n");
	fprintf(fp, "======================================================================\n");
	fprintf(fp, "[GLOBAL/LOCAL]   [MEMORY NAME]                    [ADDRESS] [SIZE]\n");

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
		if(now_memmap_tree->size > 0){
			fprintf(fp, "%-16s %-32s %08x  %8d\n", now_memmap_tree->module, now_memmap_tree->label, now_memmap_tree->adrs, now_memmap_tree->size);
		}
        now_memmap_tree = now_memmap_tree->next_ptr;
    }

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

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x902d(%rip), %rdi      # 0xe732
callq 0x1070
leaq 0x8f72(%rip), %r14      # 0xe683
movl $0x47, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x11c0
leaq 0x8f9e(%rip), %rdi      # 0xe6cb
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0x47, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x11c0
leaq 0x8f7c(%rip), %rdi      # 0xe6d7
movl $0x43, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movq 0xedec(%rip), %r15      # 0x14560
testq %r15, %r15
je 0x57ab
leaq 0x8f9b(%rip), %r14      # 0xe71b
movl 0x24(%r15), %r9d
testl %r9d, %r9d
je 0x57a2
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
movl 0x20(%r15), %r8d
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1110
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x5780
leaq 0x8ed1(%rip), %rdi      # 0xe683
movl $0x47, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: clean_memory_tree
int clean_memory_tree(MEMORY_TREE *memory_tree_ptr)
{
	MEMORY_TREE *now_memory_tree;
	MEMORY_TREE *new_memory_tree;

    now_memory_tree = memory_tree_ptr;
    while(now_memory_tree != NULL){
        new_memory_tree = now_memory_tree->next_ptr;
        if(now_memory_tree->label != NULL)		free(now_memory_tree->label);
        if(now_memory_tree->verilog_args != NULL)	free(now_memory_tree->verilog_args);
        if(now_memory_tree->type != NULL)			free(now_memory_tree->type);
        free(now_memory_tree);
        now_memory_tree = new_memory_tree;
    }
    memory_tree_top = NULL;

	if(module_name != NULL){
		free(module_name);
		module_name = NULL;
	}

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x586b
movq %rdi, %rbx
movq 0x8(%rbx), %r14
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x583f
callq 0x1030
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x584d
callq 0x1030
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x585b
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x582d
movq $0x0, 0xecf2(%rip) # 0x14568
leaq 0xe8cb(%rip), %rbx      # 0x14148
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x5891
callq 0x1030
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: print_memory_tree
int print_memory_tree(MEMORY_TREE *now_memory_tree)
{
//	MEMORY_TREE *now_memory_tree;

	printf("  [Memory Tree List]\n");

    while(now_memory_tree != NULL){
		printf("  %s: ", now_memory_tree->label);
		printf("  type = %s, ", now_memory_tree->type);
		printf("  flag = %d, ", now_memory_tree->flag);
		printf("\n");
        now_memory_tree = now_memory_tree->next_ptr;
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8fa0(%rip), %rdi      # 0xe992
callq 0x1070
testq %rbx, %rbx
je 0x5a4d
leaq 0x8d94(%rip), %r14      # 0xe797
leaq 0x8d94(%rip), %r15      # 0xe79e
leaq 0x8d9b(%rip), %r12      # 0xe7ac
movq 0x18(%rbx), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10b0
movq 0x20(%rbx), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x10b0
movl 0x10(%rbx), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x10b0
movl $0xa, %edi
callq 0x1040
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x5a11
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: create_array_size
int create_array_size()
{
	MEMORY_TREE *now_memory_tree;
	int size = 0;

    now_memory_tree = memory_tree_top;
    while(now_memory_tree != NULL){
		size = get_memory_size(now_memory_tree->label, NULL, NULL);

		if(size <= 0){
			size = 0;
		}

		if(now_memory_tree->flag == MEMORY_FLAG_GLOBAL){
			// グローバルメモリ
			register_memmap_tree("GLOBAL", now_memory_tree->label, size);
		}else if(now_memory_tree->flag == MEMORY_FLAG_LOCAL){
			// ローカルメモリ
			register_memmap_tree(module_name, now_memory_tree->label, size);
		}else if(now_memory_tree->flag == MEMORY_FLAG_POINTER){
			// ポインタ
			register_memmap_tree(module_name, now_memory_tree->label, 0);
		}

        now_memory_tree = now_memory_tree->next_ptr;
    }
	if(now_memory_tree == NULL) return MEMORY_FLAG_UNKNWON;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0xd9cc(%rip), %r14      # 0x14568
testq %r14, %r14
je 0x6c05
xorl %r15d, %r15d
leaq 0xd59d(%rip), %r12      # 0x14148
leaq 0x7bde(%rip), %rbx      # 0xe790
movq 0x18(%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6877
testl %eax, %eax
cmovlel %r15d, %eax
movl 0x10(%r14), %ecx
cmpl $0x3, %ecx
je 0x6bed
cmpl $0x2, %ecx
je 0x6be1
cmpl $0x1, %ecx
jne 0x6bfc
movq 0x18(%r14), %rsi
movq %rbx, %rdi
jmp 0x6be9
movq (%r12), %rdi
movq 0x18(%r14), %rsi
movl %eax, %edx
jmp 0x6bf7
movq (%r12), %rdi
movq 0x18(%r14), %rsi
xorl %edx, %edx
callq 0x54e9
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x6bb2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: clean_module_tree
int clean_module_tree()
{
	MODULE_TREE *now_module_tree;
	MODULE_TREE *new_module_tree;

    now_module_tree = module_tree_top;
    while(now_module_tree != NULL){
        new_module_tree = now_module_tree->next_ptr;
        if(now_module_tree->module_name != NULL) free(now_module_tree->module_name);
        if(now_module_tree->memory_tree_ptr != NULL) clean_memory_tree(now_module_tree->memory_tree_ptr);
        if(now_module_tree->call_tree_ptr != NULL) clean_call_tree(now_module_tree->memory_tree_ptr);
        free(now_module_tree);
        now_module_tree = new_module_tree;
    }
    module_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xd952(%rip), %rbx      # 0x14570
testq %rbx, %rbx
je 0x6c65
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6c35
callq 0x1030
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x6c43
callq 0x5821
cmpq $0x0, 0x20(%rbx)
je 0x6c55
movq 0x18(%rbx), %rdi
xorl %eax, %eax
callq 0x5018
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x6c23
movq $0x0, 0xd900(%rip) # 0x14570
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
leaq 0xd8e1(%rip), %rax      # 0x14570
xorl %ecx, %ecx
movq %rcx, %r15
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0x6c91
movl $0x30, %edi
movl $0x1, %esi
callq 0x10f0
movq %rax, %r14
movq %r15, (%rax)
addq $0x8, %r15
cmpq $0x0, 0xd8af(%rip)      # 0x14570
leaq 0xd8a8(%rip), %rax      # 0x14570
cmoveq %rax, %r15
movq %r14, (%r15)
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
movq 0xd86d(%rip), %rax      # 0x14568
movq %rax, 0x18(%r14)
leaq 0xd84a(%rip), %rax      # 0x14550
movq (%rax), %rax
movq %rax, 0x20(%r14)
leaq 0xd88c(%rip), %rax      # 0x145a0
movl (%rax), %eax
movl %eax, 0x28(%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
leaq 0x7ca3(%rip), %rdi      # 0xe9d4
callq 0x1070
leaq 0x7946(%rip), %r14      # 0xe683
movl $0x47, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x11c0
leaq 0x7c0a(%rip), %rdi      # 0xe963
movl $0xc, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0x47, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x11c0
movq 0xd7e9(%rip), %r15      # 0x14570
testq %r15, %r15
je 0x6dad
leaq 0x7bdd(%rip), %r14      # 0xe970
movq 0x10(%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1110
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x6d93
leaq 0x78cf(%rip), %rdi      # 0xe683
movl $0x47, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xd719(%rip), %rbx      # 0x14580
testq %rbx, %rbx
je 0x6f06
movq 0x8(%rbx), %r14
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x6e82
callq 0x1030
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6e90
callq 0x1030
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x6e9e
callq 0x1030
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x6eac
callq 0x1030
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x6eba
callq 0x1030
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x6ec8
callq 0x1030
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x6ed6
callq 0x1030
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x6ee4
callq 0x1030
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x6ef2
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x6e70
movq $0x0, 0xd66f(%rip) # 0x14580
movq 0xd670(%rip), %rdi      # 0x14588
testq %rdi, %rdi
je 0x6f2d
callq 0x1030
movq $0x0, 0xd65b(%rip) # 0x14588
movq 0xd65c(%rip), %rdi      # 0x14590
testq %rdi, %rdi
je 0x6f49
callq 0x1030
movq $0x0, 0xd647(%rip) # 0x14590
movq 0xd648(%rip), %rdi      # 0x14598
testq %rdi, %rdi
je 0x6f65
callq 0x1030
movq $0x0, 0xd633(%rip) # 0x14598
movl $0x0, 0xd631(%rip)      # 0x145a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %esi
callq 0x10f0
movq %rax, %rbx
leaq 0x7585(%rip), %rsi      # 0xf10d
movq %r14, %rdi
callq 0x1100
testl %eax, %eax
je 0x7beb
leaq 0x7578(%rip), %rsi      # 0xf113
movq %r14, %rdi
callq 0x1100
testl %eax, %eax
je 0x7bf2
movzbl (%r14), %eax
cmpl $0x40, %eax
je 0x7bb5
cmpl $0x25, %eax
jne 0x7bfb
leaq 0xc58c(%rip), %r15      # 0x14148
movq (%r15), %rdi
movq %r14, %rsi
callq 0x55d1
testl %eax, %eax
je 0x7c04
movq (%r15), %rdi
movq %r14, %rsi
callq 0x562e
leaq 0x6d24(%rip), %rsi      # 0xe901
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x11a0
jmp 0x7c1b
movl $0x293028, %eax         # imm = 0x293028
jmp 0x7bf7
movl $0x293128, %eax         # imm = 0x293128
movl %eax, (%rbx)
jmp 0x7c20
leaq 0x751f(%rip), %rsi      # 0xf121
jmp 0x7c0e
incq %r14
leaq 0x750a(%rip), %rsi      # 0xf118
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x11a0
cmpb $0x0, (%rbx)
je 0x7c3f
xorl %r14d, %r14d
cmpb $0x2e, (%rbx,%r14)
jne 0x7c2f
movb $0x5f, (%rbx,%r14)
incq %r14
movq %rbx, %rdi
callq 0x1090
cmpq %r14, %rax
ja 0x7c23
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %esi
callq 0x10f0
movq %rax, %rbx
addq %r14, %r15
leaq 0x74ac(%rip), %rsi      # 0xf126
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x11a0
cmpb $0x0, (%rbx)
je 0x7cab
xorl %r14d, %r14d
cmpb $0x2e, (%rbx,%r14)
jne 0x7c9b
movb $0x5f, (%rbx,%r14)
incq %r14
movq %rbx, %rdi
callq 0x1090
cmpq %r14, %rax
ja 0x7c8f
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10f0
movq %rax, %rbx
movb $0x0, (%r12)
movq %r13, %rdi
callq 0x7b63
movq %rax, %r13
leaq 0x6e63(%rip), %rsi      # 0xf163
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 0x8337
cmpb $0x38, 0x1(%r15)
jne 0x8337
cmpb $0x0, 0x2(%r15)
je 0x8384
leaq 0x5ccb(%rip), %rsi      # 0xe009
movq %r15, %rdi
callq 0x1100
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
shll $0x4, %ecx
addl $0x10, %ecx
testl %ebp, %ebp
jne 0x836b
leaq 0x7a74(%rip), %rsi      # 0xfdd2
movq %r14, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x5170
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %ecx
jmp 0x8353
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10f0
movq %rax, %r15
movq %r14, %rdi
callq 0x137c
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0xcaa7
movq %r14, %rdi
movq %r15, %rsi
callq 0xcaa7
movq %r14, %rdi
movq %r15, %rsi
callq 0x1fbb
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_O3/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 0x845e
movq %rdi, %r15
callq 0x137c
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
movl $0x1, %esi
callq 0x10f0
movq %rax, %r15
leaq 0x5e03(%rip), %rsi      # 0xe240
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 0x137c
// File: /workspace/github_c_makefile_star2_O3/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 0xa779(%rip), %rax      # 0x14130
movq (%rax), %r13
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10f0
movq %rax, %rbx
movups 0x5db2(%rip), %xmm0     # 0xf785
movups %xmm0, (%rax)
movups 0x5db3(%rip), %xmm0     # 0xf790
movups %xmm0, 0xb(%rax)
movq 0xabb0(%rip), %rdi      # 0x14598
movq %rax, %rsi
callq 0x83ef
movq %rax, %r15
movq %rax, 0xab9e(%rip)      # 0x14598
testq %r13, %r13
je 0x9a57
leaq 0x5d9a(%rip), %r14      # 0xf7a0
cmpl $0xe, 0x10(%r13)
jne 0x9a4e
leaq 0x30(%r13), %rdi
callq 0x7c48
movq %rax, %r12
movl 0x1c(%r13), %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11a0
movq 0xab64(%rip), %rdi      # 0x14598
movq %rbx, %rsi
callq 0x83ef
movq %rax, %r15
movq %rax, 0xab52(%rip)      # 0x14598
movq %r12, %rdi
callq 0x1030
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x9a06
movups 0x5d57(%rip), %xmm0     # 0xf7b5
movups %xmm0, (%rbx)
movabsq $0xa3b6572705f6c, %rax  # imm = 0xA3B6572705F6C
movq %rax, 0xe(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83ef
movq %rax, 0xab17(%rip)      # 0x14598
movups 0x5d43(%rip), %xmm0     # 0xf7cb
movups %xmm0, (%rbx)
movw $0xa, 0x10(%rbx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x83ef
movq %rax, 0xaaf5(%rip)      # 0x14598
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_O3/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
leaq 0xa669(%rip), %rax      # 0x14130
movq (%rax), %r13
testq %r13, %r13
je 0x9b1e
movq %rdi, %rbx
leaq 0x452b(%rip), %r14      # 0xe004
leaq 0x5f15(%rip), %r15      # 0xf9f5
cmpl $0x12, 0x10(%r13)
jne 0x9b15
leaq 0x6434(%r13), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x1100
testl %eax, %eax
je 0x9b15
movq %r12, %rdi
callq 0x12dc
leal -0x1(%rax), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1110
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x9ae0
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop