#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*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcompare(char *, char *);
int strlength(char *);
int main(int argc, const char *argv[]) {
  char *hello = "12345678";
  char test[] = "4444";
  printf("Length of %s is %d \n", hello, strlength(hello));
  printf("Length of %s is %d \n", test, strlength(test));
  printf("strcompare(%s,%s) is %s \n", hello, hello,
         strcompare(hello, hello) ? "true" : "false");
  printf("strcompare(%s,%s) is %s \n", hello, test,
         strcompare(hello, test) ? "true" : "false");
  printf("strcompare(%s,%s) is %s \n", "hello", "jello",
         strcompare("hello", "jello") ? "true" : "false");
  printf("strcompare(%s,%s) is %s \n\n", "hello", "hella",
         strcompare("hello", "hella") ? "true" : "false");
  char *myarray[4];
  myarray[0] = "Butch ";
  myarray[1] = "Cassidy ";
  myarray[2] = "and the Sundance ";
  myarray[3] = "Kid";
  printf("%s%s%s\n", myarray[0], myarray[1], myarray[2]);
  char *result8 = malloc((strlength(myarray[0]) + strlength(myarray[1]) +
                          strlength(myarray[2]) + strlength(myarray[3]) + 1) *
                         sizeof(char));
  for (int i = 0; i < 4; i++) {
    strcat(result8, myarray[i]);
  }
  printf("Result 8 is %s\n", result8);
  int match =
      (strlength(result8) == strlength(myarray[0]) + strlength(myarray[1]) +
                                 strlength(myarray[2]) + strlength(myarray[3]));
  printf("String lengths of original and concatted arrays %s\n",
         match ? "match" : "do not match");
  free(result8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe80(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe7f(%rip),%eax
mov    %eax,-0x1d(%rbp)
mov    0xe7a(%rip),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlength@plt>
mov    -0x90(%rbp),%rsi
mov    %eax,%edx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1d(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    -0x1d(%rbp),%rdi
call   1040 <strlength@plt>
mov    -0x88(%rbp),%rsi
mov    %eax,%edx
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <strcompare@plt>
mov    -0x80(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    %rax,%rdi
lea    0xe27(%rip),%rcx
lea    0xe1b(%rip),%rax
cmp    $0x0,%rdi
cmovne %rax,%rcx
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x1d(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1d(%rbp),%rsi
call   1070 <strcompare@plt>
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    %rax,%rdi
lea    0xddb(%rip),%rcx
lea    0xdcf(%rip),%rax
cmp    $0x0,%rdi
cmovne %rax,%rcx
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdbd(%rip),%rdi
lea    0xdbc(%rip),%rsi
call   1070 <strcompare@plt>
mov    %rax,%rdx
lea    0xda1(%rip),%rcx
lea    0xd95(%rip),%rax
cmp    $0x0,%rdx
cmovne %rax,%rcx
lea    0xd6c(%rip),%rdi
lea    0xd8a(%rip),%rsi
lea    0xd89(%rip),%rdx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd75(%rip),%rdi
lea    0xd95(%rip),%rsi
call   1070 <strcompare@plt>
mov    %rax,%rdx
lea    0xd59(%rip),%rcx
lea    0xd4d(%rip),%rax
cmp    $0x0,%rdx
cmovne %rax,%rcx
lea    0xd55(%rip),%rdi
lea    0xd42(%rip),%rsi
lea    0xd62(%rip),%rdx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd5a(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xd56(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xd54(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xd5b(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x54(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x4,-0x4c(%rbp)
jge    13e1 <main+0x281>
mov    -0x48(%rbp),%rdi
movslq -0x4c(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rsi
call   1080 <strcat@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13b7 <main+0x257>
mov    -0x48(%rbp),%rsi
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,-0x94(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,-0xa0(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlength@plt>
mov    %eax,%ecx
mov    -0x9c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x98(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlength@plt>
mov    -0x98(%rbp),%ecx
mov    %eax,%edx
mov    -0x94(%rbp),%eax
add    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%ecx
lea    0xc74(%rip),%rsi
lea    0xc74(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xc2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x34343434,(%rsp)
lea    0xe82(%rip),%r14
mov    %r14,%rdi
call   1040 <strlength@plt>
lea    0xe81(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <strlength@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r14,%rsi
call   1070 <strcompare@plt>
test   %rax,%rax
lea    0xe77(%rip),%rbp
lea    0xe6b(%rip),%rbx
mov    %rbx,%rcx
cmove  %rbp,%rcx
lea    0xe43(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <strcompare@plt>
test   %rax,%rax
mov    %rbx,%rcx
cmove  %rbp,%rcx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe2c(%rip),%r14
lea    0xe2b(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <strcompare@plt>
test   %rax,%rax
mov    %rbx,%rcx
cmove  %rbp,%rcx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe20(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <strcompare@plt>
test   %rax,%rax
cmove  %rbp,%rbx
lea    0xdec(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe1c(%rip),%rdi
lea    0xdef(%rip),%rbx
lea    0xdef(%rip),%rbp
lea    0xdf1(%rip),%r12
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlength@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <strlength@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1040 <strlength@plt>
mov    %eax,%r13d
lea    0xdcd(%rip),%r15
mov    %r15,%rdi
call   1040 <strlength@plt>
add    %ebx,%ebp
add    %r13d,%ebp
lea    (%rax,%rbp,1),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
lea    0xd86(%rip),%rbx
mov    %rbx,%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
lea    0xd7b(%rip),%rbp
mov    %rbp,%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
lea    0xd7d(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <strlength@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1040 <strlength@plt>
mov    %eax,%r12d
mov    %rbp,%rdi
call   1040 <strlength@plt>
mov    %eax,%ebp
add    %r12d,%ebp
lea    0xd2b(%rip),%rdi
call   1040 <strlength@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15,%rdi
call   1040 <strlength@plt>
add    %ebx,%eax
cmp    %eax,%r13d
lea    0xd77(%rip),%rax
lea    0xd69(%rip),%rsi
cmove  %rax,%rsi
lea    0xd2a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"12345678\00"
@__const.main.test = [5 x i8] c"4444\00"
@.str.1 = [21 x i8] c"Length of %s is %d \0A\00"
@.str.2 = [26 x i8] c"strcompare(%s,%s) is %s \0A\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [6 x i8] c"false\00"
@.str.5 = [6 x i8] c"hello\00"
@.str.6 = [6 x i8] c"jello\00"
@.str.7 = [27 x i8] c"strcompare(%s,%s) is %s \0A\0A\00"
@.str.8 = [6 x i8] c"hella\00"
@.str.9 = [7 x i8] c"Butch \00"
@.str.10 = [9 x i8] c"Cassidy \00"
@.str.11 = [18 x i8] c"and the Sundance \00"
@.str.12 = [4 x i8] c"Kid\00"
@.str.13 = [8 x i8] c"%s%s%s\0A\00"
@.str.14 = [16 x i8] c"Result 8 is %s\0A\00"
@.str.15 = [52 x i8] c"String lengths of original and concatted arrays %s\0A\00"
@.str.16 = [6 x i8] c"match\00"
@.str.17 = [13 x i8] c"do not match\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [5 x i8]
%8 = alloca [4 x i8*]
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
%12 = bitcast [5 x i8]* %7 to i8*
%13 = load i8*, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @strlength(i8* %14)
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15)
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%19 = call i32 @strlength(i8* %18)
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %17, i32 %19)
%21 = load i8*, i8** %6
%22 = load i8*, i8** %6
%23 = load i8*, i8** %6
%24 = load i8*, i8** %6
%25 = call i64 @strcompare(i8* %23, i8* %24)
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %21, i8* %22, i8* %28)
%30 = load i8*, i8** %6
%31 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%32 = load i8*, i8** %6
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%34 = call i64 @strcompare(i8* %32, i8* %33)
%35 = icmp ne i64 %34, 0
%36 = zext i1 %35 to i64
%37 = select i1 %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%38 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %30, i8* %31, i8* %37)
%39 = call i64 @strcompare(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp ne i64 %39, 0
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%43 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %42)
%44 = call i64 @strcompare(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%45 = icmp ne i64 %44, 0
%46 = zext i1 %45 to i64
%47 = select i1 %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%48 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %47)
%49 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8** %49
%50 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8** %50
%51 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 2
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8** %51
%52 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8** %52
%53 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
%54 = load i8*, i8** %53
%55 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 1
%56 = load i8*, i8** %55
%57 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 2
%58 = load i8*, i8** %57
%59 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8* %54, i8* %56, i8* %58)
%60 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
%61 = load i8*, i8** %60
%62 = call i32 @strlength(i8* %61)
%63 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 1
%64 = load i8*, i8** %63
%65 = call i32 @strlength(i8* %64)
%66 = add nsw i32 %62, %65
%67 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 2
%68 = load i8*, i8** %67
%69 = call i32 @strlength(i8* %68)
%70 = add nsw i32 %66, %69
%71 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 3
%72 = load i8*, i8** %71
%73 = call i32 @strlength(i8* %72)
%74 = add nsw i32 %70, %73
%75 = add nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = mul i64 %76, 1
%78 = trunc i64 %77 to i32
%79 = call i8* @malloc(i32 %78)
store i8* %79, i8** %9
store i32 0, i32* %10
br label %80
80: ; preds = %90, %2
%81 = load i32, i32* %10
%82 = icmp slt i32 %81, 4
br i1 %82, label %83, label %93
83: ; preds = %80
%84 = load i8*, i8** %9
%85 = load i32, i32* %10
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 %86
%88 = load i8*, i8** %87
%89 = call i32 @strcat(i8* %84, i8* %88)
br label %90
90: ; preds = %83
%91 = load i32, i32* %10
%92 = add nsw i32 %91, 1
store i32 %92, i32* %10
br label %80
93: ; preds = %80
%94 = load i8*, i8** %9
%95 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8* %94)
%96 = load i8*, i8** %9
%97 = call i32 @strlength(i8* %96)
%98 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
%99 = load i8*, i8** %98
%100 = call i32 @strlength(i8* %99)
%101 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 1
%102 = load i8*, i8** %101
%103 = call i32 @strlength(i8* %102)
%104 = add nsw i32 %100, %103
%105 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 2
%106 = load i8*, i8** %105
%107 = call i32 @strlength(i8* %106)
%108 = add nsw i32 %104, %107
%109 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 3
%110 = load i8*, i8** %109
%111 = call i32 @strlength(i8* %110)
%112 = add nsw i32 %108, %111
%113 = icmp eq i32 %97, %112
%114 = zext i1 %113 to i32
store i32 %114, i32* %11
%115 = load i32, i32* %11
%116 = icmp ne i32 %115, 0
%117 = zext i1 %116 to i64
%118 = select i1 %116, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0)
%119 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.15, i64 0, i64 0), i8* %118)
%120 = load i8*, i8** %9
%121 = call i32 @free(i8* %120)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"12345678\00"
@__const.main.test = [5 x i8] c"4444\00"
@.str.1 = [21 x i8] c"Length of %s is %d \0A\00"
@.str.2 = [26 x i8] c"strcompare(%s,%s) is %s \0A\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [6 x i8] c"false\00"
@.str.5 = [6 x i8] c"hello\00"
@.str.6 = [6 x i8] c"jello\00"
@.str.7 = [27 x i8] c"strcompare(%s,%s) is %s \0A\0A\00"
@.str.8 = [6 x i8] c"hella\00"
@.str.9 = [7 x i8] c"Butch \00"
@.str.10 = [9 x i8] c"Cassidy \00"
@.str.11 = [18 x i8] c"and the Sundance \00"
@.str.12 = [4 x i8] c"Kid\00"
@.str.13 = [8 x i8] c"%s%s%s\0A\00"
@.str.14 = [16 x i8] c"Result 8 is %s\0A\00"
@.str.15 = [52 x i8] c"String lengths of original and concatted arrays %s\0A\00"
@.str.16 = [6 x i8] c"match\00"
@.str.17 = [13 x i8] c"do not match\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strlength(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @strlength(i8* %4)
%8 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %7)
%9 = call i64 @strcompare(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i64 @strcompare(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %15)
%17 = call i64 @strcompare(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %19)
%21 = call i64 @strcompare(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%24 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %23)
%25 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%26 = call i32 @strlength(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%27 = call i32 @strlength(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%28 = call i32 @strlength(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%29 = call i32 @strlength(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%30 = add i32 %26, 1
%31 = add i32 %30, %27
%32 = add i32 %31, %28
%33 = add i32 %32, %29
%34 = call i8* @malloc(i32 %33)
%35 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%36 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%37 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%38 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%39 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8* %34)
%40 = call i32 @strlength(i8* %34)
%41 = call i32 @strlength(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%42 = call i32 @strlength(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%43 = add nsw i32 %42, %41
%44 = call i32 @strlength(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%45 = add nsw i32 %43, %44
%46 = call i32 @strlength(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%47 = add nsw i32 %45, %46
%48 = icmp eq i32 %40, %47
%49 = select i1 %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0)
%50 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.15, i64 0, i64 0), i8* %49)
%51 = call i32 @free(i8* %34)
ret i32 0
}