// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_vfp_tran_dbl_instr
static void prv_encode_vfp_tran_dbl_instr(void *user_data,
					  subtilis_arm_op_t *op,
					  subtilis_arm_instr_type_t type,
					  subtilis_vfp_tran_dbl_instr_t *instr,
					  subtilis_error_t *err)
{
	uint32_t word;
	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_FMDRR:
		word = 0xc400b10;
		word |= instr->dest1 & 0xf;
		word |= (instr->src1 & 0xf) << 12;
		word |= (instr->src2 & 0xf) << 16;
		break;
	case SUBTILIS_VFP_INSTR_FMRRD:
		word = 0xc500b10;
		word |= instr->src1 & 0xf;
		word |= (instr->dest1 & 0xf) << 12;
		word |= (instr->dest2 & 0xf) << 16;
		break;
	case SUBTILIS_VFP_INSTR_FMSRR:
		if (instr->dest1 + 1 != instr->dest2) {
			subtilis_error_set_assertion_failed(err);
			return;
		}
		word = 0xc400a10;
		word |= (instr->dest1 >> 1) & 0xf;
		word |= (instr->dest1 & 1) << 5;
		word |= (instr->src1 & 0xf) << 12;
		word |= (instr->src2 & 0xf) << 16;
		break;
	case SUBTILIS_VFP_INSTR_FMRRS:
		if (instr->src1 + 1 != instr->src2) {
			subtilis_error_set_assertion_failed(err);
			return;
		}
		word = 0xc500a10;
		word |= (instr->src1 >> 1) & 0xf;
		word |= (instr->src1 & 1) << 5;
		word |= (instr->dest1 & 0xf) << 12;
		word |= (instr->dest2 & 0xf) << 16;
		break;
	default:
		subtilis_error_set_assertion_failed(err);
		return;
	}

	word |= instr->ccode << 28;

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

	prv_add_word(ud, word, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x819a0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8032e
jmp 0x80595
movl -0x14(%rbp), %eax
addl $-0x7d, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x3, %eax
ja 0x80542
movq -0x40(%rbp), %rax
leaq 0x2c92a(%rip), %rcx     # 0xacc78
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xc400b10, -0x2c(%rbp) # imm = 0xC400B10
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
andq $0xf, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0xf, %rcx
shlq $0xc, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rcx
andq $0xf, %rcx
shlq $0x10, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
jmp 0x8055e
movl $0xc500b10, -0x2c(%rbp) # imm = 0xC500B10
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0xf, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
andq $0xf, %rcx
shlq $0xc, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
andq $0xf, %rcx
shlq $0x10, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
jmp 0x8055e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x1, %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0x80432
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x2ca0d(%rip), %rdx     # 0xace30
movl $0x6e8, %ecx            # imm = 0x6E8
callq 0x158e0
jmp 0x80595
movl $0xc400a10, -0x2c(%rbp) # imm = 0xC400A10
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
andq $0xf, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
andq $0x1, %rcx
shlq $0x5, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0xf, %rcx
shlq $0xc, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rcx
andq $0xf, %rcx
shlq $0x10, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
jmp 0x8055e
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x1, %rax
movq -0x20(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x804d6
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x2c969(%rip), %rdx     # 0xace30
movl $0x6f3, %ecx            # imm = 0x6F3
callq 0x158e0
jmp 0x80595
movl $0xc500a10, -0x2c(%rbp) # imm = 0xC500A10
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
shrq %rcx
andq $0xf, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0x1, %rcx
shlq $0x5, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
andq $0xf, %rcx
shlq $0xc, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
andq $0xf, %rcx
shlq $0x10, %rcx
movl -0x2c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x2c(%rbp)
jmp 0x8055e
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x2c8de(%rip), %rdx     # 0xace30
movl $0x6fd, %ecx            # imm = 0x6FD
callq 0x158e0
jmp 0x80595
movq -0x20(%rbp), %rax
movl (%rax), %eax
shll $0x1c, %eax
orl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x81b90
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x80585
jmp 0x80595
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x81bc0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)