#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*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test_algorithm();
int /*<<< orphan*/ test_logging(int);
int /*<<< orphan*/ test_statistic();
int /*<<< orphan*/ test_utility();
int main(int argc, char **argv) {
  printf("----------------------------\n");
  printf("\t test statistic\n");
  printf("----------------------------\n");
  test_statistic();
  printf("----------------------------\n");
  printf("\t test algorithm\n");
  printf("----------------------------\n");
  test_algorithm();
  printf("----------------------------\n");
  printf("\t test utility\n");
  printf("----------------------------\n");
  test_utility();
  printf("----------------------------\n");
  printf("\t test logging\n");
  printf("----------------------------\n");
  int priority = 10;
  if (argc > 1) {
    if (strcmp(argv[1], "log_level_trace") == 0) {
      priority = 1;
    } else if (strcmp(argv[1], "log_level_debug") == 0) {
      priority = 2;
    } else if (strcmp(argv[1], "log_level_info") == 0) {
      priority = 3;
    } else if (strcmp(argv[1], "log_level_warning") == 0) {
      priority = 5;
    } else if (strcmp(argv[1], "log_level_error") == 0) {
      priority = 6;
    }
  }
  test_logging(priority);
}


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)
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_statistic@plt>
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe40(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <test_algorithm@plt>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_utility@plt>
lea    0xe02(%rip),%rdi
call   1040 <printf@plt>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
lea    0xdea(%rip),%rdi
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1312 <main+0x1b2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe27(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1256 <main+0xf6>
movl   $0x1,-0x14(%rbp)
jmp    130d <main+0x1ad>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1280 <main+0x120>
movl   $0x2,-0x14(%rbp)
jmp    1308 <main+0x1a8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf3(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12aa <main+0x14a>
movl   $0x3,-0x14(%rbp)
jmp    1303 <main+0x1a3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12d4 <main+0x174>
movl   $0x5,-0x14(%rbp)
jmp    12fe <main+0x19e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12f9 <main+0x199>
movl   $0x6,-0x14(%rbp)
jmp    12fe <main+0x19e>
jmp    1303 <main+0x1a3>
jmp    1308 <main+0x1a8>
jmp    130d <main+0x1ad>
jmp    1312 <main+0x1b2>
mov    -0x14(%rbp),%edi
call   1080 <test_logging@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xf21(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_statistic@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <test_algorithm@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <test_utility@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
cmp    $0x2,%ebp
jl     1292 <main+0x132>
mov    0x8(%r14),%rdi
lea    0xdf2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1278 <main+0x118>
mov    0x8(%r14),%rdi
lea    0xded(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     127f <main+0x11f>
mov    0x8(%r14),%rdi
lea    0xde8(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1286 <main+0x126>
mov    0x8(%r14),%rdi
lea    0xde2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     128d <main+0x12d>
mov    0x8(%r14),%rdi
lea    0xddf(%rip),%rsi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0x6(,%rcx,4),%edi
jmp    1292 <main+0x132>
mov    $0x1,%edi
jmp    1292 <main+0x132>
mov    $0x2,%edi
jmp    1292 <main+0x132>
mov    $0x3,%edi
jmp    1292 <main+0x132>
mov    $0x5,%edi
call   1080 <test_logging@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"----------------------------\0A\00"
@.str.1 = [18 x i8] c"\09 test statistic\0A\00"
@.str.2 = [18 x i8] c"\09 test algorithm\0A\00"
@.str.3 = [16 x i8] c"\09 test utility\0A\00"
@.str.4 = [16 x i8] c"\09 test logging\0A\00"
@.str.5 = [16 x i8] c"log_level_trace\00"
@.str.6 = [16 x i8] c"log_level_debug\00"
@.str.7 = [15 x i8] c"log_level_info\00"
@.str.8 = [18 x i8] c"log_level_warning\00"
@.str.9 = [16 x i8] c"log_level_error\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @test_statistic()
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @test_algorithm()
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (...) @test_utility()
%19 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 10, i32* %6
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 1
br i1 %23, label %24, label %64
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %24
store i32 1, i32* %6
br label %63
31: ; preds = %24
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 2, i32* %6
br label %62
38: ; preds = %31
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %38
store i32 3, i32* %6
br label %61
45: ; preds = %38
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %45
store i32 5, i32* %6
br label %60
52: ; preds = %45
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %52
store i32 6, i32* %6
br label %59
59: ; preds = %58, %52
br label %60
60: ; preds = %59, %51
br label %61
61: ; preds = %60, %44
br label %62
62: ; preds = %61, %37
br label %63
63: ; preds = %62, %30
br label %64
64: ; preds = %63, %2
%65 = load i32, i32* %6
%66 = call i32 @test_logging(i32 %65)
%67 = load i32, i32* %3
ret i32 %67
}

LLVM IR (-O2):
@.str.5 = [16 x i8] c"log_level_trace\00"
@.str.6 = [16 x i8] c"log_level_debug\00"
@.str.7 = [15 x i8] c"log_level_info\00"
@.str.8 = [18 x i8] c"log_level_warning\00"
@.str.9 = [16 x i8] c"log_level_error\00"
@str.10 = [17 x i8] c"\09 test statistic\00"
@str.13 = [17 x i8] c"\09 test algorithm\00"
@str.16 = [15 x i8] c"\09 test utility\00"
@str.19 = [15 x i8] c"\09 test logging\00"
@str.20 = [29 x i8] c"----------------------------\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%6 = tail call i32 (...) @test_statistic()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%10 = tail call i32 (...) @test_algorithm()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%14 = tail call i32 (...) @test_utility()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.19, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.20, i64 0, i64 0))
%18 = icmp sgt i32 %0, 1
br i1 %18, label %19, label %41
19: ; preds = %2
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %41, label %24
24: ; preds = %19
%25 = load i8*, i8** %20
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %41, label %28
28: ; preds = %24
%29 = load i8*, i8** %20
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %41, label %32
32: ; preds = %28
%33 = load i8*, i8** %20
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %41, label %36
36: ; preds = %32
%37 = load i8*, i8** %20
%38 = tail call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
%40 = select i1 %39, i32 6, i32 10
br label %41
41: ; preds = %36, %32, %28, %24, %19, %2
%42 = phi i32 [ 10, %2 ], [ 1, %19 ], [ 2, %24 ], [ 3, %28 ], [ 5, %32 ], [ %40, %36 ]
%43 = tail call i32 @test_logging(i32 %42)
ret i32 0
}