// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq %rdi, %r14
callq 0xb070
movl $0x0, (%rax)
movq 0x8(%r14), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x5fe8c
testq %rdx, %rdx
je 0x5fe73
movq $-0x1, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
movq (%rbx), %r10
movb (%r10,%rsi), %r9b
cmpq $-0x1, %rdi
je 0x5fd7e
cmpb $0x2d, %r9b
jne 0x5fd8f
movq %rdi, %r8
jmp 0x5fdb5
cmpb $0x2d, %r9b
movq $-0x1, %r8
cmoveq %rsi, %r8
jmp 0x5fdb5
movq (%r14), %r11
movq $-0x1, %r8
cmpb %r9b, (%r11,%rsi)
jne 0x5fdb5
cmpb (%r11,%rdi), %r9b
jne 0x5fdb5
movb (%r10,%rdi), %cl
movb %cl, (%r10,%rsi)
movb %r9b, (%r10,%rdi)
movb $0x1, %cl
jmp 0x5fd79
incq %rsi
movq %r8, %rdi
cmpq %rsi, %rdx
jne 0x5fd66
movq 0x8(%r14), %rdx
cmpq 0x8(%rbx), %rdx
movl $0x0, (%rax)
je 0x5fe75
callq 0xb6b0
testl %eax, %eax
jne 0x5ff24
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x37224(%rip), %rsi     # 0x97018
leaq 0x37233(%rip), %rdx     # 0x9702e
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0x1e4, %esi            # imm = 0x1E4
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x33393(%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 0x5ffaf
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x5ffbc
xorl %ecx, %ecx
andb $0x1, %cl
movl %ecx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb6b0
testl %eax, %eax
jne 0x5ff24
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3716c(%rip), %rsi     # 0x97018
leaq 0x3717b(%rip), %rdx     # 0x9702e
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0x1cc, %esi            # imm = 0x1CC
callq 0xe1b2
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe10a
leaq 0x332db(%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 0x5ff2e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x5ff3b
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 0x37dd1(%rip), %rsi     # 0x97d35
leaq 0x37e1a(%rip), %rdx     # 0x97d85
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x33935(%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 0x60029
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x60036
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 0x37d50(%rip), %rsi     # 0x97d35
leaq 0x37d99(%rip), %rdx     # 0x97d85
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x338b4(%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 0x60099
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x600a6
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 0x37708(%rip), %rsi     # 0x97773
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 0x60109
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x60116
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 0x37698(%rip), %rsi     # 0x97773
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 0x60137
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x60144
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 0x60169
jmp 0x60185
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x60188
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x60188
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x601b0
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x601b0
jmp 0x601ad
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x601ce
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x601ce
jmp 0x601cb
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x601ec
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x601ec
jmp 0x601e9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x6020a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x6020a
jmp 0x60207
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x60232
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x60232
jmp 0x6022f
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6025a
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x6025a
jmp 0x60257
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x6027e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x6027e
jmp 0x6027b
movq %rax, %rbx
movq %rbx, %rdi
callq 0xba60