#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 */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a[] = {12, 14, 4, 9, 17, 3}, i, n, f = 0;
  printf("Enter a number: ");
  scanf("%d", &n);
  for (i = 0; i < sizeof(a) / sizeof(int); i++) {
    if (a[i] == n) {
      f = 1;
      break;
    }
  }
  if (f == 1)
    printf("It is found!\n");
  else
    printf("It is not found!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x6,%rax
jae    11b8 <main+0x98>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x28(%rbp),%eax
jne    11a5 <main+0x85>
movl   $0x1,-0x2c(%rbp)
jmp    11b8 <main+0x98>
jmp    11aa <main+0x8a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117a <main+0x5a>
cmpl   $0x1,-0x2c(%rbp)
jne    11d3 <main+0xb3>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0xbf>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xfffffffd,%eax
cmp    $0xe,%eax
ja     116c <main+0x3c>
cltq
lea    0xed1(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1173 <main+0x43>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [17 x i8] c"It is not found!\00"
@str.4 = [13 x i8] c"It is found!\00"
@reltable.main = [15 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 = add i32 %5, -3
%7 = icmp ult i32 %6, 15
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([15 x i32]* @reltable.main to i8*), i64 %10)
br label %12
12: ; preds = %8, %0
%13 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0), %0 ], [ %11, %8 ]
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}