// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/dnaseq.c
// Function: translateSeqN
aaSeq *translateSeqN(struct dnaSeq *inSeq, unsigned offset, unsigned inSize, boolean stop)
/* Return a translated sequence.  Offset is position of first base to
 * translate. If size is 0 then use length of inSeq. */
{
aaSeq *seq;
DNA *dna = inSeq->dna;
AA *pep, aa;
int i, lastCodon;
int actualSize = 0;

assert(offset <= inSeq->size);
if ((inSize == 0) || (inSize > (inSeq->size - offset)))
    inSize = inSeq->size - offset;
lastCodon = offset + inSize - 3;

AllocVar(seq);
seq->dna = pep = needLargeMem(inSize/3+1);
for (i=offset; i <= lastCodon; i += 3)
    {
    aa = lookupCodon(dna+i);
    if (aa == 0)
	{
        if (stop)
	    break;
	else
	    aa = 'Z';
	}
    *pep++ = aa;
    ++actualSize;
    }
*pep = 0;
assert(actualSize <= inSize/3+1);
seq->size = actualSize;
seq->name = cloneString(inSeq->name);
return seq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x40(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
ja 0x329e6
jmp 0x32a05
leaq 0xa79c7(%rip), %rdi     # 0xda3b4
leaq 0xa79d6(%rip), %rsi     # 0xda3ca
movl $0x6e, %edx
leaq 0xa79d7(%rip), %rcx     # 0xda3d7
callq 0x6450
cmpl $0x0, -0x10(%rbp)
je 0x32a1c
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x18(%rcx), %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x32a29
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
addl -0x10(%rbp), %eax
subl $0x3, %eax
movl %eax, -0x3c(%rbp)
movl $0x28, %edi
callq 0x40c50
movq %rax, -0x20(%rbp)
movl -0x10(%rbp), %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x40950
movq %rax, %rcx
movq %rcx, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jg 0x32aca
movq -0x28(%rbp), %rdi
movslq -0x38(%rbp), %rax
addq %rax, %rdi
callq 0x32dd0
movb %al, -0x31(%rbp)
movsbl -0x31(%rbp), %eax
cmpl $0x0, %eax
jne 0x32aa2
cmpl $0x0, -0x14(%rbp)
je 0x32a9c
jmp 0x32aca
movb $0x5a, -0x31(%rbp)
jmp 0x32aa2
movb -0x31(%rbp), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x38(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x38(%rbp)
jmp 0x32a70
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x10(%rbp), %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
ja 0x32af1
jmp 0x32b10
leaq 0xa7926(%rip), %rdi     # 0xda41e
leaq 0xa78cb(%rip), %rsi     # 0xda3ca
movl $0x83, %edx
leaq 0xa78cc(%rip), %rcx     # 0xda3d7
callq 0x6450
movl -0x40(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)