// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r13
movl %edx, %ebp
movq %rdi, %r14
movq 0x8(%rcx), %r15
movq 0x10(%rcx), %r12
movq %r8, %rsi
callq 0x55e87
cmpl $0x0, (%rbx)
jne 0x550db
addl $-0x51, %ebp
cmpl $0xb, %ebp
ja 0x55123
leaq 0x1ac68(%rip), %rax     # 0x6fc28
movslq (%rax,%rbp,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movb 0x4(%r13), %cl
shlq %cl, %r12
movl $0xeb80bc0, 0x10(%rsp)  # imm = 0xEB80BC0
jmp 0x550a9
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0xeb80a40, 0x10(%rsp)  # imm = 0xEB80A40
jmp 0x550c1
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0xebc0a40, 0x10(%rsp)  # imm = 0xEBC0A40
jmp 0x550c1
movb $0x1, %al
movl %eax, 0x14(%rsp)
movb 0x4(%r13), %cl
shlq %cl, %r15
movl $0xebc0bc0, 0x10(%rsp)  # imm = 0xEBC0BC0
jmp 0x55080
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0xebd0a40, 0x10(%rsp)  # imm = 0xEBD0A40
jmp 0x550c1
movb $0x1, %al
movl %eax, 0x14(%rsp)
movb 0x4(%r13), %cl
shlq %cl, %r15
movl $0xebd0b40, 0x10(%rsp)  # imm = 0xEBD0B40
jmp 0x55080
movb $0x1, %al
movl %eax, 0x14(%rsp)
movb 0x4(%r13), %cl
shlq %cl, %r15
movl $0xebd0bc0, 0x10(%rsp)  # imm = 0xEBD0BC0
jmp 0x55080
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0xeb80ac0, 0x10(%rsp)  # imm = 0xEB80AC0
jmp 0x550c1
movb $0x1, %al
movl %eax, 0x14(%rsp)
movb 0x4(%r13), %cl
shlq %cl, %r15
movl $0xebc0b40, 0x10(%rsp)  # imm = 0xEBC0B40
movl $0x0, 0xc(%rsp)
jmp 0x550c7
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0xebd0ac0, 0x10(%rsp)  # imm = 0xEBD0AC0
jmp 0x550c1
movb 0x4(%r13), %cl
shlq %cl, %r12
movl $0xebc0bc0, 0x10(%rsp)  # imm = 0xEBC0BC0
movl $0x0, 0x14(%rsp)
jmp 0x550c1
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0xebc0ac0, 0x10(%rsp)  # imm = 0xEBC0AC0
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl (%r13), %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x55e8e
cmpl $0x0, (%rbx)
je 0x550ea
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0xc(%rsp), %edx
movzbl 0x14(%rsp), %ecx
movq %r12, %rdi
movq %r15, %rsi
callq 0x56213
shll $0x1c, %ebp
addl 0x10(%rsp), %ebp
orl %eax, %ebp
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x55e99
leaq 0x1acc6(%rip), %rdx     # 0x6fdf0
pushq $0xf
popq %rsi
movq %rbx, %rdi
movl $0x6be, %ecx            # imm = 0x6BE
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1429e