// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/cse.c
// Function: insn_compare
static int insn_compare(const void *_i1, const void *_i2)
{
	const struct instruction *i1 = _i1;
	const struct instruction *i2 = _i2;
	int size1, size2;
	int diff;

	if (i1->opcode != i2->opcode)
		return i1->opcode < i2->opcode ? -1 : 1;

	switch (i1->opcode) {

	/* commutative binop */
	case OP_ADD:
	case OP_MUL:
	case OP_AND: case OP_OR:
	case OP_XOR:
	case OP_SET_EQ: case OP_SET_NE:
		if (i1->src1 == i2->src2 && i1->src2 == i2->src1)
			return 0;
		goto case_binops;

	case OP_SEL:
		if (i1->src3 != i2->src3)
			return i1->src3 < i2->src3 ? -1 : 1;
		/* Fall-through to binops */

	/* Binary arithmetic */
	case OP_SUB:
	case OP_DIVU: case OP_DIVS:
	case OP_MODU: case OP_MODS:
	case OP_SHL:
	case OP_LSR: case OP_ASR:

	/* Binary comparison */
	case OP_SET_LE: case OP_SET_GE:
	case OP_SET_LT: case OP_SET_GT:
	case OP_SET_B:  case OP_SET_A:
	case OP_SET_BE: case OP_SET_AE:

	/* floating-point arithmetic */
	case OP_FPCMP ... OP_FPCMP_END:
	case OP_FADD:
	case OP_FSUB:
	case OP_FMUL:
	case OP_FDIV:
	case_binops:
		if (i1->src2 != i2->src2)
			return i1->src2 < i2->src2 ? -1 : 1;
		/* Fall through to unops */

	/* Unary */
	case OP_NOT: case OP_NEG:
	case OP_FNEG:
	case OP_SYMADDR:
		if (i1->src1 != i2->src1)
			return i1->src1 < i2->src1 ? -1 : 1;
		break;

	case OP_LABEL:
		if (i1->bb_true != i2->bb_true)
			return i1->bb_true < i2->bb_true ? -1 : 1;
		break;

	case OP_SETVAL:
		if (i1->val != i2->val)
			return i1->val < i2->val ? -1 : 1;
		break;

	case OP_SETFVAL:
		diff = memcmp(&i1->fvalue, &i2->fvalue, sizeof(i1->fvalue));
		if (diff)
			return diff;
		break;

	/* Other */
	case OP_PHI:
		return phi_list_compare(i1->phi_list, i2->phi_list);

	case OP_SEXT: case OP_ZEXT:
	case OP_TRUNC:
	case OP_PTRCAST:
	case OP_UTPTR: case OP_PTRTU:
		if (i1->src != i2->src)
			return i1->src < i2->src ? -1 : 1;

		// Note: if it can be guaranted that identical ->src
		// implies identical orig_type->bit_size, then this
		// test and the hashing of the original size in
		// cse_collect() are not needed.
		// It must be generaly true but it isn't guaranted (yet).
		size1 = i1->orig_type->bit_size;
		size2 = i2->orig_type->bit_size;
		if (size1 != size2)
			return size1 < size2 ? -1 : 1;
		break;

	default:
		warning(i1->pos, "bad instruction on hash chain");
	}
	if (i1->size != i2->size)
		return i1->size < i2->size ? -1 : 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7f, %ecx
cmpl %ecx, %eax
je 0x499ef
movq -0x20(%rbp), %rax
movl (%rax), %edx
andl $0x7f, %edx
movq -0x28(%rbp), %rax
movl (%rax), %esi
andl $0x7f, %esi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %esi, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
addl $-0x8, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x41, %eax
ja 0x49c55
movq -0x40(%rbp), %rax
leaq 0x21a83(%rip), %rcx     # 0x6b498
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x49a4e
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jne 0x49a4e
movl $0x0, -0x4(%rbp)
jmp 0x49cae
jmp 0x49a92
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x40(%rcx), %rax
je 0x49a8a
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49a8c
jmp 0x49a8e
jmp 0x49a90
jmp 0x49a92
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
je 0x49acc
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49ace
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
je 0x49b08
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49c6b
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
je 0x49b47
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49c6b
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
je 0x49b86
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49c6b
movq -0x20(%rbp), %rdi
addq $0x30, %rdi
movq -0x28(%rbp), %rsi
addq $0x30, %rsi
movl $0x10, %edx
callq 0x11180
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x49bb9
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49c6b
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x49ec0
movl %eax, -0x4(%rbp)
jmp 0x49cae
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
je 0x49c15
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movl 0x50(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movl 0x50(%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0x49c53
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %esi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %esi, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
jmp 0x49c6b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x2193c(%rip), %rsi     # 0x6b5a0
movb $0x0, %al
callq 0x16d80
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x8, %eax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
shrl $0x8, %ecx
cmpl %ecx, %eax
je 0x49ca7
movq -0x20(%rbp), %rax
movl (%rax), %edx
shrl $0x8, %edx
movq -0x28(%rbp), %rax
movl (%rax), %esi
shrl $0x8, %esi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %esi, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x49cae
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)