#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 o, vet[10];
  int resp;
  int ashow = 0;
  for (o = 0; o < 10; o++) {
    printf("\nDigite um numero:");
    scanf("%d", &vet[o]);
  }
  printf("Entre com uma chave:");
  scanf("%d", &resp);
  for (o = 0; o < 10; o++) {
    if (resp == vet[o]) {
      ashow = 1;
    }
  }
  if (ashow == 1) {
    printf("Chave encontrada!");
  } else {
    printf("Chave nao encontrada");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    117c <main+0x5c>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11d4 <main+0xb4>
mov    -0x34(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11c1 <main+0xa1>
movl   $0x1,-0x38(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119f <main+0x7f>
cmpl   $0x1,-0x38(%rbp)
jne    11ef <main+0xcf>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
jmp    11fb <main+0xdb>
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x28(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x2c(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x34(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    0x10(%rsp),%eax
lea    0xdfc(%rip),%rcx
lea    0xe07(%rip),%rdi
cmove  %rcx,%rdi
cmp    0x14(%rsp),%eax
movdqu 0x18(%rsp),%xmm0
movdqu 0x28(%rsp),%xmm1
movd   %eax,%xmm2
pshufd $0x0,%xmm2,%xmm2
pcmpeqd %xmm2,%xmm1
pcmpeqd %xmm2,%xmm0
packssdw %xmm1,%xmm0
psllw  $0xf,%xmm0
cmove  %rcx,%rdi
pmovmskb %xmm0,%eax
test   $0xaaaa,%eax
cmovne %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0ADigite um numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Entre com uma chave:\00"
@.str.3 = [18 x i8] c"Chave encontrada!\00"
@.str.4 = [21 x i8] c"Chave nao encontrada\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %2
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
br label %21
21: ; preds = %33, %18
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %25, %29
br i1 %30, label %31, label %32
31: ; preds = %24
store i32 1, i32* %5
br label %32
32: ; preds = %31, %24
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %21
36: ; preds = %21
%37 = load i32, i32* %5
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %43
41: ; preds = %36
%42 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0ADigite um numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Entre com uma chave:\00"
@.str.3 = [18 x i8] c"Chave encontrada!\00"
@.str.4 = [21 x i8] c"Chave nao encontrada\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %27)
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %30)
%32 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %33)
%35 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%37 = load i32, i32* %2
%38 = load i32, i32* %6
%39 = icmp eq i32 %37, %38
%40 = load i32, i32* %9
%41 = icmp eq i32 %37, %40
%42 = bitcast i32* %12 to <8 x i32>*
%43 = load <8 x i32>, <8 x i32>* %42
%44 = insertelement <8 x i32> poison, i32 %37, i64 0
%45 = shufflevector <8 x i32> %44, <8 x i32> poison, <8 x i32> zeroinitializer
%46 = icmp eq <8 x i32> %45, %43
%47 = freeze <8 x i1> %46
%48 = bitcast <8 x i1> %47 to i8
%49 = icmp ne i8 %48, 0
%50 = select i1 %49, i1 true, i1 %41
%51 = select i1 %50, i1 true, i1 %39
%52 = select i1 %51, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0)
%53 = call i32 @printf(i8* dereferenceable(1) %52)
ret i32 0
}