// File: /workspace/github_c_makefile_star2_O0/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
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, -0x48(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
movl %eax, -0x50(%rbp)
subl $0x71, %eax
je 0xa1545
jmp 0xa1527
movl -0x50(%rbp), %eax
subl $0x73, %eax
je 0xa1545
jmp 0xa1531
movl -0x50(%rbp), %eax
subl $0x75, %eax
je 0xa1545
jmp 0xa153b
movl -0x50(%rbp), %eax
subl $0x77, %eax
jne 0xa1564
jmp 0xa1545
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0xcf31(%rip), %rdx      # 0xae486
movl $0x1ba, %ecx            # imm = 0x1BA
callq 0x148f0
jmp 0xa16ee
jmp 0xa1566
cmpl $0x74, -0x14(%rbp)
je 0xa1572
cmpl $0x72, -0x14(%rbp)
jne 0xa15e0
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x48(%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 0xa15b5
jmp 0xa16ee
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x90, %rcx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %r8
callq 0x76020
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %r8
addq $0x8, %r8
movq -0x28(%rbp), %r9
callq 0x764c0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0xa1623
jmp 0xa16ee
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x90, %rcx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %r8
callq 0x76020
movl %eax, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
jne 0xa1670
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
cmpl $0x74, -0x14(%rbp)
je 0xa167c
cmpl $0x72, -0x14(%rbp)
jne 0xa169e
cmpl $-0x1, -0x4c(%rbp)
jne 0xa169e
movq -0x48(%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
movl -0x34(%rbp), %edx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
cmpl $0x74, -0x14(%rbp)
je 0xa16c4
cmpl $0x72, -0x14(%rbp)
jne 0xa16de
movl -0x4c(%rbp), %edx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)