// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b2e2
movsd 0x108(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x7b383
cmpb $0x0, 0x48(%r15)
je 0x7b424
cmpb $0x0, 0x48(%r14)
je 0x7b4c5
movq 0x30(%r15), %rax
cmpq 0x30(%r14), %rax
jne 0x7b566
testq %rax, %rax
je 0x7b2d0
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 0x7b2c8
cmpb $0x2d, %r8b
je 0x7b296
cmpb $0x2d, %dil
je 0x7b296
movsbq %r8b, %r9
movsbq %dil, %r10
shlq $0xa, %r9
addq %rbx, %r9
addsd (%r9,%r10,8), %xmm0
jmp 0x7b2c8
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 0x7b2c4
andb %r11b, %r9b
je 0x7b2c8
subsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x7b253
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb6b0
testl %eax, %eax
jne 0x7b607
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cd50(%rip), %rsi     # 0x98052
leaq 0x1cd59(%rip), %rdx     # 0x98062
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe2e, %esi            # imm = 0xE2E
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x17e85(%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 0x7b611
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7b61e
callq 0xb6b0
testl %eax, %eax
jne 0x7b607
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ccaf(%rip), %rsi     # 0x98052
leaq 0x1ccb8(%rip), %rdx     # 0x98062
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe2f, %esi            # imm = 0xE2F
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x17de4(%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 0x7b694
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7b6a1
callq 0xb6b0
testl %eax, %eax
jne 0x7b607
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cc0e(%rip), %rsi     # 0x98052
leaq 0x1cc17(%rip), %rdx     # 0x98062
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe30, %esi            # imm = 0xE30
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x17d43(%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 0x7b717
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7b724
callq 0xb6b0
testl %eax, %eax
jne 0x7b607
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cb6d(%rip), %rsi     # 0x98052
leaq 0x1cb76(%rip), %rdx     # 0x98062
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe31, %esi            # imm = 0xE31
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x17ca2(%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 0x7b79a
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7b7a7
callq 0xb6b0
testl %eax, %eax
jne 0x7b607
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cacc(%rip), %rsi     # 0x98052
leaq 0x1cad5(%rip), %rdx     # 0x98062
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0xe32, %esi            # imm = 0xE32
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x17c01(%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 0x7b81d
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
jmp 0x7b82a
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 0x1d6e5(%rip), %rsi     # 0x98d2c
leaq 0x1d73c(%rip), %rdx     # 0x98d8a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x18252(%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 0x7b8a0
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7b8ad
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 0x1d662(%rip), %rsi     # 0x98d2c
leaq 0x1d6b9(%rip), %rdx     # 0x98d8a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x181cf(%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 0x7b919
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7b926
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 0x1d5df(%rip), %rsi     # 0x98d2c
leaq 0x1d636(%rip), %rdx     # 0x98d8a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x1814c(%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 0x7b992
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7b99f
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 0x1d55c(%rip), %rsi     # 0x98d2c
leaq 0x1d5b3(%rip), %rdx     # 0x98d8a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x180c9(%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 0x7ba0b
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7ba18
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 0x1d4d9(%rip), %rsi     # 0x98d2c
leaq 0x1d530(%rip), %rdx     # 0x98d8a
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x18046(%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 0x7ba84
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x7ba91
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 0xe10a
leaq 0x1d4a9(%rip), %rsi     # 0x98d8b
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 0x7bafd
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bb0a
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 0xe10a
leaq 0x1d443(%rip), %rsi     # 0x98d9e
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 0x7bb2b
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bb38
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 0xe10a
leaq 0x1d6b6(%rip), %rsi     # 0x9908a
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 0x7bb59
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bb66
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 0xe10a
leaq 0x1d360(%rip), %rsi     # 0x98dad
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 0x7bb87
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bb94
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 0xe10a
leaq 0x1d2f5(%rip), %rsi     # 0x98dbb
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 0x7bbb5
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
jmp 0x7bbc2
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 0x1155a
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 0x1155a
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 0x1155a
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 0x1155a
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 0x1155a
jmp 0x7bbf3
jmp 0x7bc0f
jmp 0x7bbf3
jmp 0x7bc0f
jmp 0x7bbf3
jmp 0x7bc0f
jmp 0x7bbf3
jmp 0x7bc0f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7bc12
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bc12
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7bc40
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bc40
jmp 0x7bc3d
jmp 0x7bc3d
jmp 0x7bc3d
jmp 0x7bc3d
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x7bc64
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bc64
jmp 0x7bc61
jmp 0x7bc61
jmp 0x7bc61
jmp 0x7bc61
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x7bc88
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bc88
jmp 0x7bc85
jmp 0x7bc85
jmp 0x7bc85
jmp 0x7bc85
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7bcac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bcac
jmp 0x7bca9
jmp 0x7bca9
jmp 0x7bca9
jmp 0x7bca9
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7bcda
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bcda
jmp 0x7bcd7
jmp 0x7bcd7
jmp 0x7bcd7
jmp 0x7bcd7
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7bd08
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bd08
jmp 0x7bd05
jmp 0x7bd05
jmp 0x7bd05
jmp 0x7bd05
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x7bd32
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x7bd32
jmp 0x7bd2f
jmp 0x7bd2f
jmp 0x7bd2f
jmp 0x7bd2f
movq %rax, %rbx
movq %rbx, %rdi
callq 0xba60