// File: /workspace/github_cpp_makefile_star2_O1/ncbi[P]amr/common.cpp
// Function: Common_sp::replaceStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, 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>> const&)
void replaceStr (string &s,
                 const string &from,
                 const string &to)
{
  ASSERT (! from. empty ());
  
  if (from == to)
    return;
  
  const bool inside = contains (to, from);

  size_t start = 0;    
  for (;;)
  {
    const size_t pos = s. find (from, start);
    if (pos == string::npos)
      break;
    s. replace (pos, from. size (), to);
    start = pos + (inside ? to. size () : 0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0xa070
movl $0x0, (%rax)
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x377be
cmpq 0x8(%rbx), %r12
jne 0x3774d
movq (%rbx), %rsi
movq (%r14), %rdi
movq %r12, %rdx
callq 0xa5c0
testl %eax, %eax
je 0x377ac
movq (%r14), %rsi
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %edx, %edx
movq %r12, %rcx
callq 0xa9e0
movq %rax, %r12
movq (%r14), %rsi
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %r13, %rdx
callq 0xa9e0
movq %rax, %rbp
cmpq $-0x1, %rax
je 0x377a6
movq 0x8(%r14), %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
movq %r15, %rdi
movq %rbp, %rsi
callq 0xa620
cmpq $-0x1, %r12
je 0x377a0
movq 0x8(%rbx), %r13
jmp 0x377a3
xorl %r13d, %r13d
addq %rbp, %r13
cmpq $-0x1, %rbp
jne 0x37763
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xa6b0
testl %eax, %eax
jne 0x37856
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x55158(%rip), %rsi     # 0x8c936
leaq 0x55164(%rip), %rdx     # 0x8c949
leaq 0x88(%rsp), %rdi
callq 0x2fdd8
leaq 0xa8(%rsp), %rdi
movl $0x3c3, %esi            # imm = 0x3C3
callq 0x2d60a
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x2d562
leaq 0x533bd(%rip), %rsi     # 0x8abe5
leaq 0xc8(%rsp), %rdi
callq 0xaac0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x37860
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x3786d
movl $0x1, %edi
callq 0xa6c0
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 0x552c1(%rip), %rsi     # 0x8cb57
leaq 0x552fe(%rip), %rdx     # 0x8cb9b
leaq 0x68(%rsp), %rdi
callq 0x2fdd8
leaq 0x55085(%rip), %rsi     # 0x8c933
leaq 0x68(%rsp), %rdi
callq 0xaac0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x378da
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x378e7
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 0x2d562
leaq 0x55280(%rip), %rsi     # 0x8cb9c
leaq 0xe8(%rsp), %rdi
callq 0xaac0
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3794a
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x37957
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 0x3523b
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x37997
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x37997
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x379bd
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x379bd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x379d9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x379d9
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x379f5
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x379f5
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x37a11
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x37a11
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37a37
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x37a37
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37a5d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x37a5d
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x37a7a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq %rbx, %rdi
callq 0xaa10