// File: /workspace/github_cpp_makefile_star2_O2/ncbi[P]amr/alignment.cpp
// Function: Alignment_sp::Alignment::Alignment(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)
Alignment::Alignment (const string &line,
                      bool targetProt_arg,
                      bool refProt_arg)
: targetProt (targetProt_arg)
, refProt (refProt_arg)
, alProt (targetProt || refProt)
, al2ref_len    (alProt && ! refProt    ? 3 : 1)
, al2target_len (alProt && ! targetProt ? 3 : 1)
{
  try
  {
    istringstream iss (line);
    iss >> targetName >> refName >> targetStart >> targetEnd >> targetLen >> refStart >> refEnd >> refLen >> targetSeq >> refSeq;
    strUpper (targetSeq);
    strUpper (refSeq);
    
    QC_ASSERT (! refSeq. empty ());	
    QC_ASSERT (targetSeq. size () == refSeq. size ());    

    if (! targetProt && ! refProt)
    {
      QC_ASSERT (refStart != refEnd);
      const bool refStrand = refStart < refEnd;  
      if (! refStrand)
      {
        swap (refStart, refEnd);
      	reverseDna (targetSeq);
      	reverseDna (refSeq);
      	toggle (targetStrand);
      }
    }

    if (! targetProt && refProt)
    {
	    QC_ASSERT (targetStart != targetEnd);
	    targetStrand = targetStart < targetEnd;  
	    if (! targetStrand)
	      swap (targetStart, targetEnd);
	  }
    
    QC_ASSERT (refStart >= 1);
    QC_ASSERT (targetStart >= 1);
    refStart--;
    targetStart--;

    if (refProt)
    {
      if (   refEnd == refLen 
          && refSeq. back () == '*'
         )
      {
        targetStopCodon = toEbool (targetSeq. back () == '*');
        if (targetStopCodon == etrue)
        {
          nident--;        
        //if (targetProt)
          //targetLen -= al2target_len;
        }
        do
        {
          // Target
          targetSeq. erase (targetSeq. size () - 1);
          if (targetStrand)
            targetEnd -= al2target_len;
          else
            targetStart += al2target_len;
          // Reference
          refSeq. erase (refSeq. size () - 1);
          refEnd--;
          QC_ASSERT (! refSeq. empty ());
        }
        while (targetSeq. back () != refSeq. back ());
      //seqChanges ??
      }
      else if (   refEnd == refLen - 1 
               && targetTail (false) >= al2target_len
              )
        targetStopCodon = efalse;
      refLen--;
    }

    normalizeSeqs (targetSeq, refSeq);    
    set_nident ();
  }
  catch (...)
  {
  	cout << line << endl;
  	throw;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, %rbx
leaq 0x46de1(%rip), %rax     # 0x88778
movq %rax, (%rdi)
movb %dl, 0x8(%rdi)
leaq 0x20(%rdi), %rax
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
xorl %eax, %eax
movb %al, 0x20(%rdi)
leaq 0x40(%rdi), %rdx
movq %rdx, 0x30(%rdi)
andq $0x0, 0x38(%rdi)
movq %rsi, %r12
movb %al, 0x40(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rdi)
andq $0x0, 0x60(%rdi)
movb $0x1, 0x68(%rdi)
movl $0x2, 0x6c(%rdi)
movb %cl, 0x70(%rdi)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x78(%rdi)
andq $0x0, 0x80(%rdi)
leaq 0x10(%rdi), %r14
leaq 0x30(%rdi), %rcx
movq %rcx, 0x10(%rsp)
movb %al, 0x88(%rdi)
leaq 0xa8(%rdi), %rcx
movq %rcx, 0x98(%rdi)
andq $0x0, 0xa0(%rdi)
leaq 0x78(%rdi), %r15
leaq 0x98(%rdi), %rcx
movq %rcx, 0x18(%rsp)
movb %al, 0xa8(%rdi)
addq $0xd0, %rdi
movups %xmm0, 0xb8(%rbx)
andq $0x0, 0xc8(%rbx)
movq %rdi, 0x128(%rsp)
callq 0x45dfc
movzbl 0x8(%rbx), %eax
movl 0x70(%rbx), %ecx
testl %eax, %eax
pushq $0x1
popq %rdx
cmovel %ecx, %edx
movb %dl, 0x1f8(%rbx)
andq $0x0, 0x200(%rbx)
notb %cl
movzbl %cl, %ecx
andl $0x1, %ecx
leaq 0x1(,%rcx,2), %rcx
xorl $0x1, %eax
addl %eax, %eax
pushq $0x1
popq %rsi
orq %rsi, %rax
testb $0x1, %dl
cmoveq %rsi, %rcx
cmoveq %rsi, %rax
movq %rcx, 0x208(%rbx)
movq %rax, 0x210(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x218(%rbx)
movups %xmm0, 0x221(%rbx)
leaq 0x148(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r12, 0x140(%rsp)
movq %r12, %rsi
movq %r15, 0x130(%rsp)
movq %r14, 0x138(%rsp)
callq 0xca10
leaq 0x148(%rsp), %rdi
movq %r14, %rsi
callq 0xc760
movq %rax, %rdi
movq %r15, %rsi
callq 0xc760
leaq 0x50(%rbx), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0xc370
leaq 0x58(%rbx), %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc370
leaq 0x60(%rbx), %rsi
movq %rax, %rdi
callq 0xc370
leaq 0xb8(%rbx), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0xc370
leaq 0xc0(%rbx), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0xc370
leaq 0xc8(%rbx), %rsi
movq %rax, %rdi
movq %rsi, 0x120(%rsp)
callq 0xc370
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0xc760
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0xc760
movq 0x10(%rsp), %rdi
callq 0x11beb
movq 0x18(%rsp), %rdi
callq 0x11beb
callq 0xc070
movq %rax, %r15
andl $0x0, (%rax)
movq 0xa0(%rbx), %rax
testq %rax, %rax
je 0x41e67
cmpq %rax, 0x38(%rbx)
jne 0x41f41
movb 0x8(%rbx), %al
testb %al, %al
jne 0x41bf2
cmpb $0x0, 0x70(%rbx)
jne 0x41bf2
movq (%r14), %rcx
movq (%r13), %rdx
cmpq %rdx, %rcx
je 0x421cf
jb 0x41bf2
movq %rdx, (%r14)
movq %rcx, (%r13)
movq 0x10(%rsp), %rdi
callq 0x42524
movq 0x18(%rsp), %rdi
callq 0x42524
xorb $0x1, 0x68(%rbx)
movb 0x8(%rbx), %al
testb $0x1, %al
jne 0x41c1f
cmpb $0x1, 0x70(%rbx)
jne 0x41c1f
andl $0x0, (%r15)
movq (%r12), %rax
movq (%rbp), %rcx
cmpq %rcx, %rax
je 0x422a9
setb 0x68(%rbx)
jb 0x41c1f
movq %rcx, (%r12)
movq %rax, (%rbp)
andl $0x0, (%r15)
movq (%r14), %rax
testq %rax, %rax
je 0x4201b
movq (%r12), %rcx
testq %rcx, %rcx
je 0x420f5
decq %rax
movq %rax, 0xb8(%rbx)
decq %rcx
movq %rcx, 0x50(%rbx)
cmpb $0x1, 0x70(%rbx)
jne 0x41d57
movq (%r13), %rdx
movq 0x120(%rsp), %r8
movq (%r8), %rax
cmpq %rax, %rdx
jne 0x41d2f
movq 0x98(%rbx), %rsi
movq 0xa0(%rbx), %rdi
cmpb $0x2a, -0x1(%rsi,%rdi)
jne 0x41d2f
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rsi
xorl %ecx, %ecx
cmpb $0x2a, -0x1(%rax,%rsi)
sete %cl
movl %ecx, 0x6c(%rbx)
jne 0x41ca6
decq 0x200(%rbx)
pushq $-0x1
popq %r14
movq 0x10(%rsp), %r13
decq %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0xc120
movq 0x210(%rbx), %rax
cmpb $0x1, 0x68(%rbx)
jne 0x41cd0
subq %rax, (%rbp)
jmp 0x41cd4
addq %rax, (%r12)
movq 0xa0(%rbx), %rsi
decq %rsi
movq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0xc120
decq 0xc0(%rbx)
andl $0x0, (%r15)
movq 0xa0(%rbx), %rax
testq %rax, %rax
je 0x41d8d
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rsi
movb -0x1(%rcx,%rsi), %cl
movq 0x98(%rbx), %rdx
cmpb -0x1(%rdx,%rax), %cl
jne 0x41caf
movq 0x120(%rsp), %r8
movq (%r8), %rax
decq %rax
jmp 0x41d54
decq %rax
cmpq %rax, %rdx
jne 0x41d54
movq 0x60(%rbx), %rdx
subq 0x58(%rbx), %rdx
cmpb $0x0, 0x68(%rbx)
cmoveq %rcx, %rdx
cmpq 0x210(%rbx), %rdx
jb 0x41d54
andl $0x0, 0x6c(%rbx)
movq %rax, (%r8)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x41381
movq %rbx, %rdi
callq 0x425cc
leaq 0x148(%rsp), %rdi
callq 0xc2e0
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x20247(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x28b, %esi            # imm = 0x28B
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1c3ee(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x20963(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1cab7(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x2095c(%rip), %rdx     # 0x627a1
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x2016d(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x256, %esi            # imm = 0x256
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1c314(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x20889(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1c9dd(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x20882(%rip), %rdx     # 0x627a1
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x20093(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x257, %esi            # imm = 0x257
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1c23a(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x207af(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1c903(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x207bb(%rip), %rdx     # 0x627b4
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x1ffb9(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x26e, %esi            # imm = 0x26E
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1c160(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x206d5(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1c829(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x20733(%rip), %rdx     # 0x62806
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x1fedf(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x26f, %esi            # imm = 0x26F
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1c086(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x205fb(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1c74f(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x20667(%rip), %rdx     # 0x62814
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x1fe05(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x25b, %esi            # imm = 0x25B
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1bfac(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x20521(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1c675(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x20553(%rip), %rdx     # 0x627da
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x42383
leaq 0x1fd2b(%rip), %rsi     # 0x61fe8
leaq 0x80(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x60(%rsp), %rdi
movl $0x268, %esi            # imm = 0x268
callq 0xe2d5
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xe26e
leaq 0x1bed2(%rip), %rdx     # 0x5e1d1
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe24f
leaq 0x20447(%rip), %rsi     # 0x62762
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1c59b(%rip), %rdx     # 0x5e8cc
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe24f
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xe26e
leaq 0x2048c(%rip), %rdx     # 0x627ed
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe24f
leaq 0x100(%rsp), %rdi
callq 0x101d0
pushq $0x1
popq %rdi
callq 0xc6f0
jmp 0x423b7
jmp 0x423c9
jmp 0x423b7
jmp 0x423c9
jmp 0x423e7
jmp 0x423e7
jmp 0x423b7
jmp 0x423c9
jmp 0x423b7
jmp 0x423c9
jmp 0x42402
jmp 0x42402
jmp 0x423b7
jmp 0x423c9
jmp 0x423b7
jmp 0x423c9
jmp 0x423e7
jmp 0x423e7
jmp 0x4241d
jmp 0x4241d
jmp 0x423e7
jmp 0x423e7
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0xcbe8
jmp 0x423cc
movq %rax, %r14
leaq 0xe0(%rsp), %rdi
callq 0xcbe8
jmp 0x423ea
jmp 0x42402
jmp 0x42402
jmp 0x4243b
jmp 0x4243b
jmp 0x42402
jmp 0x42402
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0xcbe8
jmp 0x42405
jmp 0x4241d
jmp 0x4241d
jmp 0x42455
jmp 0x42455
jmp 0x4241d
jmp 0x4241d
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0xcbe8
jmp 0x42420
jmp 0x4243b
jmp 0x4243b
jmp 0x4246e
jmp 0x4246e
jmp 0x4243b
jmp 0x4243b
movq %rax, %r14
leaq 0xc0(%rsp), %rdi
callq 0xcbe8
jmp 0x4243e
jmp 0x42455
jmp 0x42455
jmp 0x42489
jmp 0x42489
jmp 0x42455
jmp 0x42455
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0xcbe8
jmp 0x42458
jmp 0x4246e
jmp 0x4246e
jmp 0x4246e
jmp 0x4246e
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0xcbe8
jmp 0x42471
jmp 0x42489
jmp 0x42489
jmp 0x42489
jmp 0x42489
jmp 0x42489
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0xcbe8
jmp 0x4248c
jmp 0x42489
movq %rax, %r14
jmp 0x42499
jmp 0x42489
movq %rax, %r14
leaq 0x148(%rsp), %rdi
callq 0xc2e0
addq $0x218, %rbx            # imm = 0x218
movq %r14, %rdi
callq 0xc290
movq 0x46ae1(%rip), %rdi     # 0x88f90
movq 0x140(%rsp), %rsi
callq 0xc540
movq %rax, %rdi
callq 0xc300
callq 0xc880
movq %rax, %r14
callq 0xc9c0
movq %rbx, %rdi
callq 0x45eda
movq 0x128(%rsp), %rdi
callq 0xe3be
movq 0x18(%rsp), %rdi
callq 0xcbe8
movq 0x130(%rsp), %rdi
callq 0xcbe8
movq 0x10(%rsp), %rdi
callq 0xcbe8
movq 0x138(%rsp), %rdi
callq 0xcbe8
movq %r14, %rdi
callq 0xcaa0
movq %rax, %rdi
callq 0xdf79