// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
addl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jle 0xaee8
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x40(%rcx), %eax
movl %eax, -0x1c(%rbp)
jmp 0xaeee
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xa830
cmpl $0x0, %eax
jne 0xaf0b
movl $0x0, -0x4(%rbp)
jmp 0xb043
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xb02d
movq -0x10(%rbp), %rax
movl 0x68(%rax), %eax
addl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jl 0xaf36
callq 0x1050
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x40(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x68(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x40(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x68(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x90(%rax)
je 0xb01d
cmpl $0x0, -0x18(%rbp)
je 0xafee
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x40(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x68(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0xad60
jmp 0xb01b
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x68(%rcx), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
movl $0x1, %edx
callq 0xad60
jmp 0xb01d
jmp 0xb01f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xaf12
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0xaa90
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)