#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 atoi(char *);
char getchar();
int /*<<< orphan*/ printUsage(char *);
int /*<<< orphan*/ printf(char *, ...);
int randomize();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  bool optDebug = false;
  int maxAttempts = 99;
  for (int i = 1; i < argc; i++) {
    if (!strcmp("-d", argv[i]) || !strcmp("--debug", argv[i])) {
      optDebug = true;
    } else if (!strcmp("-h", argv[i]) || !strcmp("--help", argv[i])) {
      printUsage(argv[0]);
      return 0;
    } else if (!strcmp("-a", argv[i]) || !strcmp("--attempts", argv[i])) {
      i++;
      maxAttempts = atoi(argv[i]);
    } else {
      printf("%s: invalid argument(s)\n\n", argv[0]);
      printUsage(argv[0]);
      return 0;
    }
  }
  printf("Welcome to Guess-o-matic 3000!\nMachine will randomize an "
         "integer between 0 and 20.\nTry to guess it! Press ENTER "
         "when you're ready.");
  getchar();
  int theNumber = randomize();
  if (optDebug)
    printf("DEBUG theNumber: %d\nDEBUG maxAttempts: %d\n", theNumber,
           maxAttempts);
  int guessCount = 0;
  int guess = -1;
  while (guessCount < maxAttempts) {
    guessCount++;
    printf("Your guess: ");
    scanf("%d", &guess);
    while (getchar() != '\n')
      ;
    if (guess == theNumber) {
      printf("CONGRATZ! GGWP! You're Winner! Olet viineri! "
             "It took you %d tries to give a correct answer, "
             "which was %d!\n",
             guessCount, theNumber);
      return 0;
    } else if (guess < theNumber) {
      printf("Maybe you should try larger number?\n");
    } else if (guess > theNumber) {
      printf("Maybe you should try smaller number?\n");
    } else {
      printf("What the fuck?\n");
      return 666;
    }
  }
  return 666;
}


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   $0x0,-0x14(%rbp)
movl   $0x63,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12fd <main+0x18d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe46(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11e9 <main+0x79>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe28(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f5 <main+0x85>
movl   $0x1,-0x14(%rbp)
jmp    12ea <main+0x17a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe03(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1237 <main+0xc7>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xde5(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    124f <main+0xdf>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <printUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    142d <main+0x2bd>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdb3(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1291 <main+0x121>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd95(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12b3 <main+0x143>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    12e0 <main+0x170>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <printUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    142d <main+0x2bd>
jmp    12e5 <main+0x175>
jmp    12ea <main+0x17a>
jmp    12ef <main+0x17f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <main+0x2b>
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1080 <randomize@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     133a <main+0x1ca>
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
movl   $0xffffffff,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1426 <main+0x2b6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd86(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1393 <main+0x223>
jmp    137b <main+0x20b>
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    13bf <main+0x24f>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    142d <main+0x2bd>
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13de <main+0x26e>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    141c <main+0x2ac>
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    13fd <main+0x28d>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1417 <main+0x2a7>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x29a,-0x4(%rbp)
jmp    142d <main+0x2bd>
jmp    141c <main+0x2ac>
jmp    1421 <main+0x2b1>
jmp    1348 <main+0x1d8>
movl   $0x29a,-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
sub    $0x18,%rsp
cmp    $0x2,%edi
jl     1275 <main+0xf5>
xor    %ebp,%ebp
movl   $0x63,0xc(%rsp)
mov    $0x1,%r15d
mov    %edi,0x14(%rsp)
jmp    11cd <main+0x4d>
nopl   (%rax)
mov    $0x1,%r12d
add    $0x1,%r15d
mov    %r12d,%ebp
mov    0x14(%rsp),%edi
cmp    %edi,%r15d
mov    %rbx,%rsi
jge    1280 <main+0x100>
movslq %r15d,%r14
mov    %rsi,%rbx
mov    (%rsi,%r14,8),%r13
lea    0xe22(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11b0 <main+0x30>
lea    0xe12(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
mov    $0x1,%r12d
test   %eax,%eax
je     11b6 <main+0x36>
lea    0xe01(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1348 <main+0x1c8>
lea    0xded(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1348 <main+0x1c8>
lea    0xddd(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     125b <main+0xdb>
lea    0xdcd(%rip),%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    136c <main+0x1ec>
lea    0x1(%r14),%r15d
mov    0x8(%rbx,%r14,8),%rdi
call   10a0 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    %ebp,%r12d
jmp    11b6 <main+0x36>
movl   $0x63,0xc(%rsp)
xor    %r12d,%r12d
lea    0xdb6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1090 <randomize@plt>
mov    %eax,%ebx
test   %r12d,%r12d
mov    0xc(%rsp),%ebp
je     12b9 <main+0x139>
lea    0xe12(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0xffffffff,0x10(%rsp)
ff
mov    $0x29a,%r14d
test   %ebp,%ebp
jle    1388 <main+0x208>
lea    0xe15(%rip),%r12
lea    0xe1b(%rip),%r13
lea    0x10(%rsp),%r15
lea    0xeb1(%rip),%r14
xor    %ebp,%ebp
jmp    12fb <main+0x17b>
nopl   (%rax)
call   1030 <puts@plt>
cmp    0xc(%rsp),%ebp
je     1340 <main+0x1c0>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
jne    1310 <main+0x190>
add    $0x1,%ebp
mov    0x10(%rsp),%eax
cmp    %ebx,%eax
je     1355 <main+0x1d5>
mov    %r14,%rdi
jl     12f0 <main+0x170>
lea    0xe43(%rip),%rdi
jg     12f0 <main+0x170>
lea    0xe2b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x29a,%r14d
jmp    1388 <main+0x208>
mov    (%rbx),%rdi
call   1080 <printUsage@plt>
xor    %r14d,%r14d
jmp    1388 <main+0x208>
lea    0xd9f(%rip),%rdi
xor    %r14d,%r14d
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1388 <main+0x208>
mov    (%rbx),%rsi
lea    0xcad(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rdi
call   1080 <printUsage@plt>
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
@.str.1 = [8 x i8] c"--debug\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [7 x i8] c"--help\00"
@.str.4 = [3 x i8] c"-a\00"
@.str.5 = [11 x i8] c"--attempts\00"
@.str.6 = [26 x i8] c"%s: invalid argument(s)\0A\0A\00"
@.str.7 = [131 x i8] c"Welcome to Guess-o-matic 3000!\0AMachine will randomize an integer between 0 and 20.\0ATry to guess it! Press ENTER when you're ready.\00"
@.str.8 = [43 x i8] c"DEBUG theNumber: %d\0ADEBUG maxAttempts: %d\0A\00"
@.str.9 = [13 x i8] c"Your guess: \00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [107 x i8] c"CONGRATZ! GGWP! You're Winner! Olet viineri! It took you %d tries to give a correct answer, which was %d!\0A\00"
@.str.12 = [37 x i8] c"Maybe you should try larger number?\0A\00"
@.str.13 = [38 x i8] c"Maybe you should try smaller number?\0A\00"
@.str.14 = [16 x i8] c"What the fuck?\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 i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 99, i32* %7
store i32 1, i32* %8
br label %12
12: ; preds = %91, %2
%13 = load i32, i32* %8
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %94
16: ; preds = %12
%17 = load i8**, i8*** %5
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %16
%25 = load i8**, i8*** %5
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %24, %16
store i32 1, i32* %6
br label %90
33: ; preds = %24
%34 = load i8**, i8*** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %49
41: ; preds = %33
%42 = load i8**, i8*** %5
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %46)
%48 = icmp ne i32 %47, 0
br i1 %48, label %54, label %49
49: ; preds = %41, %33
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 0
%52 = load i8*, i8** %51
%53 = call i32 @printUsage(i8* %52)
store i32 0, i32* %3
br label %145
54: ; preds = %41
%55 = load i8**, i8*** %5
%56 = load i32, i32* %8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %59)
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %70
62: ; preds = %54
%63 = load i8**, i8*** %5
%64 = load i32, i32* %8
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 @strcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %67)
%69 = icmp ne i32 %68, 0
br i1 %69, label %79, label %70
70: ; preds = %62, %54
%71 = load i32, i32* %8
%72 = add nsw i32 %71, 1
store i32 %72, i32* %8
%73 = load i8**, i8*** %5
%74 = load i32, i32* %8
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 @atoi(i8* %77)
store i32 %78, i32* %7
br label %88
79: ; preds = %62
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %82)
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 0
%86 = load i8*, i8** %85
%87 = call i32 @printUsage(i8* %86)
store i32 0, i32* %3
br label %145
88: ; preds = %70
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89, %32
br label %91
91: ; preds = %90
%92 = load i32, i32* %8
%93 = add nsw i32 %92, 1
store i32 %93, i32* %8
br label %12
94: ; preds = %12
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.7, i64 0, i64 0))
%96 = call signext i8 (...) @getchar()
%97 = call i32 (...) @randomize()
store i32 %97, i32* %9
%98 = load i32, i32* %6
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %104
100: ; preds = %94
%101 = load i32, i32* %9
%102 = load i32, i32* %7
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i32 %101, i32 %102)
br label %104
104: ; preds = %100, %94
store i32 0, i32* %10
store i32 -1, i32* %11
br label %105
105: ; preds = %143, %104
%106 = load i32, i32* %10
%107 = load i32, i32* %7
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %144
109: ; preds = %105
%110 = load i32, i32* %10
%111 = add nsw i32 %110, 1
store i32 %111, i32* %10
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%113 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %11)
br label %114
114: ; preds = %118, %109
%115 = call signext i8 (...) @getchar()
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 10
br i1 %117, label %118, label %119
118: ; preds = %114
br label %114
119: ; preds = %114
%120 = load i32, i32* %11
%121 = load i32, i32* %9
%122 = icmp eq i32 %120, %121
br i1 %122, label %123, label %127
123: ; preds = %119
%124 = load i32, i32* %10
%125 = load i32, i32* %9
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.11, i64 0, i64 0), i32 %124, i32 %125)
store i32 0, i32* %3
br label %145
127: ; preds = %119
%128 = load i32, i32* %11
%129 = load i32, i32* %9
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %133
131: ; preds = %127
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
br label %142
133: ; preds = %127
%134 = load i32, i32* %11
%135 = load i32, i32* %9
%136 = icmp sgt i32 %134, %135
br i1 %136, label %137, label %139
137: ; preds = %133
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
br label %141
139: ; preds = %133
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
store i32 666, i32* %3
br label %145
141: ; preds = %137
br label %142
142: ; preds = %141, %131
br label %143
143: ; preds = %142
br label %105
144: ; preds = %105
store i32 666, i32* %3
br label %145
145: ; preds = %144, %139, %123, %79, %49
%146 = load i32, i32* %3
ret i32 %146
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
@.str.1 = [8 x i8] c"--debug\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [7 x i8] c"--help\00"
@.str.4 = [3 x i8] c"-a\00"
@.str.5 = [11 x i8] c"--attempts\00"
@.str.6 = [26 x i8] c"%s: invalid argument(s)\0A\0A\00"
@.str.7 = [131 x i8] c"Welcome to Guess-o-matic 3000!\0AMachine will randomize an integer between 0 and 20.\0ATry to guess it! Press ENTER when you're ready.\00"
@.str.8 = [43 x i8] c"DEBUG theNumber: %d\0ADEBUG maxAttempts: %d\0A\00"
@.str.9 = [13 x i8] c"Your guess: \00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [107 x i8] c"CONGRATZ! GGWP! You're Winner! Olet viineri! It took you %d tries to give a correct answer, which was %d!\0A\00"
@str = [15 x i8] c"What the fuck?\00"
@str.15 = [37 x i8] c"Maybe you should try smaller number?\00"
@str.16 = [36 x i8] c"Maybe you should try larger number?\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %49
5: ; preds = %2, %43
%6 = phi i32 [ %47, %43 ], [ 1, %2 ]
%7 = phi i32 [ %45, %43 ], [ 99, %2 ]
%8 = phi i32 [ %44, %43 ], [ 0, %2 ]
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %43, label %14
14: ; preds = %5
%15 = tail call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %11)
%16 = icmp eq i32 %15, 0
br i1 %16, label %43, label %17
17: ; preds = %14
%18 = tail call i32 @strcmp(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* dereferenceable(1) %11)
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %11)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20, %17
%24 = load i8*, i8** %1
%25 = tail call i32 @printUsage(i8* %24)
br label %86
26: ; preds = %20
%27 = tail call i32 @strcmp(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* dereferenceable(1) %11)
%28 = icmp eq i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = tail call i32 @strcmp(i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* dereferenceable(1) %11)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %29, %26
%33 = add nsw i32 %6, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %1, i64 %34
%36 = load i8*, i8** %35
%37 = tail call i32 @atoi(i8* %36)
br label %43
38: ; preds = %29
%39 = load i8*, i8** %1
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %39)
%41 = load i8*, i8** %1
%42 = tail call i32 @printUsage(i8* %41)
br label %86
43: ; preds = %5, %14, %32
%44 = phi i32 [ %8, %32 ], [ 1, %14 ], [ 1, %5 ]
%45 = phi i32 [ %37, %32 ], [ %7, %14 ], [ %7, %5 ]
%46 = phi i32 [ %33, %32 ], [ %6, %14 ], [ %6, %5 ]
%47 = add nsw i32 %46, 1
%48 = icmp slt i32 %47, %0
br i1 %48, label %5, label %49
49: ; preds = %43, %2
%50 = phi i32 [ 0, %2 ], [ %44, %43 ]
%51 = phi i32 [ 99, %2 ], [ %45, %43 ]
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([131 x i8], [131 x i8]* @.str.7, i64 0, i64 0))
%53 = tail call signext i8 (...) @getchar()
%54 = tail call i32 (...) @randomize()
%55 = icmp eq i32 %50, 0
br i1 %55, label %58, label %56
56: ; preds = %49
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i32 %54, i32 %51)
br label %58
58: ; preds = %56, %49
%59 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%60 = icmp sgt i32 %51, 0
br i1 %60, label %61, label %84
61: ; preds = %58, %80
%62 = phi i32 [ %69, %80 ], [ 0, %58 ]
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%64 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %3)
br label %65
65: ; preds = %65, %61
%66 = call signext i8 (...) @getchar()
%67 = icmp eq i8 %66, 10
br i1 %67, label %68, label %65
68: ; preds = %65
%69 = add nuw nsw i32 %62, 1
%70 = load i32, i32* %3
%71 = icmp eq i32 %70, %54
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str.11, i64 0, i64 0), i32 %69, i32 %54)
br label %84
74: ; preds = %68
%75 = icmp slt i32 %70, %54
br i1 %75, label %80, label %76
76: ; preds = %74
%77 = icmp sgt i32 %70, %54
br i1 %77, label %80, label %78
78: ; preds = %76
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %84
80: ; preds = %76, %74
%81 = phi i8* [ getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0), %74 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @str.15, i64 0, i64 0), %76 ]
%82 = call i32 @puts(i8* dereferenceable(1) %81)
%83 = icmp eq i32 %69, %51
br i1 %83, label %84, label %61
84: ; preds = %80, %58, %78, %72
%85 = phi i32 [ 0, %72 ], [ 666, %78 ], [ 666, %58 ], [ 666, %80 ]
br label %86
86: ; preds = %23, %38, %84
%87 = phi i32 [ %85, %84 ], [ 0, %38 ], [ 0, %23 ]
ret i32 %87
}