// File: ncbi[P]amr/seq.cpp
// Function: Seq_sp::KmerIndex::add(Seq_sp::Dna const&, unsigned long&, unsigned long&)
void KmerIndex::add (const Dna &dna,
                     size_t &kmers,
                     size_t &kmersRejected)
{
  ASSERT (canRead);
  
  const size_t seqSize = dna. seq. size ();
  const string id (dna. getId ());
  kmers = 0;
  size_t kmersUsed = 0;
  FOR (size_t, i, seqSize)
    if (i + kmer_size <= seqSize)
    {
      kmers++;
      const Dna kmer ("x", dna. seq. substr (i, kmer_size), false);
      kmer. qc ();
      ASSERT (kmer. seq. size () == kmer_size);
      if (kmer. getXs ())
        continue;
      kmersUsed++;
      addId (dna2code (kmer), id);
    }
  ASSERT (kmers >= kmersUsed);
  kmersRejected = kmers - kmersUsed;
  
  items++;
  f. seekp (sizeof (kmer_size));
  writeBin (f, items);
}

// Assembly:
subq $0x498, %rsp            # imm = 0x498
movq %rdi, 0x490(%rsp)
movq %rsi, 0x488(%rsp)
movq %rdx, 0x480(%rsp)
movq %rcx, 0x478(%rsp)
movq 0x490(%rsp), %rax
movq %rax, 0x50(%rsp)
callq 0xd0a0
movq %rax, %rcx
movq 0x50(%rsp), %rax
movl $0x0, (%rcx)
testb $0x1, 0x238(%rax)
jne 0xd171b
callq 0xd8c0
cmpl $0x0, %eax
jne 0xd1711
leaq 0x3d7(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xdd50
movq 0x48(%rsp), %rdx
leaq 0x16f86(%rip), %rsi     # 0xe8446
leaq 0x3d8(%rsp), %rdi
callq 0xfae0
jmp 0xd14cf
leaq 0x3a0(%rsp), %rdi
movl $0x1320, %esi           # imm = 0x1320
callq 0x11600
jmp 0xd14e3
leaq 0x3f8(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
leaq 0x3a0(%rsp), %rdx
callq 0x11510
jmp 0xd1502
leaq 0x11cc8(%rip), %rdx     # 0xe31d1
leaq 0x418(%rsp), %rdi
leaq 0x3f8(%rsp), %rsi
callq 0x114c0
jmp 0xd1520
leaq 0x35f(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xdd50
movq 0x40(%rsp), %rdx
leaq 0x18747(%rip), %rsi     # 0xe9c85
leaq 0x360(%rsp), %rdi
callq 0xfae0
jmp 0xd154d
leaq 0x12450(%rip), %rdx     # 0xe39a4
leaq 0x380(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x114c0
jmp 0xd156b
leaq 0x438(%rsp), %rdi
leaq 0x418(%rsp), %rsi
leaq 0x380(%rsp), %rdx
callq 0x11510
jmp 0xd158a
leaq 0x1869c(%rip), %rdx     # 0xe9c2d
leaq 0x458(%rsp), %rdi
leaq 0x438(%rsp), %rsi
callq 0x114c0
jmp 0xd15a8
leaq 0x458(%rsp), %rdi
callq 0x173d0
jmp 0xd15b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd16a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1697
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
leaq 0x458(%rsp), %rdi
callq 0xdf08
leaq 0x438(%rsp), %rdi
callq 0xdf08
leaq 0x380(%rsp), %rdi
callq 0xdf08
leaq 0x360(%rsp), %rdi
callq 0xdf08
leaq 0x35f(%rsp), %rdi
callq 0xd7a0
leaq 0x418(%rsp), %rdi
callq 0xdf08
leaq 0x3f8(%rsp), %rdi
callq 0xdf08
leaq 0x3a0(%rsp), %rdi
callq 0xdf08
leaq 0x3d8(%rsp), %rdi
callq 0xdf08
leaq 0x3d7(%rsp), %rdi
callq 0xd7a0
jmp 0xd1fb9
movl $0x1, %edi
callq 0xd8e0
movq 0x488(%rsp), %rdi
addq $0x28, %rdi
callq 0xd520
movq %rax, 0x350(%rsp)
movq 0x488(%rsp), %rsi
leaq 0x330(%rsp), %rdi
callq 0x11bc0
movq 0x480(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x328(%rsp)
movq $0x0, 0x320(%rsp)
movq 0x320(%rsp), %rax
cmpq 0x350(%rsp), %rax
jae 0xd1c68
movq 0x50(%rsp), %rcx
movq 0x320(%rsp), %rax
addq 0x240(%rcx), %rax
cmpq 0x350(%rsp), %rax
ja 0xd1c4d
movq 0x480(%rsp), %rax
movq (%rax), %rcx
incq %rcx
movq %rcx, (%rax)
leaq 0x2af(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xdd50
movq 0x38(%rsp), %rdx
leaq 0x131a3(%rip), %rsi     # 0xe497a
leaq 0x2b0(%rsp), %rdi
callq 0xfae0
jmp 0xd17e6
movq 0x50(%rsp), %rax
movq 0x488(%rsp), %rsi
addq $0x28, %rsi
movq 0x320(%rsp), %rdx
movq 0x240(%rax), %rcx
leaq 0x288(%rsp), %rdi
callq 0xd740
jmp 0xd1815
leaq 0x2d0(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
leaq 0x288(%rsp), %rdx
xorl %ecx, %ecx
callq 0xd9200
jmp 0xd1836
leaq 0x288(%rsp), %rdi
callq 0xdf08
leaq 0x2b0(%rsp), %rdi
callq 0xdf08
leaq 0x2af(%rsp), %rdi
callq 0xd7a0
leaq 0x2d0(%rsp), %rdi
callq 0xd8550
jmp 0xd186c
callq 0xd0a0
movl $0x0, (%rax)
leaq 0x2d0(%rsp), %rdi
addq $0x28, %rdi
callq 0xd520
movq 0x50(%rsp), %rcx
cmpq 0x240(%rcx), %rax
je 0xd1ba6
callq 0xd8c0
cmpl $0x0, %eax
jne 0xd1b9c
leaq 0x1e7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xdd50
movq 0x30(%rsp), %rdx
leaq 0x16b80(%rip), %rsi     # 0xe8446
leaq 0x1e8(%rsp), %rdi
callq 0xfae0
jmp 0xd18d5
leaq 0x1c0(%rsp), %rdi
movl $0x132c, %esi           # imm = 0x132C
callq 0x11600
jmp 0xd18e9
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
leaq 0x1c0(%rsp), %rdx
callq 0x11510
jmp 0xd1908
leaq 0x118c2(%rip), %rdx     # 0xe31d1
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x114c0
jmp 0xd1926
leaq 0x17f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xdd50
movq 0x28(%rsp), %rdx
leaq 0x18341(%rip), %rsi     # 0xe9c85
leaq 0x180(%rsp), %rdi
callq 0xfae0
jmp 0xd1953
leaq 0x1204a(%rip), %rdx     # 0xe39a4
leaq 0x1a0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x114c0
jmp 0xd1971
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x1a0(%rsp), %rdx
callq 0x11510
jmp 0xd1990
leaq 0x1832b(%rip), %rdx     # 0xe9cc2
leaq 0x268(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x114c0
jmp 0xd19ae
leaq 0x268(%rsp), %rdi
callq 0x173d0
jmp 0xd19bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1a17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1a0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
leaq 0x288(%rsp), %rdi
callq 0xdf08
leaq 0x2b0(%rsp), %rdi
callq 0xdf08
leaq 0x2af(%rsp), %rdi
callq 0xd7a0
jmp 0xd1fac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1c3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1b22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
leaq 0x268(%rsp), %rdi
callq 0xdf08
leaq 0x248(%rsp), %rdi
callq 0xdf08
leaq 0x1a0(%rsp), %rdi
callq 0xdf08
leaq 0x180(%rsp), %rdi
callq 0xdf08
leaq 0x17f(%rsp), %rdi
callq 0xd7a0
leaq 0x228(%rsp), %rdi
callq 0xdf08
leaq 0x208(%rsp), %rdi
callq 0xdf08
leaq 0x1c0(%rsp), %rdi
callq 0xdf08
leaq 0x1e8(%rsp), %rdi
callq 0xdf08
leaq 0x1e7(%rsp), %rdi
callq 0xd7a0
jmp 0xd1c3b
movl $0x1, %edi
callq 0xd8e0
leaq 0x2d0(%rsp), %rdi
callq 0xab4a0
movq %rax, 0x20(%rsp)
jmp 0xd1bba
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
je 0xd1bd2
movl $0x4, 0x178(%rsp)
jmp 0xd1c1d
movq 0x328(%rsp), %rax
incq %rax
movq %rax, 0x328(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0xd1100
movq %rax, 0x18(%rsp)
jmp 0xd1bf9
movq 0x18(%rsp), %rsi
movq 0x50(%rsp), %rdi
leaq 0x330(%rsp), %rdx
callq 0xd1fd0
jmp 0xd1c12
movl $0x0, 0x178(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0xd9260
movl 0x178(%rsp), %eax
testl %eax, %eax
je 0xd1c39
jmp 0xd1c37
jmp 0xd1c4f
jmp 0xd1c4d
leaq 0x2d0(%rsp), %rdi
callq 0xd9260
jmp 0xd1fac
jmp 0xd1c4f
movq 0x320(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x320(%rsp)
jmp 0xd1770
callq 0xd0a0
movl $0x0, (%rax)
movq 0x480(%rsp), %rax
movq (%rax), %rax
cmpq 0x328(%rsp), %rax
jae 0xd1f04
callq 0xd8c0
cmpl $0x0, %eax
jne 0xd1efa
leaq 0xd7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xdd50
movq 0x10(%rsp), %rdx
leaq 0x1678e(%rip), %rsi     # 0xe8446
leaq 0xd8(%rsp), %rdi
callq 0xfae0
jmp 0xd1cc7
leaq 0xb0(%rsp), %rdi
movl $0x1332, %esi           # imm = 0x1332
callq 0x11600
jmp 0xd1cdb
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x11510
jmp 0xd1cfa
leaq 0x114d0(%rip), %rdx     # 0xe31d1
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x114c0
jmp 0xd1d18
leaq 0x6f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xdd50
movq 0x8(%rsp), %rdx
leaq 0x17f52(%rip), %rsi     # 0xe9c85
leaq 0x70(%rsp), %rdi
callq 0xfae0
jmp 0xd1d3f
leaq 0x11c5e(%rip), %rdx     # 0xe39a4
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x114c0
jmp 0xd1d5a
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x11510
jmp 0xd1d79
leaq 0x17f62(%rip), %rdx     # 0xe9ce2
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x114c0
jmp 0xd1d97
leaq 0x158(%rsp), %rdi
callq 0x173d0
jmp 0xd1da6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1ee8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1edb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1ece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1ec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1eaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1ea0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1e93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
jmp 0xd1e86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
leaq 0x158(%rsp), %rdi
callq 0xdf08
leaq 0x138(%rsp), %rdi
callq 0xdf08
leaq 0x90(%rsp), %rdi
callq 0xdf08
leaq 0x70(%rsp), %rdi
callq 0xdf08
leaq 0x6f(%rsp), %rdi
callq 0xd7a0
leaq 0x118(%rsp), %rdi
callq 0xdf08
leaq 0xf8(%rsp), %rdi
callq 0xdf08
leaq 0xb0(%rsp), %rdi
callq 0xdf08
leaq 0xd8(%rsp), %rdi
callq 0xdf08
leaq 0xd7(%rsp), %rdi
callq 0xd7a0
jmp 0xd1fac
movl $0x1, %edi
callq 0xd8e0
movq 0x50(%rsp), %rax
movq 0x480(%rsp), %rcx
movq (%rcx), %rdx
movq 0x328(%rsp), %rcx
subq %rcx, %rdx
movq 0x478(%rsp), %rcx
movq %rdx, (%rcx)
movq 0x250(%rax), %rcx
incq %rcx
movq %rcx, 0x250(%rax)
addq $0x38, %rax
movq %rax, (%rsp)
leaq 0x58(%rsp), %rdi
movl $0x8, %esi
callq 0x4d0e0
jmp 0xd1f54
movq (%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0xd8d0
jmp 0xd1f69
movq 0x50(%rsp), %rsi
movq %rsi, %rdi
addq $0x38, %rdi
addq $0x250, %rsi            # imm = 0x250
callq 0xd8fb0
jmp 0xd1f83
leaq 0x330(%rsp), %rdi
callq 0xdf08
addq $0x498, %rsp            # imm = 0x498
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c8(%rsp)
movl %eax, 0x3c4(%rsp)
leaq 0x330(%rsp), %rdi
callq 0xdf08
movq 0x3c8(%rsp), %rdi
callq 0xdd40
nopw %cs:(%rax,%rax)