// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_fpa_tran_instr
static void prv_encode_fpa_tran_instr(void *user_data, subtilis_arm_op_t *op,
				      subtilis_arm_instr_type_t type,
				      subtilis_fpa_tran_instr_t *instr,
				      subtilis_error_t *err)
{
	subtilis_arm_encode_ud_t *ud = user_data;
	uint32_t word = 0;

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

	word |= instr->ccode << 28;
	word |= 0xE << 24;

	if (type == SUBTILIS_FPA_INSTR_FLT) {
		if (instr->size == 8)
			word |= 1 << 7;
		else if (instr->size == 12)
			word |= 1 << 19;
		word |= instr->dest << 16;
		word |= instr->op2.reg << 12;
	} else if (type == SUBTILIS_FPA_INSTR_FIX) {
		if (instr->immediate) {
			word |= 1 << 3;
			word |= instr->op2.imm;
		} else {
			word |= instr->op2.reg;
		}
		word |= instr->dest << 12;
		word |= 1 << 20;
	} else {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	word |= 1 << 8;
	prv_encode_fpa_rounding(instr->rounding, &word);
	word |= 1 << 4;

	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, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x819a0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7f8a5
jmp 0x7f9e7
movq -0x20(%rbp), %rax
movl (%rax), %eax
shll $0x1c, %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
orl $0xe000000, %eax        # imm = 0xE000000
movl %eax, -0x34(%rbp)
cmpl $0x3e, -0x14(%rbp)
jne 0x7f921
movq -0x20(%rbp), %rax
cmpq $0x8, 0x20(%rax)
jne 0x7f8dd
movl -0x34(%rbp), %eax
orl $0x80, %eax
movl %eax, -0x34(%rbp)
jmp 0x7f8f5
movq -0x20(%rbp), %rax
cmpq $0xc, 0x20(%rax)
jne 0x7f8f3
movl -0x34(%rbp), %eax
orl $0x80000, %eax          # imm = 0x80000
movl %eax, -0x34(%rbp)
jmp 0x7f8f5
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shlq $0x10, %rcx
movl -0x34(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
shlq $0xc, %rcx
movl -0x34(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
jmp 0x7f99b
cmpl $0x3f, -0x14(%rbp)
jne 0x7f97d
movq -0x20(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x7f94a
movl -0x34(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x18(%rax), %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x7f95b
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movl -0x34(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shlq $0xc, %rcx
movl -0x34(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
orl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x34(%rbp)
jmp 0x7f999
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x2d4a3(%rip), %rdx     # 0xace30
movl $0x552, %ecx            # imm = 0x552
callq 0x158e0
jmp 0x7f9e7
jmp 0x7f99b
movl -0x34(%rbp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edi
leaq -0x34(%rbp), %rsi
callq 0x823e0
movl -0x34(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x81b90
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7f9d7
jmp 0x7f9e7
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x81bc0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)