// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/hash10x.c
// Function: codeClusterReport
void codeClusterReport (int codeMin, int codeMax)
{
  int code ;
  typedef struct {
    int i ;
    int n ;
    int nRead ;
    int nt[5] ;
    I16 chr ;
    U16 pMin, pMax ;
    int nBad ;
    int bad ;			/* point to bad hash */
  } ReportInfo ;
  Array info = arrayCreate (256, ReportInfo) ;
  Array readClus = arrayCreate (1024, int) ;
  Array badLink = arrayCreate (8192, int) ;
  ReportInfo *r ;
  int i, c ;
  U64 totalGoodHash = 0 ;
  double totalPointToMin = 0.0 ;

  for (code = codeMin ; code < codeMax ; ++code)
    { ClusterBlock *b = arrp(clusterBlocks, code, ClusterBlock) ;
      arrayReCreate (info, b->nSubCluster+1, ReportInfo) ;
      arrayReCreate (readClus, b->nRead, int) ;
      arrayReCreate (badLink, b->nHash, int) ;
      int nClusHash = 0 ;
      for (i = 0 ; i < b->nHash ; ++i)
	{ if (!(c = b->clusHash[i].subCluster)) continue ;
	  ++nClusHash ;
	  arr(readClus, b->clusHash[i].read, int) = c ;
	  r = arrp(info, c, ReportInfo) ;
	  ++r->n ;
	  U32 bh = b->clusHash[i].hash ;
	  if (crib)
	    { ++r->nt[cribType[bh]] ;
	      if (cribType[bh] > CRIB_ERR && cribType[bh] < CRIB_MUL)
		{ CribInfo ch = crib[bh] ;
		  if (!r->chr) { r->chr = ch.chr ; r->pMin = r->pMax = ch.pos ; }
		  else if (ch.chr == r->chr)
		    { if (ch.pos < r->pMin) r->pMin = ch.pos ;
		      if (ch.pos > r->pMax) r->pMax = ch.pos ;
		    }
		  else { ++r->nBad ; arr(badLink,i,int) = r->bad ; r->bad = i ; }
		}
	    }
	}

      int nClusRead = 0 ;
      for (i = 0 ; i < b->nRead ; ++i)
	if ((c = arr(readClus,i,int))) { ++arrp(info,c,ReportInfo)->nRead ; ++nClusRead ; }
      
      fprintf (outFile, "  CLUSTER_SUMMARY %d nRead %d nHash %d nGoodHash %d nClusHash %d nClusRead %d nSubCluster %d\n",
	      code, b->nRead, b->nHash, nGoodHashes[code], nClusHash, nClusRead, b->nSubCluster) ;
      for (i = 1 ; i <= b->nSubCluster ; ++i)
	{ r = arrp(info, i, ReportInfo) ; if (!r->n) continue ;
	  fprintf (outFile, "    CODE_CLUSTER %d %d : %d reads %d hashes",
		   code, i, r->nRead, r->n) ;
	  if (crib)
	    { fprintf (outFile, " %d hom, %d htA, %d htB, %d mul, %d err", r->nt[CRIB_HOM],
		      r->nt[CRIB_HTA], r->nt[CRIB_HTB], r->nt[CRIB_MUL], r->nt[CRIB_ERR]) ;
	      if (r->chr)
		fprintf (outFile, "  chr %d pos %d %d", r->chr, r->pMin, r->pMax-r->pMin+1) ;
	      if (r->nBad)
		{ fprintf (outFile, "  OTHER %d", r->nBad) ;
		  int x = r->bad, j = 10 ;
		  while (x && j--)
		    { fprintf (outFile, " %s", cribText(b->clusHash[x].hash)) ;
		      x = arr(badLink, x, int) ;
		    }
		}
	    }
	  fputc ('\n', outFile) ;
	}
      totalGoodHash += nGoodHashes[code] ;
      totalPointToMin += b->pointToMin ;
    }

  if (totalGoodHash)
    fprintf (outFile, "  MIN_POINT_DENSITY %.3f\n", totalPointToMin / totalGoodHash) ;
  
  arrayDestroy (info) ; arrayDestroy (readClus) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x100, %edi            # imm = 0x100
movl $0x30, %esi
callq 0xc1e0
movq %rax, -0x18(%rbp)
movl $0x400, %edi            # imm = 0x400
movl $0x4, %esi
callq 0xc1e0
movq %rax, -0x20(%rbp)
movl $0x2000, %edi           # imm = 0x2000
movl $0x4, %esi
callq 0xc1e0
movq %rax, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x589e
movq 0xf035(%rip), %rax      # 0x143c8
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
movq 0xf027(%rip), %rdx      # 0x143c8
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x8(%rax), %esi
addl $0x1, %esi
movl $0x30, %edx
callq 0xc2b0
movq -0x20(%rbp), %rdi
movq -0x50(%rbp), %rax
movl (%rax), %esi
movl $0x4, %edx
callq 0xc2b0
movq -0x28(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x4, %edx
callq 0xc2b0
movl $0x0, -0x54(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x55cb
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movzbl 0x6(%rax,%rcx,8), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, %eax
jne 0x542c
jmp 0x55bd
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x38(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x34(%rbp), %rsi
movzwl 0x4(%rcx,%rsi,8), %ecx
movq -0x20(%rbp), %rsi
imull 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movl %eax, -0x58(%rbp)
cmpq $0x0, 0xef5d(%rip)      # 0x14400
je 0x55bb
movq -0x30(%rbp), %rax
movq 0xef54(%rip), %rcx      # 0x14408
movl -0x58(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
movl 0xc(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0xc(%rax,%rcx,4)
movq 0xef3b(%rip), %rax      # 0x14408
movl -0x58(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x55b9
movq 0xef24(%rip), %rax      # 0x14408
movl -0x58(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x4, %eax
jge 0x55b9
movq 0xef05(%rip), %rax      # 0x14400
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movq -0x30(%rbp), %rax
cmpw $0x0, 0x20(%rax)
jne 0x5534
movw -0x5c(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x20(%rax)
movw -0x5a(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x24(%rax)
movq -0x30(%rbp), %rax
movw %cx, 0x22(%rax)
jmp 0x55b7
movswl -0x5c(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x20(%rcx), %ecx
cmpl %ecx, %eax
jne 0x557e
movzwl -0x5a(%rbp), %eax
movq -0x30(%rbp), %rcx
movzwl 0x22(%rcx), %ecx
cmpl %ecx, %eax
jge 0x5560
movw -0x5a(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x22(%rax)
movzwl -0x5a(%rbp), %eax
movq -0x30(%rbp), %rcx
movzwl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jle 0x557c
movw -0x5a(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x24(%rax)
jmp 0x55b5
movq -0x30(%rbp), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %edx
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rsi
imull 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx)
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x55b7
jmp 0x55b9
jmp 0x55bb
jmp 0x55bd
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x53fe
movl $0x0, -0x60(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x563c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, %eax
je 0x562f
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl 0x8(%rax,%rcx), %edx
addl $0x1, %edx
movl %edx, 0x8(%rax,%rcx)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x5631
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x55d9
movq 0xed8d(%rip), %rdi      # 0x143d0
movl -0xc(%rbp), %edx
movq -0x50(%rbp), %rax
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movl 0x4(%rax), %r8d
movq 0xee05(%rip), %rax      # 0x14460
movslq -0xc(%rbp), %rsi
movl (%rax,%rsi,4), %r9d
movl -0x54(%rbp), %r11d
movl -0x60(%rbp), %r10d
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x92af(%rip), %rsi      # 0xe928
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x1150
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x8(%rcx), %eax
ja 0x5866
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x56d0
jmp 0x5858
movq 0xecf9(%rip), %rdi      # 0x143d0
movl -0xc(%rbp), %edx
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x30(%rbp), %rax
movl 0x4(%rax), %r9d
leaq 0x9292(%rip), %rsi      # 0xe986
movb $0x0, %al
callq 0x1150
cmpq $0x0, 0xecfd(%rip)      # 0x14400
je 0x5847
movq 0xecc0(%rip), %rdi      # 0x143d0
movq -0x30(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movl 0x14(%rax), %r8d
movq -0x30(%rbp), %rax
movl 0x1c(%rax), %r9d
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
leaq 0x9276(%rip), %rsi      # 0xe9b2
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1150
movq -0x30(%rbp), %rax
cmpw $0x0, 0x20(%rax)
je 0x578e
movq 0xec78(%rip), %rdi      # 0x143d0
movq -0x30(%rbp), %rax
movswl 0x20(%rax), %edx
movq -0x30(%rbp), %rax
movzwl 0x22(%rax), %ecx
movq -0x30(%rbp), %rax
movzwl 0x24(%rax), %r8d
movq -0x30(%rbp), %rax
movzwl 0x22(%rax), %eax
subl %eax, %r8d
addl $0x1, %r8d
leaq 0x9253(%rip), %rsi      # 0xe9da
movb $0x0, %al
callq 0x1150
movq -0x30(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x5845
movq 0xec2d(%rip), %rdi      # 0x143d0
movq -0x30(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0x923c(%rip), %rsi      # 0xe9ed
movb $0x0, %al
callq 0x1150
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x64(%rbp)
movl $0xa, -0x68(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x64(%rbp)
movb %al, -0x69(%rbp)
je 0x57e8
movl -0x68(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x68(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x57f1
jmp 0x5843
movq 0xebd8(%rip), %rax      # 0x143d0
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x64(%rbp), %rcx
movl (%rax,%rcx,8), %edi
callq 0x3440
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq 0x8f04(%rip), %rsi      # 0xe722
movb $0x0, %al
callq 0x1150
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x64(%rbp), %ecx
movq -0x28(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx), %eax
movl %eax, -0x64(%rbp)
jmp 0x57c9
jmp 0x5845
jmp 0x5847
movq 0xeb82(%rip), %rsi      # 0x143d0
movl $0xa, %edi
callq 0x1100
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5694
movq 0xebf3(%rip), %rax      # 0x14460
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movsd 0x18(%rax), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5380
cmpq $0x0, -0x40(%rbp)
je 0x58ea
movq 0xeb24(%rip), %rdi      # 0x143d0
movsd -0x48(%rbp), %xmm0
movaps 0x8758(%rip), %xmm2     # 0xe010
movq -0x40(%rbp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x8757(%rip), %xmm2     # 0xe020
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x9115(%rip), %rsi      # 0xe9f8
movb $0x1, %al
callq 0x1150
movq -0x18(%rbp), %rdi
callq 0xc3e0
movq -0x20(%rbp), %rdi
callq 0xc3e0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)