#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*/ concatStrsTestA();
int /*<<< orphan*/ concatStrsTestB();
int /*<<< orphan*/ concatStrsTestC();
int /*<<< orphan*/ deepCopyStrTestA();
int /*<<< orphan*/ deepCopyStrTestB();
int /*<<< orphan*/ deepCopyStrTestC();
int /*<<< orphan*/ flushStdin();
int /*<<< orphan*/ isLowerOrDigitStrTestA();
int /*<<< orphan*/ isLowerOrDigitStrTestB();
int /*<<< orphan*/ isLowerOrDigitStrTestC();
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *, char *);
bool getAndRunTest() {
  int numTest;
  char caseTest;
  bool rightInput = false;
  while (!rightInput) {
    int testAndCase = scanf("%d %c", &numTest, &caseTest);
    flushStdin();
    if (testAndCase == 0) {
      printf("Enter 1, 2, or 3 for the function to test.\n");
      continue;
    } else if (testAndCase == 1) {
      printf("Enter 1, 2, or 3 for the function to test.\n");
      continue;
    } else {
      if ((numTest < 1 || numTest > 3) &&
          (caseTest >= 'a' && caseTest <= 'c')) {
        printf("Enter 1, 2, or 3 for the function to test.\n");
        continue;
      } else if ((numTest >= 1 && numTest <= 3) &&
                 (caseTest < 'a' || caseTest > 'c')) {
        printf("Enter a, b, or c for the test case.\n");
        continue;
      } else {
        if (numTest == 1) {
          switch (caseTest) {
          case 'a':
            deepCopyStrTestA();
            break;
          case 'b':
            deepCopyStrTestB();
            break;
          case 'c':
            deepCopyStrTestC();
            break;
          }
        } else if (numTest == 2) {
          switch (caseTest) {
          case 'a':
            isLowerOrDigitStrTestA();
            break;
          case 'b':
            isLowerOrDigitStrTestB();
            break;
          case 'c':
            isLowerOrDigitStrTestC();
            break;
          }
        } else {
          switch (caseTest) {
          case 'a':
            concatStrsTestA();
            break;
          case 'b':
            concatStrsTestB();
            break;
          case 'c':
            concatStrsTestC();
            break;
          }
        }
      }
      rightInput = true;
      continue;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<getAndRunTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11e5 <getAndRunTest+0x25>
jmp    13f7 <getAndRunTest+0x237>
lea    0xe14(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x5(%rbp),%rdx
call   1080 <scanf@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   10d0 <flushStdin@plt>
cmpl   $0x0,-0x10(%rbp)
jne    121e <getAndRunTest+0x5e>
lea    0xdf2(%rip),%rdi
call   1040 <printf@plt>
jmp    11cf <getAndRunTest+0xf>
cmpl   $0x1,-0x10(%rbp)
jne    1239 <getAndRunTest+0x79>
lea    0xdd7(%rip),%rdi
call   1040 <printf@plt>
jmp    11cf <getAndRunTest+0xf>
cmpl   $0x1,-0x4(%rbp)
jl     124d <getAndRunTest+0x8d>
cmpl   $0x3,-0x4(%rbp)
jle    1278 <getAndRunTest+0xb8>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1278 <getAndRunTest+0xb8>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
jg     1278 <getAndRunTest+0xb8>
lea    0xd98(%rip),%rdi
call   1040 <printf@plt>
jmp    11cf <getAndRunTest+0xf>
cmpl   $0x1,-0x4(%rbp)
jl     12b7 <getAndRunTest+0xf7>
cmpl   $0x3,-0x4(%rbp)
jg     12b7 <getAndRunTest+0xf7>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     12a6 <getAndRunTest+0xe6>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
jle    12b7 <getAndRunTest+0xf7>
lea    0xd85(%rip),%rdi
call   1040 <printf@plt>
jmp    11cf <getAndRunTest+0xf>
cmpl   $0x1,-0x4(%rbp)
jne    131c <getAndRunTest+0x15c>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x61,%eax
je     12f8 <getAndRunTest+0x138>
jmp    12d6 <getAndRunTest+0x116>
mov    -0x14(%rbp),%eax
sub    $0x62,%eax
je     1304 <getAndRunTest+0x144>
jmp    12e7 <getAndRunTest+0x127>
mov    -0x14(%rbp),%eax
sub    $0x63,%eax
je     1310 <getAndRunTest+0x150>
jmp    1317 <getAndRunTest+0x157>
mov    $0x0,%al
call   10e0 <deepCopyStrTestA@plt>
jmp    1317 <getAndRunTest+0x157>
mov    $0x0,%al
call   1060 <deepCopyStrTestB@plt>
jmp    1317 <getAndRunTest+0x157>
mov    $0x0,%al
call   10b0 <deepCopyStrTestC@plt>
jmp    13e1 <getAndRunTest+0x221>
cmpl   $0x2,-0x4(%rbp)
jne    1381 <getAndRunTest+0x1c1>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x61,%eax
je     135d <getAndRunTest+0x19d>
jmp    133b <getAndRunTest+0x17b>
mov    -0x18(%rbp),%eax
sub    $0x62,%eax
je     1369 <getAndRunTest+0x1a9>
jmp    134c <getAndRunTest+0x18c>
mov    -0x18(%rbp),%eax
sub    $0x63,%eax
je     1375 <getAndRunTest+0x1b5>
jmp    137c <getAndRunTest+0x1bc>
mov    $0x0,%al
call   10c0 <isLowerOrDigitStrTestA@plt>
jmp    137c <getAndRunTest+0x1bc>
mov    $0x0,%al
call   1050 <isLowerOrDigitStrTestB@plt>
jmp    137c <getAndRunTest+0x1bc>
mov    $0x0,%al
call   10a0 <isLowerOrDigitStrTestC@plt>
jmp    13dc <getAndRunTest+0x21c>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x61,%eax
je     13b8 <getAndRunTest+0x1f8>
jmp    1396 <getAndRunTest+0x1d6>
mov    -0x1c(%rbp),%eax
sub    $0x62,%eax
je     13c4 <getAndRunTest+0x204>
jmp    13a7 <getAndRunTest+0x1e7>
mov    -0x1c(%rbp),%eax
sub    $0x63,%eax
je     13d0 <getAndRunTest+0x210>
jmp    13d7 <getAndRunTest+0x217>
mov    $0x0,%al
call   1070 <concatStrsTestA@plt>
jmp    13d7 <getAndRunTest+0x217>
mov    $0x0,%al
call   1030 <concatStrsTestB@plt>
jmp    13d7 <getAndRunTest+0x217>
mov    $0x0,%al
call   1090 <concatStrsTestC@plt>
jmp    13dc <getAndRunTest+0x21c>
jmp    13e1 <getAndRunTest+0x221>
jmp    13e6 <getAndRunTest+0x226>
jmp    13eb <getAndRunTest+0x22b>
movl   $0x1,-0xc(%rbp)
jmp    11cf <getAndRunTest+0xf>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAndRunTest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe2e(%rip),%r14
lea    0x4(%rsp),%r15
lea    0x3(%rsp),%r12
lea    0xe47(%rip),%rbx
lea    0xe1c(%rip),%r13
jmp    11f5 <getAndRunTest+0x35>
nopl   0x0(%rax)
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1080 <scanf@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10d0 <flushStdin@plt>
mov    %rbx,%rdi
cmp    $0x2,%ebp
jb     11f0 <getAndRunTest+0x30>
mov    0x4(%rsp),%ecx
lea    -0x4(%rcx),%edx
movzbl 0x3(%rsp),%eax
cmp    $0xfffffffc,%edx
ja     1230 <getAndRunTest+0x70>
cmp    $0x61,%al
jl     1230 <getAndRunTest+0x70>
mov    %rbx,%rdi
cmp    $0x64,%al
jl     11f0 <getAndRunTest+0x30>
movsbl %al,%eax
lea    -0x1(%rcx),%edx
cmp    $0x2,%edx
ja     1246 <getAndRunTest+0x86>
lea    -0x64(%rax),%edx
mov    %r13,%rdi
cmp    $0xfd,%dl
jb     11f0 <getAndRunTest+0x30>
cmp    $0x2,%ecx
je     1268 <getAndRunTest+0xa8>
cmp    $0x1,%ecx
jne    1280 <getAndRunTest+0xc0>
cmp    $0x63,%eax
je     1298 <getAndRunTest+0xd8>
cmp    $0x62,%eax
je     12a1 <getAndRunTest+0xe1>
cmp    $0x61,%eax
jne    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   10e0 <deepCopyStrTestA@plt>
jmp    12cc <getAndRunTest+0x10c>
cmp    $0x63,%eax
je     12aa <getAndRunTest+0xea>
cmp    $0x62,%eax
je     12b3 <getAndRunTest+0xf3>
cmp    $0x61,%eax
jne    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   10c0 <isLowerOrDigitStrTestA@plt>
jmp    12cc <getAndRunTest+0x10c>
cmp    $0x63,%eax
je     12bc <getAndRunTest+0xfc>
cmp    $0x62,%eax
je     12c5 <getAndRunTest+0x105>
cmp    $0x61,%eax
jne    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   1070 <concatStrsTestA@plt>
jmp    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   10b0 <deepCopyStrTestC@plt>
jmp    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   1060 <deepCopyStrTestB@plt>
jmp    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   10a0 <isLowerOrDigitStrTestC@plt>
jmp    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   1050 <isLowerOrDigitStrTestB@plt>
jmp    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   1090 <concatStrsTestC@plt>
jmp    12cc <getAndRunTest+0x10c>
xor    %eax,%eax
call   1030 <concatStrsTestB@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %c\00"
@.str.1 = [44 x i8] c"Enter 1, 2, or 3 for the function to test.\0A\00"
@.str.2 = [37 x i8] c"Enter a, b, or c for the test case.\0A\00"
define i32 @getAndRunTest() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
br label %5
5: ; preds = %92, %51, %35, %19, %14, %0
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %93
9: ; preds = %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %2)
store i32 %10, i32* %4
%11 = call i32 (...) @flushStdin()
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %5
16: ; preds = %9
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %5
21: ; preds = %16
%22 = load i32, i32* %1
%23 = icmp slt i32 %22, 1
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %1
%26 = icmp sgt i32 %25, 3
br i1 %26, label %27, label %37
27: ; preds = %24, %21
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp sge i32 %29, 97
br i1 %30, label %31, label %37
31: ; preds = %27
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp sle i32 %33, 99
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %5
37: ; preds = %31, %27, %24
%38 = load i32, i32* %1
%39 = icmp sge i32 %38, 1
br i1 %39, label %40, label %53
40: ; preds = %37
%41 = load i32, i32* %1
%42 = icmp sle i32 %41, 3
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = icmp slt i32 %45, 97
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i8, i8* %2
%49 = sext i8 %48 to i32
%50 = icmp sgt i32 %49, 99
br i1 %50, label %51, label %53
51: ; preds = %47, %43
%52 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %5
53: ; preds = %47, %40, %37
%54 = load i32, i32* %1
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i8, i8* %2
%58 = sext i8 %57 to i32
switch i32 %58, label %65 [
i32 97, label %59
i32 98, label %61
i32 99, label %63
]
59: ; preds = %56
%60 = call i32 (...) @deepCopyStrTestA()
br label %65
61: ; preds = %56
%62 = call i32 (...) @deepCopyStrTestB()
br label %65
63: ; preds = %56
%64 = call i32 (...) @deepCopyStrTestC()
br label %65
65: ; preds = %56, %63, %61, %59
br label %90
66: ; preds = %53
%67 = load i32, i32* %1
%68 = icmp eq i32 %67, 2
br i1 %68, label %69, label %79
69: ; preds = %66
%70 = load i8, i8* %2
%71 = sext i8 %70 to i32
switch i32 %71, label %78 [
i32 97, label %72
i32 98, label %74
i32 99, label %76
]
72: ; preds = %69
%73 = call i32 (...) @isLowerOrDigitStrTestA()
br label %78
74: ; preds = %69
%75 = call i32 (...) @isLowerOrDigitStrTestB()
br label %78
76: ; preds = %69
%77 = call i32 (...) @isLowerOrDigitStrTestC()
br label %78
78: ; preds = %69, %76, %74, %72
br label %89
79: ; preds = %66
%80 = load i8, i8* %2
%81 = sext i8 %80 to i32
switch i32 %81, label %88 [
i32 97, label %82
i32 98, label %84
i32 99, label %86
]
82: ; preds = %79
%83 = call i32 (...) @concatStrsTestA()
br label %88
84: ; preds = %79
%85 = call i32 (...) @concatStrsTestB()
br label %88
86: ; preds = %79
%87 = call i32 (...) @concatStrsTestC()
br label %88
88: ; preds = %79, %86, %84, %82
br label %89
89: ; preds = %88, %78
br label %90
90: ; preds = %89, %65
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91
store i32 1, i32* %3
br label %5
93: ; preds = %5
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %c\00"
@str = [36 x i8] c"Enter a, b, or c for the test case.\00"
@str.5 = [43 x i8] c"Enter 1, 2, or 3 for the function to test.\00"
define i32 @getAndRunTest() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
br label %4
4: ; preds = %48, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %2)
%6 = call i32 (...) @flushStdin()
switch i32 %5, label %8 [
i32 0, label %48
i32 1, label %7
]
7: ; preds = %4
br label %48
8: ; preds = %4
%9 = load i32, i32* %1
%10 = add i32 %9, -4
%11 = icmp ult i32 %10, -3
%12 = load i8, i8* %2
%13 = icmp sgt i8 %12, 96
%14 = select i1 %11, i1 %13, i1 false
%15 = icmp slt i8 %12, 100
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %48, label %17
17: ; preds = %8
%18 = add i32 %9, -1
%19 = icmp ult i32 %18, 3
%20 = add i8 %12, -100
%21 = icmp ult i8 %20, -3
%22 = select i1 %19, i1 %21, i1 false
br i1 %22, label %48, label %23
23: ; preds = %17
switch i32 %9, label %40 [
i32 1, label %24
i32 2, label %32
]
24: ; preds = %23
%25 = sext i8 %12 to i32
switch i32 %25, label %51 [
i32 97, label %26
i32 98, label %28
i32 99, label %30
]
26: ; preds = %24
%27 = call i32 (...) @deepCopyStrTestA()
br label %51
28: ; preds = %24
%29 = call i32 (...) @deepCopyStrTestB()
br label %51
30: ; preds = %24
%31 = call i32 (...) @deepCopyStrTestC()
br label %51
32: ; preds = %23
%33 = sext i8 %12 to i32
switch i32 %33, label %51 [
i32 97, label %34
i32 98, label %36
i32 99, label %38
]
34: ; preds = %32
%35 = call i32 (...) @isLowerOrDigitStrTestA()
br label %51
36: ; preds = %32
%37 = call i32 (...) @isLowerOrDigitStrTestB()
br label %51
38: ; preds = %32
%39 = call i32 (...) @isLowerOrDigitStrTestC()
br label %51
40: ; preds = %23
%41 = sext i8 %12 to i32
switch i32 %41, label %51 [
i32 97, label %42
i32 98, label %44
i32 99, label %46
]
42: ; preds = %40
%43 = call i32 (...) @concatStrsTestA()
br label %51
44: ; preds = %40
%45 = call i32 (...) @concatStrsTestB()
br label %51
46: ; preds = %40
%47 = call i32 (...) @concatStrsTestC()
br label %51
48: ; preds = %17, %8, %4, %7
%49 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0), %4 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0), %17 ]
%50 = call i32 @puts(i8* dereferenceable(1) %49)
br label %4
51: ; preds = %24, %30, %28, %26, %42, %44, %46, %40, %34, %36, %38, %32
ret i32 1
}