#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 getRand();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n, i;
  int answer = getRand();
  for (i = 0; i < 10; i++) {
    printf("Input number : ");
    scanf("%d", &n);
    if (n > answer) {
      printf("Too big !\n");
    } else if (n < answer) {
      printf("Too small !\n");
    } else {
      printf("Good ! Right number !\n");
      break;
    }
  }
  if (i == 10) {
    printf("Game over !\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getRand@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11d9 <main+0xa9>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1193 <main+0x63>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
jmp    11c6 <main+0x96>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b0 <main+0x80>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
jmp    11c1 <main+0x91>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
jmp    11d9 <main+0xa9>
jmp    11c6 <main+0x96>
jmp    11cb <main+0x9b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <main+0x20>
cmpl   $0xa,-0xc(%rbp)
jne    11ef <main+0xbf>
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getRand@plt>
mov    %eax,%ebp
lea    0xead(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     1186 <main+0x46>
jge    1380 <main+0x240>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe72(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     11be <main+0x7e>
jge    1380 <main+0x240>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
lea    0xe36(%rip),%rdi
call   1050 <printf@plt>
lea    0xe3a(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     11f6 <main+0xb6>
jge    1380 <main+0x240>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xdfe(%rip),%rdi
call   1050 <printf@plt>
lea    0xe02(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     122e <main+0xee>
jge    1380 <main+0x240>
lea    0xe07(%rip),%rdi
call   1030 <puts@plt>
lea    0xdc6(%rip),%rdi
call   1050 <printf@plt>
lea    0xdca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     1266 <main+0x126>
jge    1380 <main+0x240>
lea    0xdcf(%rip),%rdi
call   1030 <puts@plt>
lea    0xd8e(%rip),%rdi
call   1050 <printf@plt>
lea    0xd92(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     129e <main+0x15e>
jge    1380 <main+0x240>
lea    0xd97(%rip),%rdi
call   1030 <puts@plt>
lea    0xd56(%rip),%rdi
call   1050 <printf@plt>
lea    0xd5a(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     12d6 <main+0x196>
jge    1380 <main+0x240>
lea    0xd5f(%rip),%rdi
call   1030 <puts@plt>
lea    0xd1e(%rip),%rdi
call   1050 <printf@plt>
lea    0xd22(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     130a <main+0x1ca>
jge    1380 <main+0x240>
lea    0xd2b(%rip),%rdi
call   1030 <puts@plt>
lea    0xcea(%rip),%rdi
call   1050 <printf@plt>
lea    0xcee(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
cmp    %ebp,0x4(%rsp)
jg     133e <main+0x1fe>
jge    1380 <main+0x240>
lea    0xcf7(%rip),%rdi
call   1030 <puts@plt>
lea    0xcb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xcba(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
cmp    %ebp,0x4(%rsp)
jg     136f <main+0x22f>
jge    1380 <main+0x240>
lea    0xcc6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xc95(%rip),%rdi
jmp    1387 <main+0x247>
lea    0xc98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Input number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Too big !\0A\00"
@.str.3 = [13 x i8] c"Too small !\0A\00"
@.str.4 = [23 x i8] c"Good ! Right number !\0A\00"
@.str.5 = [13 x i8] c"Game over !\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @getRand()
store i32 %5, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %26
17: ; preds = %9
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %25
23: ; preds = %17
%24 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %30
25: ; preds = %21
br label %26
26: ; preds = %25, %15
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %6
30: ; preds = %23, %6
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 10
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@.str = [16 x i8] c"Input number : \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [12 x i8] c"Game over !\00"
@str.6 = [22 x i8] c"Good ! Right number !\00"
@str.7 = [12 x i8] c"Too small !\00"
@str.8 = [10 x i8] c"Too big !\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getRand()
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, %3
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = icmp slt i32 %6, %3
br i1 %9, label %10, label %94
10: ; preds = %8, %0
%11 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %8 ]
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = icmp sgt i32 %15, %3
br i1 %16, label %19, label %17
17: ; preds = %10
%18 = icmp slt i32 %15, %3
br i1 %18, label %19, label %94
19: ; preds = %17, %10
%20 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %10 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %17 ]
%21 = call i32 @puts(i8* dereferenceable(1) %20)
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%24 = load i32, i32* %1
%25 = icmp sgt i32 %24, %3
br i1 %25, label %28, label %26
26: ; preds = %19
%27 = icmp slt i32 %24, %3
br i1 %27, label %28, label %94
28: ; preds = %26, %19
%29 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %19 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %26 ]
%30 = call i32 @puts(i8* dereferenceable(1) %29)
%31 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%33 = load i32, i32* %1
%34 = icmp sgt i32 %33, %3
br i1 %34, label %37, label %35
35: ; preds = %28
%36 = icmp slt i32 %33, %3
br i1 %36, label %37, label %94
37: ; preds = %35, %28
%38 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %28 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %35 ]
%39 = call i32 @puts(i8* dereferenceable(1) %38)
%40 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%42 = load i32, i32* %1
%43 = icmp sgt i32 %42, %3
br i1 %43, label %46, label %44
44: ; preds = %37
%45 = icmp slt i32 %42, %3
br i1 %45, label %46, label %94
46: ; preds = %44, %37
%47 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %37 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %44 ]
%48 = call i32 @puts(i8* dereferenceable(1) %47)
%49 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%51 = load i32, i32* %1
%52 = icmp sgt i32 %51, %3
br i1 %52, label %55, label %53
53: ; preds = %46
%54 = icmp slt i32 %51, %3
br i1 %54, label %55, label %94
55: ; preds = %53, %46
%56 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %46 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %53 ]
%57 = call i32 @puts(i8* dereferenceable(1) %56)
%58 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%59 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%60 = load i32, i32* %1
%61 = icmp sgt i32 %60, %3
br i1 %61, label %64, label %62
62: ; preds = %55
%63 = icmp slt i32 %60, %3
br i1 %63, label %64, label %94
64: ; preds = %62, %55
%65 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %55 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %62 ]
%66 = call i32 @puts(i8* dereferenceable(1) %65)
%67 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%68 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%69 = load i32, i32* %1
%70 = icmp sgt i32 %69, %3
br i1 %70, label %73, label %71
71: ; preds = %64
%72 = icmp slt i32 %69, %3
br i1 %72, label %73, label %94
73: ; preds = %71, %64
%74 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %64 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %71 ]
%75 = call i32 @puts(i8* dereferenceable(1) %74)
%76 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%77 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%78 = load i32, i32* %1
%79 = icmp sgt i32 %78, %3
br i1 %79, label %82, label %80
80: ; preds = %73
%81 = icmp slt i32 %78, %3
br i1 %81, label %82, label %94
82: ; preds = %80, %73
%83 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %73 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %80 ]
%84 = call i32 @puts(i8* dereferenceable(1) %83)
%85 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%86 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%87 = load i32, i32* %1
%88 = icmp sgt i32 %87, %3
br i1 %88, label %91, label %89
89: ; preds = %82
%90 = icmp slt i32 %87, %3
br i1 %90, label %91, label %94
91: ; preds = %89, %82
%92 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %82 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), %89 ]
%93 = call i32 @puts(i8* dereferenceable(1) %92)
br label %94
94: ; preds = %91, %89, %80, %71, %62, %53, %44, %35, %26, %17, %8
%95 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %26 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %35 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %44 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %53 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %62 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %71 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %80 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0), %89 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0), %91 ]
%96 = call i32 @puts(i8* dereferenceable(1) %95)
ret i32 0
}