// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/hash10x.c
// Function: goodHashesBuild
void goodHashesBuild (void)
{
  if (!hashWithinRange) die ("cluster code called without setting hashDepthRange") ;
  goodHashes = new (arrayMax(clusterBlocks), U16*) ;
  nGoodHashes = new (arrayMax(clusterBlocks), int) ;
  Array a = arrayCreate (4096, U16) ;
  int c, i ;
  
  for (c = 0 ; c < arrayMax(clusterBlocks) ; ++c)
    { ClusterBlock *cb = arrp(clusterBlocks, c, ClusterBlock) ;
      if (cb->nHash > U16MAX)
	{ nGoodHashes[c] = 0 ; goodHashes[c] = new(1,U16) ;
	  fprintf (stderr, "ignoring barcode %d - too many hashes %d > %d\n",
		   c, cb->nHash, U16MAX) ;
	  continue ;
	}
      ClusterHash *ch = clusHashBase = cb->clusHash ;
      arrayMax(a) = 0 ;
      for (i = 0 ; i < cb->nHash ; ++i, ++ch)
	if (hashWithinRange[ch->hash]) array(a, arrayMax(a), U16) = i ;
      arraySort (a, compareGoodHashes) ; /* sort by increasing hashDepth */
      goodHashes[c] = new(arrayMax(a),U16) ;
      memcpy (goodHashes[c], arrp(a,0,U16), arrayMax(a)*sizeof(U16)) ;
      nGoodHashes[c] = arrayMax(a) ;
    }

  printf ("  made goodHashes arrays for hash range %d to %d\n  ", hashRangeMin, hashRangeMax) ;
  timeUpdate (outFile) ; fflush (outFile) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
cmpq $0x0, 0xfb30(%rip)      # 0x14440
jne 0x4920
leaq 0x9e96(%rip), %rdi      # 0xe7af
movb $0x0, %al
callq 0xd0c0
movq 0xfaa1(%rip), %rax      # 0x143c8
movslq 0x18(%rax), %rdi
shlq $0x3, %rdi
callq 0xd1a0
movq %rax, 0xfb1d(%rip)      # 0x14458
movq 0xfa86(%rip), %rax      # 0x143c8
movslq 0x18(%rax), %rdi
shlq $0x2, %rdi
callq 0xd1a0
movq %rax, 0xfb0a(%rip)      # 0x14460
movl $0x1000, %edi           # imm = 0x1000
movl $0x2, %esi
callq 0xc1e0
movq %rax, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq 0xfa4e(%rip), %rcx      # 0x143c8
cmpl 0x18(%rcx), %eax
jge 0x4b26
movq 0xfa3e(%rip), %rax      # 0x143c8
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
movq 0xfa30(%rip), %rdx      # 0x143c8
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x4(%rax)      # imm = 0xFFFF
jbe 0x4a0e
movq 0xfaa6(%rip), %rax      # 0x14460
movslq -0xc(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl $0x2, %edi
callq 0xd1a0
movq %rax, %rdx
movq 0xfa7f(%rip), %rax      # 0x14458
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0xe610(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0x9de6(%rip), %rsi      # 0xe7e2
movl $0xffff, %r8d           # imm = 0xFFFF
movb $0x0, %al
callq 0x1150
jmp 0x4b18
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xfa4b(%rip)      # 0x14468
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x4a89
movq 0xf9fa(%rip), %rax      # 0x14440
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x4a70
movl -0x10(%rbp), %eax
movw %ax, -0x22(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
callq 0xc640
movw -0x22(%rbp), %cx
movw %cx, (%rax)
jmp 0x4a72
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
jmp 0x4a33
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x14(%rax), %rdx
leaq -0x258(%rip), %rcx      # 0x4850
callq 0x1090
movq -0x8(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq %rdi
callq 0xd1a0
movq %rax, %rdx
movq 0xf991(%rip), %rax      # 0x14458
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0xf982(%rip), %rax      # 0x14458
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
imull $0x0, 0x14(%rax), %eax
cltq
addq %rax, %rsi
movq -0x8(%rbp), %rax
movslq 0x18(%rax), %rdx
shlq %rdx
callq 0x1170
movq -0x8(%rbp), %rax
movl 0x18(%rax), %edx
movq 0xf94f(%rip), %rax      # 0x14460
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4970
movl 0xf91c(%rip), %esi      # 0x14448
movl 0xf91a(%rip), %edx      # 0x1444c
leaq 0x9cd8(%rip), %rdi      # 0xe811
movb $0x0, %al
callq 0x10d0
movq 0xf889(%rip), %rdi      # 0x143d0
callq 0xd4d0
movq 0xf87d(%rip), %rdi      # 0x143d0
callq 0x11a0
addq $0x30, %rsp
popq %rbp
retq
nop