#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*/ scanf(char *, int *);
void main() {
  int a = 16, b, e;
  e = 0;
  while (e < 10) {
    printf("*** Enter your number ***\n");
    scanf("%d", &b);
    if (b == a) {
      printf("*** YOU WON ***\n");
      break;
    } else {
      if (b > a)
        printf("*** Aim lower ***\n");
      else
        printf("*** Aim higher ***\n");
    }
    e++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x10,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11b5 <main+0x95>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1179 <main+0x59>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    11b5 <main+0x95>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1196 <main+0x76>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x82>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
lea    0xedb(%rip),%r14
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4f(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
lea    0xe19(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xdf2(%rip),%rdi
call   1030 <puts@plt>
lea    0xde3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xdbc(%rip),%rdi
call   1030 <puts@plt>
lea    0xdad(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xd86(%rip),%rdi
call   1030 <puts@plt>
lea    0xd77(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xd50(%rip),%rdi
call   1030 <puts@plt>
lea    0xd41(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xd1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xd0f(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
je     1336 <main+0x216>
mov    %rbx,%rdi
cmovg  %r14,%rdi
call   1030 <puts@plt>
lea    0xcec(%rip),%rdi
call   1030 <puts@plt>
lea    0xcdd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x10,%eax
jne    134a <main+0x22a>
lea    0xd05(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
cmovg  %r14,%rbx
mov    %rbx,%rdi
jmp    133d <main+0x21d>

LLVM IR (-O0):
@.str = [27 x i8] c"*** Enter your number ***\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"*** YOU WON ***\0A\00"
@.str.3 = [19 x i8] c"*** Aim lower ***\0A\00"
@.str.4 = [20 x i8] c"*** Aim higher ***\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 16, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %24, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %27
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %27
15: ; preds = %7
%16 = load i32, i32* %2
%17 = load i32, i32* %1
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %4
27: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [26 x i8] c"*** Enter your number ***\00"
@str.5 = [19 x i8] c"*** Aim higher ***\00"
@str.6 = [18 x i8] c"*** Aim lower ***\00"
@str.7 = [16 x i8] c"*** YOU WON ***\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 16
br i1 %6, label %7, label %9
7: ; preds = %73, %65, %57, %49, %41, %33, %25, %17, %9, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
br label %85
9: ; preds = %0
%10 = icmp sgt i32 %5, 16
%11 = select i1 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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 eq i32 %15, 16
br i1 %16, label %7, label %17
17: ; preds = %9
%18 = icmp sgt i32 %15, 16
%19 = select i1 %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%20 = call i32 @puts(i8* dereferenceable(1) %19)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%23 = load i32, i32* %1
%24 = icmp eq i32 %23, 16
br i1 %24, label %7, label %25
25: ; preds = %17
%26 = icmp sgt i32 %23, 16
%27 = select i1 %26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%28 = call i32 @puts(i8* dereferenceable(1) %27)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%31 = load i32, i32* %1
%32 = icmp eq i32 %31, 16
br i1 %32, label %7, label %33
33: ; preds = %25
%34 = icmp sgt i32 %31, 16
%35 = select i1 %34, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%36 = call i32 @puts(i8* dereferenceable(1) %35)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%39 = load i32, i32* %1
%40 = icmp eq i32 %39, 16
br i1 %40, label %7, label %41
41: ; preds = %33
%42 = icmp sgt i32 %39, 16
%43 = select i1 %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%44 = call i32 @puts(i8* dereferenceable(1) %43)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%47 = load i32, i32* %1
%48 = icmp eq i32 %47, 16
br i1 %48, label %7, label %49
49: ; preds = %41
%50 = icmp sgt i32 %47, 16
%51 = select i1 %50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%52 = call i32 @puts(i8* dereferenceable(1) %51)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%55 = load i32, i32* %1
%56 = icmp eq i32 %55, 16
br i1 %56, label %7, label %57
57: ; preds = %49
%58 = icmp sgt i32 %55, 16
%59 = select i1 %58, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%60 = call i32 @puts(i8* dereferenceable(1) %59)
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%63 = load i32, i32* %1
%64 = icmp eq i32 %63, 16
br i1 %64, label %7, label %65
65: ; preds = %57
%66 = icmp sgt i32 %63, 16
%67 = select i1 %66, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%68 = call i32 @puts(i8* dereferenceable(1) %67)
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%70 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%71 = load i32, i32* %1
%72 = icmp eq i32 %71, 16
br i1 %72, label %7, label %73
73: ; preds = %65
%74 = icmp sgt i32 %71, 16
%75 = select i1 %74, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%76 = call i32 @puts(i8* dereferenceable(1) %75)
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%78 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%79 = load i32, i32* %1
%80 = icmp eq i32 %79, 16
br i1 %80, label %7, label %81
81: ; preds = %73
%82 = icmp sgt i32 %79, 16
%83 = select i1 %82, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%84 = call i32 @puts(i8* dereferenceable(1) %83)
br label %85
85: ; preds = %81, %7
ret void
}