#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 */

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(int *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
char *strstr(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  system("clear");
  char cumle[100];
  char old_str[100];
  char new_str[100];
  printf("bir cumle girin: \n");
  fgets(cumle, 100, stdin);
  cumle[strlen(cumle) - 1] = '\0';
  printf("\n");
  printf("degistirilecek stringi girin: ");
  fgets(old_str, 100, stdin);
  old_str[strlen(old_str) - 1] = '\0';
  printf("\n");
  printf("yeni stringi girin: ");
  fgets(new_str, 100, stdin);
  new_str[strlen(new_str) - 1] = '\0';
  if (strlen(old_str) == strlen(new_str)) {
    char *adres = strstr(cumle, old_str);
    int index = adres - cumle;
    while (adres != NULL) {
      memcpy(cumle + index, new_str, strlen(new_str) * sizeof(char));
      adres = strstr(adres + 1, old_str);
      index = adres - cumle;
    }
    printf("\ndegistirildikten sonra:\n%s\n", cumle);
  } else {
    int i, eleman = 0;
    char s[2];
    char cumle_updated[100];
    char *adres = strstr(cumle, old_str);
    int eleman_sayi = strlen(cumle) / strlen(old_str);
    int search_index[eleman_sayi];
    memset(search_index, -1, eleman_sayi * sizeof(int));
    for (i = 0; adres != NULL; i++) {
      search_index[i] = adres - cumle;
      adres = strstr(adres + 1, old_str);
    }
    for (i = 0; cumle[i] != '\0' && i <= strlen(cumle); i++) {
      if (i == search_index[eleman] && search_index[eleman] >= 0) {
        strcat(cumle_updated, new_str);
        i += strlen(old_str);
        eleman++;
      } else {
        s[0] = cumle[i];
        strcat(cumle_updated, s);
      }
    }
    printf("\ndegistirildikten sonra:\n%s\n", cumle_updated);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
call   1040 <system@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e31(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1070 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2de8(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1070 <fgets@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xe0(%rbp,%rax,1)
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    0x2d99(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1070 <fgets@plt>
lea    -0x150(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x150(%rbp,%rax,1)
lea    -0xe0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1f4(%rbp)
lea    -0x150(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1f4(%rbp),%eax
cmp    %ecx,%eax
jne    1373 <main+0x1f3>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   10a0 <strstr@plt>
mov    %rax,-0x158(%rbp)
mov    -0x158(%rbp),%rax
lea    -0x70(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x15c(%rbp)
cmpq   $0x0,-0x158(%rbp)
je     135c <main+0x1dc>
lea    -0x70(%rbp),%rax
movslq -0x15c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x208(%rbp)
lea    -0x150(%rbp),%rax
mov    %rax,-0x200(%rbp)
lea    -0x150(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x208(%rbp),%rdi
mov    -0x200(%rbp),%rsi
cltq
shl    $0x0,%rax
mov    %eax,%edx
call   1080 <memcpy@plt>
mov    -0x158(%rbp),%rdi
add    $0x1,%rdi
lea    -0xe0(%rbp),%rsi
call   10a0 <strstr@plt>
mov    %rax,-0x158(%rbp)
mov    -0x158(%rbp),%rax
lea    -0x70(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x15c(%rbp)
jmp    12cd <main+0x14d>
lea    -0x70(%rbp),%rsi
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15b8 <main+0x438>
movl   $0x0,-0x164(%rbp)
lea    -0x70(%rbp),%rdi
mov    %rdi,-0x228(%rbp)
lea    -0xe0(%rbp),%rsi
mov    %rsi,-0x220(%rbp)
call   10a0 <strstr@plt>
mov    -0x228(%rbp),%rdi
mov    %rax,-0x1d8(%rbp)
call   1030 <strlen@plt>
mov    -0x220(%rbp),%rdi
mov    %eax,-0x214(%rbp)
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x214(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x1dc(%rbp)
mov    -0x1dc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x1e8(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x210(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x1f0(%rbp)
movslq -0x1dc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
mov    $0xffffffff,%esi
call   1060 <memset@plt>
movl   $0x0,-0x160(%rbp)
cmpq   $0x0,-0x1d8(%rbp)
je     1486 <main+0x306>
mov    -0x210(%rbp),%rax
mov    -0x1d8(%rbp),%rcx
lea    -0x70(%rbp),%rdx
sub    %rdx,%rcx
mov    %ecx,%edx
movslq -0x160(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1d8(%rbp),%rdi
add    $0x1,%rdi
lea    -0xe0(%rbp),%rsi
call   10a0 <strstr@plt>
mov    %rax,-0x1d8(%rbp)
mov    -0x160(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x160(%rbp)
jmp    1425 <main+0x2a5>
movl   $0x0,-0x160(%rbp)
movslq -0x160(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x229(%rbp)
je     14d5 <main+0x355>
mov    -0x160(%rbp),%eax
mov    %eax,-0x230(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x230(%rbp),%eax
cmp    %ecx,%eax
setle  %al
mov    %al,-0x229(%rbp)
mov    -0x229(%rbp),%al
test   $0x1,%al
jne    14e8 <main+0x368>
jmp    1599 <main+0x419>
mov    -0x210(%rbp),%rcx
mov    -0x160(%rbp),%eax
movslq -0x164(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    155c <main+0x3dc>
mov    -0x210(%rbp),%rax
movslq -0x164(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     155c <main+0x3dc>
lea    -0x1d0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1090 <strcat@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x160(%rbp),%eax
mov    %eax,-0x160(%rbp)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1580 <main+0x400>
movslq -0x160(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%al
mov    %al,-0x166(%rbp)
lea    -0x1d0(%rbp),%rdi
lea    -0x166(%rbp),%rsi
call   1090 <strcat@plt>
jmp    1585 <main+0x405>
mov    -0x160(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x160(%rbp)
jmp    1490 <main+0x310>
lea    -0x1d0(%rbp),%rsi
lea    0xaa6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1e8(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1c8,%rsp
lea    0xe45(%rip),%rdi
call   1060 <system@plt>
lea    0xe90(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e15(%rip),%r15
mov    (%r15),%edx
lea    -0xa0(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1090 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%edx
lea    -0x110(%rbp),%r14
mov    %r14,%rdi
mov    $0x64,%esi
call   1090 <fgets@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%edx
lea    -0x180(%rbp),%r15
mov    %r15,%rdi
mov    $0x64,%esi
call   1090 <fgets@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r15,1)
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
cmp    %eax,%ebx
jne    1328 <main+0x188>
lea    -0xa0(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10c0 <strstr@plt>
test   %rax,%rax
je     130e <main+0x16e>
mov    %rax,%rbx
lea    -0xa0(%rbp),%r13
lea    -0x180(%rbp),%r14
lea    -0x110(%rbp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
sub    %r13d,%eax
cltq
lea    (%rax,%rbp,1),%r12
add    $0xffffffffffffff60,%r12
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   10a0 <memcpy@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strstr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    12d0 <main+0x130>
lea    0xd25(%rip),%rdi
lea    -0xa0(%rbp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    147d <main+0x2dd>
lea    -0xa0(%rbp),%rbx
lea    -0x110(%rbp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strstr@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    %rsp,-0x38(%rbp)
mov    %ebx,%eax
cltd
idiv   %ecx
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r13
sub    %rcx,%r13
mov    %r13,%rsp
lea    0x0(,%rax,4),%edx
mov    %r13,%rdi
mov    $0xffffffff,%esi
call   1080 <memset@plt>
test   %r12,%r12
je     13c3 <main+0x223>
lea    -0xa0(%rbp),%r14
lea    -0x110(%rbp),%r15
mov    %r13,%rbx
mov    %r12d,%eax
sub    %r14d,%eax
mov    %eax,(%rbx)
add    $0x1,%r12
mov    %r12,%rdi
mov    %r15,%rsi
call   10c0 <strstr@plt>
mov    %rax,%r12
add    $0x4,%rbx
test   %rax,%rax
jne    13a0 <main+0x200>
cmpb   $0x0,-0xa0(%rbp)
je     1464 <main+0x2c4>
xor    %ebx,%ebx
lea    -0x1f0(%rbp),%r15
lea    -0xa0(%rbp),%r14
xor    %r12d,%r12d
jmp    141f <main+0x27f>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r14),%eax
mov    %al,-0x2a(%rbp)
mov    %r15,%rdi
lea    -0x2a(%rbp),%rsi
call   10b0 <strcat@plt>
movslq %ebx,%rax
lea    0x1(%rax),%rbx
lea    (%rax,%rbp,1),%r14
add    $0xffffffffffffff61,%r14
cmpb   $0x0,-0x9f(%rbp,%rax,1)
je     1464 <main+0x2c4>
lea    -0xa0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    %eax,%ebx
jg     1464 <main+0x2c4>
movslq %r12d,%rax
mov    0x0(%r13,%rax,4),%eax
cmp    %eax,%ebx
jne    13f0 <main+0x250>
test   %eax,%eax
js     13f0 <main+0x250>
mov    %r15,%rdi
lea    -0x180(%rbp),%rsi
call   10b0 <strcat@plt>
lea    -0x110(%rbp),%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
add    $0x1,%r12d
mov    %eax,%ebx
jmp    1403 <main+0x263>
lea    0xbcf(%rip),%rdi
lea    -0x1f0(%rbp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [19 x i8] c"bir cumle girin: \0A\00"
@stdin = global i32 0
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [31 x i8] c"degistirilecek stringi girin: \00"
@.str.4 = [21 x i8] c"yeni stringi girin: \00"
@.str.5 = [29 x i8] c"\0Adegistirildikten sonra:\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i8]
%10 = alloca [100 x i8]
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
store i32 0, i32* %1
%15 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %17, i32 100, i32 %18)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%21 = call i32 @strlen(i8* %20)
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %23
store i8 0, i8* %24
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%28 = load i32, i32* @stdin
%29 = call i32 @fgets(i8* %27, i32 100, i32 %28)
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%31 = call i32 @strlen(i8* %30)
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %33
store i8 0, i8* %34
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%38 = load i32, i32* @stdin
%39 = call i32 @fgets(i8* %37, i32 100, i32 %38)
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%41 = call i32 @strlen(i8* %40)
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %43
store i8 0, i8* %44
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%46 = call i32 @strlen(i8* %45)
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
%49 = icmp eq i32 %46, %48
br i1 %49, label %50, label %88
50: ; preds = %0
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%53 = call i8* @strstr(i8* %51, i8* %52)
store i8* %53, i8** %5
%54 = load i8*, i8** %5
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%56 = ptrtoint i8* %54 to i64
%57 = ptrtoint i8* %55 to i64
%58 = sub i64 %56, %57
%59 = trunc i64 %58 to i32
store i32 %59, i32* %6
br label %60
60: ; preds = %63, %50
%61 = load i8*, i8** %5
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %85
63: ; preds = %60
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%65 = load i32, i32* %6
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%70 = call i32 @strlen(i8* %69)
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 1
%73 = trunc i64 %72 to i32
%74 = call i32 @memcpy(i8* %67, i8* %68, i32 %73)
%75 = load i8*, i8** %5
%76 = getelementptr inbounds i8, i8* %75, i64 1
%77 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%78 = call i8* @strstr(i8* %76, i8* %77)
store i8* %78, i8** %5
%79 = load i8*, i8** %5
%80 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%81 = ptrtoint i8* %79 to i64
%82 = ptrtoint i8* %80 to i64
%83 = sub i64 %81, %82
%84 = trunc i64 %83 to i32
store i32 %84, i32* %6
br label %60
85: ; preds = %60
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %86)
br label %181
88: ; preds = %0
store i32 0, i32* %8
%89 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%91 = call i8* @strstr(i8* %89, i8* %90)
store i8* %91, i8** %11
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%93 = call i32 @strlen(i8* %92)
%94 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%95 = call i32 @strlen(i8* %94)
%96 = sdiv i32 %93, %95
store i32 %96, i32* %12
%97 = load i32, i32* %12
%98 = zext i32 %97 to i64
%99 = call i8* @llvm.stacksave()
store i8* %99, i8** %13
%100 = alloca i32, i64 %98
store i64 %98, i64* %14
%101 = load i32, i32* %12
%102 = sext i32 %101 to i64
%103 = mul i64 %102, 4
%104 = trunc i64 %103 to i32
%105 = call i32 @memset(i32* %100, i32 -1, i32 %104)
store i32 0, i32* %7
br label %106
106: ; preds = %123, %88
%107 = load i8*, i8** %11
%108 = icmp ne i8* %107, null
br i1 %108, label %109, label %126
109: ; preds = %106
%110 = load i8*, i8** %11
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%112 = ptrtoint i8* %110 to i64
%113 = ptrtoint i8* %111 to i64
%114 = sub i64 %112, %113
%115 = trunc i64 %114 to i32
%116 = load i32, i32* %7
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i32, i32* %100, i64 %117
store i32 %115, i32* %118
%119 = load i8*, i8** %11
%120 = getelementptr inbounds i8, i8* %119, i64 1
%121 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%122 = call i8* @strstr(i8* %120, i8* %121)
store i8* %122, i8** %11
br label %123
123: ; preds = %109
%124 = load i32, i32* %7
%125 = add nsw i32 %124, 1
store i32 %125, i32* %7
br label %106
126: ; preds = %106
store i32 0, i32* %7
br label %127
127: ; preds = %174, %126
%128 = load i32, i32* %7
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %129
%131 = load i8, i8* %130
%132 = sext i8 %131 to i32
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %139
134: ; preds = %127
%135 = load i32, i32* %7
%136 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%137 = call i32 @strlen(i8* %136)
%138 = icmp sle i32 %135, %137
br label %139
139: ; preds = %134, %127
%140 = phi i1 [ false, %127 ], [ %138, %134 ]
br i1 %140, label %141, label %177
141: ; preds = %139
%142 = load i32, i32* %7
%143 = load i32, i32* %8
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i32, i32* %100, i64 %144
%146 = load i32, i32* %145
%147 = icmp eq i32 %142, %146
br i1 %147, label %148, label %164
148: ; preds = %141
%149 = load i32, i32* %8
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32, i32* %100, i64 %150
%152 = load i32, i32* %151
%153 = icmp sge i32 %152, 0
br i1 %153, label %154, label %164
154: ; preds = %148
%155 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%156 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%157 = call i32 @strcat(i8* %155, i8* %156)
%158 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%159 = call i32 @strlen(i8* %158)
%160 = load i32, i32* %7
%161 = add nsw i32 %160, %159
store i32 %161, i32* %7
%162 = load i32, i32* %8
%163 = add nsw i32 %162, 1
store i32 %163, i32* %8
br label %173
164: ; preds = %148, %141
%165 = load i32, i32* %7
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %166
%168 = load i8, i8* %167
%169 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
store i8 %168, i8* %169
%170 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%171 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%172 = call i32 @strcat(i8* %170, i8* %171)
br label %173
173: ; preds = %164, %154
br label %174
174: ; preds = %173
%175 = load i32, i32* %7
%176 = add nsw i32 %175, 1
store i32 %176, i32* %7
br label %127
177: ; preds = %139
%178 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %178)
%180 = load i8*, i8** %13
br label %181
181: ; preds = %177, %85
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@stdin = global i32 0
@.str.3 = [31 x i8] c"degistirilecek stringi girin: \00"
@.str.4 = [21 x i8] c"yeni stringi girin: \00"
@.str.5 = [29 x i8] c"\0Adegistirildikten sonra:\0A%s\0A\00"
@str = [18 x i8] c"bir cumle girin: \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [2 x i8]
%5 = alloca [100 x i8]
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %7, i32 100, i32 %11)
%13 = call i32 @strlen(i8* %7)
%14 = add nsw i32 %13, -1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %15
store i8 0, i8* %16
%17 = call i32 @putchar(i32 10)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %8, i32 100, i32 %19)
%21 = call i32 @strlen(i8* %8)
%22 = add nsw i32 %21, -1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %23
store i8 0, i8* %24
%25 = call i32 @putchar(i32 10)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32, i32* @stdin
%28 = call i32 @fgets(i8* %9, i32 100, i32 %27)
%29 = call i32 @strlen(i8* %9)
%30 = add nsw i32 %29, -1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %31
store i8 0, i8* %32
%33 = call i32 @strlen(i8* %8)
%34 = call i32 @strlen(i8* %9)
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %54
36: ; preds = %0
%37 = call i8* @strstr(i8* %7, i8* %8)
%38 = ptrtoint [100 x i8]* %1 to i64
%39 = icmp eq i8* %37, null
br i1 %39, label %52, label %40
40: ; preds = %36, %40
%41 = phi i8* [ %50, %40 ], [ %37, %36 ]
%42 = ptrtoint i8* %41 to i64
%43 = sub i64 %42, %38
%44 = shl i64 %43, 32
%45 = ashr exact i64 %44, 32
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %45
%47 = call i32 @strlen(i8* %9)
%48 = call i32 @memcpy(i8* %46, i8* %9, i32 %47)
%49 = getelementptr inbounds i8, i8* %41, i64 1
%50 = call i8* @strstr(i8* %49, i8* %8)
%51 = icmp eq i8* %50, null
br i1 %51, label %52, label %40
52: ; preds = %40, %36
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %7)
br label %114
54: ; preds = %0
%55 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%57 = call i8* @strstr(i8* %7, i8* %8)
%58 = call i32 @strlen(i8* %7)
%59 = call i32 @strlen(i8* %8)
%60 = sdiv i32 %58, %59
%61 = zext i32 %60 to i64
%62 = call i8* @llvm.stacksave()
%63 = alloca i32, i64 %61
%64 = shl i32 %60, 2
%65 = call i32 @memset(i32* %63, i32 -1, i32 %64)
%66 = icmp eq i8* %57, null
br i1 %66, label %69, label %67
67: ; preds = %54
%68 = ptrtoint [100 x i8]* %1 to i64
br label %72
69: ; preds = %72, %54
%70 = load i8, i8* %7
%71 = icmp eq i8 %70, 0
br i1 %71, label %112, label %83
72: ; preds = %67, %72
%73 = phi i64 [ 0, %67 ], [ %81, %72 ]
%74 = phi i8* [ %57, %67 ], [ %80, %72 ]
%75 = ptrtoint i8* %74 to i64
%76 = sub i64 %75, %68
%77 = trunc i64 %76 to i32
%78 = getelementptr inbounds i32, i32* %63, i64 %73
store i32 %77, i32* %78
%79 = getelementptr inbounds i8, i8* %74, i64 1
%80 = call i8* @strstr(i8* %79, i8* %8)
%81 = add nuw i64 %73, 1
%82 = icmp eq i8* %80, null
br i1 %82, label %69, label %72
83: ; preds = %69, %104
%84 = phi i8* [ %109, %104 ], [ %7, %69 ]
%85 = phi i32 [ %107, %104 ], [ 0, %69 ]
%86 = phi i32 [ %105, %104 ], [ 0, %69 ]
%87 = call i32 @strlen(i8* %7)
%88 = icmp sgt i32 %85, %87
br i1 %88, label %112, label %89
89: ; preds = %83
%90 = sext i32 %86 to i64
%91 = getelementptr inbounds i32, i32* %63, i64 %90
%92 = load i32, i32* %91
%93 = icmp eq i32 %85, %92
%94 = icmp sgt i32 %92, -1
%95 = and i1 %93, %94
br i1 %95, label %96, label %101
96: ; preds = %89
%97 = call i32 @strcat(i8* %56, i8* %9)
%98 = call i32 @strlen(i8* %8)
%99 = add nsw i32 %98, %85
%100 = add nsw i32 %86, 1
br label %104
101: ; preds = %89
%102 = load i8, i8* %84
store i8 %102, i8* %55
%103 = call i32 @strcat(i8* %56, i8* %55)
br label %104
104: ; preds = %96, %101
%105 = phi i32 [ %100, %96 ], [ %86, %101 ]
%106 = phi i32 [ %99, %96 ], [ %85, %101 ]
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %108
%110 = load i8, i8* %109
%111 = icmp eq i8 %110, 0
br i1 %111, label %112, label %83
112: ; preds = %83, %104, %69
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %56)
br label %114
114: ; preds = %112, %52
ret i32 0
}