// File: /workspace/github_c_makefile_star2_O3/MikeGray-APH[P]LibLouisAPH/source/translate.c
// Function: translate_copy_to_output
int translate_copy_to_output(struct translate *translate, const int count, const int do_map)
{
	int cnt, i;

	/*   ensure count is still within range   */
	if(translate->input_crs + count > translate->input_len)
		cnt = translate->input_len - translate->input_crs;
	else
		cnt = count;

	if(!translate_check_output_max(translate, cnt))
		return 0;

	for(i = 0; i < cnt; i++)
	{
		ASSERT(translate->output_len + i < translate->output_max)
		translate->output[translate->output_len + i] = translate->input[translate->input_crs + i];
		translate->output_mask[translate->output_len + i] = translate->input_mask[translate->input_crs + i];
		if(translate->maps_use)
		if(do_map)
		{
			translate->output_to_input_map[translate->output_len + i] = translate->input_map[translate->input_crs + i];
			translate_remap_input(translate, i, 0);
		}
		else
		{
			translate->output_to_input_map[translate->output_len + i] = -1;
			translate_remap_input(translate, i, 1);
		}
	}

	translate_increment(translate, cnt, cnt);

	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
movl 0x40(%rdi), %eax
movl 0x44(%rdi), %ecx
movl %ecx, %r14d
subl %eax, %r14d
addl %esi, %eax
cmpl %ecx, %eax
cmovlel %esi, %r14d
movl %r14d, %esi
callq 0x70d2
testl %eax, %eax
je 0x763d
testl %r14d, %r14d
jle 0x7605
xorl %eax, %eax
movslq 0x68(%rbx), %rdx
movslq %eax, %rcx
addq %rcx, %rdx
cmpl 0x6c(%rbx), %edx
jge 0x7658
movslq 0x40(%rbx), %rsi
addq %rcx, %rsi
movq 0x38(%rbx), %rdi
movq 0x60(%rbx), %r8
movzwl (%rdi,%rsi,2), %edi
movw %di, (%r8,%rdx,2)
movq 0x58(%rbx), %rdi
movq 0x80(%rbx), %r8
movb (%rdi,%rsi), %sil
movb %sil, (%r8,%rdx)
cmpl $0x0, 0x90(%rbx)
je 0x75fa
testl %ebp, %ebp
je 0x7580
movq 0x50(%rbx), %rsi
movq 0x78(%rbx), %rdx
movslq 0x40(%rbx), %rdi
addq %rcx, %rdi
movl (%rsi,%rdi,4), %edi
movslq 0x68(%rbx), %r8
addq %rcx, %r8
movl %edi, (%rdx,%r8,4)
movslq 0x40(%rbx), %rdi
addq %rdi, %rcx
cmpl 0x44(%rbx), %ecx
jge 0x7658
movslq (%rsi,%rcx,4), %rcx
testq %rcx, %rcx
js 0x75fa
movl 0x68(%rbx), %edx
testl %edi, %edi
je 0x7542
movl -0x4(%rsi,%rdi,4), %r8d
cmpl (%rsi,%rdi,4), %r8d
je 0x75fa
movq 0x48(%rbx), %rsi
cmpl $0x0, (%rsi,%rcx,4)
js 0x75fa
leal 0x1(%rcx), %edi
cmpl 0x20(%rbx), %edi
jge 0x757b
movl %edi, %r8d
leaq (%rsi,%r8,4), %r8
movl (%r8), %r9d
testl %r9d, %r9d
js 0x757b
cmpl (%rsi,%rcx,4), %r9d
jne 0x757b
movl %edx, (%r8)
incl %edi
addq $0x4, %r8
cmpl %edi, 0x20(%rbx)
jg 0x755f
movl %edx, (%rsi,%rcx,4)
jmp 0x75fa
movq 0x78(%rbx), %rdx
movslq 0x68(%rbx), %rsi
addq %rcx, %rsi
movl $0xffffffff, (%rdx,%rsi,4) # imm = 0xFFFFFFFF
movslq 0x40(%rbx), %rdx
addq %rdx, %rcx
cmpl 0x44(%rbx), %ecx
jge 0x7658
movq 0x50(%rbx), %rsi
movslq (%rsi,%rcx,4), %rcx
testq %rcx, %rcx
js 0x75fa
testl %edx, %edx
je 0x75bc
movl -0x4(%rsi,%rdx,4), %edi
cmpl (%rsi,%rdx,4), %edi
je 0x75fa
movq 0x48(%rbx), %rdx
cmpl $0x0, (%rdx,%rcx,4)
js 0x75fa
leal 0x1(%rcx), %esi
cmpl 0x20(%rbx), %esi
jge 0x75f3
movl %esi, %edi
leaq (%rdx,%rdi,4), %rdi
movl (%rdi), %r8d
testl %r8d, %r8d
js 0x75f3
cmpl (%rdx,%rcx,4), %r8d
jne 0x75f3
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
incl %esi
addq $0x4, %rdi
cmpl %esi, 0x20(%rbx)
jg 0x75d4
movl $0xffffffff, (%rdx,%rcx,4) # imm = 0xFFFFFFFF
incl %eax
cmpl %r14d, %eax
jl 0x749f
testl %r14d, %r14d
je 0x7641
cmpl $0x0, 0x8c(%rbx)
movl 0x40(%rbx), %eax
jne 0x7644
movl 0x88(%rbx), %ecx
cmpl %eax, %ecx
jl 0x7644
leal (%rax,%r14), %edx
cmpl %edx, %ecx
jge 0x7644
movl $0x1, 0x8c(%rbx)
movl 0x68(%rbx), %ecx
movl %ecx, 0x88(%rbx)
jmp 0x7644
xorl %eax, %eax
jmp 0x7653
movl 0x40(%rbx), %eax
addl %r14d, %eax
movl %eax, 0x40(%rbx)
addl %r14d, 0x68(%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x1060