// File: /workspace/github_c_makefile_star2_O1/richarddurbin[P]hash10x/composition.c
// Function: main
int main (int argc, char *argv[])
{
  --argc ; ++argv ;

  timeUpdate (stdout) ;
  
  SeqIO *si = seqIOopen (*argv, 0, TRUE) ;
  if (!si) die ("failed to open sequence file %s\n", *argv) ;

  U64 totLen = 0, n = 0 ;
  U64 *totBase = new0 (256, U64) ;
  U64 *totQual = new0 (256, U64) ;
  while (seqIOread (si))
    { char *s = sqioSeq(si), *e = s + si->seqLen ;
      while (s < e) ++totBase[*s++] ;
      totLen += si->seqLen ;
      if (si->isQual)
	{ char *q = sqioQual(si), *e = q + si->seqLen ;
	  while (q < e) ++totQual[*q++] ;
	}
    }
  printf ("%s file, %llu sequences >= 0, %llu total, %.2f average\n",
	  typeName[si->type], si->nSeq, totLen, totLen / (double) si->nSeq) ;
  int i ;
  U64 totUnprint = 0 ;
  printf ("bases\n") ;
  for (i = 0 ; i < 256 ; ++i)
    if (totBase[i])
      { if (isprint(i)) printf ("  %c %llu %4.1f %%\n", i, totBase[i], totBase[i]*100.0/totLen) ;
	else totUnprint += totBase[i] ;
      }
  if (totUnprint) printf (" unprintable %llu %4.1f %%\n", totUnprint, totUnprint*100.0/totLen) ;

  if (si->isQual)
    { printf ("qualities\n") ;
      for (i = 0 ; i < 256 ; ++i)
	if (totQual[i]) printf (" %3d %llu %4.1f %%\n", i, totQual[i], totQual[i]*100.0/totLen) ;
    }
  
  seqIOclose (si) ;
  timeTotal (stdout) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0x5afc(%rip), %rax      # 0x6fd0
movq (%rax), %rdi
callq 0x3941
movq 0x8(%r14), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x1774
movq %rax, %rbx
testq %rax, %rax
jne 0x1506
movq 0x8(%r14), %rsi
leaq 0x2b39(%rip), %rdi      # 0x4038
xorl %eax, %eax
callq 0x365c
movl $0x100, %edi            # imm = 0x100
movl $0x8, %esi
callq 0x374c
movq %rax, %r15
movl $0x100, %edi            # imm = 0x100
movl $0x8, %esi
callq 0x374c
movq %rax, %r14
movq %rbx, %rdi
callq 0x1935
xorl %r12d, %r12d
testb %al, %al
je 0x15a9
movl (%rbx), %ecx
cmpl $0x2, %ecx
jne 0x1546
movq 0x70(%rbx), %rdx
jmp 0x154e
movslq 0x24(%rbx), %rdx
addq 0x50(%rbx), %rdx
movslq 0x18(%rbx), %rax
testq %rax, %rax
jle 0x156b
leaq (%rdx,%rax), %rsi
movsbq (%rdx), %rdi
incq %rdx
incq (%r15,%rdi,8)
cmpq %rsi, %rdx
jb 0x155b
cmpb $0x0, 0x2c(%rbx)
je 0x159c
cmpl $0x2, %ecx
jne 0x157c
movq 0x78(%rbx), %rcx
jmp 0x1584
movslq 0x28(%rbx), %rcx
addq 0x50(%rbx), %rcx
testl %eax, %eax
jle 0x159c
leaq (%rcx,%rax), %rdx
movsbq (%rcx), %rsi
incq %rcx
incq (%r14,%rsi,8)
cmpq %rdx, %rcx
jb 0x158c
addq %rax, %r12
movq %rbx, %rdi
callq 0x1935
jmp 0x1535
movl (%rbx), %eax
leaq 0x2b46(%rip), %rcx      # 0x40f8
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq 0x8(%rbx), %rdx
movq %r12, %xmm0
movq 0x2a46(%rip), %xmm2     # 0x4010
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x2a4a(%rip), %xmm1     # 0x4020
subpd %xmm1, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %rdx, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm0
divsd %xmm1, %xmm0
leaq 0x2a46(%rip), %rdi      # 0x4059
movq %r12, %rcx
movb $0x1, %al
callq 0x10a0
leaq 0x2ac4(%rip), %rdi      # 0x40e8
callq 0x1060
xorl %r13d, %r13d
xorl %r12d, %r12d
movq (%r15,%r13,8), %rbp
testq %rbp, %rbp
je 0x168f
callq 0x1200
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r13,2)
jne 0x164d
addq %rbp, %r12
jmp 0x168f
movq %rbp, %xmm1
punpckldq 0x29b6(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x29be(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x29ba(%rip), %xmm0     # 0x4030
divsd (%rsp), %xmm0
leaq 0x2a0f(%rip), %rdi      # 0x4091
movl %r13d, %esi
movq %rbp, %rdx
movb $0x1, %al
callq 0x10a0
incq %r13
cmpq $0x100, %r13            # imm = 0x100
jne 0x162f
testq %r12, %r12
je 0x16df
movq %r12, %xmm1
punpckldq 0x2963(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x296b(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2967(%rip), %xmm0     # 0x4030
divsd (%rsp), %xmm0
leaq 0x29d0(%rip), %rdi      # 0x40a5
movq %r12, %rsi
movb $0x1, %al
callq 0x10a0
cmpb $0x0, 0x2c(%rbx)
je 0x174b
leaq 0x2a02(%rip), %rdi      # 0x40ee
callq 0x1060
xorl %r15d, %r15d
leaq 0x29c6(%rip), %r12      # 0x40c1
movq (%r14,%r15,8), %rdx
testq %rdx, %rdx
je 0x173f
movq %rdx, %xmm1
punpckldq 0x28ff(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2907(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2903(%rip), %xmm0     # 0x4030
divsd (%rsp), %xmm0
movq %r12, %rdi
movl %r15d, %esi
movb $0x1, %al
callq 0x10a0
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x16fb
movq %rbx, %rdi
callq 0x18fa
movq 0x5876(%rip), %rax      # 0x6fd0
movq (%rax), %rdi
callq 0x3a5c
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop