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

  if (fil != oldFil)
    { line = 1 ;
      oldFil = fil ;
    }
  
/* get id */
  c = getc (fil) ;
  if (!feof(fil) && c != '@')			/* header line */
    { fprintf (stderr, "bad @ header line %d\n", line) ; return 0 ; }
  
  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) ;
  
  if (!feof (fil) && c != '\n')
    { fprintf (stderr, "bad @ identifier line %d\n", line) ; return 0 ; }
  ++line ;

  /* 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 ;
  
/* second block with same identifier and matching quality values */
  c = getc (fil) ;
  if (!feof(fil) && c != '+')			/* header line */
    { fprintf (stderr, "bad + header line %d\n", line) ; return 0 ; }
  
  c = getc(fil) ; if (id) cp = *id ;
  while (!feof (fil) && c != ' ' && c != '\n' && c != '\t')
    { if (id && c != *cp++) 
	{ fprintf (stderr, "mismatching + identifier line %d\n", line) ; return 0 ; }
      c = getc (fil) ;
    }

  while (!feof (fil) && c != '\n')		/* ignore rest of line - may have desc or not */
    c = getc (fil) ;

  ++line ;

  m = 0 ;			/* qualities */
  buflen = -(n+1) ;

  while (!feof (fil))
    { 
      c = getc (fil) ;
      if (c == '@' && m == n)
	{ ungetc (c, fil) ;
	  break ;
	}
      else if (m > n)
	break ;

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

      if (c == '\n')
	++line;
      else if (qval) 
	add (c-33, qval, &buflen, m++) ;
      else 
	++m ;
    }
  if (qval) add (0, qval, &buflen, m) ;

  if (m != n)
    { fprintf (stderr, "mismatching seq, q length line %d\n", line) ; return 0 ; }

  return n ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpq 0xb799(%rip), %rax      # 0x144a8
