// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x144(%rbp)
movl $0x0, -0x148(%rbp)
movb $0x0, %al
callq 0x34580
movb $0x0, -0x140(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6bf0
movl %eax, -0x3c(%rbp)
cmpl $-0x1, %eax
jne 0x36e59
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x36fcc
cmpl $0x0, -0x148(%rbp)
jne 0x36ec0
movslq -0x144(%rbp), %rax
cmpq $0xff, %rax
jae 0x36ec0
callq 0x6780
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x36e97
movl $0x1, -0x148(%rbp)
jmp 0x36ebe
cmpl $0x3e, -0x3c(%rbp)
je 0x36ebc
movl -0x3c(%rbp), %eax
movb %al, %cl
movl -0x144(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x144(%rbp)
cltq
movb %cl, -0x140(%rbp,%rax)
jmp 0x36ebe
jmp 0x36ec0
cmpl $0xa, -0x3c(%rbp)
jne 0x36ec8
jmp 0x36ecd
jmp 0x36e1c
movslq -0x144(%rbp), %rax
movb $0x0, -0x140(%rbp,%rax)
movq -0x10(%rbp), %rdi
callq 0x6bf0
movl %eax, -0x3c(%rbp)
cmpl $-0x1, -0x3c(%rbp)
je 0x36ef4
cmpl $0x3e, -0x3c(%rbp)
jne 0x36efd
movl $0x0, -0x3c(%rbp)
jmp 0x36f3c
callq 0x6780
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x36f19
jmp 0x36edc
movslq -0x3c(%rbp), %rcx
leaq 0xd0e8c(%rip), %rax     # 0x107db0
movsbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x36f38
movl $0x6e, -0x3c(%rbp)
jmp 0x36f3a
jmp 0x36f3c
movl -0x40(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x36f59
movl -0x40(%rbp), %edi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
xorl %esi, %esi
callq 0x36fe0
movl -0x3c(%rbp), %eax
movb %al, %dl
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x40(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x3c(%rbp)
jne 0x36fc7
cmpq $0x0, -0x18(%rbp)
je 0x36f91
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x36fa4
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x36fbe
movq -0x28(%rbp), %rax
movq (%rax), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6680
movl $0x1, -0x4(%rbp)
jmp 0x36fcc
jmp 0x36edc
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax,%rax)