// File: 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:
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x290(%rsp)
movq %rsi, 0x288(%rsp)
callq 0xd0a0
movl $0x0, (%rax)
movq 0x290(%rsp), %rdi
callq 0xd520
movq %rax, 0x38(%rsp)
movq 0x288(%rsp), %rdi
callq 0xd520
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
je 0x995d9
callq 0xd8c0
cmpl $0x0, %eax
jne 0x995cf
leaq 0x1e7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xdd50
movq 0x30(%rsp), %rdx
leaq 0x4ddf2(%rip), %rsi     # 0xe7170
leaq 0x1e8(%rsp), %rdi
callq 0xfae0
jmp 0x9938d
leaq 0x1b0(%rsp), %rdi
movl $0x1cc, %esi            # imm = 0x1CC
callq 0x11600
jmp 0x993a1
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
callq 0x11510
jmp 0x993c0
leaq 0x49e0a(%rip), %rdx     # 0xe31d1
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x114c0
jmp 0x993de
leaq 0x16f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xdd50
movq 0x28(%rsp), %rdx
leaq 0x4ea91(%rip), %rsi     # 0xe7e8d
leaq 0x170(%rsp), %rdi
callq 0xfae0
jmp 0x9940b
leaq 0x4a592(%rip), %rdx     # 0xe39a4
leaq 0x190(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x114c0
jmp 0x99429
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x11510
jmp 0x99448
leaq 0x4e47c(%rip), %rdx     # 0xe78cb
leaq 0x268(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x114c0
jmp 0x99466
leaq 0x268(%rsp), %rdi
callq 0x173d0
jmp 0x99475
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x995bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x995b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x995a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x99596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x9957c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x9956f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x99562
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x99555
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x268(%rsp), %rdi
callq 0xdf08
leaq 0x248(%rsp), %rdi
callq 0xdf08
leaq 0x190(%rsp), %rdi
callq 0xdf08
leaq 0x170(%rsp), %rdi
callq 0xdf08
leaq 0x16f(%rsp), %rdi
callq 0xd7a0
leaq 0x228(%rsp), %rdi
callq 0xdf08
leaq 0x208(%rsp), %rdi
callq 0xdf08
leaq 0x1b0(%rsp), %rdi
callq 0xdf08
leaq 0x1e8(%rsp), %rdi
callq 0xdf08
leaq 0x1e7(%rsp), %rdi
callq 0xd7a0
jmp 0x99a2b
movl $0x1, %edi
callq 0xd8e0
movb $0x0, 0x16e(%rsp)
movq $-0x1, 0x160(%rsp)
movq $0x0, 0x158(%rsp)
movq 0x290(%rsp), %rdi
callq 0xd520
movq %rax, 0x150(%rsp)
movq 0x158(%rsp), %rax
cmpq 0x150(%rsp), %rax
jae 0x99775
cmpq $-0x1, 0x160(%rsp)
jne 0x99661
movq 0x288(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0xdec0
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x9965c
movq 0x158(%rsp), %rax
movq %rax, 0x160(%rsp)
jmp 0x9975a
movq 0x288(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0xdec0
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x99758
movq 0x290(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0xd7d0
movsbl (%rax), %eax
movl %eax, 0x24(%rsp)
movq 0x288(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0xdec0
movq %rax, %rcx
movl 0x24(%rsp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x9974a
movq 0x288(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0xdec0
movsbl (%rax), %eax
movl %eax, 0x20(%rsp)
movq 0x290(%rsp), %rdi
movq 0x160(%rsp), %rsi
callq 0xd7d0
movq %rax, %rcx
movl 0x20(%rsp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x9974a
movq 0x288(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0xdec0
movq %rax, 0x18(%rsp)
movq 0x288(%rsp), %rdi
movq 0x160(%rsp), %rsi
callq 0xdec0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x4cd80
movb $0x1, 0x16e(%rsp)
jmp 0x99756
movq $-0x1, 0x160(%rsp)
jmp 0x99758
jmp 0x9975a
jmp 0x9975c
movq 0x158(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x158(%rsp)
jmp 0x9960e
callq 0xd0a0
movl $0x0, (%rax)
movq 0x290(%rsp), %rdi
callq 0xd520
movq %rax, 0x10(%rsp)
movq 0x288(%rsp), %rdi
callq 0xd520
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
je 0x99a1a
callq 0xd8c0
cmpl $0x0, %eax
jne 0x99a10
leaq 0xaf(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xdd50
movq 0x8(%rsp), %rdx
leaq 0x4d994(%rip), %rsi     # 0xe7170
leaq 0xb0(%rsp), %rdi
callq 0xfae0
jmp 0x997eb
leaq 0x88(%rsp), %rdi
movl $0x1e4, %esi            # imm = 0x1E4
callq 0x11600
jmp 0x997ff
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x11510
jmp 0x9981e
leaq 0x499ac(%rip), %rdx     # 0xe31d1
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x114c0
jmp 0x9983c
leaq 0x47(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xdd50
movq (%rsp), %rdx
leaq 0x4e638(%rip), %rsi     # 0xe7e8d
leaq 0x48(%rsp), %rdi
callq 0xfae0
jmp 0x99861
leaq 0x4a13c(%rip), %rdx     # 0xe39a4
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x114c0
jmp 0x99879
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x11510
jmp 0x99895
leaq 0x4e02f(%rip), %rdx     # 0xe78cb
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x114c0
jmp 0x998b3
leaq 0x130(%rsp), %rdi
callq 0x173d0
jmp 0x998c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x99a01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x999a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x130(%rsp), %rdi
callq 0xdf08
leaq 0x110(%rsp), %rdi
callq 0xdf08
leaq 0x68(%rsp), %rdi
callq 0xdf08
leaq 0x48(%rsp), %rdi
callq 0xdf08
leaq 0x47(%rsp), %rdi
callq 0xd7a0
leaq 0xf0(%rsp), %rdi
callq 0xdf08
leaq 0xd0(%rsp), %rdi
callq 0xdf08
leaq 0x88(%rsp), %rdi
callq 0xdf08
leaq 0xb0(%rsp), %rdi
callq 0xdf08
leaq 0xaf(%rsp), %rdi
callq 0xd7a0
jmp 0x99a2b
movl $0x1, %edi
callq 0xd8e0
movb 0x16e(%rsp), %al
andb $0x1, %al
addq $0x298, %rsp            # imm = 0x298
retq
movq 0x1d8(%rsp), %rdi
callq 0xdd40
nopl (%rax,%rax)