// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/simplify.c
// Function: simplify_instruction
int simplify_instruction(struct instruction *insn)
{
	unsigned flags;
	int changed = 0;

	flags = opcode_table[insn->opcode].flags;
	if (flags & OPF_TARGET) {
		if (!has_users(insn->target))
			return kill_instruction(insn);
	}
	if (flags & OPF_COMMU)
		canonicalize_commutative(insn) ;
	if (flags & OPF_COMPARE)
		canonicalize_compare(insn) ;
	if (flags & OPF_BINOP) {
		if ((changed = simplify_binop(insn)))
			return changed;
	}
	if (flags & OPF_ASSOC) {
		if ((changed = simplify_associative_binop(insn)))
			return changed;
	}
	if (flags & OPF_UNOP) {
		if ((changed = simplify_unop(insn)))
			return changed;
	}

	switch (insn->opcode) {
	case OP_ADD: return simplify_add(insn);
	case OP_SUB: return simplify_sub(insn);
	case OP_AND: return simplify_and(insn);
	case OP_OR:  return simplify_ior(insn);
	case OP_XOR: return simplify_xor(insn);
	case OP_MUL:
	case OP_SHL:
	case OP_LSR:
	case OP_ASR:
	case OP_NOT:
	case OP_NEG:
	case OP_DIVU:
	case OP_DIVS:
	case OP_MODU:
	case OP_MODS:
		break;
	case OP_BINCMP ... OP_BINCMP_END:
		return simplify_compare(insn);
	case OP_LOAD:
	case OP_STORE:
		return simplify_memop(insn);
	case OP_SYMADDR:
		return replace_with_pseudo(insn, insn->src);
	case OP_SEXT: case OP_ZEXT:
	case OP_TRUNC:
		return simplify_cast(insn);
	case OP_FNEG:
	case OP_FCVTU: case OP_FCVTS:
	case OP_UCVTF: case OP_SCVTF:
	case OP_FCVTF:
	case OP_PTRCAST:
		break;
	case OP_UTPTR:
	case OP_PTRTU:
		return replace_with_pseudo(insn, insn->src);
	case OP_SLICE:
		break;
	case OP_SETVAL:
		return simplify_setval(insn);
	case OP_LABEL:
	case OP_SETFVAL:
		break;
	case OP_PHI:
		return clean_up_phi(insn);
	case OP_PHISOURCE:
		break;
	case OP_SEL:
		return simplify_select(insn);
	case OP_CBR:
		return simplify_branch(insn);
	case OP_SWITCH:
		return simplify_switch(insn);
	case OP_COMPUTEDGOTO:
		return simplify_cgoto(insn);
	case OP_RANGE:
		return simplify_range(insn);
	case OP_FADD:
	case OP_FSUB:
	case OP_FMUL:
	case OP_FDIV:
		break;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x2e319(%rip), %rax     # 0x63b50
movq (%rax,%rcx,8), %rax
shrq $0x28, %rax
andq $0xff, %rax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x35878
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x35790
cmpl $0x0, %eax
jne 0x35876
movq -0x10(%rbp), %rdi
callq 0x357c0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35878
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3588c
movq -0x10(%rbp), %rdi
callq 0x35a90
movl -0x14(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x358a0
movq -0x10(%rbp), %rdi
callq 0x35b10
movl -0x14(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x358c9
movq -0x10(%rbp), %rdi
callq 0x35bc0
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0x358c7
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x358c9
movl -0x14(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x358f2
movq -0x10(%rbp), %rdi
callq 0x35c70
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0x358f0
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x358f2
movl -0x14(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3591b
movq -0x10(%rbp), %rdi
callq 0x35e00
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0x35919
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x3591b
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x4c, %eax
ja 0x35a75
movq -0x20(%rbp), %rax
leaq 0x32f13(%rip), %rcx     # 0x68854
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x36220
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x36290
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x36420
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x36490
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x36500
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35a75
movq -0x10(%rbp), %rdi
callq 0x36570
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x366d0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x357e0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x36720
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35a75
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x357e0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35a75
movq -0x10(%rbp), %rdi
callq 0x36de0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35a75
movq -0x10(%rbp), %rdi
callq 0x36e40
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35a75
movq -0x10(%rbp), %rdi
callq 0x36eb0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x37720
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x379b0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x37b00
movl %eax, -0x4(%rbp)
jmp 0x35a7c
movq -0x10(%rbp), %rdi
callq 0x37df0
movl %eax, -0x4(%rbp)
jmp 0x35a7c
jmp 0x35a75
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)