#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int t1(int, char **);
int t2(int, char **);
int t3(int, char **);
int t4(int, char **);
int t5(int, char **);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int test_no;
  int rc = EXIT_SUCCESS;
  if (argc < 1) {
    usage();
    exit(EXIT_FAILURE);
  }
  test_no = atoi(argv[1]);
  switch (test_no) {
  case 1:
    rc = t1(argc, argv);
    break;
  case 2:
    rc = t2(argc, argv);
    break;
  case 3:
    rc = t3(argc, argv);
    break;
  case 4:
    rc = t4(argc, argv);
    break;
  case 5:
    rc = t5(argc, argv);
    break;
  default:
    fprintf(stderr, "unknow test number %s\n", argv[1]);
    break;
  }
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    11d1 <main+0x41>
mov    $0x0,%al
call   1070 <usage@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4,%eax
ja     126e <main+0xde>
mov    -0x20(%rbp),%rax
lea    0xdff(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <t1@plt>
mov    %eax,-0x18(%rbp)
jmp    128b <main+0xfb>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <t2@plt>
mov    %eax,-0x18(%rbp)
jmp    128b <main+0xfb>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <t3@plt>
mov    %eax,-0x18(%rbp)
jmp    128b <main+0xfb>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <t4@plt>
mov    %eax,-0x18(%rbp)
jmp    128b <main+0xfb>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <t5@plt>
mov    %eax,-0x18(%rbp)
jmp    128b <main+0xfb>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd8e(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    125c <main+0xcc>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x2e25(%rip),%rax
mov    (%rax),%r14d
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   10a0 <atoi@plt>
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     120e <main+0x7e>
lea    0xe37(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %ebp,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <t1@plt>
mov    %ebp,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <t3@plt>
mov    %ebp,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <t5@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
lea    0xdf6(%rip),%rsi
mov    %rbx,%rdx
call   1060 <fprintf@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <t2@plt>
mov    %ebp,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <t4@plt>
xor    %eax,%eax
call   1070 <usage@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"unknow test number %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @EXIT_SUCCESS
store i32 %8, i32* %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 (...) @usage()
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
switch i32 %20, label %41 [
i32 1, label %21
i32 2, label %25
i32 3, label %29
i32 4, label %33
i32 5, label %37
]
21: ; preds = %15
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @t1(i32 %22, i8** %23)
store i32 %24, i32* %7
br label %47
25: ; preds = %15
%26 = load i32, i32* %4
%27 = load i8**, i8*** %5
%28 = call i32 @t2(i32 %26, i8** %27)
store i32 %28, i32* %7
br label %47
29: ; preds = %15
%30 = load i32, i32* %4
%31 = load i8**, i8*** %5
%32 = call i32 @t3(i32 %30, i8** %31)
store i32 %32, i32* %7
br label %47
33: ; preds = %15
%34 = load i32, i32* %4
%35 = load i8**, i8*** %5
%36 = call i32 @t4(i32 %34, i8** %35)
store i32 %36, i32* %7
br label %47
37: ; preds = %15
%38 = load i32, i32* %4
%39 = load i8**, i8*** %5
%40 = call i32 @t5(i32 %38, i8** %39)
store i32 %40, i32* %7
br label %47
41: ; preds = %15
%42 = load i32, i32* @stderr
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %41, %37, %33, %29, %25, %21
%48 = load i32, i32* %7
ret i32 %48
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"unknow test number %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp slt i32 %0, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (...) @usage()
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
switch i32 %12, label %23 [
i32 1, label %13
i32 2, label %15
i32 3, label %17
i32 4, label %19
i32 5, label %21
]
13: ; preds = %9
%14 = tail call i32 @t1(i32 %0, i8** %1)
br label %26
15: ; preds = %9
%16 = tail call i32 @t2(i32 %0, i8** %1)
br label %26
17: ; preds = %9
%18 = tail call i32 @t3(i32 %0, i8** %1)
br label %26
19: ; preds = %9
%20 = tail call i32 @t4(i32 %0, i8** %1)
br label %26
21: ; preds = %9
%22 = tail call i32 @t5(i32 %0, i8** %1)
br label %26
23: ; preds = %9
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %26
26: ; preds = %23, %21, %19, %17, %15, %13
%27 = phi i32 [ %3, %23 ], [ %22, %21 ], [ %20, %19 ], [ %18, %17 ], [ %16, %15 ], [ %14, %13 ]
ret i32 %27
}