// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/hash10x.c
// Function: hashNeighbours
Array hashNeighbours (int x)
{ /* return array of hashes that share between min and max codes with x */
  /* abuse ClusterHash structure for this array, storing the number of shared codes in ->read */
  if (!hashWithinRange) die ("hashNeighbours() called without setting hashDepthRange") ;
  Array ch = arrayCreate (1000, ClusterHash) ;
  int i,j ;
  U32 xCount = arr(hashDepth,x,U32) ; if (!xCount) return 0 ;
  for (i = 0 ; i < xCount ; ++i)
    { ClusterBlock *b = arrp(clusterBlocks, arr(hashCodes,x,U32*)[i], ClusterBlock) ;
      ClusterHash *c = b->clusHash ;
      for (j = 0 ; j < b->nHash ; ++j, ++c)
	if (c->hash != x && hashWithinRange[c->hash])
	  array(ch, arrayMax(ch), ClusterHash) = *c ;
    }
  arraySort (ch, compareClusterHash) ;
  Array shared = arrayCreate (256, ClusterHash) ; /* abuse structure esp. read field */
  ClusterHash *last = arrayp (shared, 0, ClusterHash) ;
  last->hash = arrp(ch, 0, ClusterHash)->hash ; last->read = 1 ;
  for (i = 1 ; i < arrayMax(ch) ; ++i)
    if (arrp(ch, i, ClusterHash)->hash == last->hash) ++last->read ;
    else
      { last = arrayp (shared, arrayMax(shared), ClusterHash) ;
	last->hash = arrp(ch, i, ClusterHash)->hash ; last->read = 1 ;
      }
  arrayDestroy (ch) ;
  return shared ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0xc(%rbp)
cmpq $0x0, 0x10dcd(%rip)     # 0x14440
jne 0x3683
leaq 0xaf76(%rip), %rdi      # 0xe5f2
movb $0x0, %al
callq 0xd0c0
movl $0x3e8, %edi            # imm = 0x3E8
movl $0x8, %esi
callq 0xc1e0
movq %rax, -0x18(%rbp)
movq 0x10d23(%rip), %rax     # 0x143c0
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
movq 0x10d15(%rip), %rdx     # 0x143c0
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x36cb
movq $0x0, -0x8(%rbp)
jmp 0x38bb
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x37a7
movq 0x10ce3(%rip), %rax     # 0x143c8
movq 0x8(%rax), %rax
movq 0x10d08(%rip), %rcx     # 0x143f8
movq 0x8(%rcx), %rcx
movl -0xc(%rbp), %edx
movq 0x10cfa(%rip), %rsi     # 0x143f8
imull 0x14(%rsi), %edx
movslq %edx, %rdx
movq (%rcx,%rdx), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movq 0x10cb1(%rip), %rdx     # 0x143c8
imull 0x14(%rdx), %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x3797
movq -0x38(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x377e
movq 0x10ceb(%rip), %rax     # 0x14440
movq -0x38(%rbp), %rcx
movl (%rcx), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x377e
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x18(%rax), %esi
callq 0xc640
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x3780
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
jmp 0x3737
jmp 0x3799
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x36d2
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movslq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movslq 0x14(%rax), %rdx
leaq -0x2446(%rip), %rcx     # 0x1380
callq 0x1090
movl $0x100, %edi            # imm = 0x100
movl $0x8, %esi
callq 0xc1e0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xc640
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
imull $0x0, 0x14(%rcx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movw $0x1, 0x4(%rax)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x38aa
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x385d
movq -0x48(%rbp), %rax
movw 0x4(%rax), %cx
addw $0x1, %cx
movw %cx, 0x4(%rax)
jmp 0x389a
movq -0x40(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x18(%rax), %esi
callq 0xc640
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movw $0x1, 0x4(%rax)
jmp 0x389c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x381a
movq -0x18(%rbp), %rdi
callq 0xc3e0
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)