#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 *);
scalar_t__ searcharray(int *, int);
int main(void) {
  int number[20] = {0};
  int i = 0, value;
  while (++i <= 20) {
    printf("Enter a integer:");
    scanf("%d", &value);
    if (searcharray(number, value)) {
      printf("%d\n", value);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
cmp    $0x14,%eax
jg     11c2 <main+0x82>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x68(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%esi
call   1030 <searcharray@plt>
cmp    $0x0,%rax
je     11bd <main+0x7d>
mov    -0x68(%rbp),%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1166 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
mov    $0x14,%ebp
lea    0xe9a(%rip),%r14
lea    0xea4(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x10(%rsp),%rbx
lea    0xe96(%rip),%r13
jmp    1185 <main+0x55>
add    $0xffffffff,%ebp
je     11bb <main+0x8b>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <searcharray@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    0xc(%rsp),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [20 x i32]* %2 to i8*
store i32 0, i32* %3
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = icmp sle i32 %8, 20
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call i64 @searcharray(i32* %13, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %10
br label %6
21: ; preds = %6
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca i32
%3 = bitcast [20 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
br label %6
6: ; preds = %0, %16
%7 = phi i32 [ 1, %0 ], [ %17, %16 ]
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call i64 @searcharray(i32* %5, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %6
%17 = add nuw nsw i32 %7, 1
%18 = icmp eq i32 %17, 21
br i1 %18, label %19, label %6
19: ; preds = %16
ret i32 0
}