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

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

	if ((instr->dest > 15) || (instr->op1 > 15)) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	word |= instr->ccode << 28;
	word |= type << 21;
	if (instr->status)
		word |= 1 << 20;
	word |= instr->op1 << 16;
	word |= instr->dest << 12;
	prv_encode_data_op2(&instr->op2, &word, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

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

	prv_add_word(ud, word, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r12
movl %edx, %r13d
movq %rdi, %r14
xorl %esi, %esi
movq %r8, %rdx
callq 0x59d65
cmpl $0x0, (%rbx)
je 0x577a5
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%r12), %r15
cmpq $0xf, %r15
ja 0x577bb
movq 0x10(%r12), %rcx
cmpq $0x10, %rcx
jb 0x577dd
leaq 0x1e67e(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x263, %ecx            # imm = 0x263
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x145f4
movl (%r12), %edx
movl 0x18(%r12), %eax
shll $0x1c, %edx
shll $0x15, %r13d
orl %edx, %r13d
cmpb $0x0, 0x4(%r12)
leal 0x100000(%r13), %edx
cmovel %r13d, %edx
shll $0x10, %ecx
shll $0xc, %r15d
orl %ecx, %r15d
orl %edx, %r15d
cmpl $0x2, %eax
je 0x57860
cmpl $0x1, %eax
je 0x57845
testl %eax, %eax
jne 0x57934
movq 0x20(%r12), %rax
cmpq $0x10, %rax
jb 0x578c7
leaq 0x1e60a(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x232, %ecx            # imm = 0x232
jmp 0x57895
movl 0x20(%r12), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jae 0x57881
orl %eax, %r15d
orl $0x2000000, %r15d       # imm = 0x2000000
jmp 0x57934
movq 0x20(%r12), %rax
cmpq $0x10, %rax
jb 0x5789f
leaq 0x1e5ce(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x23f, %ecx            # imm = 0x23F
jmp 0x57895
leaq 0x1e5b8(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x238, %ecx            # imm = 0x238
callq 0x145f4
jmp 0x57934
movb 0x38(%r12), %cl
cmpb $0x1, %cl
jne 0x578cc
cmpq $0x10, 0x30(%r12)
jb 0x578cc
leaq 0x1e588(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x244, %ecx            # imm = 0x244
jmp 0x57895
orl %eax, %r15d
jmp 0x57934
orl %eax, %r15d
testb %cl, %cl
je 0x578e7
movl 0x30(%r12), %eax
andl $0xf, %eax
shll $0x8, %eax
orl %eax, %r15d
orl $0x10, %r15d
jmp 0x578f8
movl 0x30(%r12), %eax
andl $0x1f, %eax
shll $0x7, %eax
orl %r15d, %eax
movl %eax, %r15d
movl 0x28(%r12), %eax
testl %eax, %eax
je 0x57929
cmpl $0x5, %eax
jne 0x57923
leaq 0x1e533(%rip), %rdx     # 0x75e40
movq %rbx, %rdi
movl $0xf, %esi
movl $0x224, %ecx            # imm = 0x224
callq 0x145f4
xorl %eax, %eax
jmp 0x57929
shll $0x5, %eax
addl $-0x20, %eax
cmpl $0x0, (%rbx)
jne 0x57934
orl %r15d, %eax
movl %eax, %r15d
cmpl $0x0, (%rbx)
jne 0x5779b
movl $0x4, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x57496
cmpl $0x0, (%rbx)
jne 0x5779b
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x59d31