// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/vfp_alloc.c
// Function: prv_alloc_vfp_cmp_instr
static void prv_alloc_vfp_cmp_instr(void *user_data, subtilis_arm_op_t *op,
				    subtilis_arm_instr_type_t type,
				    subtilis_vfp_cmp_instr_t *instr,
				    subtilis_error_t *err)
{
	size_t vreg_op1;
	int dist_op1;
	size_t vreg_op2;
	subtilis_arm_reg_ud_t *ud = user_data;
	int dist_op2 = -1;

	switch (type) {
	case SUBTILIS_VFP_INSTR_FCMPS:
	case SUBTILIS_VFP_INSTR_FCMPES:
	case SUBTILIS_VFP_INSTR_FCMPZS:
	case SUBTILIS_VFP_INSTR_FCMPEZS:
		subtilis_error_set_assertion_failed(err);
		return;
	default:
		break;
	}

	if (type == SUBTILIS_VFP_INSTR_FCMPED ||
	    type == SUBTILIS_VFP_INSTR_FCMPD) {
		vreg_op2 = instr->op2;
		(void)subtilis_arm_reg_alloc_ensure(
		    ud, op, ud->int_regs, ud->real_regs, &instr->op2, 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);
	}

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

	if ((type == SUBTILIS_VFP_INSTR_FCMPED ||
	     type == SUBTILIS_VFP_INSTR_FCMPD) &&
	    dist_op2 == -1)
		ud->real_regs->phys_to_virt[instr->op2] = INT_MAX;

	ud->real_regs->next[instr->op1] = dist_op1;
	if (type == SUBTILIS_VFP_INSTR_FCMPED ||
	    type == SUBTILIS_VFP_INSTR_FCMPD)
		ud->real_regs->next[instr->op2] = dist_op2;

	ud->instr_count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r13
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
leal -0x71(%r15), %eax
cmpl $0x6, %eax
ja 0x6cc10
movl $0x55, %ecx
btl %eax, %ecx
jae 0x6cc10
leaq 0xa426(%rip), %rdx      # 0x77016
movq %r13, %rdi
movl $0xf, %esi
movl $0x1ba, %ecx            # imm = 0x1BA
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13604
cmpl $0x74, %r15d
sete 0xb(%rsp)
cmpl $0x72, %r15d
sete 0xa(%rsp)
cmpl $0x74, %r15d
je 0x6cc33
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x72, %r15d
jne 0x6cc75
leaq 0x10(%r14), %r8
movq 0x10(%r14), %rbp
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %r9
callq 0x5216a
cmpl $0x0, (%r13)
jne 0x6cd35
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x51f18
movl %eax, 0xc(%rsp)
leaq 0x8(%r14), %rbp
movq 0x8(%r14), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %r8
movq %r13, %r9
callq 0x5216a
cmpl $0x0, (%r13)
jne 0x6cd35
movb 0xb(%rsp), %r13b
orb 0xa(%rsp), %r13b
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x51f18
cmpl $-0x1, %eax
jne 0x6cce8
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq (%rbp), %rdx
movq $0x7fffffff, (%rcx,%rdx,8) # imm = 0x7FFFFFFF
movl 0xc(%rsp), %esi
cmpl $-0x1, %esi
sete %cl
andb %cl, %r13b
cmpb $0x1, %r13b
jne 0x6cd0f
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%r14), %rdx
movq $0x7fffffff, (%rcx,%rdx,8) # imm = 0x7FFFFFFF
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq (%rbp), %rdx
movl %eax, (%rcx,%rdx,4)
cmpl $0x74, %r15d
je 0x6cd2a
cmpl $0x72, %r15d
jne 0x6cd31
movq 0x10(%r14), %rax
movl %esi, (%rcx,%rax,4)
incq 0x20(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq