// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/linearize.c
// Function: cast_pseudo
static pseudo_t cast_pseudo(struct entrypoint *ep, pseudo_t src, struct symbol *from, struct symbol *to)
{
	const struct position pos = current_pos;
	pseudo_t result;
	struct instruction *insn;
	int opcode;

	if (src == VOID)
		return VOID;
	if (!from || !to)
		return VOID;
	if (from->bit_size < 0 || to->bit_size < 0)
		return VOID;
	opcode = get_cast_opcode(to, from);
	switch (opcode) {
	case OP_NOP:
		return src;
	case OP_UTPTR:
		if (from->bit_size == to->bit_size)
			break;
		if (src == value_pseudo(0))
			break;
		if (Wint_to_pointer_cast)
			warning(pos, "non size-preserving integer to pointer cast");
		src = cast_pseudo(ep, src, from, size_t_ctype);
		from = size_t_ctype;
		break;
	case OP_PTRTU:
		if (from->bit_size == to->bit_size)
			break;
		if (Wpointer_to_int_cast)
			warning(pos, "non size-preserving pointer to integer cast");
		src = cast_pseudo(ep, src, from, size_t_ctype);
		return cast_pseudo(ep, src, size_t_ctype, to);
	case OP_BADOP:
		return VOID;
	default:
		break;
	}
	insn = alloc_typed_instruction(opcode, to);
	result = alloc_pseudo(insn);
	insn->target = result;
	insn->orig_type = from;
	use_pseudo(insn, src, &insn->src);
	add_one_insn(ep, insn);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq 0x6db39(%rip), %rax     # 0x8d148
movq %rax, -0x30(%rbp)
leaq 0x6c796(%rip), %rax     # 0x8bdb0
cmpq %rax, -0x18(%rbp)
jne 0x1f630
leaq 0x6c789(%rip), %rax     # 0x8bdb0
movq %rax, -0x8(%rbp)
jmp 0x1f827
cmpq $0x0, -0x20(%rbp)
je 0x1f63e
cmpq $0x0, -0x28(%rbp)
jne 0x1f64e
leaq 0x6c76b(%rip), %rax     # 0x8bdb0
movq %rax, -0x8(%rbp)
jmp 0x1f827
movq -0x20(%rbp), %rax
cmpl $0x0, 0x50(%rax)
jl 0x1f662
movq -0x28(%rbp), %rax
cmpl $0x0, 0x50(%rax)
jge 0x1f672
leaq 0x6c747(%rip), %rax     # 0x8bdb0
movq %rax, -0x8(%rbp)
jmp 0x1f827
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1f840
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
testl %eax, %eax
je 0x1f7b9
jmp 0x1f692
movl -0x48(%rbp), %eax
subl $0x3c, %eax
je 0x1f6c5
jmp 0x1f69c
movl -0x48(%rbp), %eax
subl $0x3d, %eax
je 0x1f749
jmp 0x1f6aa
movl -0x48(%rbp), %eax
subl $0x4c, %eax
jne 0x1f7c6
jmp 0x1f6b8
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1f827
movq -0x20(%rbp), %rax
movl 0x50(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jne 0x1f6da
jmp 0x1f7c8
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1a390
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jne 0x1f6fc
jmp 0x1f7c8
leaq 0x65131(%rip), %rax     # 0x84834
cmpl $0x0, (%rax)
je 0x1f71a
movq -0x30(%rbp), %rdi
leaq 0x4431c(%rip), %rsi     # 0x63a2f
movb $0x0, %al
callq 0x16d80
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x6aec3(%rip), %rax     # 0x8a5f0
movq (%rax), %rcx
callq 0x1f5f0
movq %rax, -0x18(%rbp)
leaq 0x6aeb0(%rip), %rax     # 0x8a5f0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x1f7c8
movq -0x20(%rbp), %rax
movl 0x50(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jne 0x1f75b
jmp 0x1f7c8
leaq 0x650f2(%rip), %rax     # 0x84854
cmpl $0x0, (%rax)
je 0x1f779
movq -0x30(%rbp), %rdi
leaq 0x442e9(%rip), %rsi     # 0x63a5b
movb $0x0, %al
callq 0x16d80
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x6ae64(%rip), %rax     # 0x8a5f0
movq (%rax), %rcx
callq 0x1f5f0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x6ae49(%rip), %rax     # 0x8a5f0
movq (%rax), %rdx
movq -0x28(%rbp), %rcx
callq 0x1f5f0
movq %rax, -0x8(%rbp)
jmp 0x1f827
leaq 0x6c5f0(%rip), %rax     # 0x8bdb0
movq %rax, -0x8(%rbp)
jmp 0x1f827
jmp 0x1f7c8
movl -0x44(%rbp), %edi
movq -0x28(%rbp), %rsi
callq 0x1a240
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1a340
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq $0x30, %rdx
callq 0x1a290
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1b5b0
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)