#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*/ buscaSequencial(int *, int, int);
int /*<<< orphan*/ mostrarVetorInteiros(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int v[] = {1, 2, 3, 4};
  int k;
  scanf("%d", &k);
  if (!buscaSequencial(v, 4, k)) {
    printf("O numero %d NAO esta no vetor ", k);
    mostrarVetorInteiros(v, 4);
  } else {
    printf("O numero %d esta no vetor ", k);
    mostrarVetorInteiros(v, 4);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea4(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0x4,%esi
call   1050 <buscaSequencial@plt>
cmp    $0x0,%eax
jne    11b1 <main+0x71>
mov    -0x24(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <mostrarVetorInteiros@plt>
jmp    11ce <main+0x8e>
mov    -0x24(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <mostrarVetorInteiros@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <buscaSequencial@plt>
test   %eax,%eax
mov    0xc(%rsp),%esi
lea    0xe8e(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <mostrarVetorInteiros@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.v = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [3 x i8] c"%d\00"
@.str.1 = [31 x i8] c"O numero %d NAO esta no vetor \00"
@.str.2 = [27 x i8] c"O numero %d esta no vetor \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @buscaSequencial(i32* %6, i32 4, i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %0
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%14 = call i32 @mostrarVetorInteiros(i32* %13, i32 4)
br label %20
15: ; preds = %0
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%19 = call i32 @mostrarVetorInteiros(i32* %18, i32 4)
br label %20
20: ; preds = %15, %10
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [3 x i8] c"%d\00"
@.str.1 = [31 x i8] c"O numero %d NAO esta no vetor \00"
@.str.2 = [27 x i8] c"O numero %d esta no vetor \00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca i32
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @buscaSequencial(i32* %6, i32 4, i32 %7)
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0)
%12 = call i32 @printf(i8* %11, i32 %10)
%13 = call i32 @mostrarVetorInteiros(i32* %6, i32 4)
ret i32 0
}