#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ aux2;
typedef int /*<<< orphan*/ aux1;

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char *);
char *replace_str(char *str, char *orig, char *rep) {
  char *buffer;
  char *p;
  char *q;
  char *r;
  char aux1[140], aux2[140];
  if (!(p = strstr(str, orig)))
    return str;
  buffer = (char *)malloc(1000);
  q = str;
  r = buffer;
  do {
    strncpy(r, q, p - q);
    r = r + (p - q);
    memset(aux1, '\0', sizeof(aux1));
    strncpy(aux1, (p - 1), 1);
    memset(aux2, '\0', sizeof(aux2));
    strncpy(aux2, (p + strlen(orig)), 1);
    if (((strcmp(aux1, "(") == 0) || (strcmp(aux1, " ") == 0) ||
         (strcmp(aux1, ")") == 0) || (strcmp(aux1, "\n") == 0) ||
         (strcmp(aux1, "[") == 0) || (strcmp(aux1, "\t") == 0) ||
         (strcmp(aux1, "{") == 0) || (strcmp(aux1, "=") == 0) ||
         (strcmp(aux1, "+") == 0) || (strcmp(aux1, "-") == 0) ||
         (strcmp(aux1, "<") == 0) || (strcmp(aux1, ">") == 0) ||
         (strcmp(aux1, "!") == 0) || (strcmp(aux1, "/") == 0) ||
         (strcmp(aux1, "&") == 0) || (strcmp(aux1, "%") == 0) ||
         (strcmp(aux1, "|") == 0) || (strcmp(aux1, ".") == 0) ||
         (strcmp(aux1, "*") == 0) || (strcmp(aux1, ",") == 0) ||
         (strcmp(aux1, ":") == 0)) &&
        ((strcmp(aux2, "(") == 0) || (strcmp(aux2, " ") == 0) ||
         (strcmp(aux2, ")") == 0) || (strcmp(aux2, "\n") == 0) ||
         (strcmp(aux2, "[") == 0) || (strcmp(aux2, "\t") == 0) ||
         (strcmp(aux2, "{") == 0) || (strcmp(aux2, "=") == 0) ||
         (strcmp(aux2, "+") == 0) || (strcmp(aux2, "-") == 0) ||
         (strcmp(aux2, "<") == 0) || (strcmp(aux2, ">") == 0) ||
         (strcmp(aux2, "!") == 0) || (strcmp(aux2, "/") == 0) ||
         (strcmp(aux2, "&") == 0) || (strcmp(aux2, "%") == 0) ||
         (strcmp(aux2, "|") == 0) || (strcmp(aux2, ".") == 0) ||
         (strcmp(aux2, "*") == 0) || (strcmp(aux2, ",") == 0) ||
         (strcmp(aux2, ":") == 0))) {
      sprintf(r, "%s", rep);
      p = p + strlen(orig);
      r = r + strlen(rep);
    } else {
      sprintf(r, "%s", orig);
      p = p + strlen(orig);
      r = r + strlen(orig);
    }
    q = p;
  } while (p = strstr(q, orig));
  sprintf(r, "%s", q);
  return buffer;
}


