// File: ncbi[P]amr/seq.cpp
// Function: Seq_sp::KmerIndex::find(Seq_sp::Dna const&)
Vector<KmerIndex::NumId> KmerIndex::find (const Dna &dna) 
{
  ASSERT (canRead);
  
  unordered_map<string,size_t> id2num;  id2num. rehash (100000);  // PAR
  const size_t seqSize = dna. seq. size ();
  FOR (size_t, i, seqSize)
    if (i + kmer_size <= seqSize)
    {
      const Dna kmer ("x", dna. seq. substr (i, kmer_size), false);
      kmer. qc ();
      ASSERT (kmer. seq. size () == kmer_size);
      if (kmer. getXs ())
        continue;
      const StringVector ids (code2ids (dna2code (kmer)));
      for (const string& id : ids)
        id2num [id] ++;
    }
    
  Vector<NumId> num2id;  num2id. reserve (id2num. size ());
  for (const auto& it : id2num)
    num2id << std::move (NumId (it. second, it. first));
  num2id. sort ();
  
  return num2id; 
}

// Assembly:
subq $0x418, %rsp            # imm = 0x418
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x410(%rsp)
movq %rsi, 0x408(%rsp)
movq %rdx, 0x400(%rsp)
movq 0x408(%rsp), %rax
movq %rax, 0x58(%rsp)
callq 0xd0a0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movl $0x0, (%rcx)
testb $0x1, 0x238(%rax)
jne 0xd49d0
callq 0xd8c0
cmpl $0x0, %eax
jne 0xd49c6
leaq 0x35f(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xdd50
movq 0x40(%rsp), %rdx
leaq 0x13cd1(%rip), %rsi     # 0xe8446
leaq 0x360(%rsp), %rdi
callq 0xfae0
jmp 0xd4784
leaq 0x328(%rsp), %rdi
movl $0x1387, %esi           # imm = 0x1387
callq 0x11600
jmp 0xd4798
leaq 0x380(%rsp), %rdi
leaq 0x360(%rsp), %rsi
leaq 0x328(%rsp), %rdx
callq 0x11510
jmp 0xd47b7
leaq 0xea13(%rip), %rdx      # 0xe31d1
leaq 0x3a0(%rsp), %rdi
leaq 0x380(%rsp), %rsi
callq 0x114c0
jmp 0xd47d5
leaq 0x2e7(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xdd50
movq 0x38(%rsp), %rdx
leaq 0x1562e(%rip), %rsi     # 0xe9e21
leaq 0x2e8(%rsp), %rdi
callq 0xfae0
jmp 0xd4802
leaq 0xf19b(%rip), %rdx      # 0xe39a4
leaq 0x308(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x114c0
jmp 0xd4820
leaq 0x3c0(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
leaq 0x308(%rsp), %rdx
callq 0x11510
jmp 0xd483f
leaq 0x153e7(%rip), %rdx     # 0xe9c2d
leaq 0x3e0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x114c0
jmp 0xd485d
leaq 0x3e0(%rsp), %rdi
callq 0x173d0
jmp 0xd486c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd49b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd49a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd499a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd498d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4973
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4966
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4959
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd494c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0xdf08
leaq 0x3c0(%rsp), %rdi
callq 0xdf08
leaq 0x308(%rsp), %rdi
callq 0xdf08
leaq 0x2e8(%rsp), %rdi
callq 0xdf08
leaq 0x2e7(%rsp), %rdi
callq 0xd7a0
leaq 0x3a0(%rsp), %rdi
callq 0xdf08
leaq 0x380(%rsp), %rdi
callq 0xdf08
leaq 0x328(%rsp), %rdi
callq 0xdf08
leaq 0x360(%rsp), %rdi
callq 0xdf08
leaq 0x35f(%rsp), %rdi
callq 0xd7a0
jmp 0xd5151
movl $0x1, %edi
callq 0xd8e0
leaq 0x2a8(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xd9270
movq 0x30(%rsp), %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0xd9280
jmp 0xd49f3
movq 0x400(%rsp), %rdi
addq $0x28, %rdi
callq 0xd520
movq %rax, 0x2a0(%rsp)
movq $0x0, 0x298(%rsp)
movq 0x298(%rsp), %rax
cmpq 0x2a0(%rsp), %rax
jae 0xd4fda
movq 0x58(%rsp), %rcx
movq 0x298(%rsp), %rax
addq 0x240(%rcx), %rax
cmpq 0x2a0(%rsp), %rax
ja 0xd4fbf
leaq 0x227(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xdd50
movq 0x28(%rsp), %rdx
leaq 0xff0c(%rip), %rsi      # 0xe497a
leaq 0x228(%rsp), %rdi
callq 0xfae0
jmp 0xd4a7d
movq 0x58(%rsp), %rax
movq 0x400(%rsp), %rsi
addq $0x28, %rsi
movq 0x298(%rsp), %rdx
movq 0x240(%rax), %rcx
leaq 0x200(%rsp), %rdi
callq 0xd740
jmp 0xd4aac
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x200(%rsp), %rdx
xorl %ecx, %ecx
callq 0xd9200
jmp 0xd4acd
leaq 0x200(%rsp), %rdi
callq 0xdf08
leaq 0x228(%rsp), %rdi
callq 0xdf08
leaq 0x227(%rsp), %rdi
callq 0xd7a0
leaq 0x248(%rsp), %rdi
callq 0xd8550
jmp 0xd4b03
callq 0xd0a0
movl $0x0, (%rax)
leaq 0x248(%rsp), %rdi
addq $0x28, %rdi
callq 0xd520
movq 0x58(%rsp), %rcx
cmpq 0x240(%rcx), %rax
je 0xd4e56
callq 0xd8c0
cmpl $0x0, %eax
jne 0xd4e4c
leaq 0x15f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xdd50
movq 0x20(%rsp), %rdx
leaq 0x138e9(%rip), %rsi     # 0xe8446
leaq 0x160(%rsp), %rdi
callq 0xfae0
jmp 0xd4b6c
leaq 0x138(%rsp), %rdi
movl $0x1390, %esi           # imm = 0x1390
callq 0x11600
jmp 0xd4b80
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0x11510
jmp 0xd4b9f
leaq 0xe62b(%rip), %rdx      # 0xe31d1
leaq 0x1a0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x114c0
jmp 0xd4bbd
leaq 0xf7(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xdd50
movq 0x18(%rsp), %rdx
leaq 0x15246(%rip), %rsi     # 0xe9e21
leaq 0xf8(%rsp), %rdi
callq 0xfae0
jmp 0xd4bea
leaq 0xedb3(%rip), %rdx      # 0xe39a4
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x114c0
jmp 0xd4c08
leaq 0x1c0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x11510
jmp 0xd4c27
leaq 0x15094(%rip), %rdx     # 0xe9cc2
leaq 0x1e0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x114c0
jmp 0xd4c45
leaq 0x1e0(%rsp), %rdi
callq 0x173d0
jmp 0xd4c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd5144
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4cc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0x200(%rsp), %rdi
callq 0xdf08
leaq 0x228(%rsp), %rdi
callq 0xdf08
leaq 0x227(%rsp), %rdi
callq 0xd7a0
jmp 0xd5144
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4e3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4e2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4e20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4e13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4df9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4dec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4ddf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd4dd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0xdf08
leaq 0x1c0(%rsp), %rdi
callq 0xdf08
leaq 0x118(%rsp), %rdi
callq 0xdf08
leaq 0xf8(%rsp), %rdi
callq 0xdf08
leaq 0xf7(%rsp), %rdi
callq 0xd7a0
leaq 0x1a0(%rsp), %rdi
callq 0xdf08
leaq 0x180(%rsp), %rdi
callq 0xdf08
leaq 0x138(%rsp), %rdi
callq 0xdf08
leaq 0x160(%rsp), %rdi
callq 0xdf08
leaq 0x15f(%rsp), %rdi
callq 0xd7a0
jmp 0xd4fad
movl $0x1, %edi
callq 0xd8e0
leaq 0x248(%rsp), %rdi
callq 0xab4a0
movq %rax, 0x10(%rsp)
jmp 0xd4e6a
movq 0x10(%rsp), %rax
cmpq $0x0, %rax
je 0xd4e85
movl $0x4, 0xf0(%rsp)
jmp 0xd4f8f
leaq 0x248(%rsp), %rdi
callq 0xd1100
movq %rax, 0x8(%rsp)
jmp 0xd4e99
movq 0x8(%rsp), %rdx
movq 0x58(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xd5160
jmp 0xd4eb2
leaq 0xd0(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x4e790
movq %rax, 0xc0(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x4e7c0
movq %rax, 0xb8(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x4e7f0
testb $0x1, %al
jne 0xd4f07
jmp 0xd4f77
leaq 0xc0(%rsp), %rdi
callq 0x4e830
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x5a0b0
movq %rax, (%rsp)
jmp 0xd4f37
movq (%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
leaq 0xc0(%rsp), %rdi
callq 0x4e840
jmp 0xd4eec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x4e0f0
jmp 0xd4fad
leaq 0xd0(%rsp), %rdi
callq 0x4e0f0
movl $0x0, 0xf0(%rsp)
leaq 0x248(%rsp), %rdi
callq 0xd9260
movl 0xf0(%rsp), %eax
testl %eax, %eax
je 0xd4fab
jmp 0xd4fa9
jmp 0xd4fc1
jmp 0xd4fbf
leaq 0x248(%rsp), %rdi
callq 0xd9260
jmp 0xd5144
jmp 0xd4fc1
movq 0x298(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x298(%rsp)
jmp 0xd4a18
movq 0x48(%rsp), %rdi
movb $0x0, 0xaf(%rsp)
callq 0xd92b0
leaq 0x2a8(%rsp), %rdi
callq 0xd93f0
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0xd92e0
jmp 0xd5008
leaq 0x2a8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xd9400
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xd9430
movq %rax, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xd9460
testb $0x1, %al
jne 0xd5060
jmp 0xd50ed
leaq 0x98(%rsp), %rdi
callq 0xd9480
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdx
movq 0x20(%rdx), %rsi
leaq 0x60(%rsp), %rdi
callq 0xd40b0
jmp 0xd508d
movq 0x48(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xd94a0
jmp 0xd509e
leaq 0x60(%rsp), %rdi
callq 0xd94e0
leaq 0x98(%rsp), %rdi
callq 0xd9500
jmp 0xd5042
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xd513a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xd94e0
jmp 0xd513a
movq 0x48(%rsp), %rdi
callq 0xd9530
jmp 0xd50f9
movb $0x1, 0xaf(%rsp)
movl $0x1, 0xf0(%rsp)
testb $0x1, 0xaf(%rsp)
jne 0xd5120
movq 0x48(%rsp), %rdi
callq 0xd9570
leaq 0x2a8(%rsp), %rdi
callq 0x53df0
movq 0x50(%rsp), %rax
addq $0x418, %rsp            # imm = 0x418
retq
movq 0x48(%rsp), %rdi
callq 0xd9570
leaq 0x2a8(%rsp), %rdi
callq 0x53df0
movq 0x350(%rsp), %rdi
callq 0xdd40
nop