int main(int argc, const char *argv[]) {
  int num = 3;
  char array[2][5] = {"even\0", "odd\0"};
  printf("num is %s\n", array[num & 1]);
  printf("\nIGNORE\n");
  test_str_clean("string", "si");
  printf("\nWorking\n");
  test_str_clean("string", "si");
  printf("\nMost Everything\n");
  test_str_clean("This is a string", "This");
  printf("\nEverything\n");
  test_str_clean("This is a string", "This is a string");
  printf("\nNot in String\n");
  test_str_clean("This is a string", "m");
  printf("\nWhite Space\n");
  test_str_clean("hi this is a string", " ");
  printf("\nAnother Test\n");
  test_str_clean("hi this is a string", "hs");
  printf("\nEmbedded Zero\n");
  test_str_clean("hi this is \0 a string", "hs");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0x16(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cltq
lea    -0x1e(%rbp),%rsi
imul   $0x5,%rax,%rax
add    %rax,%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    0xe95(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe68(%rip),%rsi
mov    %rsi,%rdi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe49(%rip),%rdi
lea    0xe75(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe46(%rip),%rdi
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd97(%rip),%rdi
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1040 <test_str_clean@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movzwl 0xeca(%rip),%eax
mov    %ax,0x10(%rsp)
mov    0xeb6(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xd(%rsp),%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rbx
lea    0xeaf(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe79(%rip),%rbx
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe52(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
lea    0xe37(%rip),%rbx
lea    0xe44(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
lea    0xe29(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
lea    0xdb7(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <test_str_clean@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.array = [2 x [5 x i8]] [[5 x i8] c"even\00", [5 x i8] c"odd\00\00"]
@.str = [11 x i8] c"num is %s\0A\00"
@.str.1 = [9 x i8] c"\0AIGNORE\0A\00"
@.str.2 = [7 x i8] c"string\00"
@.str.3 = [3 x i8] c"si\00"
@.str.4 = [10 x i8] c"\0AWorking\0A\00"
@.str.5 = [18 x i8] c"\0AMost Everything\0A\00"
@.str.6 = [17 x i8] c"This is a string\00"
@.str.7 = [5 x i8] c"This\00"
@.str.8 = [13 x i8] c"\0AEverything\0A\00"
@.str.9 = [16 x i8] c"\0ANot in String\0A\00"
@.str.10 = [2 x i8] c"m\00"
@.str.11 = [14 x i8] c"\0AWhite Space\0A\00"
@.str.12 = [20 x i8] c"hi this is a string\00"
@.str.13 = [2 x i8] c" \00"
@.str.14 = [15 x i8] c"\0AAnother Test\0A\00"
@.str.15 = [3 x i8] c"hs\00"
@.str.16 = [16 x i8] c"\0AEmbedded Zero\0A\00"
@.str.17 = [22 x i8] c"hi this is \00 a string\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [2 x [5 x i8]]
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 3, i32* %5
%7 = bitcast [2 x [5 x i8]]* %6 to i8*
%8 = load i32, i32* %5
%9 = and i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %6, i64 0, i64 %10
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%25 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
%27 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
%29 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [2 x [5 x i8]] [[5 x i8] c"even\00", [5 x i8] c"odd\00\00"]
@.str = [11 x i8] c"num is %s\0A\00"
@.str.2 = [7 x i8] c"string\00"
@.str.3 = [3 x i8] c"si\00"
@.str.6 = [17 x i8] c"This is a string\00"
@.str.7 = [5 x i8] c"This\00"
@.str.10 = [2 x i8] c"m\00"
@.str.12 = [20 x i8] c"hi this is a string\00"
@.str.13 = [2 x i8] c" \00"
@.str.15 = [3 x i8] c"hs\00"
@.str.17 = [22 x i8] c"hi this is \00 a string\00"
@str = [8 x i8] c"\0AIGNORE\00"
@str.18 = [9 x i8] c"\0AWorking\00"
@str.19 = [17 x i8] c"\0AMost Everything\00"
@str.20 = [12 x i8] c"\0AEverything\00"
@str.21 = [15 x i8] c"\0ANot in String\00"
@str.22 = [13 x i8] c"\0AWhite Space\00"
@str.23 = [14 x i8] c"\0AAnother Test\00"
@str.24 = [15 x i8] c"\0AEmbedded Zero\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x [5 x i8]]
%4 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %3, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %3, i64 0, i64 1, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.18, i64 0, i64 0))
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.19, i64 0, i64 0))
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.20, i64 0, i64 0))
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.21, i64 0, i64 0))
%16 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.23, i64 0, i64 0))
%20 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.24, i64 0, i64 0))
%22 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_str_clean to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}