#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ check_intInput(int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fill_array(int *, int);
scalar_t__ is_exists(int *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n;
  printf("Enter n: ");
  check_intInput(&n);
  if (n <= 0) {
    printf("n > 0 !");
    exit(EXIT_FAILURE);
  }
  int numbers[n];
  printf("Enter %d numbers : ", n);
  fill_array(numbers, n);
  int searchElement;
  printf("Enter number to search: ");
  check_intInput(&searchElement);
  printf(is_exists(numbers, n, searchElement) ? "yes" : "no");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <check_intInput@plt>
cmpl   $0x0,-0x8(%rbp)
jg     119c <main+0x4c>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <fill_array@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <check_intInput@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1070 <is_exists@plt>
mov    %rax,%rcx
lea    0xe33(%rip),%rdi
lea    0xe28(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <check_intInput@plt>
mov    -0x14(%rbp),%eax
test   %eax,%eax
jle    1207 <main+0xb7>
mov    %rsp,%r14
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    %rbx,%rdi
call   1050 <fill_array@plt>
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1030 <check_intInput@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %rbx,%rdi
call   1070 <is_exists@plt>
test   %rax,%rax
lea    0xe63(%rip),%rax
lea    0xe58(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
mov    %r14,%rsp
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Enter n: \00"
@.str.1 = [8 x i8] c"n > 0 !\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [20 x i8] c"Enter %d numbers : \00"
@.str.3 = [25 x i8] c"Enter number to search: \00"
@.str.4 = [4 x i8] c"yes\00"
@.str.5 = [3 x i8] c"no\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @check_intInput(i32* %2)
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %0
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %3
%18 = alloca i32, i64 %16
store i64 %16, i64* %4
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %2
%22 = call i32 @fill_array(i32* %18, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 @check_intInput(i32* %5)
%25 = load i32, i32* %2
%26 = load i32, i32* %5
%27 = call i64 @is_exists(i32* %18, i32 %25, i32 %26)
%28 = icmp ne i64 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%31 = call i32 (i8*, ...) @printf(i8* %30)
%32 = load i32, i32* @EXIT_SUCCESS
store i32 %32, i32* %1
%33 = load i8*, i8** %3
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter n: \00"
@.str.1 = [8 x i8] c"n > 0 !\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [20 x i8] c"Enter %d numbers : \00"
@.str.3 = [25 x i8] c"Enter number to search: \00"
@.str.4 = [4 x i8] c"yes\00"
@.str.5 = [3 x i8] c"no\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @check_intInput(i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %0
%13 = zext i32 %6 to i64
%14 = call i8* @llvm.stacksave()
%15 = alloca i32, i64 %13
%16 = load i32, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
%19 = call i32 @fill_array(i32* %15, i32 %18)
%20 = bitcast i32* %2 to i8*
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @check_intInput(i32* %2)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = call i64 @is_exists(i32* %15, i32 %23, i32 %24)
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}