// File: /workspace/github_cpp_makefile_star2_O2/ncbi[P]amr/alignment.cpp
// Function: Alignment_sp::(anonymous namespace)::normalizeSeq(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool normalizeSeq (const string &seq1,
                   string &seq2)
// Return: seq2 is changed
{
  ASSERT (seq1. size () == seq2. size ());
  
  bool changed = false;
  size_t start = no_index;
  // -AAA --> AAA-
  FFOR (size_t, i, seq1. size ())
    if (start == no_index)
    {
      if (seq2 [i] == '-')
        start = i;
    }
    else
      if (seq2 [i] != '-')
      {
        if (   seq1 [i] == seq2 [i]
            && seq2 [i] == seq1 [start]
           )
        {
          swap (seq2 [i], seq2 [start]);
          changed = true;
        }
        else
          start = no_index;
      }
  ASSERT (seq1. size () == seq2. size ());
  
  return changed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %rbx
movq %rdi, %r14
callq 0xc070
andl $0x0, (%rax)
movq 0x8(%r14), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x4172b
pushq $-0x1
popq %rsi
xorl %ecx, %ecx
movq %rsi, %r8
xorl %edi, %edi
cmpq %rdi, %rdx
je 0x41708
movq (%rbx), %r10
movb (%r10,%rdi), %r9b
cmpq $-0x1, %r8
je 0x416ce
cmpb $0x2d, %r9b
jne 0x416db
movq %r8, %r11
jmp 0x41700
cmpb $0x2d, %r9b
movq %rsi, %r11
cmoveq %rdi, %r11
jmp 0x41700
movq (%r14), %r15
cmpb %r9b, (%r15,%rdi)
jne 0x416fd
movq %rsi, %r11
cmpb (%r15,%r8), %r9b
jne 0x41700
movb (%r10,%r8), %cl
movb %cl, (%r10,%rdi)
movb %r9b, (%r10,%r8)
movb $0x1, %cl
jmp 0x416c9
movq %rsi, %r11
incq %rdi
movq %r11, %r8
jmp 0x416b1
andl $0x0, (%rax)
movq 0x8(%r14), %rax
cmpq 0x8(%rbx), %rax
jne 0x417ff
andb $0x1, %cl
movl %ecx, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %r15
retq
callq 0xc6d0
testl %eax, %eax
jne 0x418d3
leaq 0x208a9(%rip), %rsi     # 0x61fe8
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x50(%rsp), %rdi
movl $0x1cc, %esi            # imm = 0x1CC
callq 0xe2d5
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0xe26e
leaq 0x1ca56(%rip), %rdx     # 0x5e1d1
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xe24f
leaq 0x2156e(%rip), %rsi     # 0x62d05
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1d11f(%rip), %rdx     # 0x5e8cc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe24f
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xe26e
leaq 0x20f66(%rip), %rdx     # 0x62743
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xe24f
leaq 0xf0(%rsp), %rdi
callq 0x101d0
callq 0xc6d0
testl %eax, %eax
jne 0x418d3
leaq 0x207d5(%rip), %rsi     # 0x61fe8
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xdbbe
leaq 0x50(%rsp), %rdi
movl $0x1e4, %esi            # imm = 0x1E4
callq 0xe2d5
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0xe26e
leaq 0x1c982(%rip), %rdx     # 0x5e1d1
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xe24f
leaq 0x2149a(%rip), %rsi     # 0x62d05
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0xdbbe
leaq 0x1d04b(%rip), %rdx     # 0x5e8cc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe24f
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xe26e
leaq 0x20e92(%rip), %rdx     # 0x62743
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xe24f
leaq 0xf0(%rsp), %rdi
callq 0x101d0
pushq $0x1
popq %rdi
callq 0xc6f0
jmp 0x418df
jmp 0x418f1
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0xcbe8
jmp 0x418f4
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xcbe8
jmp 0x41908
jmp 0x41905
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xcbe8
jmp 0x41919
jmp 0x41916
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xcbe8
jmp 0x4192a
jmp 0x41927
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xcbe8
jmp 0x4193e
jmp 0x4193b
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xcbe8
jmp 0x41952
jmp 0x4194f
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xcbe8
jmp 0x41963
jmp 0x41960
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xcbe8
jmp 0x41974
jmp 0x41971
movq %rax, %rbx
movq %rbx, %rdi
callq 0xcaa0