#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 files(int, int, char **, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **args) {
  if (argc < 3 || (argc <= 3 && (strcmp(args[1], "-n") == 0 ||
                                 strcmp(args[1], "-i") == 0))) {
    fprintf(stderr, "Not passed enough parameters\n");
    return 1;
  }
  if ((strcmp(args[1], "-i") == 0 && strcmp(args[2], "-n") == 0) ||
      (strcmp(args[1], "-n") == 0 && strcmp(args[2], "-i") == 0)) {
    return files(3, argc, args, 3);
  } else if (strcmp(args[1], "-i") == 0) {
    return files(2, argc, args, 2);
  } else if (strcmp(args[1], "-n") == 0) {
    return files(2, argc, args, 1);
  } else {
    return files(1, argc, args, 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)
cmpl   $0x3,-0x8(%rbp)
jl     1196 <main+0x66>
cmpl   $0x3,-0x8(%rbp)
jg     11b7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1196 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11b7 <main+0x87>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12d5 <main+0x1a5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11f3 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe1c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     122f <main+0xff>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfe(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    124a <main+0x11a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xde3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    124a <main+0x11a>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x3,%ecx
mov    %ecx,%edi
call   1050 <files@plt>
mov    %eax,-0x4(%rbp)
jmp    12d5 <main+0x1a5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdaa(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1283 <main+0x153>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x2,%ecx
mov    %ecx,%edi
call   1050 <files@plt>
mov    %eax,-0x4(%rbp)
jmp    12d5 <main+0x1a5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd6e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12bf <main+0x18f>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
mov    $0x1,%ecx
call   1050 <files@plt>
mov    %eax,-0x4(%rbp)
jmp    12d5 <main+0x1a5>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %ecx,%ecx
call   1050 <files@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jge    1159 <main+0x29>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%ebp
jne    118a <main+0x5a>
mov    0x8(%rbx),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1138 <main+0x8>
mov    0x8(%rbx),%rdi
lea    0xe83(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1138 <main+0x8>
mov    0x8(%rbx),%rdi
lea    0xe6e(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11b4 <main+0x84>
mov    0x10(%rbx),%rdi
lea    0xe56(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1216 <main+0xe6>
mov    0x8(%rbx),%rdi
lea    0xe41(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11de <main+0xae>
mov    0x10(%rbx),%rdi
lea    0xe2f(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1216 <main+0xe6>
mov    0x8(%rbx),%rdi
lea    0xe1a(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1227 <main+0xf7>
mov    0x8(%rbx),%rdi
lea    0xe02(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1238 <main+0x108>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
jmp    1247 <main+0x117>
mov    $0x3,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    $0x3,%ecx
jmp    1247 <main+0x117>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    $0x2,%ecx
jmp    1247 <main+0x117>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <files@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-n\00"
@.str.1 = [3 x i8] c"-i\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"Not passed enough parameters\0A\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %23, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 3
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %17, %11, %2
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %78
26: ; preds = %17, %8
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %26
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %50, label %38
38: ; preds = %32, %26
%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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %54
44: ; preds = %38
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %44, %32
%51 = load i32, i32* %4
%52 = load i8**, i8*** %5
%53 = call i32 @files(i32 3, i32 %51, i8** %52, i32 3)
store i32 %53, i32* %3
br label %78
54: ; preds = %44, %38
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %54
%61 = load i32, i32* %4
%62 = load i8**, i8*** %5
%63 = call i32 @files(i32 2, i32 %61, i8** %62, i32 2)
store i32 %63, i32* %3
br label %78
64: ; preds = %54
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %64
%71 = load i32, i32* %4
%72 = load i8**, i8*** %5
%73 = call i32 @files(i32 2, i32 %71, i8** %72, i32 1)
store i32 %73, i32* %3
br label %78
74: ; preds = %64
%75 = load i32, i32* %4
%76 = load i8**, i8*** %5
%77 = call i32 @files(i32 1, i32 %75, i8** %76, i32 0)
store i32 %77, i32* %3
br label %78
78: ; preds = %74, %70, %60, %50, %23
%79 = load i32, i32* %3
ret i32 %79
}

LLVM IR (-O2):
@.str = [3 x i8] c"-n\00"
@.str.1 = [3 x i8] c"-i\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"Not passed enough parameters\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 3
br i1 %5, label %6, label %18
6: ; preds = %4
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11, %6, %2
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %53
18: ; preds = %11, %4
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %18
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %37, label %28
28: ; preds = %23, %18
%29 = load i8*, i8** %19
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %32, %23
%38 = tail call i32 @files(i32 3, i32 %0, i8** %1, i32 3)
br label %53
39: ; preds = %32, %28
%40 = load i8*, i8** %19
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call i32 @files(i32 2, i32 %0, i8** %1, i32 2)
br label %53
45: ; preds = %39
%46 = load i8*, i8** %19
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call i32 @files(i32 2, i32 %0, i8** %1, i32 1)
br label %53
51: ; preds = %45
%52 = tail call i32 @files(i32 1, i32 %0, i8** %1, i32 0)
br label %53
53: ; preds = %51, %49, %43, %37, %15
%54 = phi i32 [ 1, %15 ], [ %38, %37 ], [ %44, %43 ], [ %50, %49 ], [ %52, %51 ]
ret i32 %54
}