// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_vfp_stran_instr
static void prv_encode_vfp_stran_instr(void *user_data, subtilis_arm_op_t *op,
				       subtilis_arm_instr_type_t type,
				       subtilis_vfp_stran_instr_t *instr,
				       subtilis_error_t *err)
{
	uint32_t copro = 0xb;
	uint32_t dest = instr->dest & 0x1f;
	subtilis_arm_encode_ud_t *ud = user_data;
	uint32_t word = 6 << 25;

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

	word |= instr->ccode << 28;
	word |= (0xC | (instr->pre_indexed ? 1 : 0)) << 24;
	if (!instr->subtract)
		word |= 1 << 23;

	if ((type == SUBTILIS_VFP_INSTR_FSTS) ||
	    (type == SUBTILIS_VFP_INSTR_FLDS)) {
		word |= (dest & 1) << 22;
		dest = dest >> 1;
		copro--;
	}

	if (instr->write_back)
		word |= 1 << 21;

	if (type == SUBTILIS_VFP_INSTR_FLDS || type == SUBTILIS_VFP_INSTR_FLDD)
		word |= 1 << 20;

	word |= instr->base << 16;
	word |= dest << 12;
	word |= copro << 8;
	word |= instr->offset;

	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)
movl $0xb, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x1f, %rax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0xc000000, -0x3c(%rbp) # imm = 0xC000000
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x819a0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7fd9b
jmp 0x7fe9a
movq -0x20(%rbp), %rax
movl (%rax), %eax
shll $0x1c, %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movb 0x19(%rax), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
orl $0xc, %eax
shll $0x18, %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x1b(%rax)
jne 0x7fddf
movl -0x3c(%rbp), %eax
orl $0x800000, %eax         # imm = 0x800000
movl %eax, -0x3c(%rbp)
cmpl $0x46, -0x14(%rbp)
je 0x7fdeb
cmpl $0x47, -0x14(%rbp)
jne 0x7fe0b
movl -0x30(%rbp), %eax
andl $0x1, %eax
shll $0x16, %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x30(%rbp), %eax
shrl %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x1a(%rax)
je 0x7fe20
movl -0x3c(%rbp), %eax
orl $0x200000, %eax         # imm = 0x200000
movl %eax, -0x3c(%rbp)
cmpl $0x47, -0x14(%rbp)
je 0x7fe2c
cmpl $0x49, -0x14(%rbp)
jne 0x7fe37
movl -0x3c(%rbp), %eax
orl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
shlq $0x10, %rcx
movl -0x3c(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x3c(%rbp)
movl -0x30(%rbp), %eax
shll $0xc, %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
shll $0x8, %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x18(%rax), %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x81b90
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7fe8a
jmp 0x7fe9a
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x81bc0
addq $0x40, %rsp
popq %rbp
retq