// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %rbp
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x25b5c
movb $0x0, 0x20(%rsp)
xorl %r15d, %r15d
movq %rbp, %rdi
callq 0x6bf0
cmpl $-0x1, %eax
je 0x27740
movl %eax, %ebx
testl %r15d, %r15d
sete %al
cmpl $0xff, %r14d
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x27683
callq 0x6790
movq (%rax), %rax
movslq %ebx, %rcx
movl $0x1, %r15d
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x27683
xorl %r15d, %r15d
cmpl $0x3e, %ebx
je 0x27683
movslq %r14d, %rax
incl %r14d
movb %bl, 0x20(%rsp,%rax)
cmpl $0xa, %ebx
jne 0x2762f
movslq %r14d, %rax
movb $0x0, 0x20(%rsp,%rax)
xorl %eax, %eax
movl $0x6e, %r15d
movq %rax, %rbx
movq %rbp, %rdi
callq 0x6bf0
cmpl $-0x1, %eax
je 0x276d9
movl %eax, %r14d
cmpl $0x3e, %eax
je 0x276d9
callq 0x6790
movq (%rax), %rcx
movslq %r14d, %rax
testb $0x4, 0x1(%rcx,%rax,2)
je 0x2769b
leaq 0x9a2a7(%rip), %rcx     # 0xc1970
movzbl (%rcx,%rax), %eax
testb %al, %al
cmovel %r15d, %eax
movsbl %al, %r14d
jmp 0x276dc
xorl %r14d, %r14d
movl (%r13), %eax
cmpq %rax, %rbx
jb 0x276f4
movl %ebx, %edi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x27771
movq (%r12), %rcx
leaq 0x1(%rbx), %rax
movb %r14b, (%rcx,%rbx)
testl %r14d, %r14d
jne 0x27698
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rdx
je 0x27720
movq (%r12), %rax
movq %rax, (%rsi)
testq %rdx, %rdx
je 0x27727
movl %ebx, (%rdx)
movl $0x1, %ebx
testq %rcx, %rcx
je 0x2775d
movq (%rcx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x6680
jmp 0x2775d
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x18(%rsp), %rax
movq %rbx, (%rax)
movl %ebx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq