// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/cse.c
// Function: cse_collect
void cse_collect(struct instruction *insn)
{
	unsigned long hash;

	hash = (insn->opcode << 3) + (insn->size >> 3);
	switch (insn->opcode) {
	case OP_SEL:
		hash += hashval(insn->src3);
		/* Fall through */	

	/* Binary arithmetic */
	case OP_ADD: case OP_SUB:
	case OP_MUL:
	case OP_DIVU: case OP_DIVS:
	case OP_MODU: case OP_MODS:
	case OP_SHL:
	case OP_LSR: case OP_ASR:
	case OP_AND: case OP_OR:

	/* Binary logical */
	case OP_XOR:

	/* Binary comparison */
	case OP_SET_EQ: case OP_SET_NE:
	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 & comparison */
	case OP_FPCMP ... OP_FPCMP_END:
	case OP_FADD:
	case OP_FSUB:
	case OP_FMUL:
	case OP_FDIV:
		hash += hashval(insn->src2);
		/* Fall through */
	
	/* Unary */
	case OP_NOT: case OP_NEG:
	case OP_FNEG:
	case OP_SYMADDR:
		hash += hashval(insn->src1);
		break;

	case OP_LABEL:
		hash += hashval(insn->bb_true);
		break;

	case OP_SETVAL:
		hash += hashval(insn->val);
		break;

	case OP_SETFVAL:
		hash += hashval(insn->fvalue);
		break;

	case OP_SEXT: case OP_ZEXT:
	case OP_TRUNC:
	case OP_PTRCAST:
	case OP_UTPTR: case OP_PTRTU:
		if (!insn->orig_type || insn->orig_type->bit_size < 0)
			return;
		hash += hashval(insn->src);

		// Note: see corresponding line in insn_compare()
		hash += hashval(insn->orig_type->bit_size);
		break;

	/* Other */
	case OP_PHI: {
		pseudo_t phi;
		FOR_EACH_PTR(insn->phi_list, phi) {
			struct instruction *def;
			if (phi == VOID || !phi->def)
				continue;
			def = phi->def;
			hash += hashval(def->src1);
			hash += hashval(def->bb);
		} END_FOR_EACH_PTR(phi);
		break;
	}

	default:
		/*
		 * Nothing to do, don't even bother hashing them,
		 * we're not going to try to CSE them
		 */
		return;
	}
	hash += hash >> 16;
	hash &= INSN_HASH_SIZE-1;
	add_instruction(insn_hash_table + hash, insn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edx
movl %edx, %eax
andl $0x7f, %eax
shrl $0xb, %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,8), %eax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
addl $-0x8, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x41, %eax
ja 0x49754
movq -0x58(%rbp), %rax
leaq 0x21e25(%rip), %rcx     # 0x6b390
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x49586
jmp 0x49588
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x49756
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x49756
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x49756
movq -0x8(%rbp), %rax
fldt 0x30(%rax)
flds 0x21da8(%rip)           # 0x6b38c
fucomi %st(1), %st
setbe %al
fldz
fcmovbe %st(1), %st
fstp %st(1)
fsubrp %st, %st(1)
fnstcw -0x4a(%rbp)
movzwl -0x4a(%rbp), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movw %cx, -0x4c(%rbp)
fldcw -0x4c(%rbp)
fistpll -0x48(%rbp)
fldcw -0x4a(%rbp)
movzbl %al, %eax
movl %eax, %ecx
shlq $0x3f, %rcx
movq -0x48(%rbp), %rax
xorq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x49756
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x49641
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
cmpl $0x0, 0x50(%rax)
jge 0x49646
jmp 0x4978f
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq 0x50(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x49756
jmp 0x49671
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x49699
jmp 0x49752
jmp 0x4969b
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x4973a
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x496e6
cmpq $0x0, -0x18(%rbp)
jne 0x496e6
jmp 0x4972c
leaq 0x426c3(%rip), %rax     # 0x8bdb0
cmpq %rax, -0x18(%rbp)
je 0x496fe
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x49700
jmp 0x4972c
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x496a2
jmp 0x4973c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq -0x20(%rbp), %rax
jne 0x4969b
jmp 0x49756
jmp 0x4978f
movq -0x10(%rbp), %rax
shrq $0x10, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0xff, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x6c361(%rip), %rdi     # 0xb5ae0
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x497a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)