// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/hash10x.c
// Function: codeClusterReadMerge
void codeClusterReadMerge (int code)
{
  ClusterBlock *b = arrp(clusterBlocks, code, ClusterBlock) ;
  if (!b->nSubCluster) return ;	/* nothing to do */
  int i, j ;
  int *readMap = new0 (b->nRead, int), *trueCluster = new (b->nSubCluster+1, int) ;
  int *deadCluster = new0 (b->nSubCluster+1, int) ;
  for (i = 0 ; i <= b->nSubCluster ; ++i) trueCluster[i] = i ; /* initialisation */
  for (i = 0 ; i < b->nHash ; ++i)
    { int hashCluster = trueCluster[b->clusHash[i].subCluster] ; if (!hashCluster) continue ;
      int readCluster = trueCluster[readMap[b->clusHash[i].read]] ;
      if (hashCluster == readCluster) continue ;
      else if (!readCluster)
	readMap[b->clusHash[i].read] = hashCluster ;
      else			/* merge clusters hashCluster and readCluster */
	{ if (hashCluster > readCluster)
	    { int t = hashCluster ; hashCluster = readCluster ; readCluster = t ; }
	  for (j = 1 ; j <= b->nSubCluster ; ++j)
	    if (trueCluster[j] == readCluster) trueCluster[j] = hashCluster ;
	  deadCluster[readCluster] = 1 ;
	}
    }

  /* now compactify trueCluster, reusing deadCluster[] for the map removing dead indices */
  for (j = 1 ; j <= b->nSubCluster ; ++j) deadCluster[j] = deadCluster[j-1] + 1 - deadCluster[j] ;
  for (j = 1 ; j <= b->nSubCluster ; ++j) trueCluster[j] = deadCluster[trueCluster[j]] ;
  b->nSubCluster = deadCluster[b->nSubCluster] ;
  for (i = 0 ; i < b->nHash ; ++i) b->clusHash[i].subCluster = trueCluster[b->clusHash[i].subCluster] ;

  free (readMap) ; free(trueCluster) ; free(deadCluster) ;
  if (isVerbose) { fprintf (outFile, " then %d merged clusters\n", b->nSubCluster) ; fflush (stdout) ; }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq 0xf396(%rip), %rax      # 0x143c8
movq 0x8(%rax), %rax
movl -0x4(%rbp), %ecx
movq 0xf388(%rip), %rdx      # 0x143c8
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x505d
jmp 0x530e
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
movl $0x4, %esi
callq 0xd1f0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0xd1a0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x4, %esi
callq 0xd1f0
movq %rax, -0x30(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
ja 0x50d6
movl -0x14(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x50b1
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x51df
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movzbl 0x6(%rcx,%rdx,8), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x5113
jmp 0x51d1
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x10(%rdx), %rdx
movslq -0x14(%rbp), %rsi
movzwl 0x4(%rdx,%rsi,8), %edx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x5143
jmp 0x51d1
cmpl $0x0, -0x38(%rbp)
jne 0x5166
movl -0x34(%rbp), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x14(%rbp), %rsi
movzwl 0x4(%rcx,%rsi,8), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x51cd
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jle 0x5180
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
ja 0x51be
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x38(%rbp), %eax
jne 0x51b1
movl -0x34(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x51b3
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5187
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x51cf
jmp 0x51d1
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x50dd
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
ja 0x5226
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
subl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x51e6
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
ja 0x5262
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x522d
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x52bf
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movzbl 0x6(%rcx,%rdx,8), %ecx
movl (%rax,%rcx,4), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movb %dl, 0x6(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x527e
movq -0x20(%rbp), %rdi
callq 0x1040
movq -0x28(%rbp), %rdi
callq 0x1040
movq -0x30(%rbp), %rdi
callq 0x1040
cmpb $0x0, 0xf0d0(%rip)      # 0x143b1
je 0x530e
movq 0xf0e6(%rip), %rdi      # 0x143d0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x9616(%rip), %rsi      # 0xe90e
movb $0x0, %al
callq 0x1150
movq 0xdcca(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
callq 0x11a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)