// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/vfp_gen.c
// Function: subtilis_vfp_gen_movrrdi32
void subtilis_vfp_gen_movrrdi32(subtilis_ir_section_t *s, size_t start,
				void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t src;
	subtilis_arm_reg_t fpscr;
	subtilis_arm_reg_t tmp;
	subtilis_arm_reg_t fpscr_mod;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *instr = &s->ops[start]->op.instr;

	dest = subtilis_arm_ir_to_arm_reg(instr->operands[0].reg);
	src = subtilis_arm_ir_to_dreg(instr->operands[1].reg);
	tmp = subtilis_arm_ir_to_dreg(s->freg_counter++);
	fpscr = subtilis_arm_ir_to_dreg(s->reg_counter++);
	fpscr_mod = subtilis_arm_ir_to_dreg(s->reg_counter++);

	subtilis_vfp_add_sysreg(arm_s, SUBTILIS_VFP_INSTR_FMRX,
				SUBTILIS_ARM_CCODE_AL,
				SUBTILIS_VFP_SYSREG_FPSCR, fpscr, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_data_imm(arm_s, SUBTILIS_ARM_INSTR_BIC,
				  SUBTILIS_ARM_CCODE_AL, false, fpscr_mod,
				  fpscr, 3 << 22, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_data_imm(arm_s, SUBTILIS_ARM_INSTR_ORR,
				  SUBTILIS_ARM_CCODE_AL, false, fpscr_mod,
				  fpscr_mod, 2 << 22, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_vfp_add_sysreg(arm_s, SUBTILIS_VFP_INSTR_FMXR,
				SUBTILIS_ARM_CCODE_AL,
				SUBTILIS_VFP_SYSREG_FPSCR, fpscr_mod, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_vfp_add_tran(arm_s, SUBTILIS_VFP_INSTR_FTOSID,
			      SUBTILIS_ARM_CCODE_AL, true, tmp, src, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_vfp_add_sysreg(arm_s, SUBTILIS_VFP_INSTR_FMXR,
				SUBTILIS_ARM_CCODE_AL,
				SUBTILIS_VFP_SYSREG_FPSCR, fpscr, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	subtilis_vfp_add_cptran(arm_s, SUBTILIS_VFP_INSTR_FMRS,
				SUBTILIS_ARM_CCODE_AL, true, dest, tmp, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x6eea0
movq %rax, -0x28(%rbp)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6f840
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq %rdi, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
callq 0x6f840
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq %rdi, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
callq 0x6f840
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq %rdi, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
callq 0x6f840
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %r9
movl $0x7c, %esi
movl $0xe, %edx
movl $0x1, %ecx
callq 0x87630
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9debc
jmp 0x9dfe3
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x20(%rbp), %rax
movl $0xe, %edx
xorl %ecx, %ecx
movl %edx, %esi
movl $0xc00000, (%rsp)       # imm = 0xC00000
movq %rax, 0x8(%rsp)
callq 0x70ce0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9def4
jmp 0x9dfe3
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x20(%rbp), %rax
movl $0xc, %esi
movl $0xe, %edx
xorl %ecx, %ecx
movl $0x800000, (%rsp)       # imm = 0x800000
movq %rax, 0x8(%rsp)
callq 0x70ce0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9df2f
jmp 0x9dfe3
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %r8
movq -0x20(%rbp), %r9
movl $0x7b, %esi
movl $0xe, %edx
movl $0x1, %ecx
callq 0x87630
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9df5d
jmp 0x9dfe3
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x20(%rbp), %rax
movl $0x54, %esi
movl $0xe, %edx
movl $0x1, %ecx
movq %rax, (%rsp)
callq 0x87350
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9df90
jmp 0x9dfe3
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %r9
movl $0x7b, %esi
movl $0xe, %edx
movl $0x1, %ecx
callq 0x87630
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9dfbb
jmp 0x9dfe3
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %r8
movq -0x40(%rbp), %r9
movq -0x20(%rbp), %rax
movl $0x5e, %esi
movl $0xe, %edx
movl $0x1, %ecx
movq %rax, (%rsp)
callq 0x873e0
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)