// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/hash10x.c
// Function: cribAddGenome
static void cribAddGenome (FILE *f, CribInfo *crib)
{
  char *seq ;
  int len, chr = 0, pos ;
  int nAbsent = 0, nPresent = 0 ;
  U32 index ;
  dna2indexConv['N'] = dna2indexConv['n'] = 0 ; /* to get 2-bit encoding */
  while (readSequence (f, dna2indexConv, &seq, 0, 0, &len))
    { SeqhashRCiterator *mi = moshRCiterator (hasher, seq, len) ;
      U64 hash ; int pos ;
      ++chr ; if (chr >= cribChrMax) cribChrMax = chr+1 ;
      while (moshRCnext (mi, &hash, &pos, 0))
	if ((index = hashIndexFind (hash, FALSE)))
	  { CribInfo *c = &crib[index] ;
	    if (!c->chr) { c->chr = chr ; c->pos = pos >> 10 ; }
	    else if (c->chr > 0) c->chr = -1 ;
	    else --c->chr ;
	    ++nPresent ;
	  }
	else
	  ++nAbsent ;
      seqhashRCiteratorDestroy (mi) ;
    }
  fclose (f) ;

  fprintf (outFile, "  read %d known and %d unknown hashes from %d sequences in crib genome\n",
	  nPresent, nAbsent, chr) ;
  if (outFile != stdout)
    printf ("  read %d known and %d unknown hashes from %d sequences in crib genome\n",
	    nPresent, nAbsent, chr) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
leaq 0xc440(%rip), %rsi      # 0xf760
xorl %eax, %eax
movl %eax, 0x1b8(%rsi)
movq $0x0, 0x8(%rsp)
movl %eax, 0x138(%rsi)
leaq 0x28(%rsp), %rdx
leaq 0x18(%rsp), %r9
movq %rdi, 0x20(%rsp)
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6a10
movl $0x0, %ebp
movl $0x0, %r12d
testl %eax, %eax
je 0x34b1
xorl %ebx, %ebx
leaq 0x30(%rsp), %r13
leaq 0x1c(%rsp), %r14
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
movq 0xcff7(%rip), %rdi      # 0x10378
movq 0x28(%rsp), %rsi
movl 0x18(%rsp), %edx
callq 0x8014
movq %rax, %r12
leal 0x1(%rbx), %eax
movl %eax, 0x14(%rsp)
cmpl 0xd031(%rip), %eax      # 0x103d0
jl 0x33aa
addl $0x2, %ebx
movl %ebx, 0xd026(%rip)      # 0x103d0
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x81bf
testb %al, %al
je 0x346f
movq 0x8(%rsp), %rbx
movq 0x30(%rsp), %rax
movq 0xd07d(%rip), %rdx      # 0x10450
movq %rdx, %rsi
movb 0xbd74(%rip), %cl       # 0xf150
movq %rax, %rdi
shrq %cl, %rdi
andq %rax, %rsi
movq 0xcfac(%rip), %rcx      # 0x10398
movl (%rcx,%rsi,4), %r8d
testl %r8d, %r8d
je 0x341b
andq %rdx, %rdi
orq $0x1, %rdi
movq 0xcfad(%rip), %r9       # 0x103b0
movl %r8d, %r8d
cmpq %rax, (%r9,%r8,8)
je 0x341f
addq %rdi, %rsi
andq %rdx, %rsi
movl (%rcx,%rsi,4), %r8d
testl %r8d, %r8d
jne 0x3403
incl %ebp
jmp 0x3455
movzwl (%r15,%r8,4), %eax
testw %ax, %ax
je 0x3434
jle 0x344c
movw $0xffff, (%r15,%r8,4)   # imm = 0xFFFF
jmp 0x3453
movl 0x14(%rsp), %eax
movw %ax, (%r15,%r8,4)
movl 0x1c(%rsp), %eax
shrl $0xa, %eax
movw %ax, 0x2(%r15,%r8,4)
jmp 0x3453
decl %eax
movw %ax, (%r15,%r8,4)
incl %ebx
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x81bf
testb %al, %al
jne 0x33c7
jmp 0x3474
movq 0x8(%rsp), %rbx
movq %rbx, 0x8(%rsp)
movq %r12, %rdi
callq 0x1dfb
movq 0x20(%rsp), %rdi
leaq 0xc2d3(%rip), %rsi      # 0xf760
leaq 0x28(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x18(%rsp), %r9
callq 0x6a10
movl 0x14(%rsp), %r12d
movl %r12d, %ebx
testl %eax, %eax
jne 0x337a
movq 0x20(%rsp), %rdi
callq 0x10b0
movq 0xcece(%rip), %rdi      # 0x10390
leaq 0x818d(%rip), %rsi      # 0xb656
movq 0x8(%rsp), %rbx
movl %ebx, %edx
movl %ebp, %ecx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x1150
movq 0xcead(%rip), %rax      # 0x10390
movq 0xbade(%rip), %rcx      # 0xefc8
cmpq (%rcx), %rax
je 0x3504
leaq 0x8160(%rip), %rdi      # 0xb656
movl %ebx, %esi
movl %ebp, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x10d0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq