// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/hash10x.c
// Function: processBlock
void processBlock (U32 *readData, ClusterBlock *b)
{
  Array a = arrayCreate (4096, HashTemp) ;
  int i, j, n ;
  char s1[160], s2[160] ;

  for (i = 0 ; i < b->nRead ; ++i, readData += 30)
    { unpackFQB (readData, s1, 0, s2, 0) ;
      seqAddHashes (&s1[23], 127, a, i) ; /* ignore 16bp of barcode and 7bp of spacer */
      seqAddHashes (s2, 150, a, i) ;
    }
  
  arraySort (a, compareHashTemp) ; /* sort then remove duplicate hash values */
  U64 hash, lastHash = arrp(a,0,HashTemp)->hash ;
  for (n = 1, j = 1 ; j < arrayMax(a) ; ++j)
    { hash = arrp(a,j,HashTemp)->hash ;
      if (hash != lastHash)
	arr(a,n++,HashTemp) = arr(a,j,HashTemp) ; lastHash = hash ;
    }

  b->nHash = n ;
  b->clusHash = new (n, ClusterHash) ;
  for (i = 0 ; i < n ; ++i)
    { int index = hashIndexFind (arrp(a,i,HashTemp)->hash, TRUE) ;
      ++array(hashDepth, index, U32) ;
      b->clusHash[i].hash = index ;
      b->clusHash[i].read = arrp(a,i,HashTemp)->read ;
    }

  qsort (b->clusHash, n, sizeof(ClusterHash), compareClusterHash) ; /* sort so hashes are in order */
  
  arrayDestroy (a) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x10, %esi
callq 0xc1e0
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x17e2
movq -0x8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x170(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rdx
callq 0x1440
leaq -0xd0(%rbp), %rdi
addq $0x17, %rdi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl $0x7f, %esi
callq 0x1610
leaq -0x170(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl $0x96, %esi
callq 0x1610
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
addq $0x78, %rax
movq %rax, -0x8(%rbp)
jmp 0x176d
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 -0x121(%rip), %rcx      # 0x16e0
callq 0x1090
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
imull $0x0, 0x14(%rcx), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x180(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x18d5
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
cmpq -0x180(%rbp), %rax
je 0x18b9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movq -0x18(%rbp), %rdx
movq 0x8(%rdx), %rdx
movl -0x20(%rbp), %esi
movq -0x18(%rbp), %rdi
imull 0x14(%rdi), %esi
movslq %esi, %rsi
movq (%rdx,%rsi), %rdi
movq %rdi, (%rax,%rcx)
movq 0x8(%rdx,%rsi), %rdx
movq %rdx, 0x8(%rax,%rcx)
movq -0x178(%rbp), %rax
movq %rax, -0x180(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1832
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movslq -0x24(%rbp), %rdi
shlq $0x3, %rdi
callq 0xd1a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x199e
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx), %rdi
movl $0x1, %esi
callq 0x19d0
movl %eax, -0x184(%rbp)
movq 0x12a85(%rip), %rdi     # 0x143c0
movl -0x184(%rbp), %esi
callq 0xc640
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x184(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl 0x8(%rax,%rcx), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movw %dx, 0x4(%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x18fe
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x24(%rbp), %rsi
movl $0x8, %edx
leaq -0x636(%rip), %rcx      # 0x1380
callq 0x1090
movq -0x18(%rbp), %rdi
callq 0xc3e0
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopl (%rax)