#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int my_array[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int correct_number = 10;
  printf("Enter a number between 0 and 10\n");
  int input, input2;
  scanf("%d", &input);
  printf("Enter a number between 0 and 10\n");
  scanf("%d", &input2);
  int lookup = my_array[input2];
  printf("%d\n", lookup);
  if (input == correct_number) {
    printf("You are awesome!\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x44(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x48(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x4c(%rbp),%rsi
call   1050 <scanf@plt>
movslq -0x4c(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jne    11d4 <main+0xa4>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xef8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%r14
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movslq (%rsp),%rax
lea    0xe8b(%rip),%rcx
mov    (%rcx,%rax,4),%esi
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0xa,0x4(%rsp)
jne    1199 <main+0x69>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.my_array = [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [33 x i8] c"Enter a number between 0 and 10\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [18 x i8] c"You are awesome!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [11 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [11 x i32]* %6 to i8*
store i32 10, i32* %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %25, %2
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

LLVM IR (-O2):
@__const.main.my_array = [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
@str.4 = [32 x i8] c"Enter a number between 0 and 10\00"
@str.5 = [17 x i8] c"You are awesome!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [11 x i32], [11 x i32]* @__const.main.my_array, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}