// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_vfp_tran_instr
static void prv_encode_vfp_tran_instr(void *user_data, subtilis_arm_op_t *op,
				      subtilis_arm_instr_type_t type,
				      subtilis_vfp_tran_instr_t *instr,
				      subtilis_error_t *err)
{
	uint32_t word;
	bool float32_src = true;
	bool float32_dest = true;
	subtilis_arm_reg_t src = instr->src;
	subtilis_arm_reg_t dest = instr->dest;
	subtilis_arm_encode_ud_t *ud = user_data;

	prv_check_pool(ud, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	switch (type) {
	case SUBTILIS_VFP_INSTR_FTOSIS:
		word = 0xebd0a40;
		break;
	case SUBTILIS_VFP_INSTR_FTOUIS:
		word = 0xebc0a40;
		break;
	case SUBTILIS_VFP_INSTR_FTOUIZS:
		word = 0xebc0ac0;
		break;
	case SUBTILIS_VFP_INSTR_FTOSIZS:
		word = 0xebd0ac0;
		break;
	case SUBTILIS_VFP_INSTR_FSITOS:
		word = 0xeb80ac0;
		break;
	case SUBTILIS_VFP_INSTR_FUITOS:
		word = 0xeb80a40;
		break;
	case SUBTILIS_VFP_INSTR_FSITOD:
		word = 0xeb80bc0;
		float32_dest = false;
		if (instr->use_dregs)
			src *= 2;
		break;
	case SUBTILIS_VFP_INSTR_FTOSID:
		word = 0xebd0b40;
		float32_src = false;
		if (instr->use_dregs)
			dest *= 2;
		break;
	case SUBTILIS_VFP_INSTR_FTOUID:
		word = 0xebc0b40;
		float32_src = false;
		if (instr->use_dregs)
			dest *= 2;
		break;
	case SUBTILIS_VFP_INSTR_FTOSIZD:
		word = 0xebd0bc0;
		float32_src = false;
		if (instr->use_dregs)
			dest *= 2;
		break;
	case SUBTILIS_VFP_INSTR_FTOUIZD:
		word = 0xebc0bc0;
		float32_src = false;
		if (instr->use_dregs)
			dest *= 2;
		break;
	case SUBTILIS_VFP_INSTR_FUITOD:
		word = 0xebc0bc0;
		float32_dest = false;
		if (instr->use_dregs)
			src *= 2;
		break;
	default:
		subtilis_error_set_assertion_failed(err);
		return;
	}

	word |= instr->ccode << 28;
	word |= prv_encode_src_dest(src, dest, float32_src, float32_dest);

	prv_ensure_code(ud, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_add_word(ud, word, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movl %edx, %r12d
movq %rdi, %rbx
movq 0x8(%rcx), %r13
movq 0x10(%rcx), %rbp
xorl %esi, %esi
movq %r8, %rdx
callq 0x59e32
cmpl $0x0, (%r14)
jne 0x58da9
addl $-0x51, %r12d
cmpl $0xb, %r12d
ja 0x58df5
leaq 0x1cfd9(%rip), %rax     # 0x75cb8
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0xeb80bc0, %r12d       # imm = 0xEB80BC0
jmp 0x58d48
movl $0xeb80a40, %r12d       # imm = 0xEB80A40
jmp 0x58d6d
movl $0xebc0a40, %r12d       # imm = 0xEBC0A40
jmp 0x58d6d
movl $0xebc0bc0, %r12d       # imm = 0xEBC0BC0
jmp 0x58d2e
movl $0xebd0a40, %r12d       # imm = 0xEBD0A40
jmp 0x58d6d
movl $0xebd0b40, %r12d       # imm = 0xEBD0B40
jmp 0x58d2e
movl $0xebd0bc0, %r12d       # imm = 0xEBD0BC0
jmp 0x58d2e
movl $0xeb80ac0, %r12d       # imm = 0xEB80AC0
jmp 0x58d6d
movl $0xebc0b40, %r12d       # imm = 0xEBC0B40
movb 0x4(%r15), %cl
shlq %cl, %r13
andl $0xf, %ebp
jmp 0x58d7c
movl $0xebd0ac0, %r12d       # imm = 0xEBD0AC0
jmp 0x58d6d
movl $0xebc0bc0, %r12d       # imm = 0xEBC0BC0
movb 0x4(%r15), %cl
shll %cl, %ebp
movl %ebp, %eax
shrl %eax
andl $0xf, %eax
shll $0x5, %ebp
andl $0x20, %ebp
orl %eax, %ebp
shll $0xc, %r13d
movzwl %r13w, %r13d
jmp 0x58d90
movl $0xebc0ac0, %r12d       # imm = 0xEBC0AC0
movl %ebp, %eax
shrl %eax
andl $0xf, %eax
shll $0x5, %ebp
andl $0x20, %ebp
orl %eax, %ebp
movl %r13d, %eax
andl $0x1e, %eax
shll $0xb, %eax
andl $0x1, %r13d
shll $0x16, %r13d
orl %eax, %r13d
movl (%r15), %r15d
movl $0x4, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5758f
cmpl $0x0, (%r14)
je 0x58db8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rbx), %rax
testb $0x3, %al
je 0x58dd6
leaq 0x1d0b9(%rip), %rdx     # 0x75e80
movq %r14, %rdi
movl $0x5d, %esi
movl $0xfb, %ecx
jmp 0x58e09
shll $0x1c, %r15d
orl %r12d, %r15d
orl %ebp, %r13d
orl %r15d, %r13d
movq 0x28(%rbx), %rcx
movl %r13d, (%rcx,%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x58da9
leaq 0x1d084(%rip), %rdx     # 0x75e80
movq %r14, %rdi
movl $0xf, %esi
movl $0x6be, %ecx            # imm = 0x6BE
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145a4