// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1070
movq %rax, %rdi
addq $0x14, %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x96ac(%rip), %rsi      # 0x14111
callq 0x10d0
cmpl $0x0, %eax
jne 0xaa86
movq -0x10(%rbp), %rdi
leaq 0x969d(%rip), %rsi      # 0x14117
movb $0x0, %al
callq 0x1160
jmp 0xabb3
movq -0x8(%rbp), %rdi
leaq 0x968a(%rip), %rsi      # 0x1411b
callq 0x10d0
cmpl $0x0, %eax
jne 0xaab2
movq -0x10(%rbp), %rdi
leaq 0x967a(%rip), %rsi      # 0x14120
movb $0x0, %al
callq 0x1160
jmp 0xabb1
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0xab26
leaq 0xd663(%rip), %rax      # 0x18128
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x7900
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xab07
leaq 0xd647(%rip), %rax      # 0x18128
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x7980
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0x8e73(%rip), %rsi      # 0x13971
movb $0x0, %al
callq 0x1160
jmp 0xab21
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x1, %rdx
leaq 0x960a(%rip), %rsi      # 0x14124
movb $0x0, %al
callq 0x1160
jmp 0xabaf
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0xab97
leaq 0xd5ef(%rip), %rax      # 0x18128
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x7900
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xab7b
leaq 0xd5d3(%rip), %rax      # 0x18128
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x7980
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0x8dff(%rip), %rsi      # 0x13971
movb $0x0, %al
callq 0x1160
jmp 0xab95
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x1, %rdx
leaq 0x9596(%rip), %rsi      # 0x14124
movb $0x0, %al
callq 0x1160
jmp 0xabad
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x9587(%rip), %rsi      # 0x1412d
movb $0x0, %al
callq 0x1160
jmp 0xabaf
jmp 0xabb1
jmp 0xabb3
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1070
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0xac01
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0xabf4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x5f, (%rax,%rcx)
jmp 0xabf6
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xabba
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)