// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x370c
movq 0x10(%r14), %rdx
movl 0x40(%r14), %ecx
leaq 0x28c5(%rip), %rsi      # 0x6d80
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
cmpl $0x0, 0x40(%r14)
je 0x464f
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movl $0x100, %edi            # imm = 0x100
movl $0x4, %esi
callq 0x5204
movq %rax, %r15
cmpl $0x0, 0x40(%r14)
je 0x453d
movl $0x1, %eax
movq 0x30(%r14), %rcx
movl %eax, %r12d
movzwl (%rcx,%r12,2), %esi
cmpl %esi, 0x18(%r15)
jle 0x4519
movslq 0x14(%r15), %rcx
movl %esi, %eax
imulq %rcx, %rax
addq 0x8(%r15), %rax
jmp 0x4521
movq %r15, %rdi
callq 0x54ad
incl (%rax)
movq 0x38(%r14), %rax
movzbl (%rax,%r12), %eax
andl $0x3, %eax
incl (%rsp,%rax,4)
leal 0x1(%r12), %eax
cmpl 0x40(%r14), %eax
jbe 0x44f7
movl 0x18(%r15), %ecx
testq %rcx, %rcx
je 0x45d0
movq 0x8(%r15), %rax
movl 0x14(%r15), %esi
xorl %edi, %edi
xorl %r9d, %r9d
xorl %edx, %edx
xorl %r8d, %r8d
movl %edi, %r10d
movl (%rax,%r10), %r10d
addq %r10, %r8
movl %r9d, %r11d
imull %r10d, %r11d
addq %r11, %rdx
incq %r9
addl %esi, %edi
cmpq %r9, %rcx
jne 0x455c
movq %r8, %xmm0
punpckldq 0x25d9(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x25e1(%rip), %xmm0     # 0x6b70
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
testq %rcx, %rcx
je 0x45d6
movq %rdx, %rax
shrq %rax
movq 0x8(%r15), %rsi
movl 0x14(%r15), %r8d
xorl %r9d, %r9d
xorl %edi, %edi
movl %r9d, %r10d
movl (%rsi,%r10), %r10d
imull %edi, %r10d
subq %r10, %rax
js 0x45da
incq %rdi
addl %r8d, %r9d
cmpq %rdi, %rcx
jne 0x45b3
jmp 0x45dc
xorl %edx, %edx
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
jmp 0x45dc
movl %edi, %ecx
movq %rdx, %xmm2
punpckldq 0x2577(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x257f(%rip), %xmm2     # 0x6b70
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
divsd %xmm1, %xmm0
leaq 0x27a0(%rip), %rsi      # 0x6da8
movq %rbx, %rdi
movb $0x1, %al
callq 0x1120
movl (%rsp), %edx
cmpl 0x40(%r14), %edx
jae 0x463a
movl 0x4(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl 0xc(%rsp), %r9d
leaq 0x27ad(%rip), %rsi      # 0x6ddd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10e0
movq %r15, %rdi
callq 0x5352
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop