// File: ncbi[P]amr/seq.cpp
// Function: Seq_sp::Peptide::getSelfSimilarity(Seq_sp::SubstMat const&, unsigned long, unsigned long) const
double Peptide::getSelfSimilarity (const SubstMat &mat,
                                   size_t start,
                                   size_t stop) const
{
  ASSERT (start <= stop);
  ASSERT (stop <= seq. size ());
  
  if (! start && ! stop)
    stop = seq. size ();
  
  double s = 0.0;
  FOR_START (size_t, i, start, stop)
  {
    const char c = seq [i];
    if (c != '-')
      s += mat. sim [(size_t) c] [(size_t) c];
  }

  return s;
}

// Assembly:
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x290(%rsp)
movq %rsi, 0x288(%rsp)
movq %rdx, 0x280(%rsp)
movq %rcx, 0x278(%rsp)
movq 0x290(%rsp), %rax
movq %rax, 0x28(%rsp)
callq 0xd0a0
movl $0x0, (%rax)
movq 0x280(%rsp), %rax
cmpq 0x278(%rsp), %rax
jbe 0xbd9dc
callq 0xd8c0
cmpl $0x0, %eax
jne 0xbd9d2
leaq 0x1d7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xdd50
movq 0x20(%rsp), %rdx
leaq 0x2acc5(%rip), %rsi     # 0xe8446
leaq 0x1d8(%rsp), %rdi
callq 0xfae0
jmp 0xbd790
leaq 0x1a0(%rsp), %rdi
movl $0xe16, %esi            # imm = 0xE16
callq 0x11600
jmp 0xbd7a4
leaq 0x1f8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x1a0(%rsp), %rdx
callq 0x11510
jmp 0xbd7c3
leaq 0x25a07(%rip), %rdx     # 0xe31d1
leaq 0x218(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0x114c0
jmp 0xbd7e1
leaq 0x15f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xdd50
movq 0x18(%rsp), %rdx
leaq 0x2b8fa(%rip), %rsi     # 0xe90f9
leaq 0x160(%rsp), %rdi
callq 0xfae0
jmp 0xbd80e
leaq 0x2618f(%rip), %rdx     # 0xe39a4
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x114c0
jmp 0xbd82c
leaq 0x238(%rsp), %rdi
leaq 0x218(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0x11510
jmp 0xbd84b
leaq 0x2b675(%rip), %rdx     # 0xe8ec7
leaq 0x258(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x114c0
jmp 0xbd869
leaq 0x258(%rsp), %rdi
callq 0x173d0
jmp 0xbd878
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd9c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd9b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd9a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd999
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd97f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd972
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd965
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbd958
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
leaq 0x258(%rsp), %rdi
callq 0xdf08
leaq 0x238(%rsp), %rdi
callq 0xdf08
leaq 0x180(%rsp), %rdi
callq 0xdf08
leaq 0x160(%rsp), %rdi
callq 0xdf08
leaq 0x15f(%rsp), %rdi
callq 0xd7a0
leaq 0x218(%rsp), %rdi
callq 0xdf08
leaq 0x1f8(%rsp), %rdi
callq 0xdf08
leaq 0x1a0(%rsp), %rdi
callq 0xdf08
leaq 0x1d8(%rsp), %rdi
callq 0xdf08
leaq 0x1d7(%rsp), %rdi
callq 0xd7a0
jmp 0xbdd44
movl $0x1, %edi
callq 0xd8e0
callq 0xd0a0
movq 0x28(%rsp), %rdi
movl $0x0, (%rax)
movq 0x278(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x28, %rdi
callq 0xd520
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jbe 0xbdc80
callq 0xd8c0
cmpl $0x0, %eax
jne 0xbdc76
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xdd50
movq 0x8(%rsp), %rdx
leaq 0x2aa07(%rip), %rsi     # 0xe8446
leaq 0xb8(%rsp), %rdi
callq 0xfae0
jmp 0xbda4e
leaq 0x90(%rsp), %rdi
movl $0xe17, %esi            # imm = 0xE17
callq 0x11600
jmp 0xbda62
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x11510
jmp 0xbda81
leaq 0x25749(%rip), %rdx     # 0xe31d1
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x114c0
jmp 0xbda9f
leaq 0x4f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xdd50
movq (%rsp), %rdx
leaq 0x2b641(%rip), %rsi     # 0xe90f9
leaq 0x50(%rsp), %rdi
callq 0xfae0
jmp 0xbdac4
leaq 0x25ed9(%rip), %rdx     # 0xe39a4
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x114c0
jmp 0xbdadc
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x11510
jmp 0xbdaf8
leaq 0x2b64c(%rip), %rdx     # 0xe914b
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x114c0
jmp 0xbdb16
leaq 0x138(%rsp), %rdi
callq 0x173d0
jmp 0xbdb25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0xbdc05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
leaq 0x138(%rsp), %rdi
callq 0xdf08
leaq 0x118(%rsp), %rdi
callq 0xdf08
leaq 0x70(%rsp), %rdi
callq 0xdf08
leaq 0x50(%rsp), %rdi
callq 0xdf08
leaq 0x4f(%rsp), %rdi
callq 0xd7a0
leaq 0xf8(%rsp), %rdi
callq 0xdf08
leaq 0xd8(%rsp), %rdi
callq 0xdf08
leaq 0x90(%rsp), %rdi
callq 0xdf08
leaq 0xb8(%rsp), %rdi
callq 0xdf08
leaq 0xb7(%rsp), %rdi
callq 0xd7a0
jmp 0xbdd44
movl $0x1, %edi
callq 0xd8e0
cmpq $0x0, 0x280(%rsp)
jne 0xbdcac
cmpq $0x0, 0x278(%rsp)
jne 0xbdcac
movq 0x28(%rsp), %rdi
addq $0x28, %rdi
callq 0xd520
movq %rax, 0x278(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x280(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x278(%rsp), %rax
jae 0xbdd36
movq 0x28(%rsp), %rdi
addq $0x28, %rdi
movq 0x38(%rsp), %rsi
callq 0xd7d0
movb (%rax), %al
movb %al, 0x37(%rsp)
movsbl 0x37(%rsp), %eax
cmpl $0x2d, %eax
je 0xbdd24
movq 0x288(%rsp), %rax
addq $0x8, %rax
movsbq 0x37(%rsp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movsbq 0x37(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
jmp 0xbdd26
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0xbdcc2
movsd 0x40(%rsp), %xmm0
addq $0x298, %rsp            # imm = 0x298
retq
movq 0x1c8(%rsp), %rdi
callq 0xdd40
nopw %cs:(%rax,%rax)