// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/readseq.c
// Function: readSequence
int readSequence (FILE *fil, int *conv, 
                  char **seq, char **id, char **desc, int *length)
{
  char c ;
  int n ;
  static FILE *oldFil = 0 ;
  static int line ;
  int buflen ;

  if (fil != oldFil)
    { line = 1 ;
      oldFil = fil ;
    }
  
/* get id, descriptor */
  c = getc (fil) ;
  if (c == '>')			/* header line */
    { c = getc(fil) ;

      n = 0 ;			/* id */
      buflen = -32;
      while (!feof (fil) && c != ' ' && c != '\n' && c != '\t')
	{ if (id) add (c, id, &buflen, n++) ;
	  c = getc (fil) ;
	}
      if (id) add (0, id, &buflen, n) ;

				/* white space */
      while (!feof (fil) && (c == ' ' || c == '\t'))
	c = getc (fil) ;

      n = 0 ;			/* desc */
      buflen = -32 ;
      while (!feof (fil) && c != '\n')
	{ if (desc) add (c, desc, &buflen, n++) ;
	  c = getc (fil) ;
	}
      if (desc) add (0, desc, &buflen, n) ;

      ++line ;
    }
  else
    { ungetc (c, fil) ;		/* no header line */
      if (id) 
	*id = "" ;
      if (desc)
	*desc = "" ;
    }

  /* ensure whitespace ignored */

  conv[' '] = conv['\t'] = -1 ;
  conv['\n'] = -3 ;

  n = 0 ;			/* sequence */
  buflen = -1024 ;

  while (!feof (fil))
    { 
      c = getc (fil) ;
      if (c == '>')
	{ ungetc (c, fil) ;
	  break ;
	}

      if (c == EOF) /* for some compiler once needed || c == EOF + 256 */
	break ;

    
      switch (conv[c]) {
        case -2:
          { if (id) 
              fprintf (stderr, "Bad char 0x%x = '%c' at line %d, base %d, sequence %s\n",
          	     c, c, line, n, *id) ;
            else
              fprintf (stderr, "Bad char 0x%x = '%c' at line %d, base %d\n",
          	     c, c, line, n) ;
            return 0 ;
          }
          break;
        case -3:
          ++line;
        case -1:
          break;
        default:
	  if (seq) add (conv[c], seq, &buflen, n++) ;
	  else ++n ;
      }
    }
  if (seq) add (0, seq, &buflen, n) ;

  if (length)
    *length = n ;

  return n ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, 0x18(%rsp)
movq %rdx, %r15
movq %rsi, 0x20(%rsp)
movq %rdi, %r12
cmpq %rdi, 0x9a1d(%rip)      # 0x10458
je 0x6a4e
movl $0x1, 0x9a19(%rip)      # 0x10460
movq %r12, 0x9a0a(%rip)      # 0x10458
movq %r12, %rdi
callq 0x1260
shll $0x18, %eax
cmpl $0x3e000000, %eax       # imm = 0x3E000000
movq %rbx, 0x30(%rsp)
jne 0x6b51
movq %r12, %rdi
callq 0x1260
movl %eax, %ebx
movl $0xffffffe0, 0x14(%rsp) # imm = 0xFFFFFFE0
movq %r12, %rdi
callq 0x1160
xorl %r14d, %r14d
testl %eax, %eax
movq %r15, 0x28(%rsp)
je 0x6c69
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x6ac5
leaq 0x14(%rsp), %rdx
xorl %edi, %edi
movl %r14d, %ecx
callq 0x6d26
jmp 0x6ac5
cmpb $0x20, %bl
je 0x6abb
movzbl %bl, %eax
cmpl $0x9, %eax
jne 0x6ad1
movq %r12, %rdi
callq 0x1260
movl %eax, %ebx
movq %r12, %rdi
callq 0x1160
testl %eax, %eax
je 0x6aae
movl $0xffffffe0, 0x14(%rsp) # imm = 0xFFFFFFE0
movq %r12, %rdi
callq 0x1160
xorl %r14d, %r14d
cmpb $0xa, %bl
je 0x6b2d
testl %eax, %eax
jne 0x6b2d
xorl %r14d, %r14d
leaq 0x14(%rsp), %r15
testq %rbp, %rbp
je 0x6b12
leal 0x1(%r14), %r13d
movsbl %bl, %edi
movq %rbp, %rsi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x6d26
movl %r13d, %r14d
movq %r12, %rdi
callq 0x1260
movl %eax, %ebx
movq %r12, %rdi
callq 0x1160
cmpb $0xa, %bl
je 0x6b2d
testl %eax, %eax
je 0x6af5
testq %rbp, %rbp
je 0x6b44
leaq 0x14(%rsp), %rdx
xorl %edi, %edi
movq %rbp, %rsi
movl %r14d, %ecx
callq 0x6d26
incl 0x9916(%rip)            # 0x10460
movq 0x28(%rsp), %r15
jmp 0x6b82
sarl $0x18, %eax
movl %eax, %edi
movq %r12, %rsi
callq 0x11b0
movq 0x18(%rsp), %rcx
testq %rcx, %rcx
je 0x6b72
leaq 0x404f(%rip), %rax      # 0xabbe
movq %rax, (%rcx)
testq %rbp, %rbp
je 0x6b82
leaq 0x4040(%rip), %rax      # 0xabbe
movq %rax, (%rbp)
movabsq $-0x200000001, %rax     # imm = 0xFFFFFFFDFFFFFFFF
movq 0x20(%rsp), %r13
movq %rax, 0x24(%r13)
movl $0xffffffff, 0x80(%r13) # imm = 0xFFFFFFFF
movl $0xfffffc00, 0x14(%rsp) # imm = 0xFFFFFC00
movq %r12, %rdi
callq 0x1160
xorl %ebx, %ebx
testl %eax, %eax
je 0x6be9
testq %r15, %r15
je 0x6bcc
leaq 0x14(%rsp), %rdx
xorl %edi, %edi
movq %r15, %rsi
movl %ebx, %ecx
callq 0x6d26
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x6bd8
movl %ebx, (%rax)
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
leaq 0x14(%rsp), %r14
movq %r12, %rdi
callq 0x1260
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0xff000000, %ecx       # imm = 0xFF000000
je 0x6bb6
cmpl $0x3e000000, %ecx       # imm = 0x3E000000
je 0x6ccc
movsbq %al, %rax
movl (%r13,%rax,4), %eax
cmpl $-0x3, %eax
je 0x6c4e
cmpl $-0x1, %eax
je 0x6c58
cmpl $-0x2, %eax
je 0x6cde
testq %r15, %r15
je 0x6c56
leal 0x1(%rbx), %ebp
movsbl %al, %edi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x6d26
movl %ebp, %ebx
movq 0x20(%rsp), %r13
jmp 0x6c58
incl 0x980c(%rip)            # 0x10460
jmp 0x6c58
incl %ebx
movq %r12, %rdi
callq 0x1160
testl %eax, %eax
je 0x6bf0
jmp 0x6bb6
xorl %r14d, %r14d
leaq 0x14(%rsp), %r13
movq 0x18(%rsp), %rsi
cmpb $0x20, %bl
ja 0x6c92
movzbl %bl, %eax
movabsq $0x100000600, %rcx      # imm = 0x100000600
btq %rax, %rcx
jb 0x6a98
testq %rsi, %rsi
je 0x6cac
leal 0x1(%r14), %r15d
movsbl %bl, %edi
movq %r13, %rdx
movl %r14d, %ecx
callq 0x6d26
movl %r15d, %r14d
movq %r12, %rdi
callq 0x1260
movl %eax, %ebx
movq %r12, %rdi
callq 0x1160
testl %eax, %eax
movq 0x18(%rsp), %rsi
je 0x6c76
jmp 0x6a98
movl $0x3e, %edi
movq %r12, %rsi
callq 0x11b0
jmp 0x6bb6
sarl $0x18, %ecx
movq 0x8308(%rip), %rax      # 0xeff0
movq (%rax), %rdi
movl 0x976e(%rip), %r8d      # 0x10460
movq 0x18(%rsp), %rax
testq %rax, %rax
jne 0x6d05
leaq 0x49e2(%rip), %rsi      # 0xb6e5
jmp 0x6d13
movq (%rax), %rax
movq %rax, (%rsp)
leaq 0x499b(%rip), %rsi      # 0xb6ae
movl %ecx, %edx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x1150
xorl %ebx, %ebx
jmp 0x6bd8