// File: /workspace/github_c_makefile_star2_O2/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 0x5cac(%rip), %rax      # 0x6fd0
movq (%rax), %rdi
callq 0x368b
movq 0x8(%r14), %rdi
pushq $0x1
popq %rdx
xorl %esi, %esi
callq 0x15b4
movq %rax, %rbx
testq %rax, %rax
jne 0x1354
movq 0x8(%r14), %rsi
leaq 0x2ceb(%rip), %rdi      # 0x4038
xorl %eax, %eax
callq 0x33c4
pushq $0x8
popq %r14
movl $0x100, %edi            # imm = 0x100
movq %r14, %rsi
callq 0x34ac
movq %rax, %r15
movl $0x100, %edi            # imm = 0x100
movq %r14, %rsi
callq 0x34ac
movq %rax, %r14
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x176c
movl (%rbx), %ecx
testb %al, %al
je 0x13e7
cmpl $0x2, %ecx
jne 0x1394
movq 0x70(%rbx), %rdx
jmp 0x139c
movslq 0x24(%rbx), %rdx
addq 0x50(%rbx), %rdx
movslq 0x18(%rbx), %rax
leaq (%rdx,%rax), %rsi
cmpq %rsi, %rdx
jae 0x13b6
movsbq (%rdx), %rdi
incq %rdx
incq (%r15,%rdi,8)
jmp 0x13a4
addq %rax, %r12
cmpb $0x0, 0x2c(%rbx)
je 0x137b
cmpl $0x2, %ecx
jne 0x13ca
movq 0x78(%rbx), %rcx
jmp 0x13d2
movslq 0x28(%rbx), %rcx
addq 0x50(%rbx), %rcx
addq %rcx, %rax
cmpq %rax, %rcx
jae 0x137b
movsbq (%rcx), %rdx
incq %rcx
incq (%r14,%rdx,8)
jmp 0x13d5
leaq 0x2d0a(%rip), %rax      # 0x40f8
movslq (%rax,%rcx,4), %rsi
addq %rax, %rsi
movq 0x8(%rbx), %rdx
movq %r12, %xmm0
movq 0x2c0a(%rip), %xmm2     # 0x4010
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x2c0e(%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 0x2c0a(%rip), %rdi      # 0x4059
movq %r12, %rcx
movb $0x1, %al
callq 0x10a0
leaq 0x2c88(%rip), %rdi      # 0x40e8
callq 0x1060
xorl %r13d, %r13d
xorl %r12d, %r12d
cmpq $0x100, %r13            # imm = 0x100
je 0x14d9
movq (%r15,%r13,8), %rbp
testq %rbp, %rbp
je 0x14d4
callq 0x1200
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r13,2)
jne 0x1492
addq %rbp, %r12
jmp 0x14d4
movq %rbp, %xmm1
punpckldq 0x2b71(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2b79(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2b75(%rip), %xmm0     # 0x4030
divsd (%rsp), %xmm0
leaq 0x2bca(%rip), %rdi      # 0x4091
movl %r13d, %esi
movq %rbp, %rdx
movb $0x1, %al
callq 0x10a0
incq %r13
jmp 0x146b
testq %r12, %r12
je 0x151d
movq %r12, %xmm1
punpckldq 0x2b25(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2b2d(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2b29(%rip), %xmm0     # 0x4030
divsd (%rsp), %xmm0
leaq 0x2b92(%rip), %rdi      # 0x40a5
movq %r12, %rsi
movb $0x1, %al
callq 0x10a0
cmpb $0x0, 0x2c(%rbx)
je 0x158b
leaq 0x2bc4(%rip), %rdi      # 0x40ee
callq 0x1060
xorl %r15d, %r15d
leaq 0x2b88(%rip), %r12      # 0x40c1
cmpq $0x100, %r15            # imm = 0x100
je 0x158b
movq (%r14,%r15,8), %rdx
testq %rdx, %rdx
je 0x1586
movq %rdx, %xmm1
punpckldq 0x2ab8(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2ac0(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2abc(%rip), %xmm0     # 0x4030
divsd (%rsp), %xmm0
movq %r12, %rdi
movl %r15d, %esi
movb $0x1, %al
callq 0x10a0
incq %r15
jmp 0x1539
movq %rbx, %rdi
callq 0x173b
movq 0x5a36(%rip), %rax      # 0x6fd0
movq (%rax), %rdi
callq 0x37a4
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop