// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/cse.c
// Function: cse_eliminate
void cse_eliminate(struct entrypoint *ep)
{
	int i;

	for (i = 0; i < INSN_HASH_SIZE; i++) {
		struct instruction_list **list = insn_hash_table + i;
		if (*list) {
			if (instruction_list_size(*list) > 1) {
				struct instruction *insn, *last;

				sort_instruction_list(list);

				last = NULL;
				FOR_EACH_PTR(*list, insn) {
					if (!insn->bb)
						continue;
					if (last) {
						if (!insn_compare(last, insn))
							insn = try_to_cse(ep, last, insn);
					}
					last = insn;
				} END_FOR_EACH_PTR(insn);
			}
			free_ptr_list(list);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x5e839(%rip), %rax     # 0x8f700
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x3112c
movq %rcx, 0x20(%rsp)
leaq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
callq 0x22530
cmpl $0x2, %eax
jl 0x31116
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x24a(%rip), %rsi       # 0x3114b
callq 0x29f40
movq (%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x31116
xorl %r12d, %r12d
movq 0x10(%rsp), %rbx
movzwl (%rbx), %eax
testb %al, %al
jle 0x31107
xorl %r15d, %r15d
movq 0x18(%rbx,%r15,8), %r13
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x30f41
testq %r13, %r13
je 0x30f5f
cmpq $0x0, 0x8(%r13)
je 0x30f5f
testq %r12, %r12
je 0x30f5c
movq %r12, %rdi
movq %r13, %rsi
callq 0x3114b
testl %eax, %eax
je 0x30f72
movq %r13, %r12
incq %r15
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %r15
jl 0x30f2d
jmp 0x31107
movq 0x8(%r12), %rbp
movq 0x8(%r13), %r14
cmpq %r14, %rbp
je 0x30fb6
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3d05e
testb %al, %al
je 0x3101a
movq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x3b384
movq %r13, %rdi
xorl %esi, %esi
callq 0x24a3f
leaq 0x35dc3(%rip), %rax     # 0x66d74
orb $0x1, (%rax)
jmp 0x30f5f
movq 0x28(%rbp), %rax
testq %rax, %rax
je 0x31003
movq %rax, %rcx
movzwl (%rcx), %esi
movsbl %sil, %edx
testw %dx, %dx
jle 0x30ffa
movzwl %dx, %edx
movzwl %si, %esi
xorl %edi, %edi
movq 0x18(%rcx,%rdi,8), %r8
cmpl $0x100, %esi            # imm = 0x100
jb 0x30fe8
testq %r8, %r8
je 0x30ff2
cmpq %r12, %r8
je 0x30f93
cmpq %r13, %r8
je 0x31029
incq %rdi
cmpq %rdi, %rdx
jne 0x30fd6
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x30fc2
movq (%rbp), %rdi
leaq 0x18930(%rip), %rsi     # 0x4993e
xorl %eax, %eax
callq 0x118fc
jmp 0x30f5f
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3d05e
testb %al, %al
je 0x3104e
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x3b384
movq %r12, %rdi
xorl %esi, %esi
callq 0x24a3f
leaq 0x35d2e(%rip), %rax     # 0x66d74
orb $0x1, (%rax)
jmp 0x30f5c
movq 0x18(%rbp), %rdi
callq 0x22530
cmpl $0x1, %eax
jne 0x30f5c
movq 0x18(%rbp), %rdi
callq 0x225b0
movq %rax, 0x18(%rsp)
movq 0x18(%r14), %rdi
callq 0x22530
cmpl $0x1, %eax
jne 0x30f5c
movq 0x18(%r14), %rdi
callq 0x225b0
movq 0x18(%rsp), %r14
testq %r14, %r14
je 0x30f5c
cmpq %r14, %rax
jne 0x30f5c
movq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x3b384
movq %r13, %rdi
xorl %esi, %esi
callq 0x24a3f
leaq 0x35cb6(%rip), %rax     # 0x66d74
orb $0x1, (%rax)
addq $0x28, %rbp
movq %rbp, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x228ce
movq %r14, %rbp
addq $0x28, %r14
movq %r14, %rdi
callq 0x22a6b
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x227b4
movq %r14, %rdi
movq %r13, %rsi
callq 0x227b4
movq %rbp, 0x8(%r12)
jmp 0x30f5f
movq 0x10(%rbx), %rbx
cmpq 0x10(%rsp), %rbx
jne 0x30f1f
movq 0x8(%rsp), %rdi
callq 0x22c4e
leaq 0x5e5d9(%rip), %rax     # 0x8f700
movq 0x20(%rsp), %rcx
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x30ec9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq