// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshset.c
// Function: moshsetSummary
void moshsetSummary (Moshset *ms, FILE *f)
{
  seqhashReport (ms->hasher, f) ;
  fprintf (f, "MS table size %llu number of entries %u", ms->tableSize, ms->max) ;
  if (!ms->max) return ;
  U32 i, copy[4] ; copy[0] = copy[1] = copy[2] = copy[3] = 0 ;
  Array h = arrayCreate (256, U32) ;
  for (i = 1 ; i <= ms->max ; ++i)
    { if (ms->depth[i] < arrayMax(h)) ++arr(h,ms->depth[i],U32) ; /* more efficient to check */
      else ++array(h,ms->depth[i],U32) ;
      ++copy[msCopy(ms,i)] ;
    }
  U64 sum = 0, tot = 0 ;
  for (i = 0 ; i < arrayMax(h) ; ++i) { sum += arr(h,i,U32) ; tot += i * arr(h,i,U32) ; }
  I64 htot = tot / 2 ;
  for (i = 0 ; i < arrayMax(h) ; ++i) { htot -= i*arr(h,i,U32) ; if (htot < 0) break ; }
  fprintf (f, " total count %llu\nMS average depth %.1f N50 depth %u",
	   tot, tot / (double)sum , i) ;
  if (copy[0] < ms->max)
    fprintf (f, " copy0 %u copy1 %u copy2 %u copyM %u", copy[0], copy[1], copy[2], copy[3]) ;
  fputc ('\n', f) ;
  arrayDestroy (h) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x3220
movq 0x10(%r14), %rdx
movl 0x40(%r14), %ecx
leaq 0x2f88(%rip), %rsi      # 0x6d60
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
cmpl $0x0, 0x40(%r14)
je 0x3f34
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
pushq $0x4
popq %rsi
movl $0x100, %edi            # imm = 0x100
callq 0x4a24
movq %rax, %r15
pushq $0x1
popq %rbp
cmpl 0x40(%r14), %ebp
ja 0x3e4c
movq 0x30(%r14), %rax
movl %ebp, %r12d
movzwl (%rax,%r12,2), %esi
cmpl %esi, 0x18(%r15)
jle 0x3e2f
movslq 0x14(%r15), %rcx
movl %esi, %eax
imulq %rcx, %rax
addq 0x8(%r15), %rax
jmp 0x3e37
movq %r15, %rdi
callq 0x4cbc
incl (%rax)
movq 0x38(%r14), %rax
movzbl (%rax,%r12), %eax
andl $0x3, %eax
incl (%rsp,%rax,4)
incl %ebp
jmp 0x3e07
movl 0x18(%r15), %ecx
xorl %esi, %esi
xorl %eax, %eax
xorl %edx, %edx
cmpl %esi, %ecx
je 0x3e77
movq 0x8(%r15), %rdi
movl 0x14(%r15), %r8d
imull %esi, %r8d
movl (%rdi,%r8), %edi
addq %rdi, %rax
imull %esi, %edi
addq %rdi, %rdx
incl %esi
jmp 0x3e56
movq %rdx, %rsi
shrq %rsi
xorl %edi, %edi
cmpl %edi, %ecx
je 0x3ea2
movq 0x8(%r15), %r8
movl 0x14(%r15), %r9d
imull %edi, %r9d
movl (%r8,%r9), %r8d
imull %edi, %r8d
subq %r8, %rsi
js 0x3ea0
incl %edi
jmp 0x3e7f
movl %edi, %ecx
movq %rdx, %xmm1
movq 0x2c91(%rip), %xmm2     # 0x6b40
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2c95(%rip), %xmm3     # 0x6b50
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rax, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x2e99(%rip), %rsi      # 0x6d88
movq %rbx, %rdi
movb $0x1, %al
callq 0x1120
movl (%rsp), %edx
cmpl 0x40(%r14), %edx
jae 0x3f21
movl 0x4(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl 0xc(%rsp), %r9d
leaq 0x2ea6(%rip), %rsi      # 0x6dbd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x10e0
movq %r15, %rdi
callq 0x4b64
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)