// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/cse.c
// Function: try_to_cse
static struct instruction * try_to_cse(struct entrypoint *ep, struct instruction *i1, struct instruction *i2)
{
	struct basic_block *b1, *b2, *common;

	/*
	 * OK, i1 and i2 are the same instruction, modulo "target".
	 * We should now see if we can combine them.
	 */
	b1 = i1->bb;
	b2 = i2->bb;

	/*
	 * Currently we only handle the uninteresting degenerate case where
	 * the CSE is inside one basic-block.
	 */
	if (b1 == b2) {
		struct instruction *insn;
		FOR_EACH_PTR(b1->insns, insn) {
			if (insn == i1)
				return cse_one_instruction(i2, i1);
			if (insn == i2)
				return cse_one_instruction(i1, i2);
		} END_FOR_EACH_PTR(insn);
		warning(b1->pos, "Whaa? unable to find CSE instructions");
		return i1;
	}
	if (domtree_dominates(b1, b2))
		return cse_one_instruction(i2, i1);

	if (domtree_dominates(b2, b1))
		return cse_one_instruction(i1, i2);

	/* No direct dominance - but we could try to find a common ancestor.. */
	common = trivial_common_parent(b1, b2);
	if (common) {
		i1 = cse_one_instruction(i2, i1);
		remove_instruction(&b1->insns, i1, 1);
		insert_last_instruction(common, i1);
	} else {
		i1 = i2;
	}

	return i1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x49dfb
jmp 0x49cfc
movq -0x28(%rbp), %rax
movq 0x28(%rax), %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 0x49d24
jmp 0x49dd9
jmp 0x49d26
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 0x49dc1
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x49d71
cmpq $0x0, -0x40(%rbp)
jne 0x49d71
jmp 0x49db3
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x49d91
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4a310
movq %rax, -0x8(%rbp)
jmp 0x49ea8
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x49db1
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4a310
movq %rax, -0x8(%rbp)
jmp 0x49ea8
jmp 0x49db3
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x49d2d
jmp 0x49dc3
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq -0x48(%rbp), %rax
jne 0x49d26
movq -0x28(%rbp), %rax
movq (%rax), %rdi
leaq 0x217d7(%rip), %rsi     # 0x6b5be
movb $0x0, %al
callq 0x16d80
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x49ea8
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5ce40
testb $0x1, %al
jne 0x49e0e
jmp 0x49e24
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4a310
movq %rax, -0x8(%rbp)
jmp 0x49ea8
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5ce40
testb $0x1, %al
jne 0x49e37
jmp 0x49e4a
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4a310
movq %rax, -0x8(%rbp)
jmp 0x49ea8
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4a360
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x49e98
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4a310
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x4a3f0
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4a420
jmp 0x49ea0
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)