// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/fa.c
// Function: faMixedSpeedReadNext
boolean faMixedSpeedReadNext(struct lineFile *lf, DNA **retDna, int *retSize, char **retName,
                             DNA **faFastBuf, unsigned *faFastBufSize)
/* Read in DNA or Peptide FA record in mixed case.   Allow any upper or lower case
 * letter, or the dash character in. */
{
    char c;
    int bufIx = 0;
    char name[512];
    int lineSize, i;
    char *line;

    dnaUtilOpen();

    /* Read first line, make sure it starts with '>', and read first word
     * as name of sequence. */
    name[0] = 0;
    if (!lineFileNext(lf, &line, &lineSize))
    {
        if (retDna!=NULL) *retDna = NULL;
        if (retSize!=NULL) *retSize = 0;
        return FALSE;
    }
    if (line[0] == '>')
    {
        line = firstWordInLine(skipLeadingSpaces(line+1));
        if (line == NULL)
            errAbort("Expecting sequence name after '>' line %d of %s", lf->lineIx, lf->fileName);
        strncpy(name, line, sizeof(name));
        name[sizeof(name)-1] = '\0'; /* Just to make sure name is NULL terminated. */
    }
    else
    {
        errAbort("Expecting '>' line %d of %s", lf->lineIx, lf->fileName);
    }
    /* Read until next '>' */
    for (;;)
    {
        if (!lineFileNext(lf, &line, &lineSize))
            break;
        if (line[0] == '>')
        {
            lineFileReuse(lf);
            break;
        }
        if (bufIx + lineSize >= *faFastBufSize)
            expandFaFastBuf(bufIx, lineSize, faFastBuf, faFastBufSize);
        for (i=0; i<lineSize; ++i)
        {
            c = line[i];
            if (isalpha(c) || c == '-')
                (*faFastBuf)[bufIx++] = c;
        }
    }
    if (bufIx >= *faFastBufSize)
        expandFaFastBuf(bufIx, 0, faFastBuf, faFastBufSize);
    (*faFastBuf)[bufIx] = 0;
    if (retDna!=NULL) *retDna = *faFastBuf;
    if (retSize!=NULL) *retSize = bufIx;
    if (retName!=NULL) strcpy(*retName, name);
    if (bufIx == 0)
    {
        warn("Invalid fasta format: sequence size == 0 for element %s",name);
    }

    return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
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)
movb $0x0, %al
callq 0x34580
movb $0x0, -0x240(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x244(%rbp), %rdx
callq 0x3b660
cmpl $0x0, %eax
jne 0x372b3
cmpq $0x0, -0x18(%rbp)
je 0x37296
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x372a7
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x374bc
movq -0x250(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x37326
movq -0x250(%rbp), %rdi
addq $0x1, %rdi
callq 0x2ca80
movq %rax, %rdi
callq 0x2f070
movq %rax, -0x250(%rbp)
cmpq $0x0, -0x250(%rbp)
jne 0x37308
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xa365f(%rip), %rdi     # 0xda960
movb $0x0, %al
callq 0x35d40
leaq -0x240(%rbp), %rdi
movq -0x250(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x6370
movb $0x0, -0x41(%rbp)
jmp 0x37343
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xa3654(%rip), %rdi     # 0xda990
movb $0x0, %al
callq 0x35d40
jmp 0x37345
movq -0x10(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x244(%rbp), %rdx
callq 0x3b660
cmpl $0x0, %eax
jne 0x37366
jmp 0x3742f
movq -0x250(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x37383
movq -0x10(%rbp), %rdi
callq 0x3b440
jmp 0x3742f
movl -0x40(%rbp), %eax
addl -0x244(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x373aa
movl -0x40(%rbp), %edi
movl -0x244(%rbp), %esi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x36fe0
movl $0x0, -0x248(%rbp)
movl -0x248(%rbp), %eax
cmpl -0x244(%rbp), %eax
jge 0x3742a
movq -0x250(%rbp), %rax
movslq -0x248(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x39(%rbp)
callq 0x6780
movq (%rax), %rax
movsbl -0x39(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x373fc
movsbl -0x39(%rbp), %eax
cmpl $0x2d, %eax
jne 0x37417
movb -0x39(%rbp), %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)
jmp 0x37419
movl -0x248(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x248(%rbp)
jmp 0x373b4
jmp 0x37345
movl -0x40(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x3744c
movl -0x40(%rbp), %edi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
xorl %esi, %esi
callq 0x36fe0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x40(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpq $0x0, -0x18(%rbp)
je 0x37470
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x37480
movl -0x40(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x3749a
movq -0x28(%rbp), %rax
movq (%rax), %rdi
leaq -0x240(%rbp), %rsi
callq 0x6680
cmpl $0x0, -0x40(%rbp)
jne 0x374b5
leaq -0x240(%rbp), %rsi
leaq 0xa3451(%rip), %rdi     # 0xda8ff
movb $0x0, %al
callq 0x358e0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopl (%rax,%rax)