je 0x8d26
movl $0x1, 0xb795(%rip)      # 0x144b0
movq -0x10(%rbp), %rax
movq %rax, 0xb782(%rip)      # 0x144a8
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1160
cmpl $0x0, %eax
jne 0x8d73
movsbl -0x39(%rbp), %eax
cmpl $0x40, %eax
je 0x8d73
movq 0xa2a8(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl 0xb757(%rip), %edx      # 0x144b0
leaq 0x6979(%rip), %rsi      # 0xf6d9
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9358
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0xffffffe0, -0x54(%rbp) # imm = 0xFFFFFFE0
movq -0x10(%rbp), %rdi
callq 0x1160
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x55(%rbp)
jne 0x8dcb
movsbl -0x39(%rbp), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x55(%rbp)
je 0x8dcb
movsbl -0x39(%rbp), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x55(%rbp)
je 0x8dcb
movsbl -0x39(%rbp), %eax
cmpl $0x9, %eax
setne %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x8dd4
jmp 0x8e07
cmpq $0x0, -0x30(%rbp)
je 0x8df9
movb -0x39(%rbp), %al
movq -0x30(%rbp), %rsi
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
leaq -0x54(%rbp), %rdx
movsbl %al, %edi
callq 0x8c20
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
jmp 0x8d8d
cmpq $0x0, -0x30(%rbp)
je 0x8e20
movq -0x30(%rbp), %rsi
movl -0x4c(%rbp), %ecx
xorl %edi, %edi
leaq -0x54(%rbp), %rdx
callq 0x8c20
jmp 0x8e22
movq -0x10(%rbp), %rdi
callq 0x1160
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x56(%rbp)
jne 0x8e58
movsbl -0x39(%rbp), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x57(%rbp)
je 0x8e52
movsbl -0x39(%rbp), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x57(%rbp)
movb -0x57(%rbp), %al
movb %al, -0x56(%rbp)
movb -0x56(%rbp), %al
testb $0x1, %al
jne 0x8e61
jmp 0x8e6f
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
jmp 0x8e22
movl $0x0, -0x4c(%rbp)
movl $0xffffffe0, -0x54(%rbp) # imm = 0xFFFFFFE0
movq -0x10(%rbp), %rdi
callq 0x1160
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x58(%rbp)
jne 0x8e9f
movsbl -0x39(%rbp), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x58(%rbp)
movb -0x58(%rbp), %al
testb $0x1, %al
jne 0x8ea8
jmp 0x8edb
cmpq $0x0, -0x38(%rbp)
je 0x8ecd
movb -0x39(%rbp), %al
movq -0x38(%rbp), %rsi
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
leaq -0x54(%rbp), %rdx
movsbl %al, %edi
callq 0x8c20
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
jmp 0x8e7d
cmpq $0x0, -0x38(%rbp)
je 0x8ef4
movq -0x38(%rbp), %rsi
movl -0x4c(%rbp), %ecx
xorl %edi, %edi
leaq -0x54(%rbp), %rdx
callq 0x8c20
movq -0x10(%rbp), %rdi
callq 0x1160
cmpl $0x0, %eax
jne 0x8f35
movsbl -0x39(%rbp), %eax
cmpl $0xa, %eax
je 0x8f35
movq 0xa0e6(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl 0xb595(%rip), %edx      # 0x144b0
leaq 0x67cd(%rip), %rsi      # 0xf6ef
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9358
movl 0xb575(%rip), %eax      # 0x144b0
addl $0x1, %eax
movl %eax, 0xb56c(%rip)      # 0x144b0
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x80(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xfffffffd, 0x28(%rax) # imm = 0xFFFFFFFD
movl $0x0, -0x4c(%rbp)
movl $0xfffffc00, -0x54(%rbp) # imm = 0xFFFFFC00
movq -0x10(%rbp), %rdi
callq 0x1160
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8f90
jmp 0x90c1
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
cmpl $0x2b, %eax
jne 0x8fb7
movsbl -0x39(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x11b0
jmp 0x90c1
movsbl -0x39(%rbp), %eax
cmpl $-0x1, %eax
jne 0x8fc5
jmp 0x90c1
movq -0x18(%rbp), %rax
movsbq -0x39(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
subl $-0x3, %eax
je 0x9070
jmp 0x8fdf
movl -0x5c(%rbp), %eax
subl $-0x2, %eax
je 0x8ffa
jmp 0x8fe9
movl -0x5c(%rbp), %eax
subl $-0x1, %eax
je 0x907f
jmp 0x9081
cmpq $0x0, -0x30(%rbp)
je 0x9039
movq 0x9ff0(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movsbl -0x39(%rbp), %edx
movsbl -0x39(%rbp), %ecx
movl 0xb496(%rip), %r8d      # 0x144b0
movl -0x4c(%rbp), %r9d
movq -0x30(%rbp), %rax
movq (%rax), %rax
leaq 0x664c(%rip), %rsi      # 0xf678
movq %rax, (%rsp)
movb $0x0, %al
callq 0x1150
jmp 0x9064
movq 0x9fb8(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movsbl -0x39(%rbp), %edx
movsbl -0x39(%rbp), %ecx
movl 0xb45e(%rip), %r8d      # 0x144b0
movl -0x4c(%rbp), %r9d
leaq 0x6652(%rip), %rsi      # 0xf6af
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9358
movl 0xb43a(%rip), %eax      # 0x144b0
addl $0x1, %eax
movl %eax, 0xb431(%rip)      # 0x144b0
jmp 0x90bc
cmpq $0x0, -0x20(%rbp)
je 0x90b1
movq -0x18(%rbp), %rax
movsbq -0x39(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rsi
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
leaq -0x54(%rbp), %rdx
movsbl %al, %edi
callq 0x8c20
jmp 0x90ba
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x90bc
jmp 0x8f76
cmpq $0x0, -0x20(%rbp)
je 0x90da
movq -0x20(%rbp), %rsi
movl -0x4c(%rbp), %ecx
xorl %edi, %edi
leaq -0x54(%rbp), %rdx
callq 0x8c20
cmpq $0x0, 0x10(%rbp)
je 0x90ea
movl -0x4c(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1160
cmpl $0x0, %eax
jne 0x9137
movsbl -0x39(%rbp), %eax
cmpl $0x2b, %eax
je 0x9137
movq 0x9ee4(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl 0xb393(%rip), %edx      # 0x144b0
leaq 0x65e5(%rip), %rsi      # 0xf709
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9358
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x9155
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x9157
movq -0x10(%rbp), %rdi
callq 0x1160
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5d(%rbp)
jne 0x9195
movsbl -0x39(%rbp), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x5d(%rbp)
je 0x9195
movsbl -0x39(%rbp), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x5d(%rbp)
je 0x9195
movsbl -0x39(%rbp), %eax
cmpl $0x9, %eax
setne %al
movb %al, -0x5d(%rbp)
movb -0x5d(%rbp), %al
testb $0x1, %al
jne 0x919e
jmp 0x91fa
cmpq $0x0, -0x30(%rbp)
je 0x91e9
movsbl -0x39(%rbp), %eax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x91e9
movq 0x9e32(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl 0xb2e1(%rip), %edx      # 0x144b0
leaq 0x6549(%rip), %rsi      # 0xf71f
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9358
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
jmp 0x9157
jmp 0x91fc
movq -0x10(%rbp), %rdi
callq 0x1160
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5e(%rbp)
jne 0x921e
movsbl -0x39(%rbp), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x5e(%rbp)
movb -0x5e(%rbp), %al
testb $0x1, %al
jne 0x9227
jmp 0x9235
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
jmp 0x91fc
movl 0xb275(%rip), %eax      # 0x144b0
addl $0x1, %eax
movl %eax, 0xb26c(%rip)      # 0x144b0
movl $0x0, -0x50(%rbp)
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1160
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x9272
jmp 0x930a
movq -0x10(%rbp), %rdi
callq 0x1260
movb %al, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
cmpl $0x40, %eax
jne 0x929e
movl -0x50(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jne 0x929e
movsbl -0x39(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x11b0
jmp 0x930a
movl -0x50(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jle 0x92a8
jmp 0x930a
jmp 0x92aa
movsbl -0x39(%rbp), %eax
cmpl $-0x1, %eax
jne 0x92b5
jmp 0x930a
movsbl -0x39(%rbp), %eax
cmpl $0xa, %eax
jne 0x92cf
movl 0xb1ec(%rip), %eax      # 0x144b0
addl $0x1, %eax
movl %eax, 0xb1e3(%rip)      # 0x144b0
jmp 0x9305
cmpq $0x0, -0x28(%rbp)
je 0x92fa
movsbl -0x39(%rbp), %eax
subl $0x21, %eax
movq -0x28(%rbp), %rsi
movl -0x50(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x50(%rbp)
leaq -0x54(%rbp), %rdx
movsbl %al, %edi
callq 0x8c20
jmp 0x9303
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x9305
jmp 0x9258
cmpq $0x0, -0x28(%rbp)
je 0x9323
movq -0x28(%rbp), %rsi
movl -0x50(%rbp), %ecx
xorl %edi, %edi
leaq -0x54(%rbp), %rdx
callq 0x8c20
movl -0x50(%rbp), %eax
cmpl -0x4c(%rbp), %eax
je 0x9352
movq 0x9cc6(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl 0xb175(%rip), %edx      # 0x144b0
leaq 0x63ff(%rip), %rsi      # 0xf741
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9358
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)