#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*/ getAndRunTest();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Which unit test would you like to run?\n");
  printf("1) deepCopyStr\n");
  printf("\ta) n = 2, src = \"test string\"\n");
  printf("\tb) n = 0 returns \"\\0\"\n");
  printf("\tc) negative n returns NULL\n");
  printf("2) isLowerOrDigitStr\n");
  printf("\ta) n = 4, src = \"testString\"\n");
  printf("\tb) n = 5, src = \"testString\"\n");
  printf("\tc) n = 0\n");
  printf("3) concatStrs\n");
  printf("\ta) n = 5, str1 = \"test\", str2 = \"string\"\n");
  printf("\tb) n = 5, str1 = \"\", str2 = \"test string\" returns \"test \"\n");
  printf("\tc) n = 5, str1 = \"test\", str2 = \"\" returns NULL\n");
  while (!getAndRunTest()) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getAndRunTest@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11e7 <main+0xc7>
jmp    11ec <main+0xcc>
jmp    11cb <main+0xab>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf51(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf51(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9e(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getAndRunTest@plt>
test   %eax,%eax
je     11c0 <main+0xa0>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Which unit test would you like to run?\0A\00"
@.str.1 = [16 x i8] c"1) deepCopyStr\0A\00"
@.str.2 = [32 x i8] c"\09a) n = 2, src = \22test string\22\0A\00"
@.str.3 = [24 x i8] c"\09b) n = 0 returns \22\\0\22\0A\00"
@.str.4 = [29 x i8] c"\09c) negative n returns NULL\0A\00"
@.str.5 = [22 x i8] c"2) isLowerOrDigitStr\0A\00"
@.str.6 = [31 x i8] c"\09a) n = 4, src = \22testString\22\0A\00"
@.str.7 = [31 x i8] c"\09b) n = 5, src = \22testString\22\0A\00"
@.str.8 = [11 x i8] c"\09c) n = 0\0A\00"
@.str.9 = [15 x i8] c"3) concatStrs\0A\00"
@.str.10 = [43 x i8] c"\09a) n = 5, str1 = \22test\22, str2 = \22string\22\0A\00"
@.str.11 = [60 x i8] c"\09b) n = 5, str1 = \22\22, str2 = \22test string\22 returns \22test \22\0A\00"
@.str.12 = [50 x i8] c"\09c) n = 5, str1 = \22test\22, str2 = \22\22 returns NULL\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0))
br label %15
15: ; preds = %19, %0
%16 = call i32 (...) @getAndRunTest()
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br i1 %18, label %19, label %20
19: ; preds = %15
br label %15
20: ; preds = %15
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@str = [39 x i8] c"Which unit test would you like to run?\00"
@str.13 = [15 x i8] c"1) deepCopyStr\00"
@str.14 = [31 x i8] c"\09a) n = 2, src = \22test string\22\00"
@str.15 = [23 x i8] c"\09b) n = 0 returns \22\\0\22\00"
@str.16 = [28 x i8] c"\09c) negative n returns NULL\00"
@str.17 = [21 x i8] c"2) isLowerOrDigitStr\00"
@str.18 = [30 x i8] c"\09a) n = 4, src = \22testString\22\00"
@str.19 = [30 x i8] c"\09b) n = 5, src = \22testString\22\00"
@str.20 = [10 x i8] c"\09c) n = 0\00"
@str.21 = [14 x i8] c"3) concatStrs\00"
@str.22 = [42 x i8] c"\09a) n = 5, str1 = \22test\22, str2 = \22string\22\00"
@str.23 = [59 x i8] c"\09b) n = 5, str1 = \22\22, str2 = \22test string\22 returns \22test \22\00"
@str.24 = [49 x i8] c"\09c) n = 5, str1 = \22test\22, str2 = \22\22 returns NULL\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.13, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.14, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.15, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.16, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.17, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.20, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.24, i64 0, i64 0))
br label %14
14: ; preds = %14, %0
%15 = tail call i32 (...) @getAndRunTest()
%16 = icmp eq i32 %15, 0
br i1 %16, label %14, label %17
17: ; preds = %14
ret i32 0
}