// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/fa.c
// Function: nextSeqFromMem
static bioSeq *nextSeqFromMem(char **pText, boolean isDna, boolean doFilter)
/* Convert fa in memory to bioSeq.  Update *pText to point to next
 * record.  Returns NULL when no more sequences left. */
{
char *name = "";
char *s, *d;
struct dnaSeq *seq;
int size = 0;
char c;
char *filter = (isDna ? ntChars : aaChars);
char *text = *pText;
char *p = skipLeadingSpaces(text);
if (p == NULL)
    return NULL;
dnaUtilOpen();
if (*p == '>')
    {
    char *end;
    s = strchr(p, '\n');
    if (s != NULL) ++s;
    name = skipLeadingSpaces(p+1);
    end = skipToSpaces(name);
    if (end >= s || name >= s)
        errAbort("No name in line starting with '>'");
    if (end != NULL)
        *end = 0;
    }
else
    {
    s = p; 
    if (s == NULL || s[0] == 0)
        return NULL;
    }
name = cloneString(name);
    
d = text;
if (s != NULL)
    {
    for (;;)
	{
	c = *s;
	if (c == 0 || c == '>')
	    break;
	++s;
	if (!isalpha(c))
	    continue;
	if (doFilter)
	    {
	    if ((c = filter[(int)c]) == 0) 
		{
		if (isDna)
		    c = 'n';
		else
		    c = 'X';
		}
	    }
	d[size++] = c;
	}
    }
d[size] = 0;

/* Put sequence into our little sequence structure. */
AllocVar(seq);
seq->name = name;
seq->dna = text;
seq->size = size;
*pText = s;
return seq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
leaq 0xaeadd(%rip), %rax     # 0xe5406
movq %rax, -0x20(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x14(%rbp), %edx
leaq 0xd1672(%rip), %rax     # 0x107fb0
leaq 0xd146b(%rip), %rcx     # 0x107db0
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2ca80
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x3697c
movq $0x0, -0x8(%rbp)
jmp 0x36b39
movb $0x0, %al
callq 0x34580
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x36a04
movq -0x58(%rbp), %rdi
movl $0xa, %esi
callq 0x6260
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x369b4
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x58(%rbp), %rdi
addq $0x1, %rdi
callq 0x2ca80
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2ecf0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x369e6
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x369f4
leaq 0xa3fd3(%rip), %rdi     # 0xda9c0
movb $0x0, %al
callq 0x35d40
cmpq $0x0, -0x60(%rbp)
je 0x36a02
movq -0x60(%rbp), %rax
movb $0x0, (%rax)
jmp 0x36a2e
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x36a1f
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x36a2c
movq $0x0, -0x8(%rbp)
jmp 0x36b39
jmp 0x36a2e
movq -0x20(%rbp), %rdi
callq 0x2a450
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x36aea
jmp 0x36a50
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
cmpl $0x0, %eax
je 0x36a6b
movsbl -0x3d(%rbp), %eax
cmpl $0x3e, %eax
jne 0x36a6d
jmp 0x36ae8
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
callq 0x6780
movq (%rax), %rax
movsbl -0x3d(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x36a98
jmp 0x36a50
cmpl $0x0, -0x18(%rbp)
je 0x36acb
movq -0x48(%rbp), %rax
movsbl -0x3d(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x3d(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x36ac9
cmpl $0x0, -0x14(%rbp)
je 0x36ac3
movb $0x6e, -0x3d(%rbp)
jmp 0x36ac7
movb $0x58, -0x3d(%rbp)
jmp 0x36ac9
jmp 0x36acb
movb -0x3d(%rbp), %dl
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x3c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x36a50
jmp 0x36aea
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x28, %edi
callq 0x40c50
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x3c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)