// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/vfp_alloc.c
// Function: prv_alloc_vfp_tran_instr
static void prv_alloc_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)
{
	size_t vreg_src;
	int dist_src;
	subtilis_arm_reg_ud_t *ud = user_data;

	switch (type) {
	case SUBTILIS_VFP_INSTR_FTOSIS:
	case SUBTILIS_VFP_INSTR_FTOUIS:
	case SUBTILIS_VFP_INSTR_FTOUIZS:
	case SUBTILIS_VFP_INSTR_FTOSIZS:
	case SUBTILIS_VFP_INSTR_FSITOS:
	case SUBTILIS_VFP_INSTR_FUITOS:
		subtilis_error_set_assertion_failed(err);
		break;
	default:
		break;
	}

	if (!instr->use_dregs) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	vreg_src = instr->src;
	(void)subtilis_arm_reg_alloc_ensure(ud, op, ud->int_regs, ud->real_regs,
					    &instr->src, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	dist_src = subtilis_arm_reg_alloc_calculate_dist(
	    ud, vreg_src, op, &ud->real_regs->dist_walker, ud->real_regs);
	if (dist_src == -1)
		ud->real_regs->phys_to_virt[instr->src] = INT_MAX;

	subtilis_arm_reg_alloc_alloc_fp_dest(ud, op, &instr->dest, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ud->real_regs->next[instr->src] = dist_src;

	ud->instr_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %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, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
addl $-0x52, %eax
subl $0x2, %eax
jb 0xa0d2b
jmp 0xa0d03
movl -0x44(%rbp), %eax
subl $0x55, %eax
je 0xa0d2b
jmp 0xa0d0d
movl -0x44(%rbp), %eax
subl $0x57, %eax
je 0xa0d2b
jmp 0xa0d17
movl -0x44(%rbp), %eax
subl $0x59, %eax
je 0xa0d2b
jmp 0xa0d21
movl -0x44(%rbp), %eax
subl $0x5c, %eax
jne 0xa0d47
jmp 0xa0d2b
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0xd74b(%rip), %rdx      # 0xae486
movl $0xdd, %ecx
callq 0x148f0
jmp 0xa0d49
jmp 0xa0d49
movq -0x20(%rbp), %rax
testb $0x1, 0x4(%rax)
jne 0xa0d72
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0xd723(%rip), %rdx      # 0xae486
movl $0xe4, %ecx
callq 0x148f0
jmp 0xa0e50
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %r8
addq $0x10, %r8
movq -0x28(%rbp), %r9
callq 0x764c0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0xa0db5
jmp 0xa0e50
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x90, %rcx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %r8
callq 0x76020
movl %eax, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
jne 0xa0e02
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
movq -0x28(%rbp), %rcx
callq 0x76940
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0xa0e26
jmp 0xa0e50
movl -0x34(%rbp), %edx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)