x86 assembly (clang, -O0):
<replace_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11af <replace_str+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1845 <replace_str+0x6d5>
mov    $0x3e8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    -0x40(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rdx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x8c,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rdi
mov    -0x30(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
mov    $0x1,%edx
call   1030 <strncpy@plt>
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0x8c,%edx
call   1050 <memset@plt>
lea    -0x160(%rbp),%rax
mov    %rax,-0x168(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x170(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x170(%rbp),%rsi
mov    -0x168(%rbp),%rdi
cltq
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <strncpy@plt>
lea    -0xd0(%rbp),%rdi
lea    0xd77(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xd5c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xd41(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xd26(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xd0b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xcf0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xcd5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xcba(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xc9f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xc84(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xc69(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xc4e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xc33(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xc18(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xbfd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xbe2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xbc7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xbac(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xb91(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xb76(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14dc <replace_str+0x36c>
lea    -0xd0(%rbp),%rdi
lea    0xb5b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    17a4 <replace_str+0x634>
lea    -0x160(%rbp),%rdi
lea    0xb16(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xafb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xae0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xac5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xaaa(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xa8f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xa74(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xa59(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xa3e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xa23(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0xa08(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x9ed(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x9d2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x9b7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x99c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x981(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x966(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x94b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x930(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x915(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     173d <replace_str+0x5cd>
lea    -0x160(%rbp),%rdi
lea    0x8fa(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    17a4 <replace_str+0x634>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0x8de(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x180(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x180(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x178(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x178(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    1806 <replace_str+0x696>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0x877(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x190(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x190(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x188(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x188(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11cd <replace_str+0x5d>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0x7f2(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_str>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%rbx
call   1090 <strstr@plt>
test   %rax,%rax
je     16bb <replace_str+0x54b>
mov    %rax,%r14
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %rax,(%rsp)
jmp    1212 <replace_str+0xa2>
mov    %r15,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %r15,%rbx
mov    %r13,%r15
mov    %eax,%r13d
mov    %r14,%rdi
call   1050 <strlen@plt>
movslq %eax,%rbp
add    %r12,%rbp
movslq %r13d,%rax
mov    %r15,%r13
mov    %rbx,%r15
mov    0x8(%rsp),%rbx
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <strstr@plt>
mov    %rax,%r14
test   %rax,%rax
je     16ac <replace_str+0x53c>
mov    %r14,%r12
sub    %rbx,%r12
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1030 <strncpy@plt>
add    %rbp,%r12
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8c,%edx
call   1060 <memset@plt>
lea    -0x1(%r14),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncpy@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x8c,%edx
call   1060 <memset@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
movslq %eax,%rsi
mov    %r14,0x8(%rsp)
add    %r14,%rsi
mov    %rbp,%rdi
mov    $0x1,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
lea    0xd71(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xd5b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xd45(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xd2f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xd19(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xd03(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xced(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xcd7(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xcc1(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xcab(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc95(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc7f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc69(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc53(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc3d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc27(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc15(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xc03(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xbf1(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xbdf(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1470 <replace_str+0x300>
mov    %rbx,%rdi
lea    0xbcd(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11ae <replace_str+0x3e>
nopl   0x0(%rax)
mov    %rbp,%rdi
lea    0xb86(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xb6d(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xb54(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xb3b(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xb22(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xb09(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xaf0(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xad7(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xabe(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xaa5(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xa8c(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xa73(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xa5a(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xa41(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xa28(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0xa0f(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0x9f6(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0x9dd(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0x9c4(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0x9ab(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
je     11c0 <replace_str+0x50>
mov    %rbp,%rdi
lea    0x992(%rip),%rsi
call   1070 <strcmp@plt>
mov    %r13,%r14
test   %rax,%rax
jne    11ae <replace_str+0x3e>
jmp    11c0 <replace_str+0x50>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    (%rsp),%rbx
mov    %rbx,%rax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c")\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c"[\00"
@.str.5 = [2 x i8] c"\09\00"
@.str.6 = [2 x i8] c"{\00"
@.str.7 = [2 x i8] c"=\00"
@.str.8 = [2 x i8] c"+\00"
@.str.9 = [2 x i8] c"-\00"
@.str.10 = [2 x i8] c"<\00"
@.str.11 = [2 x i8] c">\00"
@.str.12 = [2 x i8] c"!\00"
@.str.13 = [2 x i8] c"/\00"
@.str.14 = [2 x i8] c"&\00"
@.str.15 = [2 x i8] c"%\00"
@.str.16 = [2 x i8] c"|\00"
@.str.17 = [2 x i8] c".\00"
@.str.18 = [2 x i8] c"*\00"
@.str.19 = [2 x i8] c",\00"
@.str.20 = [2 x i8] c":\00"
@.str.21 = [3 x i8] c"%s\00"
define i8* @replace_str(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [140 x i8]
%13 = alloca [140 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i8* @strstr(i8* %14, i8* %15)
store i8* %16, i8** %9
%17 = icmp ne i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %3
%19 = load i8*, i8** %5
store i8* %19, i8** %4
br label %264
20: ; preds = %3
%21 = call i64 @malloc(i32 1000)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %8
%23 = load i8*, i8** %5
store i8* %23, i8** %10
%24 = load i8*, i8** %8
store i8* %24, i8** %11
br label %25
25: ; preds = %254, %20
%26 = load i8*, i8** %11
%27 = load i8*, i8** %10
%28 = load i8*, i8** %9
%29 = load i8*, i8** %10
%30 = ptrtoint i8* %28 to i64
%31 = ptrtoint i8* %29 to i64
%32 = sub i64 %30, %31
%33 = trunc i64 %32 to i32
%34 = call i32 @strncpy(i8* %26, i8* %27, i32 %33)
%35 = load i8*, i8** %11
%36 = load i8*, i8** %9
%37 = load i8*, i8** %10
%38 = ptrtoint i8* %36 to i64
%39 = ptrtoint i8* %37 to i64
%40 = sub i64 %38, %39
%41 = getelementptr inbounds i8, i8* %35, i64 %40
store i8* %41, i8** %11
%42 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%43 = call i32 @memset(i8* %42, i8 signext 0, i32 140)
%44 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%45 = load i8*, i8** %9
%46 = getelementptr inbounds i8, i8* %45, i64 -1
%47 = call i32 @strncpy(i8* %44, i8* %46, i32 1)
%48 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%49 = call i32 @memset(i8* %48, i8 signext 0, i32 140)
%50 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%51 = load i8*, i8** %9
%52 = load i8*, i8** %6
%53 = call i32 @strlen(i8* %52)
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %51, i64 %54
%56 = call i32 @strncpy(i8* %50, i8* %55, i32 1)
%57 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %140, label %60
60: ; preds = %25
%61 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %140, label %64
64: ; preds = %60
%65 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %140, label %68
68: ; preds = %64
%69 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %140, label %72
72: ; preds = %68
%73 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %140, label %76
76: ; preds = %72
%77 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %140, label %80
80: ; preds = %76
%81 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %140, label %84
84: ; preds = %80
%85 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %140, label %88
88: ; preds = %84
%89 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%90 = call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %140, label %92
92: ; preds = %88
%93 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %140, label %96
96: ; preds = %92
%97 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%98 = call i64 @strcmp(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%99 = icmp eq i64 %98, 0
br i1 %99, label %140, label %100
100: ; preds = %96
%101 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%102 = call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %140, label %104
104: ; preds = %100
%105 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %140, label %108
108: ; preds = %104
%109 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%110 = call i64 @strcmp(i8* %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %140, label %112
112: ; preds = %108
%113 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %140, label %116
116: ; preds = %112
%117 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%118 = call i64 @strcmp(i8* %117, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%119 = icmp eq i64 %118, 0
br i1 %119, label %140, label %120
120: ; preds = %116
%121 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%122 = call i64 @strcmp(i8* %121, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %140, label %124
124: ; preds = %120
%125 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%126 = call i64 @strcmp(i8* %125, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%127 = icmp eq i64 %126, 0
br i1 %127, label %140, label %128
128: ; preds = %124
%129 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%130 = call i64 @strcmp(i8* %129, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%131 = icmp eq i64 %130, 0
br i1 %131, label %140, label %132
132: ; preds = %128
%133 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%134 = call i64 @strcmp(i8* %133, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%135 = icmp eq i64 %134, 0
br i1 %135, label %140, label %136
136: ; preds = %132
%137 = getelementptr inbounds [140 x i8], [140 x i8]* %12, i64 0, i64 0
%138 = call i64 @strcmp(i8* %137, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%139 = icmp eq i64 %138, 0
br i1 %139, label %140, label %238
140: ; preds = %136, %132, %128, %124, %120, %116, %112, %108, %104, %100, %96, %92, %88, %84, %80, %76, %72, %68, %64, %60, %25
%141 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%143 = icmp eq i64 %142, 0
br i1 %143, label %224, label %144
144: ; preds = %140
%145 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%146 = call i64 @strcmp(i8* %145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
br i1 %147, label %224, label %148
148: ; preds = %144
%149 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%150 = call i64 @strcmp(i8* %149, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%151 = icmp eq i64 %150, 0
br i1 %151, label %224, label %152
152: ; preds = %148
%153 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%154 = call i64 @strcmp(i8* %153, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%155 = icmp eq i64 %154, 0
br i1 %155, label %224, label %156
156: ; preds = %152
%157 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%158 = call i64 @strcmp(i8* %157, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%159 = icmp eq i64 %158, 0
br i1 %159, label %224, label %160
160: ; preds = %156
%161 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%162 = call i64 @strcmp(i8* %161, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%163 = icmp eq i64 %162, 0
br i1 %163, label %224, label %164
164: ; preds = %160
%165 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%166 = call i64 @strcmp(i8* %165, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%167 = icmp eq i64 %166, 0
br i1 %167, label %224, label %168
168: ; preds = %164
%169 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%170 = call i64 @strcmp(i8* %169, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%171 = icmp eq i64 %170, 0
br i1 %171, label %224, label %172
172: ; preds = %168
%173 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%174 = call i64 @strcmp(i8* %173, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%175 = icmp eq i64 %174, 0
br i1 %175, label %224, label %176
176: ; preds = %172
%177 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%178 = call i64 @strcmp(i8* %177, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%179 = icmp eq i64 %178, 0
br i1 %179, label %224, label %180
180: ; preds = %176
%181 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%182 = call i64 @strcmp(i8* %181, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%183 = icmp eq i64 %182, 0
br i1 %183, label %224, label %184
184: ; preds = %180
%185 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%186 = call i64 @strcmp(i8* %185, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%187 = icmp eq i64 %186, 0
br i1 %187, label %224, label %188
188: ; preds = %184
%189 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%190 = call i64 @strcmp(i8* %189, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%191 = icmp eq i64 %190, 0
br i1 %191, label %224, label %192
192: ; preds = %188
%193 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%194 = call i64 @strcmp(i8* %193, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%195 = icmp eq i64 %194, 0
br i1 %195, label %224, label %196
196: ; preds = %192
%197 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%198 = call i64 @strcmp(i8* %197, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%199 = icmp eq i64 %198, 0
br i1 %199, label %224, label %200
200: ; preds = %196
%201 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%202 = call i64 @strcmp(i8* %201, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%203 = icmp eq i64 %202, 0
br i1 %203, label %224, label %204
204: ; preds = %200
%205 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%206 = call i64 @strcmp(i8* %205, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%207 = icmp eq i64 %206, 0
br i1 %207, label %224, label %208
208: ; preds = %204
%209 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%210 = call i64 @strcmp(i8* %209, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%211 = icmp eq i64 %210, 0
br i1 %211, label %224, label %212
212: ; preds = %208
%213 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%214 = call i64 @strcmp(i8* %213, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%215 = icmp eq i64 %214, 0
br i1 %215, label %224, label %216
216: ; preds = %212
%217 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%218 = call i64 @strcmp(i8* %217, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%219 = icmp eq i64 %218, 0
br i1 %219, label %224, label %220
220: ; preds = %216
%221 = getelementptr inbounds [140 x i8], [140 x i8]* %13, i64 0, i64 0
%222 = call i64 @strcmp(i8* %221, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%223 = icmp eq i64 %222, 0
br i1 %223, label %224, label %238
224: ; preds = %220, %216, %212, %208, %204, %200, %196, %192, %188, %184, %180, %176, %172, %168, %164, %160, %156, %152, %148, %144, %140
%225 = load i8*, i8** %11
%226 = load i8*, i8** %7
%227 = call i32 @sprintf(i8* %225, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i8* %226)
%228 = load i8*, i8** %9
%229 = load i8*, i8** %6
%230 = call i32 @strlen(i8* %229)
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i8, i8* %228, i64 %231
store i8* %232, i8** %9
%233 = load i8*, i8** %11
%234 = load i8*, i8** %7
%235 = call i32 @strlen(i8* %234)
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i8, i8* %233, i64 %236
store i8* %237, i8** %11
br label %252
238: ; preds = %220, %136
%239 = load i8*, i8** %11
%240 = load i8*, i8** %6
%241 = call i32 @sprintf(i8* %239, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i8* %240)
%242 = load i8*, i8** %9
%243 = load i8*, i8** %6
%244 = call i32 @strlen(i8* %243)
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds i8, i8* %242, i64 %245
store i8* %246, i8** %9
%247 = load i8*, i8** %11
%248 = load i8*, i8** %6
%249 = call i32 @strlen(i8* %248)
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds i8, i8* %247, i64 %250
store i8* %251, i8** %11
br label %252
252: ; preds = %238, %224
%253 = load i8*, i8** %9
store i8* %253, i8** %10
br label %254
254: ; preds = %252
%255 = load i8*, i8** %10
%256 = load i8*, i8** %6
%257 = call i8* @strstr(i8* %255, i8* %256)
store i8* %257, i8** %9
%258 = icmp ne i8* %257, null
br i1 %258, label %25, label %259
259: ; preds = %254
%260 = load i8*, i8** %11
%261 = load i8*, i8** %10
%262 = call i32 @sprintf(i8* %260, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i8* %261)
%263 = load i8*, i8** %8
store i8* %263, i8** %4
br label %264
264: ; preds = %259, %18
%265 = load i8*, i8** %4
ret i8* %265
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c")\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c"[\00"
@.str.5 = [2 x i8] c"\09\00"
@.str.6 = [2 x i8] c"{\00"
@.str.7 = [2 x i8] c"=\00"
@.str.8 = [2 x i8] c"+\00"
@.str.9 = [2 x i8] c"-\00"
@.str.10 = [2 x i8] c"<\00"
@.str.11 = [2 x i8] c">\00"
@.str.12 = [2 x i8] c"!\00"
@.str.13 = [2 x i8] c"/\00"
@.str.14 = [2 x i8] c"&\00"
@.str.15 = [2 x i8] c"%\00"
@.str.16 = [2 x i8] c"|\00"
@.str.17 = [2 x i8] c".\00"
@.str.18 = [2 x i8] c"*\00"
@.str.19 = [2 x i8] c",\00"
@.str.20 = [2 x i8] c":\00"
define i8* @replace_str(i8* %0, i8* %1, i8* %2) {
%4 = alloca [140 x i8]
%5 = alloca [140 x i8]
%6 = getelementptr inbounds [140 x i8], [140 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [140 x i8], [140 x i8]* %5, i64 0, i64 0
%8 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%9 = icmp eq i8* %8, null
br i1 %9, label %170, label %10
10: ; preds = %3
%11 = tail call i64 @malloc(i32 1000)
%12 = inttoptr i64 %11 to i8*
br label %13
13: ; preds = %157, %10
%14 = phi i8* [ %8, %10 ], [ %166, %157 ]
%15 = phi i8* [ %0, %10 ], [ %165, %157 ]
%16 = phi i8* [ %12, %10 ], [ %163, %157 ]
%17 = ptrtoint i8* %14 to i64
%18 = ptrtoint i8* %15 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
%21 = call i32 @strncpy(i8* %16, i8* %15, i32 %20)
%22 = getelementptr inbounds i8, i8* %16, i64 %19
%23 = call i32 @memset(i8* %6, i8 signext 0, i32 140)
%24 = getelementptr inbounds i8, i8* %14, i64 -1
%25 = call i32 @strncpy(i8* %6, i8* %24, i32 1)
%26 = call i32 @memset(i8* %7, i8 signext 0, i32 140)
%27 = call i32 @strlen(i8* %1)
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %14, i64 %28
%30 = call i32 @strncpy(i8* %7, i8* %29, i32 1)
%31 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %93, label %33
33: ; preds = %13
%34 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %93, label %36
36: ; preds = %33
%37 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %93, label %39
39: ; preds = %36
%40 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %93, label %42
42: ; preds = %39
%43 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %93, label %45
45: ; preds = %42
%46 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %93, label %48
48: ; preds = %45
%49 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %93, label %51
51: ; preds = %48
%52 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %93, label %54
54: ; preds = %51
%55 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %93, label %57
57: ; preds = %54
%58 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %93, label %60
60: ; preds = %57
%61 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %93, label %63
63: ; preds = %60
%64 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %93, label %66
66: ; preds = %63
%67 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %93, label %69
69: ; preds = %66
%70 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %93, label %72
72: ; preds = %69
%73 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %93, label %75
75: ; preds = %72
%76 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %93, label %78
78: ; preds = %75
%79 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %93, label %81
81: ; preds = %78
%82 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %93, label %84
84: ; preds = %81
%85 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %93, label %87
87: ; preds = %84
%88 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %93, label %90
90: ; preds = %87
%91 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %156
93: ; preds = %90, %87, %84, %81, %78, %75, %72, %69, %66, %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %13
%94 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %157, label %96
96: ; preds = %93
%97 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %157, label %99
99: ; preds = %96
%100 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %157, label %102
102: ; preds = %99
%103 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%104 = icmp eq i64 %103, 0
br i1 %104, label %157, label %105
105: ; preds = %102
%106 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %157, label %108
108: ; preds = %105
%109 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%110 = icmp eq i64 %109, 0
br i1 %110, label %157, label %111
111: ; preds = %108
%112 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
br i1 %113, label %157, label %114
114: ; preds = %111
%115 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%116 = icmp eq i64 %115, 0
br i1 %116, label %157, label %117
117: ; preds = %114
%118 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%119 = icmp eq i64 %118, 0
br i1 %119, label %157, label %120
120: ; preds = %117
%121 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%122 = icmp eq i64 %121, 0
br i1 %122, label %157, label %123
123: ; preds = %120
%124 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%125 = icmp eq i64 %124, 0
br i1 %125, label %157, label %126
126: ; preds = %123
%127 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%128 = icmp eq i64 %127, 0
br i1 %128, label %157, label %129
129: ; preds = %126
%130 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%131 = icmp eq i64 %130, 0
br i1 %131, label %157, label %132
132: ; preds = %129
%133 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%134 = icmp eq i64 %133, 0
br i1 %134, label %157, label %135
135: ; preds = %132
%136 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%137 = icmp eq i64 %136, 0
br i1 %137, label %157, label %138
138: ; preds = %135
%139 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%140 = icmp eq i64 %139, 0
br i1 %140, label %157, label %141
141: ; preds = %138
%142 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%143 = icmp eq i64 %142, 0
br i1 %143, label %157, label %144
144: ; preds = %141
%145 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%146 = icmp eq i64 %145, 0
br i1 %146, label %157, label %147
147: ; preds = %144
%148 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%149 = icmp eq i64 %148, 0
br i1 %149, label %157, label %150
150: ; preds = %147
%151 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%152 = icmp eq i64 %151, 0
br i1 %152, label %157, label %153
153: ; preds = %150
%154 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%155 = icmp eq i64 %154, 0
br i1 %155, label %157, label %156
156: ; preds = %153, %90
br label %157
157: ; preds = %93, %96, %99, %102, %105, %108, %111, %114, %117, %120, %123, %126, %129, %132, %135, %138, %141, %144, %147, %150, %153, %156
%158 = phi i8* [ %1, %156 ], [ %2, %153 ], [ %2, %150 ], [ %2, %147 ], [ %2, %144 ], [ %2, %141 ], [ %2, %138 ], [ %2, %135 ], [ %2, %132 ], [ %2, %129 ], [ %2, %126 ], [ %2, %123 ], [ %2, %120 ], [ %2, %117 ], [ %2, %114 ], [ %2, %111 ], [ %2, %108 ], [ %2, %105 ], [ %2, %102 ], [ %2, %99 ], [ %2, %96 ], [ %2, %93 ]
%159 = call i8* @strcpy(i8* dereferenceable(1) %22, i8* dereferenceable(1) %158)
%160 = call i32 @strlen(i8* %1)
%161 = call i32 @strlen(i8* %158)
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8, i8* %22, i64 %162
%164 = sext i32 %160 to i64
%165 = getelementptr inbounds i8, i8* %14, i64 %164
%166 = call i8* @strstr(i8* dereferenceable(1) %165, i8* dereferenceable(1) %1)
%167 = icmp eq i8* %166, null
br i1 %167, label %168, label %13
168: ; preds = %157
%169 = call i8* @strcpy(i8* dereferenceable(1) %163, i8* dereferenceable(1) %165)
br label %170
170: ; preds = %3, %168
%171 = phi i8* [ %12, %168 ], [ %0, %3 ]
ret i8* %171
}