// File: /workspace/github_cpp_makefile_star2_O1/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 0x5fea7
testq %rdx, %rdx
je 0x5fe7a
movq $-0x1, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
movq (%rbx), %r10
movb (%r10,%rsi), %r9b
cmpq $-0x1, %rdi
je 0x5fe36
cmpb $0x2d, %r9b
jne 0x5fe47
movq %rdi, %r8
jmp 0x5fe6d
cmpb $0x2d, %r9b
movq $-0x1, %r8
cmoveq %rsi, %r8
jmp 0x5fe6d
movq (%r14), %r11
movq $-0x1, %r8
cmpb %r9b, (%r11,%rsi)
jne 0x5fe6d
cmpb (%r11,%rdi), %r9b
jne 0x5fe6d
movb (%r10,%rdi), %cl
movb %cl, (%r10,%rsi)
movb %r9b, (%r10,%rdi)
movb $0x1, %cl
jmp 0x5fe31
incq %rsi
movq %r8, %rdi
cmpq %rsi, %rdx
jne 0x5fe1e
jmp 0x5fe7c
xorl %ecx, %ecx
movl $0x0, (%rax)
movq 0x8(%r14), %rax
cmpq 0x8(%rbx), %rax
jne 0x5ff46
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 0x5ffe5
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x37161(%rip), %rsi     # 0x97028
leaq 0x37170(%rip), %rdx     # 0x9703e
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0x1cc, %esi            # imm = 0x1CC
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x332c0(%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 0x5ffef
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x5fffc
callq 0xb6b0
testl %eax, %eax
jne 0x5ffe5
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x370c2(%rip), %rsi     # 0x97028
leaq 0x370d1(%rip), %rdx     # 0x9703e
leaq 0x88(%rsp), %rdi
callq 0xdc76
leaq 0xa8(%rsp), %rdi
movl $0x1e4, %esi            # imm = 0x1E4
callq 0xe1a8
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xe100
leaq 0x33221(%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 0x60070
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x6007d
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 0x37d20(%rip), %rsi     # 0x97d45
leaq 0x37d69(%rip), %rdx     # 0x97d95
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x33874(%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 0x600ea
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x600f7
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 0x37c9f(%rip), %rsi     # 0x97d45
leaq 0x37ce8(%rip), %rdx     # 0x97d95
leaq 0x68(%rsp), %rdi
callq 0xdc76
leaq 0x337f3(%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 0x6015a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x60167
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 0xe100
leaq 0x37657(%rip), %rsi     # 0x97783
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 0x601ca
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x601d7
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 0xe100
leaq 0x375e7(%rip), %rsi     # 0x97783
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 0x601f8
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x60205
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 0x1151b
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 0x1151b
jmp 0x6022a
jmp 0x60246
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x60249
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x60249
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x60271
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x60271
jmp 0x6026e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x6028f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x6028f
jmp 0x6028c
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x602ad
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x602ad
jmp 0x602aa
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x602cb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x602cb
jmp 0x602c8
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x602f3
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x602f3
jmp 0x602f0
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6031b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x6031b
jmp 0x60318
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x6033f
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xb5a0
jmp 0x6033f
jmp 0x6033c
movq %rax, %rbx
movq %rbx, %rdi
callq 0xba60
nop