// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/memops.c
// Function: rewrite_load_instruction
static void rewrite_load_instruction(struct instruction *insn, struct pseudo_list *dominators)
{
	pseudo_t new = NULL;
	pseudo_t phi;

	/*
	 * Check for somewhat common case of duplicate
	 * phi nodes.
	 */
	FOR_EACH_PTR(dominators, phi) {
		if (!new)
			new = phi->def->phi_src;
		else if (new != phi->def->phi_src)
			goto complex_phi;
	} END_FOR_EACH_PTR(phi);

	/*
	 * All the same pseudo - mark the phi-nodes unused
	 * and convert the load into a LNOP and replace the
	 * pseudo.
	 */
	replace_with_pseudo(insn, new);
	FOR_EACH_PTR(dominators, phi) {
		kill_instruction(phi->def);
	} END_FOR_EACH_PTR(phi);
	goto end;

complex_phi:
	kill_use(&insn->src);
	insn->opcode = OP_PHI;
	insn->phi_list = dominators;

end:
	repeat_phase |= REPEAT_CSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x600fc
jmp 0x601a3
jmp 0x600fe
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x6018b
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x60149
cmpq $0x0, -0x20(%rbp)
jne 0x60149
jmp 0x6017d
cmpq $0x0, -0x18(%rbp)
jne 0x60162
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x6017b
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x30(%rcx), %rax
je 0x60179
jmp 0x6024c
jmp 0x6017b
jmp 0x6017d
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x60105
jmp 0x6018d
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq -0x28(%rbp), %rax
jne 0x600fe
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x357e0
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x601d1
jmp 0x6024a
jmp 0x601d3
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x60236
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x6021e
cmpq $0x0, -0x20(%rbp)
jne 0x6021e
jmp 0x6022b
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x5fd30
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x601da
jmp 0x60238
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq -0x48(%rbp), %rax
jne 0x601d3
jmp 0x60273
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
callq 0x35160
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $-0x80, %ecx
orl $0x46, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
leaq 0x2ceda(%rip), %rax     # 0x8d154
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2cece(%rip), %rax     # 0x8d154
movl %ecx, (%rax)
addq $0x60, %rsp
popq %rbp
retq
nop