int main() {
  char teststr1[] = "";
  char teststr2[] = "string_is_13";
  printf("The test string1 is: %s\n", teststr1);
  printf("The length of the test string1 is: %d\n", strlen(teststr1));
  printf("The test string2 is: %s\n", teststr2);
  printf("The length of the test string2 is: %d\n", strlen(teststr2));
  tell_if_eq(teststr1, teststr2);
  printf("\nNow copy string 1 to string 2.\n");
  strcpy(teststr1, teststr2);
  printf("Now string 1 is: %s\n", teststr1);
  printf("Now string 2 is: %s\n", teststr2);
  tell_if_eq(teststr1, teststr2);
  str_replace(teststr1, '_', ' ');
  printf("\nUsing strchr to replace all '_' in string 1.\n");
  printf("Now string 1 is: %s\n", teststr1);
  tell_if_eq(teststr1, teststr2);
  printf("\nThe strings are still the same length.\n");
  printf("The length of the test string1 is: %d\n", strlen(teststr1));
  printf("The length of the test string2 is: %d\n", strlen(teststr2));
  printf("\nNow let's put back the underscores.\n");
  str_replace(teststr1, ' ', '_');
  printf("Now string 1 is: %s\n", teststr1);
  tell_if_eq(teststr1, teststr2);
  printf("\nLet's try to do the find and replace with the strpbrk function\n");
  char *strptr;
  while ((strptr = strpbrk(teststr2, "_"))) {
    *strptr = ' ';
  }
  printf("Now string 2 is: %s\n", teststr2);
  tell_if_eq(teststr1, teststr2);
  while ((strptr = strpbrk(teststr2, "_"))) {
    *strptr = '_';
  }
  printf("Now string 2 is: %s\n", teststr2);
  tell_if_eq(teststr1, teststr2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
mov    0xe6a(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xe68(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xe63(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0x5(%rbp),%rsi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x12(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x12(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1090 <tell_if_eq@plt>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x5(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x12(%rbp),%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1090 <tell_if_eq@plt>
lea    -0x5(%rbp),%rdi
mov    $0x5f,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1070 <str_replace@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1090 <tell_if_eq@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x12(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
mov    $0x20,%esi
mov    $0x5f,%edx
mov    $0x0,%al
call   1070 <str_replace@plt>
lea    -0x5(%rbp),%rsi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1090 <tell_if_eq@plt>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x12(%rbp),%rdi
lea    0xe53(%rip),%rsi
call   1080 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1363 <main+0x1f3>
mov    -0x20(%rbp),%rax
movb   $0x20,(%rax)
jmp    1339 <main+0x1c9>
lea    -0x12(%rbp),%rsi
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1090 <tell_if_eq@plt>
lea    -0x12(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   1080 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     13ae <main+0x23e>
mov    -0x20(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1384 <main+0x214>
lea    -0x12(%rbp),%rsi
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1090 <tell_if_eq@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
movb   $0x0,0xf(%rsp)
movabs $0x33315f73695f67,%rax
mov    %rax,0x15(%rsp)
movabs $0x695f676e69727473,%rax
67 5f 69
mov    %rax,0x10(%rsp)
lea    0xe66(%rip),%rdi
lea    0xf(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xe61(%rip),%r15
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe74(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0xe6f(%rip),%r12
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <tell_if_eq@plt>
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xe5e(%rip),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe5f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <tell_if_eq@plt>
mov    %rbx,%rdi
mov    $0x5f,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1080 <str_replace@plt>
lea    0xe62(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <tell_if_eq@plt>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe5c(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x5f,%edx
xor    %eax,%eax
call   1080 <str_replace@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <tell_if_eq@plt>
lea    0xe47(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1345 <main+0x1d5>
lea    0x10(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movb   $0x20,(%rax)
mov    %rbx,%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
test   %rax,%rax
jne    1330 <main+0x1c0>
lea    0xd56(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf(%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <tell_if_eq@plt>
mov    %rbx,%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     13a5 <main+0x235>
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x5f,(%rax)
mov    %rbx,%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
test   %rax,%rax
jne    1390 <main+0x220>
lea    0xcf6(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf(%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <tell_if_eq@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.teststr2 = [13 x i8] c"string_is_13\00"
@.str = [25 x i8] c"The test string1 is: %s\0A\00"
@.str.1 = [39 x i8] c"The length of the test string1 is: %d\0A\00"
@.str.2 = [25 x i8] c"The test string2 is: %s\0A\00"
@.str.3 = [39 x i8] c"The length of the test string2 is: %d\0A\00"
@.str.4 = [33 x i8] c"\0ANow copy string 1 to string 2.\0A\00"
@.str.5 = [21 x i8] c"Now string 1 is: %s\0A\00"
@.str.6 = [21 x i8] c"Now string 2 is: %s\0A\00"
@.str.7 = [47 x i8] c"\0AUsing strchr to replace all '_' in string 1.\0A\00"
@.str.8 = [41 x i8] c"\0AThe strings are still the same length.\0A\00"
@.str.9 = [38 x i8] c"\0ANow let's put back the underscores.\0A\00"
@.str.10 = [65 x i8] c"\0ALet's try to do the find and replace with the strpbrk function\0A\00"
@.str.11 = [2 x i8] c"_\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8]
%3 = alloca [13 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [1 x i8]* %2 to i8*
%6 = bitcast [13 x i8]* %3 to i8*
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%10 = call i64 @strlen(i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 %10)
%12 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%15 = call i64 @strlen(i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i64 %15)
%17 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %17, i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%21 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%23 = call i8* @strcpy(i8* %21, i8* %22)
%24 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%29 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%30 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %28, i8* %29)
%31 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%32 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @str_replace to i32 (i8*, i32, i32, ...)*)(i8* %31, i32 95, i32 32)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%34 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%37 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%38 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %36, i8* %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%40 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%41 = call i64 @strlen(i8* %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 %41)
%43 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%44 = call i64 @strlen(i8* %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i64 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
%47 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%48 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @str_replace to i32 (i8*, i32, i32, ...)*)(i8* %47, i32 32, i32 95)
%49 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %49)
%51 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%52 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%53 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %51, i8* %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0))
br label %55
55: ; preds = %59, %0
%56 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%57 = call i8* @strpbrk(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i8* %57, i8** %4
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = load i8*, i8** %4
store i8 32, i8* %60
br label %55
61: ; preds = %55
%62 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %62)
%64 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%65 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%66 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %64, i8* %65)
br label %67
67: ; preds = %71, %61
%68 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%69 = call i8* @strpbrk(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i8* %69, i8** %4
%70 = icmp ne i8* %69, null
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = load i8*, i8** %4
store i8 95, i8* %72
br label %67
73: ; preds = %67
%74 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %74)
%76 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%77 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%78 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %76, i8* %77)
ret i32 0
}

LLVM IR (-O2):
@__const.main.teststr2 = [13 x i8] c"string_is_13\00"
@.str = [25 x i8] c"The test string1 is: %s\0A\00"
@.str.1 = [39 x i8] c"The length of the test string1 is: %d\0A\00"
@.str.2 = [25 x i8] c"The test string2 is: %s\0A\00"
@.str.3 = [39 x i8] c"The length of the test string2 is: %d\0A\00"
@.str.5 = [21 x i8] c"Now string 1 is: %s\0A\00"
@.str.6 = [21 x i8] c"Now string 2 is: %s\0A\00"
@str = [32 x i8] c"\0ANow copy string 1 to string 2.\00"
@str.12 = [46 x i8] c"\0AUsing strchr to replace all '_' in string 1.\00"
@str.13 = [40 x i8] c"\0AThe strings are still the same length.\00"
@str.14 = [37 x i8] c"\0ANow let's put back the underscores.\00"
@str.15 = [64 x i8] c"\0ALet's try to do the find and replace with the strpbrk function\00"
define i32 @main() {
%1 = alloca [1 x i8]
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i64 @strlen(i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%9 = call i64 @strlen(i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i64 %9)
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%13 = call i8* @strcpy(i8* %3, i8* %4)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%16 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
%17 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @str_replace to i32 (i8*, i32, i32, ...)*)(i8* %3, i32 95, i32 32)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%20 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.13, i64 0, i64 0))
%22 = call i64 @strlen(i8* %3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 %22)
%24 = call i64 @strlen(i8* %4)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i64 %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.14, i64 0, i64 0))
%27 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @str_replace to i32 (i8*, i32, i32, ...)*)(i8* %3, i32 32, i32 95)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%29 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.15, i64 0, i64 0))
%31 = call i8* @strchr(i8* %4, i32 95)
%32 = icmp eq i8* %31, null
br i1 %32, label %37, label %33
33: ; preds = %0, %33
%34 = phi i8* [ %35, %33 ], [ %31, %0 ]
store i8 32, i8* %34
%35 = call i8* @strchr(i8* %4, i32 95)
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %33
37: ; preds = %33, %0
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%39 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
%40 = call i8* @strchr(i8* %4, i32 95)
%41 = icmp eq i8* %40, null
br i1 %41, label %46, label %42
42: ; preds = %37, %42
%43 = phi i8* [ %44, %42 ], [ %40, %37 ]
store i8 95, i8* %43
%44 = call i8* @strchr(i8* %4, i32 95)
%45 = icmp eq i8* %44, null
br i1 %45, label %46, label %42
46: ; preds = %42, %37
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%48 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tell_if_eq to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
ret i32 0
}