// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rcx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movb 0x10(%rcx), %al
cmpl $0x3e, %edx
jne 0x6d0f8
testb %al, %al
je 0x6d189
movb $0x1, %bpl
leaq 0x8(%r14), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x53417
cmpl $0x0, (%r15)
jne 0x6d1b3
testb %bpl, %bpl
jne 0x6d183
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x18(%r14), %rcx
movl %r13d, (%rax,%rcx,4)
jmp 0x6d183
testb %al, %al
jne 0x6d168
leaq 0x18(%r14), %r13
movq 0x18(%r14), %rbp
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %r8
movq %r15, %r9
callq 0x5315a
cmpl $0x0, (%r15)
jne 0x6d1b3
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x52f08
cmpl $-0x1, %eax
jne 0x6d159
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq (%r13), %rdx
movq $0x7fffffff, (%rcx,%rdx,8) # imm = 0x7FFFFFFF
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq (%r13), %rdx
movl %eax, (%rcx,%rdx,4)
addq $0x8, %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x5336c
cmpl $0x0, (%r15)
jne 0x6d1b3
incq 0x20(%rbx)
jmp 0x6d1b3
leaq 0x18(%r14), %r13
movq 0x18(%r14), %rax
movq %rax, (%rsp)
movq 0x8(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %rcx, %rdx
movq %r13, %r8
movq %r15, %r9
callq 0x5315a
cmpl $0x0, (%r15)
je 0x6d1c2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ebp
movq 0x8(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
callq 0x52f08
cmpl $-0x1, %eax
je 0x6d1eb
movl %eax, %r13d
jmp 0x6d0be
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq (%r13), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x6d0be