LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, 0x15d0c(%rip)     # 0x18110
jne 0x243a
movl $0xb838, %edi           # imm = 0xB838
callq 0x1100
movq %rax, 0x15cf9(%rip)     # 0x18110
movq 0x15cf2(%rip), %rdi     # 0x18110
xorl %esi, %esi
movl $0xb838, %edx           # imm = 0xB838
callq 0x10a0
movq 0x15cdf(%rip), %rax     # 0x18110
movq %rax, 0x15ce0(%rip)     # 0x18118
jmp 0x24a9
movl $0xb838, %edi           # imm = 0xB838
callq 0x1100
movq %rax, %rcx
movq 0x15cca(%rip), %rax     # 0x18118
movq %rcx, 0x8(%rax)
movq 0x15cbf(%rip), %rax     # 0x18118
movq 0x8(%rax), %rdi
xorl %esi, %esi
movl $0xb838, %edx           # imm = 0xB838
callq 0x10a0
movq 0x15ca8(%rip), %rax     # 0x18118
movq %rax, 0x15ca9(%rip)     # 0x18120
movq 0x15c9a(%rip), %rax     # 0x18118
movq 0x8(%rax), %rax
movq %rax, 0x15c8f(%rip)     # 0x18118
movq 0x15c90(%rip), %rcx     # 0x18120
movq 0x15c81(%rip), %rax     # 0x18118
movq %rcx, (%rax)
movq 0x15c77(%rip), %rax     # 0x18118
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %rcx
movq 0x15c4b(%rip), %rax     # 0x18118
movq %rcx, 0x28(%rax)
movq 0x15c40(%rip), %rax     # 0x18118
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x1050
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x15c11(%rip), %rax     # 0x18110
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x250c
jmp 0x2543
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2530
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2503
movq $0x0, 0x15bc2(%rip) # 0x18110
cmpq $0x0, 0x15bd2(%rip)     # 0x18128
je 0x256f
movq 0x15bc9(%rip), %rdi     # 0x18128
callq 0x1030
movq $0x0, 0x15bb9(%rip) # 0x18128
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x13b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11ca0
movq -0x20(%rbp), %rdi
leaq 0x12299(%rip), %rsi     # 0x14fc1
callq 0x1050
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11ca0
movq -0x20(%rbp), %rdi
leaq 0x1227c(%rip), %rsi     # 0x14fc1
callq 0x1050
movq -0x18(%rbp), %rdi
leaq 0x1047b(%rip), %rsi     # 0x131d0
callq 0x10d0
cmpl $0x0, %eax
jne 0x2d6e
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11ca0
jmp 0x2d9a
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1050
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1050
movq -0x28(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
jmp 0x2de7
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x25b0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11ca0
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1050
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1050
movq -0x28(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq 0x12cad(%rip), %rax     # 0x18110
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x54e0
movq -0x18(%rbp), %rax
cmpl $0xe, 0x10(%rax)
jne 0x54d2
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x549c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x54aa
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x54b2
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x54d0
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x54e7
jmp 0x54d2
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x5467
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x13b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0xee96(%rip), %rsi      # 0x14fc1
callq 0x10d0
cmpl $0x0, %eax
je 0x6168
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x11ca0
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x6166
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
jmp 0x6181
jmp 0x6120
movq -0x28(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x13b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x11ca0
movq -0x28(%rbp), %rdi
callq 0x1070
cmpq $0x0, %rax
jbe 0x645a
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x25b0
movq -0x30(%rbp), %rdi
leaq 0xebf7(%rip), %rsi      # 0x14fc1
callq 0x10d0
cmpl $0x0, %eax
jne 0x63d9
jmp 0x645a
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x11ca0
movq -0x30(%rbp), %rdi
leaq 0xd228(%rip), %rsi      # 0x13619
callq 0x10d0
cmpl $0x0, %eax
jne 0x6408
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x11ca0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0xeba6(%rip), %rcx      # 0x14fc1
callq 0x6190
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x34(%rbp), %eax
jg 0x643c
movl -0x4(%rbp), %eax
cmpl -0x38(%rbp), %eax
jle 0x6448
movl -0x8(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x11ca0
jmp 0x639f
movq -0x28(%rbp), %rdi
callq 0x1030
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir.c
// Function: search_proc_llvm
INST_STAGE search_proc_llvm(PARSER_TREE_IR *now_parser_tree_ir, int flag)
{
    now_parser_tree_ir = now_parser_tree_ir->prev_ptr;

	INST_STAGE inst_stage;

	inst_stage.parallel = 0;
	inst_stage.stage = 0;

	while(now_parser_tree_ir != parser_tree_ir_top){
		if(
			(now_parser_tree_ir->flag == PARSER_IR_FLAG_CALL) ||
			(now_parser_tree_ir->flag == PARSER_IR_FLAG_SCALL) ||
			(now_parser_tree_ir->flag == PARSER_IR_FLAG_STORE) ||
			(now_parser_tree_ir->flag == PARSER_IR_FLAG_LOAD) ||
			(now_parser_tree_ir->flag == PARSER_IR_FLAG_LABEL)
		){
			inst_stage.parallel = now_parser_tree_ir->parallel;
			inst_stage.stage = now_parser_tree_ir->stage;
			break;
		}

        now_parser_tree_ir = now_parser_tree_ir->prev_ptr;
	}

	return inst_stage;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x11c61(%rip), %rax     # 0x18110
je 0x6506
movq -0x10(%rbp), %rax
cmpl $0x10, 0x10(%rax)
je 0x64e3
movq -0x10(%rbp), %rax
cmpl $0x13, 0x10(%rax)
je 0x64e3
movq -0x10(%rbp), %rax
cmpl $0x5, 0x10(%rax)
je 0x64e3
movq -0x10(%rbp), %rax
cmpl $0x8, 0x10(%rax)
je 0x64e3
movq -0x10(%rbp), %rax
cmpl $0xe, 0x10(%rax)
jne 0x64f9
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6506
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x64a4
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir.c
// Function: search_maxstage_llvm
INST_STAGE search_maxstage_llvm(PARSER_TREE_IR *now_parser_tree_ir)
{
    now_parser_tree_ir = now_parser_tree_ir->prev_ptr;

	INST_STAGE inst_stage;

	inst_stage.parallel = 0;
	inst_stage.stage = 0;

	while(now_parser_tree_ir != parser_tree_ir_top){
		if(inst_stage.stage < now_parser_tree_ir->stage){
//			inst_stage.parallel = now_parser_tree_ir->parallel;
			inst_stage.stage = now_parser_tree_ir->stage;
			break;
		}
        now_parser_tree_ir = now_parser_tree_ir->prev_ptr;
	}

	return inst_stage;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x11bd4(%rip), %rax     # 0x18110
je 0x6563
movl -0x4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x6556
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6563
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x6531
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x6fe5
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x703a
movl $0x1, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x7034
callq 0x1190
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x7029
movl $0x0, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6fec
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x114d1(%rip), %rax     # 0x18530
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x70b9
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x708e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x70a6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7063
movq $0x0, 0x1146c(%rip) # 0x18530
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_call.c
// Function: is_call_tree
int is_call_tree(char *call_name)
{
	CALL_TREE *now_call_tree = NULL;
	now_call_tree = call_tree_top;
	while(now_call_tree != NULL){
		if(!strcmp(now_call_tree->call_name, call_name)) return 1;
		now_call_tree = now_call_tree->next_ptr;
	}
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x11445(%rip), %rax     # 0x18530
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7123
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x7115
movl $0x1, -0x4(%rbp)
jmp 0x712a
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x70ef
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_call.c
// Function: search_call_tree
CALL_TREE * search_call_tree(char *call_name)
{
	CALL_TREE *now_call_tree = NULL;
	now_call_tree = call_tree_top;
	while(now_call_tree != NULL){
		if(!strcmp(now_call_tree->call_name, call_name)) return now_call_tree;
		now_call_tree = now_call_tree->next_ptr;
	}
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x113d5(%rip), %rax     # 0x18530
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7194
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x7186
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x719c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x715f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x70d0
cmpl $0x0, %eax
jne 0x7297
movq 0x1134b(%rip), %rax     # 0x18530
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7206
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x71e9
movl $0x28, %edi
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0x112f8(%rip)     # 0x18530
jne 0x7247
movq -0x18(%rbp), %rax
movq %rax, 0x112eb(%rip)     # 0x18530
jmp 0x7253
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1050
jmp 0x72a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x72a7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7140
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x7310
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x72f3
movl $0x30, %edi
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x7353
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x735f
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1050
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x20(%rax)
movl -0x14(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x18(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x24(%rax)
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xc268(%rip), %rdi      # 0x1363f
movb $0x0, %al
callq 0x1090
cmpq $0x0, -0x8(%rbp)
je 0x7482
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xd91b(%rip), %rsi      # 0x14d13
callq 0x10d0
cmpl $0x0, %eax
je 0x7434
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xd8d7(%rip), %rsi      # 0x14ce8
callq 0x10d0
cmpl $0x0, %eax
je 0x7434
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xd8b2(%rip), %rsi      # 0x14cdc
callq 0x10d0
cmpl $0x0, %eax
jne 0x7450
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0xc215(%rip), %rdi      # 0x1365c
movb $0x0, %al
callq 0x1090
jmp 0x7471
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xc204(%rip), %rdi      # 0x1366e
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x73de
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xc1e0(%rip), %rdi      # 0x13683
movb $0x0, %al
callq 0x1090
cmpq $0x0, -0x8(%rbp)
je 0x74ea
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0xc0f1(%rip), %rdi      # 0x135b1
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x73c0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x74aa
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x10e21(%rip), %rax     # 0x18540
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x7779
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x774e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x7766
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7723
movq $0x0, 0x10dbc(%rip) # 0x18540
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7900
cmpl $0x0, %eax
jne 0x78ee
movq 0x10d69(%rip), %rax     # 0x18540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x77f8
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x77db
movl $0x28, %edi
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0x10d16(%rip)     # 0x18540
jne 0x7839
movq -0x20(%rbp), %rax
movq %rax, 0x10d09(%rip)     # 0x18540
jmp 0x7845
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, -0x28(%rbp)
je 0x7867
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x28(%rbp), %rcx
addl 0x24(%rcx), %eax
addl $0x3, %eax
andl $0xffffffc, %eax        # imm = 0xFFFFFFC
movl %eax, -0x2c(%rbp)
jmp 0x786e
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x1050
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x24(%rax)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: is_memmap_tree
int is_memmap_tree(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 1;
		}
        now_memmap_tree = now_memmap_tree->next_ptr;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq 0x10c29(%rip), %rax     # 0x18540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7965
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x7957
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x7957
movl $0x1, -0x4(%rbp)
jmp 0x796c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x791b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq 0x10ba9(%rip), %rax     # 0x18540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x79f2
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x79e4
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x79e4
movq -0x20(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jbe 0x79e4
movq -0x20(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x79f9
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x799b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq 0x10b19(%rip), %rax     # 0x18540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7a78
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x7a6a
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x10d0
cmpl $0x0, %eax
jne 0x7a6a
movq -0x20(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x7a7f
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7a2b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xbc22(%rip), %rdi      # 0x136c5
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rdi
leaq 0xbc27(%rip), %rsi      # 0x136dc
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
leaq 0xbc09(%rip), %rsi      # 0x136d0
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
leaq 0xbc03(%rip), %rsi      # 0x136dc
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
leaq 0xbc39(%rip), %rsi      # 0x13724
movb $0x0, %al
callq 0x10e0
movq 0x10a47(%rip), %rax     # 0x18540
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7b4e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jbe 0x7b40
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x20(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x24(%rax), %r9d
leaq 0xbc2f(%rip), %rsi      # 0x13768
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x7afd
movq -0x8(%rbp), %rdi
leaq 0xbb83(%rip), %rsi      # 0x136dc
movb $0x0, %al
callq 0x10e0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: alloc_memory_tree
MEMORY_TREE * alloc_memory_tree(){
	MEMORY_TREE *now_memory_tree		= NULL;
	MEMORY_TREE *old_memory_tree		= NULL;

	// メモリツリーに存在しなければ新規登録
	now_memory_tree = memory_tree_top;
	while(now_memory_tree != NULL){
		old_memory_tree = now_memory_tree;
		now_memory_tree = now_memory_tree->next_ptr;
	}

	now_memory_tree				= (MEMORY_TREE *)calloc(sizeof(MEMORY_TREE),1);
	now_memory_tree->prev_ptr	= old_memory_tree;
	now_memory_tree->next_ptr	= NULL;

	if(memory_tree_top == NULL){
		memory_tree_top				= now_memory_tree;
	}else{
		old_memory_tree->next_ptr	= now_memory_tree;
	}

	return now_memory_tree;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq $0x0, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq 0x109b9(%rip), %rax     # 0x18548
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x7bb0
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x7b93
movl $0x48, %edi
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0x10966(%rip)     # 0x18548
jne 0x7bf1
movq -0x8(%rbp), %rax
movq %rax, 0x10959(%rip)     # 0x18548
jmp 0x7bfd
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7cb2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x7c6f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x7c87
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7c9f
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1030
movq -0x10(%rbp), %rdi
callq 0x1030
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x7c44
movq $0x0, 0x1088b(%rip) # 0x18548
leaq 0x10464(%rip), %rax     # 0x18128
cmpq $0x0, (%rax)
je 0x7ce7
leaq 0x10457(%rip), %rax     # 0x18128
movq (%rax), %rdi
callq 0x1030
leaq 0x10448(%rip), %rax     # 0x18128
movq $0x0, (%rax)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xb8a2(%rip), %rdi      # 0x137b5
movb $0x0, %al
callq 0x1090
cmpq $0x0, -0x8(%rbp)
je 0x7f7e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
leaq 0xb89b(%rip), %rdi      # 0x137cb
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0xb88c(%rip), %rdi      # 0x137d2
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0xb885(%rip), %rdi      # 0x137e0
movb $0x0, %al
callq 0x1090
leaq 0xd057(%rip), %rdi      # 0x14fc0
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x7f1a
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x14(%rbp)
movq 0xed22(%rip), %rax      # 0x18548
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x98da
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x9420
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x9859
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x987c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
leaq 0x9f1b(%rip), %rdi      # 0x13790
callq 0x7790
jmp 0x98c9
movq -0x10(%rbp), %rax
cmpl $0x2, 0x10(%rax)
jne 0x98a2
leaq 0xe89b(%rip), %rax      # 0x18128
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
callq 0x7790
jmp 0x98c7
movq -0x10(%rbp), %rax
cmpl $0x3, 0x10(%rax)
jne 0x98c5
leaq 0xe875(%rip), %rax      # 0x18128
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
callq 0x7790
jmp 0x98c7
jmp 0x98c9
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x982a
cmpq $0x0, -0x10(%rbp)
jne 0x98ea
movl $0x0, -0x4(%rbp)
jmp 0x98f1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0xec41(%rip), %rax      # 0x18550
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x9983
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x993e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x9956
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x7c30
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x9970
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movb $0x0, %al
callq 0x7050
movq -0x8(%rbp), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9913
movq $0x0, 0xebc2(%rip) # 0x18550
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: search_module_tree
int search_module_tree(char *module, char label)
{
	MODULE_TREE *now_module_tree;

    now_module_tree = module_tree_top;
    while(now_module_tree != NULL){
        now_module_tree = now_module_tree->next_ptr;
    }
    if(now_module_tree == NULL) return -1;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq 0xeb9b(%rip), %rax      # 0x18550
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x99ce
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x99b9
cmpq $0x0, -0x20(%rbp)
jne 0x99de
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x99e5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq 0xeb3d(%rip), %rax      # 0x18550
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9a34
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x9a17
movl $0x30, %edi
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0xeaea(%rip)      # 0x18550
jne 0x9a75
movq -0x10(%rbp), %rax
movq %rax, 0xeadd(%rip)      # 0x18550
jmp 0x9a81
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x1050
movq 0xea8a(%rip), %rcx      # 0x18548
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq 0xea63(%rip), %rax      # 0x18530
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
leaq 0xeaa1(%rip), %rax      # 0x18580
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x9ed0(%rip), %rdi      # 0x139d3
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rdi
leaq 0x9bc7(%rip), %rsi      # 0x136dc
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
leaq 0x9eb7(%rip), %rsi      # 0x139de
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
leaq 0x9ba3(%rip), %rsi      # 0x136dc
movb $0x0, %al
callq 0x10e0
movq 0xea09(%rip), %rax      # 0x18550
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9b7a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x9e86(%rip), %rsi      # 0x139eb
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x9b4b
movq -0x8(%rbp), %rdi
leaq 0x9b57(%rip), %rsi      # 0x136dc
movb $0x0, %al
callq 0x10e0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)