// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/arch/arm32/fpa_alloc.c
// Function: prv_alloc_fpa_tran_instr
static void prv_alloc_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)
{
	size_t vreg_op2;
	int dist_op2;
	subtilis_arm_reg_ud_t *ud = user_data;
	bool fixed_op2 = true;

	if (type != SUBTILIS_FPA_INSTR_FLT) {
		if (!instr->immediate) {
			vreg_op2 = instr->op2.reg;
			subtilis_arm_reg_alloc_ensure(ud, op, ud->int_regs,
						      ud->real_regs,
						      &instr->op2.reg, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			dist_op2 = subtilis_arm_reg_alloc_calculate_dist(
			    ud, vreg_op2, op, &ud->real_regs->dist_walker,
			    ud->real_regs);
			if (dist_op2 == -1)
				ud->real_regs->phys_to_virt[instr->op2.reg] =
				    INT_MAX;
			ud->real_regs->next[instr->op2.reg] = dist_op2;
		}

		subtilis_arm_reg_alloc_alloc_dest(ud, op, &instr->dest, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	} else {
		if (!instr->immediate) {
			vreg_op2 = instr->op2.reg;
			fixed_op2 = subtilis_arm_reg_alloc_ensure(
			    ud, op, ud->int_regs, ud->int_regs, &instr->op2.reg,
			    err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			dist_op2 = subtilis_arm_reg_alloc_calculate_dist(
			    ud, vreg_op2, op, &ud->int_regs->dist_walker,
			    ud->int_regs);
			if (dist_op2 == -1)
				ud->int_regs->phys_to_virt[instr->op2.reg] =
				    INT_MAX;
		}

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

		if (!fixed_op2)
			ud->int_regs->next[instr->op2.reg] = dist_op2;
	}

	ud->instr_count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movb 0x10(%rcx), %al
cmpl $0x3e, %edx
jne 0x6ccd1
testb %al, %al
je 0x6cd62
addq $0x8, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x53287
jmp 0x6cd52
testb %al, %al
jne 0x6cd3d
leaq 0x18(%r15), %r13
movq 0x18(%r15), %rbp
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %r8
movq %r14, %r9
callq 0x52fd8
cmpl $0x0, (%r14)
jne 0x6cddf
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x52d7c
movq 0x10(%rbx), %rcx
cmpl $-0x1, %eax
jne 0x6cd32
movq 0x8(%rcx), %rdx
movq (%r13), %rsi
movq $0x7fffffff, (%rdx,%rsi,8) # imm = 0x7FFFFFFF
movq 0x10(%rcx), %rcx
movq (%r13), %rdx
movl %eax, (%rcx,%rdx,4)
addq $0x8, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x531e0
cmpl $0x0, (%r14)
jne 0x6cddf
incq 0x20(%rbx)
jmp 0x6cddf
leaq 0x18(%r15), %r13
movq 0x18(%r15), %rbp
movq 0x8(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %rcx, %rdx
movq %r13, %r8
movq %r14, %r9
callq 0x52fd8
cmpl $0x0, (%r14)
jne 0x6cddf
movb %al, 0x7(%rsp)
movq 0x8(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x52d7c
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x6cdc0
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq (%r13), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
addq $0x8, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x53287
cmpl $0x0, (%r14)
movb 0x7(%rsp), %al
je 0x6cdee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
jne 0x6cd5c
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rax
movq (%r13), %rcx
movl %ebp, (%rax,%rcx,4)
jmp 0x6cd5c