// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/seqio.c
// Function: seqIOopen
SeqIO *seqIOopen (char *filename, int* convert, BOOL isQual)
{
  SeqIO *si = new0 (1, SeqIO) ;
  if (!strcmp (filename, "-")) si->f = gzdopen (fileno (stdin), "r") ;
  else si->f = gzopen (filename, "r") ;
  if (!si->f) { free(si) ; return 0 ; }
  si->bufSize = 1<<24 ;
  si->b = si->buf = new (si->bufSize, char) ;
  si->convert = convert ;
  si->isQual = isQual ;
  si->nb = gzread (si->f, si->buf, si->bufSize) ;
  if (!si->nb)
    { fprintf (stderr, "sequence file %s unreadable or empty\n", filename) ;
      seqIOclose (si) ;
      return 0 ;
    }
  si->line = 1 ;
  if (*si->buf == '>')
    { si->type = FASTA ; si->isQual = FALSE ;
      if (!si->convert) si->convert = dna2textAmbigConv ; /* default: need to remove whitespace */
    }
  else if (*si->buf == '@') si->type = FASTQ ;
  else if (*si->buf == 'B')
    { si->type = BINARY ;
      if (si->nb <= 8) die ("binary file too short\n") ;
      si->qualThresh = si->buf[1] ;
      si->isQual = (si->qualThresh > 0) ;
      si->nSeq = *(U64*)si->buf & 0xffffffffffffLL ; /* 6 bytes of ff */
      si->b += 8 ; si->nb -= 8 ;
    }
  else
    { fprintf (stderr, "sequence file %s is unknown type\n", filename) ;
      seqIOclose (si) ;
      return 0 ;
    }
  return si ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movl $0x1, %edi
movl $0x80, %esi
callq 0x5a64
movq %rax, %rbx
cmpb $0x2d, (%r14)
jne 0x28be
cmpb $0x0, 0x1(%r14)
je 0x29bb
leaq 0x4441(%rip), %rsi      # 0x6d06
movq %r14, %rdi
callq 0x11b0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x2950
movl $0x1000000, 0x34(%rbx)  # imm = 0x1000000
movl $0x1000000, %edi        # imm = 0x1000000
callq 0x5a3c
movq %rax, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %r15, 0x60(%rbx)
movb %bpl, 0x2c(%rbx)
movq 0x48(%rbx), %rdi
movl 0x34(%rbx), %edx
movq %rax, %rsi
callq 0x1110
movl %eax, 0x38(%rbx)
testl %eax, %eax
je 0x29dd
movl $0x1, 0x3c(%rbx)
movq 0x50(%rbx), %rcx
movzbl (%rcx), %edx
cmpl $0x42, %edx
je 0x295c
cmpl $0x40, %edx
je 0x29a7
cmpl $0x3e, %edx
jne 0x29f0
movl $0x0, (%rbx)
movb $0x0, 0x2c(%rbx)
cmpq $0x0, 0x60(%rbx)
jne 0x29ad
leaq 0x79f6(%rip), %rax      # 0xa340
movq %rax, 0x60(%rbx)
jmp 0x29ad
movq %rbx, %rdi
callq 0x1040
xorl %ebx, %ebx
jmp 0x29ad
movl $0x2, (%rbx)
cmpl $0x8, %eax
jg 0x297c
leaq 0x3f28(%rip), %rdi      # 0x6896
xorl %eax, %eax
callq 0x5974
movq 0x50(%rbx), %rcx
movl 0x38(%rbx), %eax
movsbl 0x1(%rcx), %edx
testl %edx, %edx
movl %edx, 0x30(%rbx)
setg 0x2c(%rbx)
movabsq $0xffffffffffff, %rdx   # imm = 0xFFFFFFFFFFFF
andq (%rcx), %rdx
movq %rdx, 0x8(%rbx)
addq $0x8, 0x58(%rbx)
addl $-0x8, %eax
movl %eax, 0x38(%rbx)
jmp 0x29ad
movl $0x1, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x7616(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1150
leaq 0x4335(%rip), %rsi      # 0x6d06
movl %eax, %edi
callq 0x1080
jmp 0x28cd
movq 0x7614(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x3e82(%rip), %rsi      # 0x6870
jmp 0x2a01
movq 0x7601(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x3eac(%rip), %rsi      # 0x68ad
movq %r14, %rdx
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
callq 0x2a18
jmp 0x2958