// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_encode_cmov_instr
static void prv_encode_cmov_instr(void *user_data, subtilis_arm_op_t *op,
				  subtilis_arm_instr_type_t type,
				  subtilis_arm_cmov_instr_t *instr,
				  subtilis_error_t *err)
{
	subtilis_arm_data_instr_t data;

	if (!instr->fused) {
		memset(&data, 0, sizeof(data));

		data.ccode = SUBTILIS_ARM_CCODE_AL;
		data.status = true;
		data.op1 = instr->op1;
		data.op2.type = SUBTILIS_ARM_OP2_I32;
		data.op2.op.integer = 0;

		prv_encode_cmp_instr(user_data, NULL, SUBTILIS_ARM_INSTR_CMP,
				     &data, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}

	memset(&data, 0, sizeof(data));

	data.ccode = instr->fused ? instr->true_cond : SUBTILIS_ARM_CCODE_EQ;
	data.status = false;
	data.dest = instr->dest;
	data.op2.type = SUBTILIS_ARM_OP2_REG;
	data.op2.op.reg = instr->op3;

	prv_encode_mov_instr(user_data, NULL, SUBTILIS_ARM_INSTR_MOV, &data,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	memset(&data, 0, sizeof(data));

	data.ccode = instr->fused ? instr->false_cond : SUBTILIS_ARM_CCODE_NE;
	data.status = false;
	data.dest = instr->dest;
	data.op2.type = SUBTILIS_ARM_OP2_REG;
	data.op2.op.reg = instr->op2;

	prv_encode_mov_instr(user_data, NULL, SUBTILIS_ARM_INSTR_MOV, &data,
			     err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x20(%rax)
jne 0x7f444
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x12110
movl $0xe, -0x68(%rbp)
movb $0x1, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x1, -0x50(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %r8
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
leaq -0x68(%rbp), %rcx
callq 0x7eab0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7f442
jmp 0x7f530
jmp 0x7f444
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x12110
movq -0x20(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x7f46a
movq -0x20(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x6c(%rbp)
jmp 0x7f471
xorl %eax, %eax
movl %eax, -0x6c(%rbp)
jmp 0x7f471
movl -0x6c(%rbp), %eax
movl %eax, -0x68(%rbp)
movb $0x0, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %r8
xorl %eax, %eax
movl %eax, %esi
movl $0xd, %edx
leaq -0x68(%rbp), %rcx
callq 0x7eb10
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7f4be
jmp 0x7f530
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x12110
movq -0x20(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x7f4e4
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x70(%rbp)
jmp 0x7f4ee
movl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x7f4ee
movl -0x70(%rbp), %eax
movl %eax, -0x68(%rbp)
movb $0x0, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %r8
xorl %eax, %eax
movl %eax, %esi
movl $0xd, %edx
leaq -0x68(%rbp), %rcx
callq 0x7eb10
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)