#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 *);
int /*<<< orphan*/ run_all_unit_tests();
scalar_t__ strncmp(char *, char *, int);
int vipernec(char *, char *);
int main(int argc, char *argv[]) {
  int ret_val = -1;
  if (argc >= 2) {
    if (strncmp("-u", argv[1], 2) == 0) {
      run_all_unit_tests();
      printf("All unit tests passed.");
      ret_val = 0;
    } else if (argc >= 3) {
      ret_val = vipernec(argv[1], argv[2]);
    } else {
      printf("Invalid input parameters.");
    }
  } else {
    printf("No input parameters specified.");
  }
  return ret_val;
}


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)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     11e6 <main+0xa6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe8a(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11a9 <main+0x69>
mov    $0x0,%al
call   1040 <run_all_unit_tests@plt>
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
jmp    11e1 <main+0xa1>
cmpl   $0x3,-0x8(%rbp)
jl     11d0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1060 <vipernec@plt>
mov    %eax,-0x14(%rbp)
jmp    11dc <main+0x9c>
lea    0xe43(%rip),%rdi
call   1050 <printf@plt>
jmp    11e1 <main+0xa1>
jmp    11f2 <main+0xb2>
lea    0xe47(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     117f <main+0x3f>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rsi
lea    0xea8(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1188 <main+0x48>
cmp    $0x3,%ebp
jb     119f <main+0x5f>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <vipernec@plt>
lea    0xeae(%rip),%rdi
jmp    11a6 <main+0x66>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <run_all_unit_tests@plt>
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
jmp    11b0 <main+0x70>
lea    0xe74(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-u\00"
@.str.1 = [23 x i8] c"All unit tests passed.\00"
@.str.2 = [26 x i8] c"Invalid input parameters.\00"
@.str.3 = [31 x i8] c"No input parameters specified.\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
store i32 -1, i32* %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %33
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12, i32 2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = call i32 (...) @run_all_unit_tests()
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %32
18: ; preds = %9
%19 = load i32, i32* %4
%20 = icmp sge i32 %19, 3
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @vipernec(i8* %24, i8* %27)
store i32 %28, i32* %6
br label %31
29: ; preds = %18
%30 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %21
br label %32
32: ; preds = %31, %15
br label %35
33: ; preds = %2
%34 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %35
35: ; preds = %33, %32
%36 = load i32, i32* %6
ret i32 %36
}

LLVM IR (-O2):
@.str = [3 x i8] c"-u\00"
@.str.1 = [23 x i8] c"All unit tests passed.\00"
@.str.2 = [26 x i8] c"Invalid input parameters.\00"
@.str.3 = [31 x i8] c"No input parameters specified.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6, i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i32 (...) @run_all_unit_tests()
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %23
12: ; preds = %4
%13 = icmp ugt i32 %0, 2
br i1 %13, label %14, label %19
14: ; preds = %12
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @vipernec(i8* %15, i8* %17)
br label %23
19: ; preds = %12
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %23
21: ; preds = %2
%22 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %9, %19, %14, %21
%24 = phi i32 [ 0, %9 ], [ %18, %14 ], [ -1, %19 ], [ -1, %21 ]
ret i32 %24
}