// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_fpa_cmp_instr
static void prv_encode_fpa_cmp_instr(void *user_data, subtilis_arm_op_t *op,
				     subtilis_arm_instr_type_t type,
				     subtilis_fpa_cmp_instr_t *instr,
				     subtilis_error_t *err)
{
	subtilis_arm_encode_ud_t *ud = user_data;
	uint32_t word = 0;
	uint32_t op_code = 0;

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

	word |= instr->ccode << 28;
	word |= 0xE << 24;

	switch (type) {
	case SUBTILIS_FPA_INSTR_CMF:
		op_code = 4;
		break;
	case SUBTILIS_FPA_INSTR_CNF:
		op_code = 5;
		break;
	case SUBTILIS_FPA_INSTR_CMFE:
		op_code = 6;
		break;
	case SUBTILIS_FPA_INSTR_CNFE:
		op_code = 7;
		break;
	default:
		subtilis_error_set_assertion_failed(err);
		return;
	}
	word |= op_code << 21;
	word |= 1 << 20;
	word |= instr->dest << 16;
	word |= 15 << 12;
	word |= 1 << 8;
	word |= 1 << 4;

	if (instr->immediate) {
		word |= 1 << 3;
		word |= instr->op2.imm;
	} else {
		word |= instr->op2.reg;
	}

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

	prv_add_word(ud, word, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x819a0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7fa3c
jmp 0x7fb64
movq -0x20(%rbp), %rax
movl (%rax), %ecx
shll $0x1c, %ecx
movl -0x34(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x34(%rbp)
movb -0x31(%rbp), %al
orb $0xe, %al
movb %al, -0x31(%rbp)
movl -0x14(%rbp), %eax
addl $-0x40, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x3, %eax
ja 0x7fa9e
movq -0x40(%rbp), %rax
leaq 0x2d1af(%rip), %rcx     # 0xacc20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x4, -0x38(%rbp)
jmp 0x7fabd
movl $0x5, -0x38(%rbp)
jmp 0x7fabd
movl $0x6, -0x38(%rbp)
jmp 0x7fabd
movl $0x7, -0x38(%rbp)
jmp 0x7fabd
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x2d382(%rip), %rdx     # 0xace30
movl $0x57f, %ecx            # imm = 0x57F
callq 0x158e0
jmp 0x7fb64
movl -0x38(%rbp), %eax
shll $0x15, %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
orl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shlq $0x10, %rcx
movl -0x34(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
orl $0xf000, %eax           # imm = 0xF000
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x7fb2b
movl -0x34(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x18(%rax), %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x7fb3c
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movl -0x34(%rbp), %eax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x81b90
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7fb54
jmp 0x7fb64
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x81bc0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)