#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*/ EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ createIndex(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int getopt(int, char **, char *);
int /*<<< orphan*/ isprint(char);
char *optarg;
scalar_t__ opterr;
unsigned int optind;
char optopt;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int check;
  int n = -1, c = -1;
  char *value = NULL;
  unsigned int i;
  if (argc < 3) {
    usage();
    exit(EXIT_SUCCESS);
  }
  opterr = 0;
  while ((check = getopt(argc, argv, "n:c:")) != -1) {
    switch (check) {
    case 'n':
      value = optarg;
      n = atoi(value);
      break;
    case 'c':
      value = optarg;
      c = atoi(optarg);
      break;
    case '?':
      if (optopt == 'c')
        fprintf(stderr, "Option -%c requires a cluster id.\n", optopt);
      else if (optopt == 'n')
        fprintf(stderr, "Option -%c requires a cluster count.\n", optopt);
      else if (isprint(optopt)) {
        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
        usage();
      } else
        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
      return 1;
    default:
      usage();
      return 1;
    }
  }
  for (i = optind; i < argc; i++)
    printf("Non-option argument %s\n", argv[i]);
  if (n != -1)
    for (i = 0; i < n; i++)
      createIndex(i);
  if (c != -1)
    createIndex(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11cb <main+0x4b>
mov    $0x0,%al
call   1060 <usage@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    0x2dee(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe19(%rip),%rdx
call   1080 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1370 <main+0x1f0>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x3f,%eax
je     1272 <main+0xf2>
jmp    120c <main+0x8c>
mov    -0x30(%rbp),%eax
sub    $0x63,%eax
je     124d <main+0xcd>
jmp    121d <main+0x9d>
mov    -0x30(%rbp),%eax
sub    $0x6e,%eax
jne    1358 <main+0x1d8>
jmp    122e <main+0xae>
mov    0x2dc3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    136b <main+0x1eb>
mov    0x2da4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    0x2d96(%rip),%rax
mov    (%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    136b <main+0x1eb>
mov    0x2d67(%rip),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    12a9 <main+0x129>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
mov    0x2d44(%rip),%rax
movsbl (%rax),%edx
call   1050 <fprintf@plt>
jmp    134c <main+0x1cc>
mov    0x2d30(%rip),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    12e0 <main+0x160>
mov    0x2d05(%rip),%rax
mov    (%rax),%edi
lea    0xd5c(%rip),%rsi
mov    0x2d0d(%rip),%rax
movsbl (%rax),%edx
call   1050 <fprintf@plt>
jmp    1347 <main+0x1c7>
mov    0x2cf9(%rip),%rax
movsbl (%rax),%edi
call   1070 <isprint@plt>
cmp    $0x0,%eax
je     1323 <main+0x1a3>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
lea    0xd46(%rip),%rsi
mov    0x2cd1(%rip),%rax
movsbl (%rax),%edx
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1060 <usage@plt>
jmp    1342 <main+0x1c2>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
lea    0xd32(%rip),%rsi
mov    0x2ca6(%rip),%rax
movsbl (%rax),%edx
call   1050 <fprintf@plt>
jmp    1347 <main+0x1c7>
jmp    134c <main+0x1cc>
movl   $0x1,-0x4(%rbp)
jmp    13fe <main+0x27e>
mov    $0x0,%al
call   1060 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fe <main+0x27e>
jmp    11d9 <main+0x59>
mov    0x2c61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    13ad <main+0x22d>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
lea    0xced(%rip),%rdi
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    137c <main+0x1fc>
cmpl   $0xffffffff,-0x18(%rbp)
je     13e5 <main+0x265>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    13e0 <main+0x260>
mov    -0x2c(%rbp),%edi
call   1030 <createIndex@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13be <main+0x23e>
jmp    13e5 <main+0x265>
cmpl   $0xffffffff,-0x1c(%rbp)
je     13f7 <main+0x277>
mov    -0x1c(%rbp),%edi
call   1030 <createIndex@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jle    1305 <main+0x185>
mov    %rsi,%rbx
mov    %edi,%r14d
mov    0x2e1f(%rip),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%ebp
lea    0xe4c(%rip),%r12
mov    0x2e3d(%rip),%r13
mov    $0xffffffff,%r15d
jmp    11dc <main+0x5c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13),%rdi
call   1090 <atoi@plt>
mov    %eax,%r15d
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1080 <getopt@plt>
cmp    $0x63,%eax
je     11d0 <main+0x50>
cmp    $0xffffffff,%eax
je     120f <main+0x8f>
cmp    $0x3f,%eax
je     1275 <main+0xf5>
cmp    $0x6e,%eax
jne    12da <main+0x15a>
mov    0x0(%r13),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
jmp    11dc <main+0x5c>
mov    %rbp,%r13
mov    0x2dbf(%rip),%rax
mov    (%rax),%ebp
cmp    %r14d,%ebp
jae    1245 <main+0xc5>
mov    %r14d,%r12d
lea    0xe5d(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %ebp,%r12d
jne    1230 <main+0xb0>
lea    -0x1(%r13),%eax
cmp    $0xfffffffd,%eax
ja     125f <main+0xdf>
xor    %ebx,%ebx
mov    %ebx,%edi
call   1030 <createIndex@plt>
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    1250 <main+0xd0>
xor    %ebx,%ebx
cmp    $0xffffffff,%r15d
je     12f4 <main+0x174>
mov    %r15d,%edi
call   1030 <createIndex@plt>
jmp    12f4 <main+0x174>
mov    0x2d64(%rip),%rbx
mov    (%rbx),%al
cmp    $0x6e,%al
je     129d <main+0x11d>
cmp    $0x63,%al
jne    12b4 <main+0x134>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
lea    0xd6f(%rip),%rsi
mov    $0x63,%edx
jmp    12ea <main+0x16a>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xd7b(%rip),%rsi
mov    $0x6e,%edx
jmp    12ea <main+0x16a>
movsbl %al,%edi
call   1070 <isprint@plt>
mov    0x2d05(%rip),%rcx
mov    (%rcx),%edi
mov    (%rbx),%cl
movsbl %cl,%edx
test   %eax,%eax
je     12e3 <main+0x163>
lea    0xd79(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1060 <usage@plt>
jmp    12ef <main+0x16f>
lea    0xd7b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1060 <usage@plt>
mov    0x2ca5(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@opterr = global i64 0
@.str = [5 x i8] c"n:c:\00"
@optarg = global i8* null
@optopt = global i8 0
@stderr = global i32 0
@.str.1 = [35 x i8] c"Option -%c requires a cluster id.\0A\00"
@.str.2 = [38 x i8] c"Option -%c requires a cluster count.\0A\00"
@.str.3 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.4 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i32 0
@.str.5 = [24 x i8] c"Non-option argument %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %7
store i32 -1, i32* %8
store i8* null, i8** %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = call i32 (...) @usage()
%15 = load i32, i32* @EXIT_SUCCESS
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
store i64 0, i64* @opterr
br label %18
18: ; preds = %67, %17
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @getopt(i32 %19, i8** %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %21, i32* %6
%22 = icmp ne i32 %21, -1
br i1 %22, label %23, label %68
23: ; preds = %18
%24 = load i32, i32* %6
switch i32 %24, label %65 [
i32 110, label %25
i32 99, label %29
i32 63, label %33
]
25: ; preds = %23
%26 = load i8*, i8** @optarg
store i8* %26, i8** %9
%27 = load i8*, i8** %9
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %7
br label %67
29: ; preds = %23
%30 = load i8*, i8** @optarg
store i8* %30, i8** %9
%31 = load i8*, i8** @optarg
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %8
br label %67
33: ; preds = %23
%34 = load i8, i8* @optopt
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 99
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i32, i32* @stderr
%39 = load i8, i8* @optopt
%40 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8 signext %39)
br label %64
41: ; preds = %33
%42 = load i8, i8* @optopt
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 110
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i32, i32* @stderr
%47 = load i8, i8* @optopt
%48 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8 signext %47)
br label %63
49: ; preds = %41
%50 = load i8, i8* @optopt
%51 = call i32 @isprint(i8 signext %50)
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %58
53: ; preds = %49
%54 = load i32, i32* @stderr
%55 = load i8, i8* @optopt
%56 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8 signext %55)
%57 = call i32 (...) @usage()
br label %62
58: ; preds = %49
%59 = load i32, i32* @stderr
%60 = load i8, i8* @optopt
%61 = call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8 signext %60)
br label %62
62: ; preds = %58, %53
br label %63
63: ; preds = %62, %45
br label %64
64: ; preds = %63, %37
store i32 1, i32* %3
br label %106
65: ; preds = %23
%66 = call i32 (...) @usage()
store i32 1, i32* %3
br label %106
67: ; preds = %29, %25
br label %18
68: ; preds = %18
%69 = load i32, i32* @optind
store i32 %69, i32* %10
br label %70
70: ; preds = %81, %68
%71 = load i32, i32* %10
%72 = load i32, i32* %4
%73 = icmp ult i32 %71, %72
br i1 %73, label %74, label %84
74: ; preds = %70
%75 = load i8**, i8*** %5
%76 = load i32, i32* %10
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
%79 = load i8*, i8** %78
%80 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %79)
br label %81
81: ; preds = %74
%82 = load i32, i32* %10
%83 = add i32 %82, 1
store i32 %83, i32* %10
br label %70
84: ; preds = %70
%85 = load i32, i32* %7
%86 = icmp ne i32 %85, -1
br i1 %86, label %87, label %99
87: ; preds = %84
store i32 0, i32* %10
br label %88
88: ; preds = %95, %87
%89 = load i32, i32* %10
%90 = load i32, i32* %7
%91 = icmp ult i32 %89, %90
br i1 %91, label %92, label %98
92: ; preds = %88
%93 = load i32, i32* %10
%94 = call i32 @createIndex(i32 %93)
br label %95
95: ; preds = %92
%96 = load i32, i32* %10
%97 = add i32 %96, 1
store i32 %97, i32* %10
br label %88
98: ; preds = %88
br label %99
99: ; preds = %98, %84
%100 = load i32, i32* %8
%101 = icmp ne i32 %100, -1
br i1 %101, label %102, label %105
102: ; preds = %99
%103 = load i32, i32* %8
%104 = call i32 @createIndex(i32 %103)
br label %105
105: ; preds = %102, %99
store i32 0, i32* %3
br label %106
106: ; preds = %105, %65, %64
%107 = load i32, i32* %3
ret i32 %107
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@opterr = global i64 0
@.str = [5 x i8] c"n:c:\00"
@optarg = global i8* null
@optopt = global i8 0
@stderr = global i32 0
@.str.1 = [35 x i8] c"Option -%c requires a cluster id.\0A\00"
@.str.2 = [38 x i8] c"Option -%c requires a cluster count.\0A\00"
@.str.3 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.4 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i32 0
@.str.5 = [24 x i8] c"Non-option argument %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 (...) @usage()
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
store i64 0, i64* @opterr
br label %9
9: ; preds = %15, %8
%10 = phi i32 [ %17, %15 ], [ -1, %8 ]
%11 = phi i32 [ %13, %15 ], [ -1, %8 ]
br label %12
12: ; preds = %9, %18
%13 = phi i32 [ %20, %18 ], [ %11, %9 ]
%14 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %14, label %39 [
i32 -1, label %41
i32 110, label %15
i32 99, label %18
i32 63, label %21
]
15: ; preds = %12
%16 = load i8*, i8** @optarg
%17 = tail call i32 @atoi(i8* %16)
br label %9
18: ; preds = %12
%19 = load i8*, i8** @optarg
%20 = tail call i32 @atoi(i8* %19)
br label %12
21: ; preds = %12
%22 = load i8, i8* @optopt
switch i8 %22, label %29 [
i8 99, label %23
i8 110, label %26
]
23: ; preds = %21
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8 signext 99)
br label %66
26: ; preds = %21
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8 signext 110)
br label %66
29: ; preds = %21
%30 = tail call i32 @isprint(i8 signext %22)
%31 = icmp eq i32 %30, 0
%32 = load i32, i32* @stderr
%33 = load i8, i8* @optopt
br i1 %31, label %37, label %34
34: ; preds = %29
%35 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8 signext %33)
%36 = tail call i32 (...) @usage()
br label %66
37: ; preds = %29
%38 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8 signext %33)
br label %66
39: ; preds = %12
%40 = tail call i32 (...) @usage()
br label %66
41: ; preds = %12
%42 = load i32, i32* @optind
%43 = icmp ult i32 %42, %0
br i1 %43, label %44, label %54
44: ; preds = %41
%45 = zext i32 %42 to i64
br label %46
46: ; preds = %44, %46
%47 = phi i64 [ %45, %44 ], [ %51, %46 ]
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = load i8*, i8** %48
%50 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %49)
%51 = add nuw nsw i64 %47, 1
%52 = trunc i64 %51 to i32
%53 = icmp eq i32 %52, %0
br i1 %53, label %54, label %46
54: ; preds = %46, %41
%55 = add i32 %10, -1
%56 = icmp ult i32 %55, -2
br i1 %56, label %57, label %62
57: ; preds = %54, %57
%58 = phi i32 [ %60, %57 ], [ 0, %54 ]
%59 = tail call i32 @createIndex(i32 %58)
%60 = add nuw i32 %58, 1
%61 = icmp eq i32 %60, %10
br i1 %61, label %62, label %57
62: ; preds = %57, %54
%63 = icmp eq i32 %13, -1
br i1 %63, label %66, label %64
64: ; preds = %62
%65 = tail call i32 @createIndex(i32 %13)
br label %66
66: ; preds = %62, %64, %23, %34, %37, %26, %39
%67 = phi i32 [ 1, %39 ], [ 1, %26 ], [ 1, %37 ], [ 1, %34 ], [ 1, %23 ], [ 0, %64 ], [ 0, %62 ]
ret i32 %67
}