// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/ir.c
// Function: validate_insn
static int validate_insn(struct entrypoint *ep, struct instruction *insn)
{
	int err = 0;

	switch (insn->opcode) {
	case OP_SEL:
	case OP_RANGE:
		err += check_user(insn, insn->src3);
		/* fall through */

	case OP_BINARY ... OP_BINCMP_END:
		err += check_user(insn, insn->src2);
		/* fall through */

	case OP_UNOP ... OP_UNOP_END:
	case OP_SLICE:
	case OP_SYMADDR:
	case OP_PHISOURCE:
		err += check_user(insn, insn->src1);
		break;

	case OP_CBR:
		err += check_branch(ep, insn, insn->bb_true);
		err += check_branch(ep, insn, insn->bb_false);
		/* fall through */
	case OP_COMPUTEDGOTO:
		err += check_user(insn, insn->cond);
		break;

	case OP_PHI:
		err += check_phi_node(insn);
		break;

	case OP_CALL:
		// FIXME: ignore for now
		break;

	case OP_STORE:
		err += check_user(insn, insn->target);
		/* fall through */

	case OP_LOAD:
		err += check_user(insn, insn->src);
		break;

	case OP_RET:
		err += check_return(insn);
		break;

	case OP_BR:
		err += check_branch(ep, insn, insn->bb_true);
		break;
	case OP_SWITCH:
		err += check_switch(ep, insn);
		break;

	case OP_ENTRY:
	case OP_LABEL:
	case OP_SETVAL:
	default:
		break;
	}

	return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x4f, %eax
ja 0x5d23b
movq -0x20(%rbp), %rax
leaq 0xfee8(%rip), %rcx      # 0x6cff4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x5d250
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x5d250
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d145
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x5d250
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdx
callq 0x5d350
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
callq 0x5d350
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x5d250
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
movq -0x10(%rbp), %rdi
callq 0x5d3d0
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
jmp 0x5d23d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x5d250
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x5d250
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
movq -0x10(%rbp), %rdi
callq 0x5d770
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdx
callq 0x5d350
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5d7e0
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x5d23d
jmp 0x5d23b
jmp 0x5d23d
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)