// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x7de5(%rip), %rdi      # 0xa16b
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1250
cmpq $0x1, %rax
jne 0x241a
leaq 0xcdb3(%rip), %rdi      # 0xf158
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1250
cmpq $0x1, %rax
jne 0x241a
leaq 0xcd98(%rip), %rdi      # 0xf15c
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1250
cmpq $0x1, %rax
jne 0x241a
leaq 0xcd7b(%rip), %rdi      # 0xf15e
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1250
cmpq $0x1, %rax
jne 0x241a
leaq 0xcd4e(%rip), %rdi      # 0xf150
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1250
cmpq $0x1, %rax
je 0x2428
leaq 0x7d4f(%rip), %rdi      # 0xa170
xorl %eax, %eax
callq 0x9408
movq 0xdf69(%rip), %rdi      # 0x10398
movq 0xdf6a(%rip), %rdx      # 0x103a0
movl $0x4, %esi
movq %rbx, %rcx
callq 0x1250
cmpq 0xdf56(%rip), %rax      # 0x103a0
je 0x245a
leaq 0x7d2a(%rip), %rdi      # 0xa17d
xorl %eax, %eax
callq 0x9408
leaq 0xdf47(%rip), %rdi      # 0x103a8
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1250
cmpq $0x1, %rax
je 0x2487
leaq 0x7d0a(%rip), %rdi      # 0xa18a
xorl %eax, %eax
callq 0x9408
movq 0xdf22(%rip), %rdi      # 0x103b0
movl 0xdf14(%rip), %edx      # 0x103a8
movl $0x8, %esi
movq %rbx, %rcx
callq 0x1250
movl 0xdf01(%rip), %ecx      # 0x103a8
cmpq %rcx, %rax
je 0x24ba
leaq 0x7cf2(%rip), %rdi      # 0xa1a5
xorl %eax, %eax
callq 0x9408
movq 0xdebf(%rip), %rdi      # 0x10380
movq %rbx, %rsi
callq 0x9011
testb %al, %al
jne 0x24db
leaq 0x7ceb(%rip), %rdi      # 0xa1bf
xorl %eax, %eax
callq 0x9408
movq 0xdea6(%rip), %rdi      # 0x10388
movq %rbx, %rsi
callq 0x9011
testb %al, %al
jne 0x24fc
leaq 0x7cea(%rip), %rdi      # 0xa1df
xorl %eax, %eax
callq 0x9408
movq 0xde85(%rip), %rax      # 0x10388
cmpl $0x2, 0x18(%rax)
jl 0x255d
movl $0x1, %ebp
leaq 0x7cee(%rip), %r14      # 0xa203
movq 0x8(%rax), %r15
movslq 0x14(%rax), %rax
movslq %ebp, %r12
imulq %rax, %r12
movq 0x10(%r15,%r12), %rdi
movl 0x4(%r15,%r12), %edx
movl $0x8, %esi
movq %rbx, %rcx
callq 0x1250
movl 0x4(%r15,%r12), %ecx
cmpq %rcx, %rax
je 0x254f
movq %r14, %rdi
xorl %eax, %eax
callq 0x9408
incl %ebp
movq 0xde30(%rip), %rax      # 0x10388
cmpl 0x18(%rax), %ebp
jl 0x2515
movq %rbx, %rdi
callq 0x10b0
movq 0xde24(%rip), %rdi      # 0x10390
movq 0xde2d(%rip), %rdx      # 0x103a0
movq 0xde0e(%rip), %rax      # 0x10388
movl 0x18(%rax), %ecx
leaq 0x7c8c(%rip), %rsi      # 0xa210
xorl %eax, %eax
callq 0x1150
movq 0xddfe(%rip), %rax      # 0x10390
movq 0xca2f(%rip), %rcx      # 0xefc8
cmpq (%rcx), %rax
je 0x25c5
movq 0xddfb(%rip), %rsi      # 0x103a0
movq 0xdddc(%rip), %rax      # 0x10388
movl 0x18(%rax), %edx
leaq 0x7c5a(%rip), %rdi      # 0xa210
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq