// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/vfp_gen.c
// Function: prv_cmp_jmp_imm
static void prv_cmp_jmp_imm(subtilis_ir_section_t *s, size_t start,
			    void *user_data, subtilis_arm_ccode_type_t ccode,
			    subtilis_error_t *err)
{
	subtilis_arm_instr_t *instr;
	subtilis_arm_br_instr_t *br;
	subtilis_arm_reg_t op1;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *cmp = &s->ops[start]->op.instr;
	subtilis_ir_inst_t *jmp = &s->ops[start + 1]->op.instr;

	op1 = subtilis_arm_ir_to_dreg(cmp->operands[1].reg);

	if (cmp->operands[2].real == 0.0) {
		subtilis_vfp_add_cmpz(arm_s, SUBTILIS_VFP_INSTR_FCMPZD,
				      SUBTILIS_ARM_CCODE_AL, op1, err);
	} else {
		op2 = subtilis_arm_ir_to_dreg(s->freg_counter++);
		subtilis_vfp_add_copy_imm(arm_s, SUBTILIS_ARM_CCODE_AL, op2,
					  cmp->operands[2].real, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		subtilis_vfp_add_cmp(arm_s, SUBTILIS_VFP_INSTR_FCMPD,
				     SUBTILIS_ARM_CCODE_AL, op1, op2, err);
	}
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_vfp_add_sysreg(arm_s, SUBTILIS_VFP_INSTR_FMRX,
				SUBTILIS_ARM_CCODE_AL,
				SUBTILIS_VFP_SYSREG_FPSCR, 15, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_B, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	br = &instr->operands.br;
	br->ccode = ccode;
	br->link = false;
	br->link_type = SUBTILIS_ARM_BR_LINK_VOID;
	br->target.label = jmp->operands[2].label;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6f840
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movsd 0x18(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x9ef06
jp 0x9ef06
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %r8
movl $0x76, %esi
movl $0xe, %edx
callq 0x87560
jmp 0x9ef6e
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq %rdi, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
callq 0x6f840
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x58(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0x28(%rbp), %rcx
movl $0xe, %esi
callq 0x86f10
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9ef4f
jmp 0x9f002
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x28(%rbp), %r9
movl $0x72, %esi
movl $0xe, %edx
callq 0x874f0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9ef7c
jmp 0x9f002
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %r9
movl $0x7c, %esi
movl $0xe, %edx
movl $0x1, %ecx
movl $0xf, %r8d
callq 0x87630
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9efa9
jmp 0x9f002
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x16, %esi
callq 0x6fb60
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9efca
jmp 0x9f002
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)