// File: /workspace/github_c_makefile_star2_O1/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 0x5f11d(%rip), %rax     # 0x90700
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x318bd
movq %rcx, 0x20(%rsp)
leaq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
callq 0x225b4
cmpl $0x2, %eax
jl 0x318a7
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x2bf(%rip), %rsi       # 0x318dc
callq 0x2a384
movq (%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x318a7
xorl %r12d, %r12d
movq 0x10(%rsp), %r15
movzwl (%r15), %eax
testb %al, %al
jle 0x31892
xorl %ebx, %ebx
movq 0x18(%r15,%rbx,8), %r13
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x31661
testq %r13, %r13
je 0x31877
cmpq $0x0, 0x8(%r13)
je 0x31877
testq %r12, %r12
je 0x3187a
movq %r12, %rdi
movq %r13, %rsi
callq 0x318dc
testl %eax, %eax
jne 0x3187a
movq 0x8(%r12), %rbp
movq 0x8(%r13), %r14
cmpq %r14, %rbp
je 0x316cf
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3e021
testb %al, %al
je 0x3172c
movq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x3c2b1
movq %r13, %rdi
xorl %esi, %esi
callq 0x24adf
leaq 0x366ad(%rip), %rax     # 0x67d74
orb $0x1, (%rax)
jmp 0x31877
movq 0x28(%rbp), %rax
testq %rax, %rax
je 0x317a6
movq %rax, %rcx
movzwl (%rcx), %esi
movsbl %sil, %edx
testw %dx, %dx
jle 0x3171f
movzwl %dx, %edx
movzwl %si, %esi
xorl %edi, %edi
movq 0x18(%rcx,%rdi,8), %r8
cmpl $0x100, %esi            # imm = 0x100
jb 0x31705
testq %r8, %r8
je 0x31717
cmpq %r12, %r8
je 0x31820
cmpq %r13, %r8
je 0x3183c
incq %rdi
cmpq %rdi, %rdx
jne 0x316f3
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x316df
xorl %eax, %eax
jmp 0x317ab
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3e021
testb %al, %al
je 0x31760
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x3c2b1
movq %r12, %rdi
xorl %esi, %esi
callq 0x24adf
leaq 0x3661c(%rip), %rax     # 0x67d74
orb $0x1, (%rax)
jmp 0x3187a
movq 0x18(%rbp), %rdi
callq 0x225b4
cmpl $0x1, %eax
jne 0x317b0
movq 0x18(%rbp), %rdi
callq 0x22634
movq %rax, 0x18(%rsp)
movq 0x18(%r14), %rdi
callq 0x225b4
cmpl $0x1, %eax
jne 0x317b0
movq 0x18(%r14), %rdi
callq 0x22634
movq 0x18(%rsp), %r14
cmpq %r14, %rax
movl $0x0, %eax
cmovneq %rax, %r14
jmp 0x317b3
movl $0x2, %eax
jmp 0x31861
xorl %r14d, %r14d
testq %r14, %r14
je 0x3187a
movq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x3c2b1
movq %r13, %rdi
xorl %esi, %esi
callq 0x24adf
leaq 0x3659a(%rip), %rax     # 0x67d74
orb $0x1, (%rax)
addq $0x28, %rbp
movq %rbp, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x2296b
movq %r14, %rbp
addq $0x28, %r14
movq %r14, %rdi
callq 0x22b10
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x2285b
movq %r14, %rdi
movq %r13, %rsi
callq 0x2285b
movq %rbp, 0x8(%r12)
jmp 0x31877
movq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x3c2b1
movq %r13, %rdi
xorl %esi, %esi
callq 0x24adf
movq %r12, %r13
jmp 0x31852
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x3c2b1
movq %r12, %rdi
xorl %esi, %esi
callq 0x24adf
leaq 0x3651b(%rip), %rax     # 0x67d74
orb $0x1, (%rax)
movl $0x1, %eax
testb $0x1, %al
jne 0x3187a
movq (%rbp), %rdi
leaq 0x1915e(%rip), %rsi     # 0x4a9ce
xorl %eax, %eax
callq 0x118b4
movq %r12, %r13
incq %rbx
movl (%r15), %eax
movsbq %al, %rcx
movq %r13, %r12
cmpq %rcx, %rbx
jl 0x31649
jmp 0x31895
movq %r12, %r13
movq 0x10(%r15), %r15
movq %r13, %r12
cmpq 0x10(%rsp), %r15
jne 0x3163b
movq 0x8(%rsp), %rdi
callq 0x22cf3
leaq 0x5ee48(%rip), %rax     # 0x90700
movq 0x20(%rsp), %rcx
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x315e5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq