// File: /workspace/github_c_makefile_star2_O3/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 0x59e32
cmpl $0x0, (%rbx)
je 0x5789e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%r12), %r15
cmpq $0xf, %r15
ja 0x578b4
movq 0x10(%r12), %rcx
cmpq $0x10, %rcx
jb 0x578d6
leaq 0x1e5c5(%rip), %rdx     # 0x75e80
movq %rbx, %rdi
movl $0xf, %esi
movl $0x263, %ecx            # imm = 0x263
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x145a4
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 0x57956
cmpl $0x1, %eax
je 0x5793e
testl %eax, %eax
jne 0x579be
movq 0x20(%r12), %rax
cmpq $0x10, %rax
jb 0x579bb
leaq 0x1e551(%rip), %rdx     # 0x75e80
movq %rbx, %rdi
movl $0xf, %esi
movl $0x232, %ecx            # imm = 0x232
jmp 0x5798b
movl 0x20(%r12), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jae 0x57977
orl %eax, %r15d
orl $0x2000000, %r15d       # imm = 0x2000000
jmp 0x579be
movq 0x20(%r12), %rax
cmpq $0x10, %rax
jb 0x57992
leaq 0x1e518(%rip), %rdx     # 0x75e80
movq %rbx, %rdi
movl $0xf, %esi
movl $0x23f, %ecx            # imm = 0x23F
jmp 0x5798b
leaq 0x1e502(%rip), %rdx     # 0x75e80
movq %rbx, %rdi
movl $0xf, %esi
movl $0x238, %ecx            # imm = 0x238
callq 0x145a4
jmp 0x579be
cmpb $0x1, 0x38(%r12)
jne 0x579f7
movq 0x30(%r12), %r13
cmpq $0x10, %r13
jb 0x57a0c
leaq 0x1e4d4(%rip), %rdx     # 0x75e80
movq %rbx, %rdi
movl $0xf, %esi
movl $0x244, %ecx            # imm = 0x244
jmp 0x5798b
orl %eax, %r15d
cmpl $0x0, (%rbx)
jne 0x57894
movl $0x4, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x5758f
cmpl $0x0, (%rbx)
jne 0x57894
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x59dfe
movl 0x30(%r12), %r13d
andl $0x1f, %r13d
shll $0x7, %r13d
orl %eax, %r13d
orl %r15d, %r13d
jmp 0x57a1a
shll $0x8, %r13d
orl %eax, %r13d
orl %r15d, %r13d
orl $0x10, %r13d
movl 0x28(%r12), %r15d
testl %r15d, %r15d
je 0x57a59
cmpl $0x5, %r15d
jne 0x57a51
leaq 0x1e44f(%rip), %rdx     # 0x75e80
movq %rbx, %rdi
movl $0xf, %esi
movl $0x224, %ecx            # imm = 0x224
callq 0x145a4
cmpl $0x0, (%rbx)
jne 0x57894
xorl %r15d, %r15d
jmp 0x57a59
shll $0x5, %r15d
addl $-0x20, %r15d
orl %r13d, %r15d
jmp 0x579c7