// File: /workspace/github_c_makefile_star2_O1/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), %rbp
movq 0x10(%rcx), %r13
xorl %esi, %esi
movq %r8, %rdx
callq 0x59d65
cmpl $0x0, (%r14)
jne 0x58cdf
addl $-0x51, %r12d
cmpl $0xb, %r12d
ja 0x58d2b
movb $0x1, %al
leaq 0x1d082(%rip), %rcx     # 0x75c78
movslq (%rcx,%r12,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movb 0x4(%r15), %cl
shlq %cl, %r13
movl $0xeb80bc0, %r12d       # imm = 0xEB80BC0
jmp 0x58c81
movl $0xeb80a40, %r12d       # imm = 0xEB80A40
jmp 0x58c8b
movl $0xebc0a40, %r12d       # imm = 0xEBC0A40
jmp 0x58c8b
movb 0x4(%r15), %cl
shlq %cl, %rbp
movl $0xebc0bc0, %r12d       # imm = 0xEBC0BC0
jmp 0x58c68
movl $0xebd0a40, %r12d       # imm = 0xEBD0A40
jmp 0x58c8b
movb 0x4(%r15), %cl
shlq %cl, %rbp
movl $0xebd0b40, %r12d       # imm = 0xEBD0B40
jmp 0x58c68
movb 0x4(%r15), %cl
shlq %cl, %rbp
movl $0xebd0bc0, %r12d       # imm = 0xEBD0BC0
jmp 0x58c68
movl $0xeb80ac0, %r12d       # imm = 0xEB80AC0
jmp 0x58c8b
movb 0x4(%r15), %cl
shlq %cl, %rbp
movl $0xebc0b40, %r12d       # imm = 0xEBC0B40
xorl %ecx, %ecx
jmp 0x58c8d
movl $0xebd0ac0, %r12d       # imm = 0xEBD0AC0
jmp 0x58c8b
movb 0x4(%r15), %cl
shlq %cl, %r13
movl $0xebc0bc0, %r12d       # imm = 0xEBC0BC0
xorl %eax, %eax
jmp 0x58c8b
movl $0xebc0ac0, %r12d       # imm = 0xEBC0AC0
movb $0x1, %cl
testb %cl, %cl
je 0x58ca6
movl %r13d, %ecx
shrl %ecx
andl $0xf, %ecx
shll $0x5, %r13d
andl $0x20, %r13d
orl %ecx, %r13d
jmp 0x58caa
andl $0xf, %r13d
testb %al, %al
je 0x58cc0
movl %ebp, %eax
andl $0x1e, %eax
shll $0xb, %eax
andl $0x1, %ebp
shll $0x16, %ebp
orl %eax, %ebp
jmp 0x58cc6
shll $0xc, %ebp
movzwl %bp, %ebp
movl (%r15), %r15d
movl $0x4, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x57496
cmpl $0x0, (%r14)
je 0x58cee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rbx), %rax
testb $0x3, %al
je 0x58d0c
leaq 0x1d143(%rip), %rdx     # 0x75e40
movq %r14, %rdi
movl $0x5d, %esi
movl $0xfb, %ecx
jmp 0x58d3f
shll $0x1c, %r15d
orl %r12d, %r15d
orl %r15d, %r13d
orl %ebp, %r13d
movq 0x28(%rbx), %rcx
movl %r13d, (%rcx,%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x58cdf
leaq 0x1d10e(%rip), %rdx     # 0x75e40
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 0x145f4