// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/fa.c
// Function: faFastReadNext
boolean faFastReadNext(FILE *f, DNA **retDna, int *retSize, char **retName, DNA **faFastBuf, unsigned *faFastBufSize)
/* Read in next FA entry as fast as we can. Return FALSE at EOF. 
 * The returned DNA and name will be overwritten by the next call
 * to this function. */
{
    int c;
    int bufIx = 0;
    char name[256];
    int nameIx = 0;
    boolean gotSpace = FALSE;


    /* Seek to next '\n' and save first word as name. */
    dnaUtilOpen();
    name[0] = 0;
    for (;;)
    {
        if ((c = fgetc(f)) == EOF)
        {
            *retDna = NULL;
            *retSize = 0;
            *retName = NULL;
            return FALSE;
        }
        if (!gotSpace && nameIx < ArraySize(name)-1)
        {
            if (isspace(c))
                gotSpace = TRUE;
            else if (c != '>')
            {
                name[nameIx++] = c;
            }
        }
        if (c == '\n')
            break;
    }
    name[nameIx] = 0;
    /* Read until next '>' */
    for (;;)
    {
        c = fgetc(f);
        if (c == EOF || c == '>')
            c = 0;
        else if (!isalpha(c))
            continue;
        else
        {
            c = ntChars[c];
            if (c == 0) c = 'n';
        }
        if (bufIx >= *faFastBufSize)
            expandFaFastBuf(bufIx, 0, faFastBuf, faFastBufSize);
        (*faFastBuf)[bufIx++] = c;
        if (c == 0)
        {
            if (retDna!=NULL) *retDna = *faFastBuf;
            if (retSize!=NULL) *retSize = bufIx-1;
            if (retName!=NULL) strcpy(*retName, name);
            return TRUE;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %r9, %r13
movq %r8, %r15
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %rbp
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x21578
movb $0x0, 0x20(%rsp)
xorl %r12d, %r12d
movq %rbp, %rdi
callq 0x6bf0
cmpl $-0x1, %eax
je 0x22f5d
movl %eax, %ebx
testl %r12d, %r12d
sete %al
cmpl $0xff, %r14d
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x22ea6
callq 0x6790
movq (%rax), %rax
movslq %ebx, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x22ea2
xorl %r12d, %r12d
cmpl $0x3e, %ebx
je 0x22ea6
movslq %r14d, %rax
incl %r14d
movb %bl, 0x20(%rsp,%rax)
jmp 0x22ea6
pushq $0x1
popq %r12
cmpl $0xa, %ebx
jne 0x22e52
movslq %r14d, %rax
movb $0x0, 0x20(%rsp,%rax)
xorl %eax, %eax
pushq $0x6e
popq %r12
movq %rax, %rbx
movq %rbp, %rdi
callq 0x6bf0
cmpl $-0x1, %eax
je 0x22efa
movl %eax, %r14d
cmpl $0x3e, %eax
je 0x22efa
callq 0x6790
movq (%rax), %rcx
movslq %r14d, %rax
testb $0x4, 0x1(%rcx,%rax,2)
je 0x22ebc
leaq 0x92aa6(%rip), %rcx     # 0xb5990
movzbl (%rcx,%rax), %eax
testb %al, %al
cmovel %r12d, %eax
movsbl %al, %r14d
jmp 0x22efd
xorl %r14d, %r14d
movl (%r13), %eax
cmpq %rax, %rbx
jb 0x22f15
movl %ebx, %edi
xorl %esi, %esi
movq %r15, %rdx
movq %r13, %rcx
callq 0x22f8d
movq (%r15), %rcx
leaq 0x1(%rbx), %rax
movb %r14b, (%rcx,%rbx)
testl %r14d, %r14d
jne 0x22eb9
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rdx
je 0x22f3f
movq (%r15), %rax
movq %rax, (%rsi)
testq %rdx, %rdx
je 0x22f46
movl %ebx, (%rdx)
pushq $0x1
popq %rbx
testq %rcx, %rcx
je 0x22f79
movq (%rcx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x6680
jmp 0x22f79
movq 0x8(%rsp), %rax
andq $0x0, (%rax)
movq 0x10(%rsp), %rax
andl $0x0, (%rax)
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq