// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, %r15
leaq 0xc3fb(%rip), %rsi      # 0xf760
xorl %ebx, %ebx
movl %ebx, 0x1b8(%rsi)
movl %ebx, 0x138(%rsi)
leaq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %r9
movq %rdi, 0x10(%rsp)
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6898
movl $0x0, %ebp
movl $0x0, %r12d
testl %eax, %eax
je 0x34df
xorl %r13d, %r13d
leaq 0xc(%rsp), %r14
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0xcfc6(%rip), %rdi      # 0x10378
movq 0x20(%rsp), %rsi
movl 0x8(%rsp), %edx
callq 0x7e1e
movq %rax, %r12
leal 0x1(%r13), %eax
movl %eax, 0x4(%rsp)
cmpl 0xcfff(%rip), %eax      # 0x103d0
jl 0x33de
addl $0x2, %r13d
movl %r13d, 0xcff2(%rip)     # 0x103d0
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x7fb0
testb %al, %al
je 0x34a7
movl 0x4(%rsp), %r13d
movq 0x18(%rsp), %rax
movq 0xd03f(%rip), %rdx      # 0x10448
movq %rdx, %rsi
movb 0xbd3e(%rip), %cl       # 0xf150
movq %rax, %rdi
shrq %cl, %rdi
andq %rax, %rsi
movq 0xcf76(%rip), %r8       # 0x10398
movl (%r8,%rsi,4), %ecx
testl %ecx, %ecx
je 0x344f
andq %rdx, %rdi
orq $0x1, %rdi
movq 0xcf78(%rip), %r9       # 0x103b0
movl %ecx, %r10d
cmpq %rax, (%r9,%r10,8)
je 0x344f
addq %rdi, %rsi
andq %rdx, %rsi
movl (%r8,%rsi,4), %ecx
testl %ecx, %ecx
jne 0x3438
testl %ecx, %ecx
je 0x346a
movl %ecx, %eax
movzwl (%r15,%rax,4), %ecx
testw %cx, %cx
je 0x346e
jle 0x3482
movw $0xffff, (%r15,%rax,4)  # imm = 0xFFFF
jmp 0x3489
incl %ebp
jmp 0x348b
movw %r13w, (%r15,%rax,4)
movl 0xc(%rsp), %ecx
shrl $0xa, %ecx
movw %cx, 0x2(%r15,%rax,4)
jmp 0x3489
decl %ecx
movw %cx, (%r15,%rax,4)
incl %ebx
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x7fb0
testb %al, %al
jne 0x33fd
jmp 0x34ac
movl 0x4(%rsp), %r13d
movq %r12, %rdi
callq 0x1deb
movq 0x10(%rsp), %rdi
leaq 0xc2a0(%rip), %rsi      # 0xf760
leaq 0x20(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x8(%rsp), %r9
callq 0x6898
movl %r13d, %r12d
testl %eax, %eax
jne 0x33ab
movq 0x10(%rsp), %rdi
callq 0x10b0
movq 0xcea0(%rip), %rdi      # 0x10390
leaq 0x8139(%rip), %rsi      # 0xb630
movl %ebx, %edx
movl %ebp, %ecx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x1150
movq 0xce84(%rip), %rax      # 0x10390
movq 0xbab5(%rip), %rcx      # 0xefc8
cmpq (%rcx), %rax
je 0x352d
leaq 0x8111(%rip), %rdi      # 0xb630
movl %ebx, %esi
movl %ebp, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x10d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq