// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_vfp_cmp_instr
static void prv_encode_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)
{
	uint32_t word = 0;
	bool float32 = false;
	bool two_ops = false;
	subtilis_arm_encode_ud_t *ud = user_data;

	prv_check_pool(ud, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	switch (type) {
	case SUBTILIS_VFP_INSTR_FCMPS:
		two_ops = true;
		float32 = true;
		word |= 0xeb40a40;
		break;
	case SUBTILIS_VFP_INSTR_FCMPD:
		two_ops = true;
		word |= 0xeb40b40;
		break;
	case SUBTILIS_VFP_INSTR_FCMPES:
		two_ops = true;
		float32 = true;
		word |= 0xeb40ac0;
		break;
	case SUBTILIS_VFP_INSTR_FCMPED:
		two_ops = true;
		word |= 0xeb40bc0;
		break;
	case SUBTILIS_VFP_INSTR_FCMPZS:
		float32 = true;
		word |= 0xeb50a40;
		break;
	case SUBTILIS_VFP_INSTR_FCMPZD:
		word |= 0xeb50b40;
		break;
	case SUBTILIS_VFP_INSTR_FCMPEZS:
		two_ops = true;
		word |= 0xeb50ac0;
		break;
	case SUBTILIS_VFP_INSTR_FCMPEZD:
		word |= 0xeb50bc0;
		break;
	default:
		subtilis_error_set_assertion_failed(err);
		return;
	}

	word |= instr->ccode << 28;

	if (float32) {
		if (two_ops) {
			word |= (instr->op2 >> 1) & 0xf;
			word |= (instr->op2 & 1) << 5;
		}

		word |= ((instr->op1 >> 1) & 0xf) << 12;
		word |= (instr->op1 & 1) << 22;
	} else {
		if (two_ops)
			word |= instr->op2 & 0xf;
		word |= (instr->op1 & 0xf) << 12;
	}

	prv_ensure_code(ud, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_add_word(ud, word, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r15
movl %edx, %r12d
movq %rdi, %r14
xorl %esi, %esi
movq %r8, %rdx
callq 0x59d65
cmpl $0x0, (%rbx)
jne 0x5929e
addl $-0x71, %r12d
cmpl $0x7, %r12d
ja 0x592d6
movb $0x1, %al
leaq 0x1cb18(%rip), %rcx     # 0x75d00
movslq (%rcx,%r12,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl $0xeb40a40, %ecx        # imm = 0xEB40A40
jmp 0x59206
movl $0xeb50a40, %ecx        # imm = 0xEB50A40
xorl %eax, %eax
jmp 0x59206
movl $0xeb40ac0, %ecx        # imm = 0xEB40AC0
movb $0x1, %sil
jmp 0x59232
movl $0xeb40bc0, %ecx        # imm = 0xEB40BC0
jmp 0x59230
movl $0xeb50bc0, %ecx        # imm = 0xEB50BC0
jmp 0x59225
movl $0xeb40b40, %ecx        # imm = 0xEB40B40
jmp 0x59230
movl $0xeb50b40, %ecx        # imm = 0xEB50B40
xorl %esi, %esi
xorl %eax, %eax
jmp 0x59232
movl $0xeb50ac0, %ecx        # imm = 0xEB50AC0
xorl %esi, %esi
movl (%r15), %edx
shll $0x1c, %edx
orl %ecx, %edx
testb %sil, %sil
je 0x59270
testb %al, %al
je 0x59258
movl 0x10(%r15), %eax
movl %eax, %ecx
shrl %ecx
andl $0xf, %ecx
shll $0x5, %eax
andl $0x20, %eax
orl %ecx, %eax
orl %eax, %edx
movl 0x8(%r15), %ebp
movl %ebp, %eax
andl $0x1e, %eax
shll $0xb, %eax
orl %edx, %eax
andl $0x1, %ebp
shll $0x16, %ebp
orl %eax, %ebp
jmp 0x59289
testb %al, %al
je 0x5927d
movl 0x10(%r15), %eax
andl $0xf, %eax
orl %eax, %edx
movl 0x8(%r15), %eax
shll $0xc, %eax
movzwl %ax, %ebp
orl %edx, %ebp
movl $0x4, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x57496
cmpl $0x0, (%rbx)
je 0x592a7
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%r14), %rax
testb $0x3, %al
je 0x592c5
leaq 0x1cb8a(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0x5d, %esi
movl $0xfb, %ecx
jmp 0x592ea
movq 0x28(%r14), %rcx
movl %ebp, (%rcx,%rax)
addq $0x4, %rax
movq %rax, 0x30(%r14)
jmp 0x5929e
leaq 0x1cb63(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x7cb, %ecx            # imm = 0x7CB
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x145f4