// File: ncbi[P]amr/alignment.cpp
// Function: Alignment_sp::SeqChange::matchesMutation(Alignment_sp::AmrMutation const&) const
bool SeqChange::matchesMutation (const AmrMutation& mut) const
{ 
  if (empty ())
    return false;
    
  if (   mut. pos_real        < start_ref
      || mut. getStop () > stop_ref
     )
    return false;
    
  const size_t head = mut. pos_real - start_ref;
  const size_t tail = stop_ref - mut. getStop ();
  ASSERT (head + mut. reference. size () + tail == reference. size ());
  const string ref_seg (reference. substr (head, mut. reference. size ()));
  if (ref_seg != mut. reference)
    throw runtime_error ("Reference sequence has " + strQuote (ref_seg) + ", but mutation is: " + mut. geneMutation_std);
  
  // PD-3267 
  // ??
  if (head + mut. allele. size () + tail != allele. size ())
    return false;   
  return allele. substr (head, mut. allele. size ()) == mut. allele;
}

// Assembly:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x268(%rsp)
movq %rsi, 0x260(%rsp)
movq 0x268(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xa3c00
testb $0x1, %al
jne 0x985cf
jmp 0x985dc
movb $0x0, 0x277(%rsp)
jmp 0x98c4c
movq 0x60(%rsp), %rcx
movq 0x260(%rsp), %rax
movq 0x8(%rax), %rax
cmpq 0x68(%rcx), %rax
jb 0x9860b
movq 0x260(%rsp), %rdi
callq 0xa41e0
movq 0x60(%rsp), %rcx
cmpq 0x70(%rcx), %rax
jbe 0x98618
movb $0x0, 0x277(%rsp)
jmp 0x98c4c
movq 0x60(%rsp), %rax
movq 0x260(%rsp), %rcx
movq 0x8(%rcx), %rcx
subq 0x68(%rax), %rcx
movq %rcx, 0x258(%rsp)
movq 0x70(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x260(%rsp), %rdi
callq 0xa41e0
movq %rax, %rcx
movq 0x48(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x250(%rsp)
callq 0xd0a0
movl $0x0, (%rax)
movq 0x258(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x260(%rsp), %rdi
addq $0x30, %rdi
callq 0xd520
movq 0x60(%rsp), %rdi
movq %rax, %rcx
movq 0x50(%rsp), %rax
addq %rcx, %rax
addq 0x250(%rsp), %rax
movq %rax, 0x58(%rsp)
addq $0x28, %rdi
callq 0xd520
movq %rax, %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
je 0x98945
callq 0xd8c0
cmpl $0x0, %eax
jne 0x9893b
leaq 0x1af(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xdd50
movq 0x40(%rsp), %rdx
leaq 0x4ea86(%rip), %rsi     # 0xe7170
leaq 0x1b0(%rsp), %rdi
callq 0xfae0
jmp 0x986f9
leaq 0x178(%rsp), %rdi
movl $0x1b4, %esi            # imm = 0x1B4
callq 0x11600
jmp 0x9870d
leaq 0x1d0(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
leaq 0x178(%rsp), %rdx
callq 0x11510
jmp 0x9872c
leaq 0x4aa9e(%rip), %rdx     # 0xe31d1
leaq 0x1f0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x114c0
jmp 0x9874a
leaq 0x137(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xdd50
movq 0x38(%rsp), %rdx
leaq 0x4f07d(%rip), %rsi     # 0xe77e5
leaq 0x138(%rsp), %rdi
callq 0xfae0
jmp 0x98777
leaq 0x4b226(%rip), %rdx     # 0xe39a4
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x114c0
jmp 0x98795
leaq 0x210(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
leaq 0x158(%rsp), %rdx
callq 0x11510
jmp 0x987b4
leaq 0x4f073(%rip), %rdx     # 0xe782e
leaq 0x230(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x114c0
jmp 0x987d2
leaq 0x230(%rsp), %rdi
callq 0x173d0
jmp 0x987e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98929
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x9891c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x9890f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x988e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x988db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x988ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x988c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
leaq 0x230(%rsp), %rdi
callq 0xdf08
leaq 0x210(%rsp), %rdi
callq 0xdf08
leaq 0x158(%rsp), %rdi
callq 0xdf08
leaq 0x138(%rsp), %rdi
callq 0xdf08
leaq 0x137(%rsp), %rdi
callq 0xd7a0
leaq 0x1f0(%rsp), %rdi
callq 0xdf08
leaq 0x1d0(%rsp), %rdi
callq 0xdf08
leaq 0x178(%rsp), %rdi
callq 0xdf08
leaq 0x1b0(%rsp), %rdi
callq 0xdf08
leaq 0x1af(%rsp), %rdi
callq 0xd7a0
jmp 0x98c5d
movl $0x1, %edi
callq 0xd8e0
movq 0x60(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x28(%rsp)
movq 0x258(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x260(%rsp), %rdi
addq $0x30, %rdi
callq 0xd520
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rax, %rcx
leaq 0x110(%rsp), %rdi
callq 0xd740
movq 0x260(%rsp), %rsi
addq $0x30, %rsi
leaq 0x110(%rsp), %rdi
callq 0x4cd50
testb $0x1, %al
jne 0x989ad
jmp 0x98b36
movb $0x1, 0x8f(%rsp)
movl $0x10, %edi
callq 0xd3b0
movq %rax, 0x20(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x110(%rsp), %rsi
movl $0x22, %edx
callq 0x1af10
jmp 0x989e0
leaq 0x4ee83(%rip), %rsi     # 0xe786a
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x12260
jmp 0x989fe
leaq 0x4ee7d(%rip), %rdx     # 0xe7882
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x114c0
jmp 0x98a1c
movq 0x260(%rsp), %rdx
addq $0x10, %rdx
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x12210
jmp 0x98a3f
movq 0x20(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0xdbf0
jmp 0x98a53
movq 0x20(%rsp), %rdi
movb $0x0, 0x8f(%rsp)
movq 0x87589(%rip), %rsi     # 0x11fff0
movq 0x87502(%rip), %rdx     # 0x11ff70
callq 0xdcd0
jmp 0x98c6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98b1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98b0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98b01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98af4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xdf08
leaq 0xd0(%rsp), %rdi
callq 0xdf08
leaq 0xb0(%rsp), %rdi
callq 0xdf08
leaq 0x90(%rsp), %rdi
callq 0xdf08
testb $0x1, 0x8f(%rsp)
jne 0x98b27
jmp 0x98b31
movq 0x20(%rsp), %rdi
callq 0xd570
jmp 0x98c3d
movq 0x258(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x260(%rsp), %rdi
addq $0x50, %rdi
callq 0xd520
movq 0x60(%rsp), %rdi
movq %rax, %rcx
movq 0x10(%rsp), %rax
addq %rcx, %rax
addq 0x250(%rsp), %rax
movq %rax, 0x18(%rsp)
addq $0x48, %rdi
callq 0xd520
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
je 0x98b9f
movb $0x0, 0x277(%rsp)
movl $0x1, 0x88(%rsp)
jmp 0x98c2e
movq 0x60(%rsp), %rax
addq $0x48, %rax
movq %rax, (%rsp)
movq 0x258(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x260(%rsp), %rdi
addq $0x50, %rdi
callq 0xd520
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rax, %rcx
leaq 0x68(%rsp), %rdi
callq 0xd740
jmp 0x98be2
movq 0x260(%rsp), %rsi
addq $0x50, %rsi
leaq 0x68(%rsp), %rdi
callq 0x4c8a0
andb $0x1, %al
movb %al, 0x277(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xdf08
movl $0x1, 0x88(%rsp)
jmp 0x98c2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x98c3d
leaq 0x110(%rsp), %rdi
callq 0xdf08
jmp 0x98c4c
leaq 0x110(%rsp), %rdi
callq 0xdf08
jmp 0x98c5d
movb 0x277(%rsp), %al
andb $0x1, %al
addq $0x278, %rsp            # imm = 0x278
retq
movq 0x1a0(%rsp), %rdi
callq 0xdd40
nopw (%rax,%rax)