#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*/ puts(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test_args(int, char **);
int /*<<< orphan*/ test_cat(char *);
int /*<<< orphan*/ test_constructor();
int /*<<< orphan*/ test_gettime();
int /*<<< orphan*/ test_perf_fib(int);
int /*<<< orphan*/ test_printf();
int /*<<< orphan*/ test_random();
int /*<<< orphan*/ test_trap();
int /*<<< orphan*/ test_write();
int main(int argc, char **argv) {
  test_write();
  test_constructor();
  test_printf();
  test_args(argc, argv);
  test_gettime();
  test_random();
  if (0 == strcmp(argv[1], "trap")) {
    test_trap();
  }
  test_perf_fib(20);
  if (0 == strcmp(argv[1], "cat")) {
    test_cat(argv[2]);
  }
  puts("=== done ===");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_write@plt>
mov    $0x0,%al
call   10a0 <test_constructor@plt>
mov    $0x0,%al
call   1080 <test_printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <test_args@plt>
mov    $0x0,%al
call   10d0 <test_gettime@plt>
mov    $0x0,%al
call   1030 <test_random@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfc(%rip),%rsi
call   10c0 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    121e <main+0x6e>
mov    $0x0,%al
call   1070 <test_trap@plt>
mov    $0x14,%edi
call   1060 <test_perf_fib@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdce(%rip),%rsi
call   10c0 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1257 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <test_cat@plt>
lea    0xdab(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <test_write@plt>
xor    %eax,%eax
call   10a0 <test_constructor@plt>
xor    %eax,%eax
call   1080 <test_printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <test_args@plt>
xor    %eax,%eax
call   10d0 <test_gettime@plt>
xor    %eax,%eax
call   1030 <test_random@plt>
mov    0x8(%rbx),%rdi
lea    0xe10(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    1201 <main+0x51>
xor    %eax,%eax
call   1070 <test_trap@plt>
mov    $0x14,%edi
call   1060 <test_perf_fib@plt>
mov    0x8(%rbx),%rdi
lea    0xdef(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    1229 <main+0x79>
mov    0x10(%rbx),%rdi
call   10b0 <test_cat@plt>
lea    0xdd9(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"trap\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [13 x i8] c"=== done ===\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_write()
%7 = call i32 (...) @test_constructor()
%8 = call i32 (...) @test_printf()
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @test_args(i32 %9, i8** %10)
%12 = call i32 (...) @test_gettime()
%13 = call i32 (...) @test_random()
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 0, %17
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @test_trap()
br label %21
21: ; preds = %19, %2
%22 = call i32 @test_perf_fib(i32 20)
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 0, %26
br i1 %27, label %28, label %33
28: ; preds = %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32 @test_cat(i8* %31)
br label %33
33: ; preds = %28, %21
%34 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"trap\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [13 x i8] c"=== done ===\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @test_write()
%4 = tail call i32 (...) @test_constructor()
%5 = tail call i32 (...) @test_printf()
%6 = tail call i32 @test_args(i32 %0, i8** %1)
%7 = tail call i32 (...) @test_gettime()
%8 = tail call i32 (...) @test_random()
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = tail call i32 (...) @test_trap()
br label %15
15: ; preds = %13, %2
%16 = tail call i32 @test_perf_fib(i32 20)
%17 = load i8*, i8** %9
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @test_cat(i8* %22)
br label %24
24: ; preds = %20, %15
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}