#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*/ print_usage(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ test_linsched_exponential(int, char **);
int /*<<< orphan*/ test_linsched_gaussian(int, char **);
int /*<<< orphan*/ test_linsched_lognormal(int, char **);
int /*<<< orphan*/ test_linsched_poisson(int, char **);
int /*<<< orphan*/ test_linsched_rand(int, char **);
int /*<<< orphan*/ test_linsched_rand_range(int, char **);
int linsched_test_main(int argc, char **argv) {
  if (argc == 4 && !strcmp(argv[1], "rand"))
    test_linsched_rand(argc, argv);
  else if (argc == 6 && !strcmp(argv[1], "rand_range"))
    test_linsched_rand_range(argc, argv);
  else if (argc == 6 && !strcmp(argv[1], "gaussian"))
    test_linsched_gaussian(argc, argv);
  else if (argc == 5 && !strcmp(argv[1], "poisson"))
    test_linsched_poisson(argc, argv);
  else if (argc == 5 && !strcmp(argv[1], "exp"))
    test_linsched_exponential(argc, argv);
  else if (argc == 6 && !strcmp(argv[1], "lnorm"))
    test_linsched_lognormal(argc, argv);
  else
    print_usage(argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<linsched_test_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    11c7 <linsched_test_main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe58(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11c7 <linsched_test_main+0x47>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <test_linsched_rand@plt>
jmp    1304 <linsched_test_main+0x184>
cmpl   $0x6,-0x4(%rbp)
jne    11ff <linsched_test_main+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe25(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11ff <linsched_test_main+0x7f>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <test_linsched_rand_range@plt>
jmp    12ff <linsched_test_main+0x17f>
cmpl   $0x6,-0x4(%rbp)
jne    1237 <linsched_test_main+0xb7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1237 <linsched_test_main+0xb7>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <test_linsched_gaussian@plt>
jmp    12fa <linsched_test_main+0x17a>
cmpl   $0x5,-0x4(%rbp)
jne    126f <linsched_test_main+0xef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    126f <linsched_test_main+0xef>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <test_linsched_poisson@plt>
jmp    12f5 <linsched_test_main+0x175>
cmpl   $0x5,-0x4(%rbp)
jne    12a7 <linsched_test_main+0x127>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd99(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12a7 <linsched_test_main+0x127>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_linsched_exponential@plt>
jmp    12f0 <linsched_test_main+0x170>
cmpl   $0x6,-0x4(%rbp)
jne    12df <linsched_test_main+0x15f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd65(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12df <linsched_test_main+0x15f>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <test_linsched_lognormal@plt>
jmp    12eb <linsched_test_main+0x16b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <print_usage@plt>
jmp    12f0 <linsched_test_main+0x170>
jmp    12f5 <linsched_test_main+0x175>
jmp    12fa <linsched_test_main+0x17a>
jmp    12ff <linsched_test_main+0x17f>
jmp    1304 <linsched_test_main+0x184>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linsched_test_main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x6,%edi
je     11c1 <linsched_test_main+0x41>
cmp    $0x5,%edi
je     120d <linsched_test_main+0x8d>
cmp    $0x4,%edi
jne    1237 <linsched_test_main+0xb7>
mov    0x8(%rbx),%rdi
lea    0xe5b(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1237 <linsched_test_main+0xb7>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <test_linsched_rand@plt>
jmp    123f <linsched_test_main+0xbf>
mov    0x8(%rbx),%r14
lea    0xe39(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1249 <linsched_test_main+0xc9>
lea    0xe31(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1267 <linsched_test_main+0xe7>
lea    0xe33(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1237 <linsched_test_main+0xb7>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1060 <test_linsched_lognormal@plt>
jmp    123f <linsched_test_main+0xbf>
mov    0x8(%rbx),%r14
lea    0xe01(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1258 <linsched_test_main+0xd8>
lea    0xdf6(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1276 <linsched_test_main+0xf6>
mov    (%rbx),%rdi
call   10a0 <print_usage@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x6,%edi
mov    %rbx,%rsi
call   1080 <test_linsched_rand_range@plt>
jmp    123f <linsched_test_main+0xbf>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1090 <test_linsched_poisson@plt>
jmp    123f <linsched_test_main+0xbf>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1070 <test_linsched_gaussian@plt>
jmp    123f <linsched_test_main+0xbf>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1030 <test_linsched_exponential@plt>
jmp    123f <linsched_test_main+0xbf>

LLVM IR (-O0):
@.str = [5 x i8] c"rand\00"
@.str.1 = [11 x i8] c"rand_range\00"
@.str.2 = [9 x i8] c"gaussian\00"
@.str.3 = [8 x i8] c"poisson\00"
@.str.4 = [4 x i8] c"exp\00"
@.str.5 = [6 x i8] c"lnorm\00"
define i32 @linsched_test_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = load i8**, i8*** %4
%16 = call i32 @test_linsched_rand(i32 %14, i8** %15)
br label %92
17: ; preds = %7, %2
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 6
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %20
%27 = load i32, i32* %3
%28 = load i8**, i8*** %4
%29 = call i32 @test_linsched_rand_range(i32 %27, i8** %28)
br label %91
30: ; preds = %20, %17
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 6
br i1 %32, label %33, label %43
33: ; preds = %30
%34 = load i8**, i8*** %4
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %33
%40 = load i32, i32* %3
%41 = load i8**, i8*** %4
%42 = call i32 @test_linsched_gaussian(i32 %40, i8** %41)
br label %90
43: ; preds = %33, %30
%44 = load i32, i32* %3
%45 = icmp eq i32 %44, 5
br i1 %45, label %46, label %56
46: ; preds = %43
%47 = load i8**, i8*** %4
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %56, label %52
52: ; preds = %46
%53 = load i32, i32* %3
%54 = load i8**, i8*** %4
%55 = call i32 @test_linsched_poisson(i32 %53, i8** %54)
br label %89
56: ; preds = %46, %43
%57 = load i32, i32* %3
%58 = icmp eq i32 %57, 5
br i1 %58, label %59, label %69
59: ; preds = %56
%60 = load i8**, i8*** %4
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i32 @strcmp(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%64 = icmp ne i32 %63, 0
br i1 %64, label %69, label %65
65: ; preds = %59
%66 = load i32, i32* %3
%67 = load i8**, i8*** %4
%68 = call i32 @test_linsched_exponential(i32 %66, i8** %67)
br label %88
69: ; preds = %59, %56
%70 = load i32, i32* %3
%71 = icmp eq i32 %70, 6
br i1 %71, label %72, label %82
72: ; preds = %69
%73 = load i8**, i8*** %4
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i32 @strcmp(i8* %75, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%77 = icmp ne i32 %76, 0
br i1 %77, label %82, label %78
78: ; preds = %72
%79 = load i32, i32* %3
%80 = load i8**, i8*** %4
%81 = call i32 @test_linsched_lognormal(i32 %79, i8** %80)
br label %87
82: ; preds = %72, %69
%83 = load i8**, i8*** %4
%84 = getelementptr inbounds i8*, i8** %83, i64 0
%85 = load i8*, i8** %84
%86 = call i32 @print_usage(i8* %85)
br label %87
87: ; preds = %82, %78
br label %88
88: ; preds = %87, %65
br label %89
89: ; preds = %88, %52
br label %90
90: ; preds = %89, %39
br label %91
91: ; preds = %90, %26
br label %92
92: ; preds = %91, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"rand\00"
@.str.1 = [11 x i8] c"rand_range\00"
@.str.2 = [9 x i8] c"gaussian\00"
@.str.3 = [8 x i8] c"poisson\00"
@.str.4 = [4 x i8] c"exp\00"
@.str.5 = [6 x i8] c"lnorm\00"
define i32 @linsched_test_main(i32 %0, i8** %1) {
switch i32 %0, label %39 [
i32 4, label %3
i32 6, label %10
i32 5, label %22
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %39
8: ; preds = %3
%9 = tail call i32 @test_linsched_rand(i32 4, i8** %1)
br label %42
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = tail call i32 @test_linsched_rand_range(i32 6, i8** %1)
br label %42
17: ; preds = %10
%18 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %34
20: ; preds = %17
%21 = tail call i32 @test_linsched_gaussian(i32 6, i8** %1)
br label %42
22: ; preds = %2
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = tail call i32 @test_linsched_poisson(i32 5, i8** %1)
br label %42
29: ; preds = %22
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = tail call i32 @test_linsched_exponential(i32 5, i8** %1)
br label %42
34: ; preds = %17
%35 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = tail call i32 @test_linsched_lognormal(i32 6, i8** %1)
br label %42
39: ; preds = %2, %29, %3, %34
%40 = load i8*, i8** %1
%41 = tail call i32 @print_usage(i8* %40)
br label %42
42: ; preds = %15, %27, %37, %39, %32, %20, %8
ret i32 0
}