// File: /workspace/github_cpp_makefile_star2_O1/ncbi[P]amr/seq.cpp
// Function: Seq_sp::Peptide::getSimilarity(Seq_sp::Peptide const&, Seq_sp::SubstMat const&, double, double) const
double Peptide::getSimilarity (const Peptide &other,
                               const SubstMat &mat,
                               double gapOpenCost,
                               double gapCost) const
{
  ASSERT (gapOpenCost >= 0.0);
  ASSERT (gapCost >= 0.0);
  ASSERT (sparse);
  ASSERT (other. sparse);
  ASSERT (seq. size () == other. seq. size ());
  
  double s = 0.0;
  char c1_prev = '\0';
  char c2_prev = '\0';
  FFOR (size_t, i, seq. size ())
  {
    const char c1 =        seq [i];
    const char c2 = other. seq [i];
    if (   c1 == '-' 
        && c2 == '-'
       )
      ;
    else if (   c1 == '-' 
             || c2 == '-'
            )
    {
      s -= gapCost;
      if (   (c1 == '-' && c1_prev != '-')
          || (c2 == '-' && c2_prev != '-')
         )
        s -= gapOpenCost;
    }
    else
      s += mat. sim [(size_t) c1] [(size_t) c2];
    c1_prev = c1;
    c2_prev = c2;
  }

  return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movsd %xmm1, 0x108(%rsp)
movsd %xmm0, 0x110(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0xb070
movsd 0x110(%rsp), %xmm2
movl $0x0, (%rax)
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jb 0x7b6b4
movl $0x0, (%rax)
movsd 0x108(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x7b755
movl $0x0, (%rax)
cmpb $0x0, 0x48(%r15)
je 0x7b7f6
movl $0x0, (%rax)
cmpb $0x0, 0x48(%r14)
je 0x7b897
movl $0x0, (%rax)
movq 0x30(%r15), %rax
cmpq 0x30(%r14), %rax
jne 0x7b938
testq %rax, %rax
je 0x7b6a2
movq 0x28(%r15), %rcx
movq 0x28(%r14), %rdx
addq $0x8, %rbx
xorl %esi, %esi
xorl %edi, %edi
xorl %r8d, %r8d
movl %r8d, %r10d
movl %edi, %r9d
movb (%rcx,%rsi), %r8b
movb (%rdx,%rsi), %dil
movl %r8d, %r11d
xorb $0x2d, %r11b
movl %edi, %ebp
xorb $0x2d, %bpl
orb %r11b, %bpl
je 0x7b69a
cmpb $0x2d, %r8b
je 0x7b668
cmpb $0x2d, %dil
je 0x7b668
movsbq %r8b, %r9
movsbq %dil, %r10
shlq $0xa, %r9
addq %rbx, %r9
addsd (%r9,%r10,8), %xmm0
jmp 0x7b69a
cmpb $0x2d, %dil
sete %r11b
cmpb $0x2d, %r8b
sete %bpl
subsd %xmm1, %xmm0
cmpb $0x2d, %r10b
setne %r10b
cmpb $0x2d, %r9b
setne %r9b
testb %bpl, %r10b
jne 0x7b696
andb %r11b, %r9b
je 0x7b69a
subsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x7b625
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb6b0
testl %eax, %eax
jne 0x7b9d9
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c98e(%rip), %rsi     # 0x98062
leaq 0x1c997(%rip), %rdx     # 0x98072
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe2e, %esi            # imm = 0xE2E
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x17ab3(%rip), %rsi     # 0x931d1
leaq 0xc8(%rsp), %rdi
callq 0xbb10
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7b9e3
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7b9f0
callq 0xb6b0
testl %eax, %eax
jne 0x7b9d9
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c8ed(%rip), %rsi     # 0x98062
leaq 0x1c8f6(%rip), %rdx     # 0x98072
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe2f, %esi            # imm = 0xE2F
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x17a12(%rip), %rsi     # 0x931d1
leaq 0xc8(%rsp), %rdi
callq 0xbb10
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7ba66
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7ba73
callq 0xb6b0
testl %eax, %eax
jne 0x7b9d9
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c84c(%rip), %rsi     # 0x98062
leaq 0x1c855(%rip), %rdx     # 0x98072
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe30, %esi            # imm = 0xE30
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x17971(%rip), %rsi     # 0x931d1
leaq 0xc8(%rsp), %rdi
callq 0xbb10
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bae9
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7baf6
callq 0xb6b0
testl %eax, %eax
jne 0x7b9d9
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c7ab(%rip), %rsi     # 0x98062
leaq 0x1c7b4(%rip), %rdx     # 0x98072
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe31, %esi            # imm = 0xE31
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x178d0(%rip), %rsi     # 0x931d1
leaq 0xc8(%rsp), %rdi
callq 0xbb10
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bb6c
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7bb79
callq 0xb6b0
testl %eax, %eax
jne 0x7b9d9
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c70a(%rip), %rsi     # 0x98062
leaq 0x1c713(%rip), %rdx     # 0x98072
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe32, %esi            # imm = 0xE32
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x1782f(%rip), %rsi     # 0x931d1
leaq 0xc8(%rsp), %rdi
callq 0xbb10
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bbef
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7bbfc
movl $0x1, %edi
callq 0xb6d0
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d323(%rip), %rsi     # 0x98d3c
leaq 0x1d37a(%rip), %rdx     # 0x98d9a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x17e80(%rip), %rsi     # 0x938b1
leaq 0x68(%rsp), %rdi
callq 0xbb10
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bc72
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7bc7f
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d2a0(%rip), %rsi     # 0x98d3c
leaq 0x1d2f7(%rip), %rdx     # 0x98d9a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x17dfd(%rip), %rsi     # 0x938b1
leaq 0x68(%rsp), %rdi
callq 0xbb10
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bceb
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7bcf8
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d21d(%rip), %rsi     # 0x98d3c
leaq 0x1d274(%rip), %rdx     # 0x98d9a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x17d7a(%rip), %rsi     # 0x938b1
leaq 0x68(%rsp), %rdi
callq 0xbb10
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bd64
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7bd71
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d19a(%rip), %rsi     # 0x98d3c
leaq 0x1d1f1(%rip), %rdx     # 0x98d9a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x17cf7(%rip), %rsi     # 0x938b1
leaq 0x68(%rsp), %rdi
callq 0xbb10
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bddd
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7bdea
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d117(%rip), %rsi     # 0x98d3c
leaq 0x1d16e(%rip), %rdx     # 0x98d9a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x17c74(%rip), %rsi     # 0x938b1
leaq 0x68(%rsp), %rdi
callq 0xbb10
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7be56
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7be63
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe100
leaq 0x1d0e7(%rip), %rsi     # 0x98d9b
leaq 0xe8(%rsp), %rdi
callq 0xbb10
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7becf
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bedc
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe100
leaq 0x1d081(%rip), %rsi     # 0x98dae
leaq 0xe8(%rsp), %rdi
callq 0xbb10
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7befd
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bf0a
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe100
leaq 0x1d2f4(%rip), %rsi     # 0x9909a
leaq 0xe8(%rsp), %rdi
callq 0xbb10
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bf2b
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bf38
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe100
leaq 0x1cf9e(%rip), %rsi     # 0x98dbd
leaq 0xe8(%rsp), %rdi
callq 0xbb10
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bf59
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bf66
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe100
leaq 0x1cf33(%rip), %rsi     # 0x98dcb
leaq 0xe8(%rsp), %rdi
callq 0xbb10
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7bf87
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bf94
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x1151b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x1151b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x1151b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x1151b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x1151b
jmp 0x7bfc5
jmp 0x7bfe1
jmp 0x7bfc5
jmp 0x7bfe1
jmp 0x7bfc5
jmp 0x7bfe1
jmp 0x7bfc5
jmp 0x7bfe1
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7bfe4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bfe4
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7c012
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c012
jmp 0x7c00f
jmp 0x7c00f
jmp 0x7c00f
jmp 0x7c00f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x7c036
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c036
jmp 0x7c033
jmp 0x7c033
jmp 0x7c033
jmp 0x7c033
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x7c05a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c05a
jmp 0x7c057
jmp 0x7c057
jmp 0x7c057
jmp 0x7c057
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7c07e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c07e
jmp 0x7c07b
jmp 0x7c07b
jmp 0x7c07b
jmp 0x7c07b
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7c0ac
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c0ac
jmp 0x7c0a9
jmp 0x7c0a9
jmp 0x7c0a9
jmp 0x7c0a9
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7c0da
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c0da
jmp 0x7c0d7
jmp 0x7c0d7
jmp 0x7c0d7
jmp 0x7c0d7
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x7c104
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7c104
jmp 0x7c101
jmp 0x7c101
jmp 0x7c101
jmp 0x7c101
movq %rax, %rbx
movq %rbx, %rdi
callq 0xba60