// File: /workspace/github_c_makefile_star2_O1/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 0x3495
movq 0x10(%r14), %rdx
movl 0x40(%r14), %ecx
leaq 0x2b65(%rip), %rsi      # 0x6d60
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
cmpl $0x0, 0x40(%r14)
je 0x438b
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movl $0x100, %edi            # imm = 0x100
movl $0x4, %esi
callq 0x4f40
movq %rax, %r15
cmpl $0x0, 0x40(%r14)
je 0x427d
movl $0x1, %eax
movq 0x30(%r14), %rcx
movl %eax, %r12d
movzwl (%rcx,%r12,2), %esi
cmpl %esi, 0x18(%r15)
jle 0x4259
movslq 0x14(%r15), %rcx
movl %esi, %eax
imulq %rcx, %rax
addq 0x8(%r15), %rax
jmp 0x4261
movq %r15, %rdi
callq 0x51fb
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 0x4237
movl 0x18(%r15), %eax
xorl %ecx, %ecx
testq %rax, %rax
je 0x42d9
movq 0x8(%r15), %rsi
movl 0x14(%r15), %edi
xorl %r8d, %r8d
xorl %edx, %edx
xorl %r9d, %r9d
movl %ecx, %r10d
movl (%rsi,%r10), %r10d
addq %r10, %r9
movl %r8d, %r11d
imull %r10d, %r11d
addq %r11, %rdx
incq %r8
addl %edi, %ecx
cmpq %r8, %rax
jne 0x4298
movq %r9, %xmm0
punpckldq 0x287d(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2885(%rip), %xmm0     # 0x6b50
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
jmp 0x42df
xorpd %xmm1, %xmm1
xorl %edx, %edx
testq %rax, %rax
je 0x4316
movq %rdx, %rsi
shrq %rsi
movq 0x8(%r15), %rdi
movl 0x14(%r15), %r8d
xorl %r9d, %r9d
xorl %ecx, %ecx
movl %r9d, %r10d
movl (%rdi,%r10), %r10d
imull %ecx, %r10d
subq %r10, %rsi
js 0x4318
incq %rcx
addl %r8d, %r9d
cmpq %rcx, %rax
jne 0x42f7
movl %eax, %ecx
jmp 0x4318
xorl %ecx, %ecx
movq %rdx, %xmm2
punpckldq 0x281b(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x2823(%rip), %xmm2     # 0x6b50
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
divsd %xmm1, %xmm0
leaq 0x2a44(%rip), %rsi      # 0x6d88
movq %rbx, %rdi
movb $0x1, %al
callq 0x1120
movl (%rsp), %edx
cmpl 0x40(%r14), %edx
jae 0x4376
movl 0x4(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl 0xc(%rsp), %r9d
leaq 0x2a51(%rip), %rsi      # 0x6dbd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10e0
movq %r15, %rdi
callq 0x5099
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop