// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0x80, %esi
callq 0x5280
movq %rax, %rbx
cmpb $0x2d, (%r14)
jne 0x24cc
cmpb $0x0, 0x1(%r14)
je 0x25c6
leaq 0x4813(%rip), %rsi      # 0x6ce6
movq %r14, %rdi
callq 0x11b0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x255b
movl $0x1000000, 0x34(%rbx)  # imm = 0x1000000
movl $0x1000000, %edi        # imm = 0x1000000
callq 0x5258
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 0x25e8
movl $0x1, 0x3c(%rbx)
movq 0x50(%rbx), %rcx
movzbl (%rcx), %edx
cmpl $0x42, %edx
je 0x2567
cmpl $0x40, %edx
je 0x25b2
cmpl $0x3e, %edx
jne 0x25fb
andl $0x0, (%rbx)
movb $0x0, 0x2c(%rbx)
cmpq $0x0, 0x60(%rbx)
jne 0x25b8
leaq 0x7deb(%rip), %rax      # 0xa340
movq %rax, 0x60(%rbx)
jmp 0x25b8
movq %rbx, %rdi
callq 0x1040
xorl %ebx, %ebx
jmp 0x25b8
movl $0x2, (%rbx)
cmpl $0x8, %eax
jg 0x2587
leaq 0x431d(%rip), %rdi      # 0x6896
xorl %eax, %eax
callq 0x5198
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 0x25b8
movl $0x1, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x7a0b(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1150
leaq 0x470a(%rip), %rsi      # 0x6ce6
movl %eax, %edi
callq 0x1080
jmp 0x24db
movq 0x7a09(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x4277(%rip), %rsi      # 0x6870
jmp 0x260c
movq 0x79f6(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x42a1(%rip), %rsi      # 0x68ad
movq %r14, %rdx
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
callq 0x2623
jmp 0x2563