#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 *);
int main() {
  int arr[3][3] = {{6, 37, 33}, {12, 11, 13}, {14, 85, 96}};
  int i, j, n;
  printf("Enter the number: ");
  scanf("%d", &n);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (arr[i][j] == n) {
        printf("The number %d is in the array\n", n);
        return 0;
      }
    }
  }
  printf("The number %d is not in the array\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x3c(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    11f6 <main+0xc6>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    11e3 <main+0xb3>
movslq -0x34(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x3c(%rbp),%eax
jne    11d0 <main+0xa0>
mov    -0x3c(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    120e <main+0xde>
jmp    11d5 <main+0xa5>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    118a <main+0x5a>
jmp    11e8 <main+0xb8>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1179 <main+0x49>
mov    -0x3c(%rbp),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x1018(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x101d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0x102e(%rip),%rdi
mov    0x4(%rsp),%esi
lea    -0x6(%rsi),%eax
cmp    $0x4f,%eax
ja     1175 <main+0x55>
lea    0xea6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
cmp    $0x60,%esi
je     1163 <main+0x43>
jmp    116a <main+0x4a>

LLVM IR (-O0):
@__const.main.arr = [3 x [3 x i32]] [[3 x i32] [i32 6, i32 37, i32 33], [3 x i32] [i32 12, i32 11, i32 13], [3 x i32] [i32 14, i32 85, i32 96]]
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"The number %d is in the array\0A\00"
@.str.3 = [35 x i8] c"The number %d is not in the array\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x [3 x i32]]* %2 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 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* %5)
store i32 0, i32* %3
br label %9
9: ; preds = %34, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %37
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %30, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %33
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 %18
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %5
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %16
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %27)
store i32 0, i32* %1
br label %40
29: ; preds = %16
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %13
33: ; preds = %13
br label %34
34: ; preds = %33
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %9
37: ; preds = %9
%38 = load i32, i32* %5
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %38)
store i32 0, i32* %1
br label %40
40: ; preds = %37, %26
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"The number %d is in the array\0A\00"
@.str.3 = [35 x i8] c"The number %d is not in the array\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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
switch i32 %5, label %7 [
i32 6, label %6
i32 37, label %6
i32 33, label %6
i32 12, label %6
i32 11, label %6
i32 13, label %6
i32 14, label %6
i32 85, label %6
i32 96, label %6
]
6: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0
br label %7
7: ; preds = %0, %6
%8 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), %0 ]
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %8, i32 %5)
ret i32 0
}