// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/hash10x.c
// Function: writeHashFile
void writeHashFile (FILE *f)
{
  if ((fwrite ("10XH", 4, 1, f) != 1) || (fwrite (&HASHFILE_VERSION, 4, 1, f) != 1) ||
      (fwrite (&CLUSTERHASH_SIZE, 2, 1, f) != 1) || (fwrite (&CLUSTERBLOCK_SIZE, 2, 1, f) != 1) ||
      (fwrite (&hashTableBits, 4, 1, f) != 1)) die ("write fail 1") ;
  if (fwrite (hashIndex, sizeof(U32), hashTableSize, f) != hashTableSize) die ("write fail 2") ;
  if (fwrite (&hashNumber, sizeof(U32), 1, f) != 1) die ("failed to write hashNumber") ;
  if (fwrite (hashValue, sizeof(U64), hashNumber, f) != hashNumber) die ("failed to write hashValue") ;
  
  if (!arrayWrite (hashDepth, f)) die ("failed to write hashDepth array") ;
  if (!arrayWrite (clusterBlocks, f)) die ("failed to write clusterBlocks array") ;
  int i ;
  for (i = 1 ; i < arrayMax(clusterBlocks) ; ++i)
    { ClusterBlock *b = arrp(clusterBlocks, i, ClusterBlock) ;
      if (fwrite (b->clusHash, sizeof(ClusterHash), b->nHash, f) != b->nHash) die ("write fail 3") ;
    }
  fclose (f) ;

  fprintf (outFile, "  wrote %lld hash table entries and %d barcode blocks\n",
	   hashTableSize, arrayMax(clusterBlocks)) ;
  if (outFile != stdout)
    printf ("  wrote %lld hash table entries and %d barcode blocks\n",
	    hashTableSize, arrayMax(clusterBlocks)) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
leaq 0xc2f4(%rip), %rdi      # 0xe15b
movl $0x4, %esi
movl $0x1, %edx
callq 0x1250
cmpq $0x1, %rax
jne 0x1f00
movq -0x8(%rbp), %rcx
leaq 0x112cd(%rip), %rdi     # 0x13158
movl $0x4, %esi
movl $0x1, %edx
callq 0x1250
cmpq $0x1, %rax
jne 0x1f00
movq -0x8(%rbp), %rcx
leaq 0x112b1(%rip), %rdi     # 0x1315c
movl $0x2, %esi
movl $0x1, %edx
callq 0x1250
cmpq $0x1, %rax
jne 0x1f00
movq -0x8(%rbp), %rcx
leaq 0x11293(%rip), %rdi     # 0x1315e
movl $0x2, %esi
movl $0x1, %edx
callq 0x1250
cmpq $0x1, %rax
jne 0x1f00
movq -0x8(%rbp), %rcx
leaq 0x11265(%rip), %rdi     # 0x13150
movl $0x4, %esi
movl $0x1, %edx
callq 0x1250
cmpq $0x1, %rax
je 0x1f0e
leaq 0xc259(%rip), %rdi      # 0xe160
movb $0x0, %al
callq 0xd0c0
movq 0x124c3(%rip), %rdi     # 0x143d8
movq 0x124c4(%rip), %rdx     # 0x143e0
movq -0x8(%rbp), %rcx
movl $0x4, %esi
callq 0x1250
cmpq 0x124af(%rip), %rax     # 0x143e0
je 0x1f41
leaq 0xc233(%rip), %rdi      # 0xe16d
movb $0x0, %al
callq 0xd0c0
movq -0x8(%rbp), %rcx
leaq 0x1249c(%rip), %rdi     # 0x143e8
movl $0x4, %esi
movl $0x1, %edx
callq 0x1250
cmpq $0x1, %rax
je 0x1f6f
leaq 0xc212(%rip), %rdi      # 0xe17a
movb $0x0, %al
callq 0xd0c0
movq 0x1247a(%rip), %rdi     # 0x143f0
movl 0x1246c(%rip), %eax     # 0x143e8
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x8, %esi
callq 0x1250
movl 0x12456(%rip), %ecx     # 0x143e8
cmpq %rcx, %rax
je 0x1fa5
leaq 0xc1f7(%rip), %rdi      # 0xe195
movb $0x0, %al
callq 0xd0c0
movq 0x12414(%rip), %rdi     # 0x143c0
movq -0x8(%rbp), %rsi
callq 0xc7a0
cmpb $0x0, %al
jne 0x1fc7
leaq 0xc1ef(%rip), %rdi      # 0xe1af
movb $0x0, %al
callq 0xd0c0
movq 0x123fa(%rip), %rdi     # 0x143c8
movq -0x8(%rbp), %rsi
callq 0xc7a0
cmpb $0x0, %al
jne 0x1fe9
leaq 0xc1ed(%rip), %rdi      # 0xe1cf
movb $0x0, %al
callq 0xd0c0
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq 0x123ce(%rip), %rcx     # 0x143c8
cmpl 0x18(%rcx), %eax
jge 0x2068
movq 0x123c2(%rip), %rax     # 0x143c8
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
movq 0x123b4(%rip), %rdx     # 0x143c8
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x8, %esi
callq 0x1250
movq -0x18(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
je 0x205b
leaq 0xc19f(%rip), %rdi      # 0xe1f3
movb $0x0, %al
callq 0xd0c0
jmp 0x205d
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1ff0
movq -0x8(%rbp), %rdi
callq 0x10b0
movq 0x12358(%rip), %rdi     # 0x143d0
movq 0x12361(%rip), %rdx     # 0x143e0
movq 0x12342(%rip), %rax     # 0x143c8
movl 0x18(%rax), %ecx
leaq 0xc170(%rip), %rsi      # 0xe200
movb $0x0, %al
callq 0x1150
movq 0x12332(%rip), %rax     # 0x143d0
movq 0x10f2b(%rip), %rcx     # 0x12fd0
cmpq (%rcx), %rax
je 0x20c9
movq 0x1232f(%rip), %rsi     # 0x143e0
movq 0x12310(%rip), %rax     # 0x143c8
movl 0x18(%rax), %edx
leaq 0xc13e(%rip), %rdi      # 0xe200
movb $0x0, %al
callq 0x10d0
addq $0x20, %rsp
popq %rbp
retq
nop