// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/ssa.c
// Function: ssa_rename_insn
static void ssa_rename_insn(struct basic_block *bb, struct instruction *insn)
{
	struct instruction *def;
	struct symbol *var;
	pseudo_t addr;
	pseudo_t val;

	switch (insn->opcode) {
	case OP_STORE:
		addr = insn->src;
		if (addr->type != PSEUDO_SYM)
			break;
		var = addr->sym;
		if (!var || !var->torename)
			break;
		phi_map_update(&bb->phi_map, var, insn);
		add_instruction(&stores, insn);
		break;
	case OP_LOAD:
		addr = insn->src;
		if (addr->type != PSEUDO_SYM)
			break;
		var = addr->sym;
		if (!var || !var->torename)
			break;
		def = lookup_var(bb, var);
		if (!def) {
			val = undef_pseudo();
		} else if (!matching_load(def, insn)) {
			var->torename = false;
			break;
		} else {
			val = def->target;
		}
		replace_with_pseudo(insn, val);
		break;
	case OP_PHI:
		var = insn->type;
		if (!var || !var->torename)
			break;
		phi_map_update(&bb->phi_map, var, insn);
		add_instruction(&phis_all, insn);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
movl %eax, -0x34(%rbp)
subl $0x43, %eax
je 0x3ece1
jmp 0x3ec57
movl -0x34(%rbp), %eax
subl $0x44, %eax
je 0x3ec72
jmp 0x3ec61
movl -0x34(%rbp), %eax
subl $0x46, %eax
je 0x3ed8c
jmp 0x3edd8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x5, 0x4(%rax)
je 0x3ec8d
jmp 0x3edd8
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3ecb2
movq -0x20(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x14, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x3ecb7
jmp 0x3edd8
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x3ede0
movq -0x10(%rbp), %rsi
leaq 0x520f1(%rip), %rdi     # 0x90dc8
callq 0x3ee10
jmp 0x3edd8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x5, 0x4(%rax)
je 0x3ecfc
jmp 0x3edd8
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3ed21
movq -0x20(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x14, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x3ed26
jmp 0x3edd8
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3ee40
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3ed49
callq 0x1a4f0
movq %rax, -0x30(%rbp)
jmp 0x3ed7d
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3eea0
testb $0x1, %al
jne 0x3ed6f
movq -0x20(%rbp), %rax
movl 0x54(%rax), %ecx
andl $0xffefffff, %ecx       # imm = 0xFFEFFFFF
orl $0x0, %ecx
movl %ecx, 0x54(%rax)
jmp 0x3edd8
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x3ed7d
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x357e0
jmp 0x3edd8
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3edb1
movq -0x20(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x14, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x3edb3
jmp 0x3edd8
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x3ede0
movq -0x10(%rbp), %rsi
leaq 0x52005(%rip), %rdi     # 0x90dd8
callq 0x3ee10
addq $0x40, %rsp
popq %rbp
retq
nop