#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 *);
main() {
  int i, verifica, resposta = 0,
                   vet[10] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
  printf("Por favor, digite um numero: ");
  scanf(" %d", &verifica);
  for (i = 0; i <= 9; i++) {
    if (vet[i] == verifica)
      resposta++;
  }
  if (resposta >= 1) {
    printf("Encontra-se no vetor.");
  } else {
    printf("Nao se encontra no vetor.");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     11b5 <main+0x85>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0xc(%rbp),%eax
jne    11a2 <main+0x72>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a7 <main+0x77>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x4e>
cmpl   $0x1,-0x10(%rbp)
jl     11d0 <main+0xa0>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xac>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
xor    %ecx,%ecx
cmp    $0x5a,%esi
sete   %cl
movdqa 0xea5(%rip),%xmm1
pcmpeqd %xmm0,%xmm1
pcmpeqd 0xea9(%rip),%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%edx
mov    %edx,%eax
shr    %al
and    $0x55,%al
sub    %al,%dl
mov    %edx,%eax
and    $0x33,%al
shr    $0x2,%dl
and    $0x33,%dl
add    %al,%dl
mov    %edx,%eax
shr    $0x4,%al
add    %dl,%al
and    $0xf,%al
movzbl %al,%eax
add    %ecx,%eax
xor    %ecx,%ecx
cmp    $0x64,%esi
sete   %cl
neg    %ecx
cmp    %ecx,%eax
lea    0xeb0(%rip),%rax
lea    0xe93(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.vet = [10 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50, i32 60, i32 70, i32 80, i32 90, i32 100]
@.str = [30 x i8] c"Por favor, digite um numero: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [22 x i8] c"Encontra-se no vetor.\00"
@.str.3 = [26 x i8] c"Nao se encontra no vetor.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
store i32 0, i32* %1
store i32 0, i32* %4
%6 = bitcast [10 x i32]* %5 to i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 0, i32* %2
br label %9
9: ; preds = %23, %0
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 9
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %9
26: ; preds = %9
%27 = load i32, i32* %4
%28 = icmp sge i32 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %33
31: ; preds = %26
%32 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@.str = [30 x i8] c"Por favor, digite um numero: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [22 x i8] c"Encontra-se no vetor.\00"
@.str.3 = [26 x i8] c"Nao se encontra no vetor.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = insertelement <8 x i32> poison, i32 %5, i64 0
%7 = shufflevector <8 x i32> %6, <8 x i32> poison, <8 x i32> zeroinitializer
%8 = icmp eq <8 x i32> %7, <i32 10, i32 20, i32 30, i32 40, i32 50, i32 60, i32 70, i32 80>
%9 = icmp eq i32 %5, 90
%10 = zext i1 %9 to i32
%11 = bitcast <8 x i1> %8 to i8
%12 = call i8 @llvm.ctpop.i8(i8 %11)
%13 = zext i8 %12 to i32
%14 = add nuw nsw i32 %13, %10
%15 = icmp eq i32 %5, 100
%16 = sext i1 %15 to i32
%17 = icmp eq i32 %14, %16
%18 = select i1 %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 @printf(i8* dereferenceable(1) %18)
ret i32 0
}