#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);
int main() {
  int a[5], n = 5, i, flag = 0, search;
  for (i = 0; i < n; i++) {
    if (a[i] == search) {
      flag = 1;
      break;
    }
  }
  if (flag == 0)
    printf("%d is  saved in array", n);
  if (flag == 1)
    printf("%d is not saved in array", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1170 <main+0x60>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x30(%rbp),%eax
jne    115d <main+0x4d>
movl   $0x1,-0x2c(%rbp)
jmp    1170 <main+0x60>
jmp    1162 <main+0x52>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x0,-0x2c(%rbp)
jne    1189 <main+0x79>
mov    -0x24(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x2c(%rbp)
jne    11a2 <main+0x92>
mov    -0x24(%rbp),%esi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"%d is saved in array\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}