#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 vet1[8], x, cont = 0, soma = 0, soma2 = 0;
  for (x = 0; x <= 7; x++) {
    printf("\nDigite um valor: ");
    scanf("%d", &vet1[x]);
    if (vet1[x] > 30) {
      cont++;
      soma = soma + vet1[x];
    }
  }
  for (x = 0; x <= 7; x++) {
    printf("\t%d", vet1[x]);
  }
  printf("\n\n %d Numeros sao maiores que 30", cont);
  printf("\n\n A Soma dos numeros maiores que 30 e = %d", soma);
  for (x = 0; x <= 7; x++) {
    soma2 = soma2 + vet1[x];
  }
  printf("\n\n A Soma dos numeros digitados e = %d", soma2);
  printf("\n\n");
  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,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x7,-0x34(%rbp)
jg     11b7 <main+0x97>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9b(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x34(%rbp),%rax
cmpl   $0x1e,-0x30(%rbp,%rax,4)
jle    11a4 <main+0x84>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
movslq -0x34(%rbp),%rcx
add    -0x30(%rbp,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
jmp    11a9 <main+0x89>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114b <main+0x2b>
movl   $0x0,-0x34(%rbp)
cmpl   $0x7,-0x34(%rbp)
jg     11ec <main+0xcc>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11be <main+0x9e>
mov    -0x38(%rbp),%esi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x7,-0x34(%rbp)
jg     123b <main+0x11b>
mov    -0x40(%rbp),%eax
movslq -0x34(%rbp),%rcx
add    -0x30(%rbp,%rcx,4),%eax
mov    %eax,-0x40(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1215 <main+0xf5>
mov    -0x40(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xed2(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movaps (%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
unpcklpd 0x20(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
unpcklpd 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
shufps $0x22,%xmm0,%xmm1
movaps %xmm1,0x30(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
unpcklps %xmm0,%xmm1
movaps %xmm1,0x20(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x18(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x1c(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
unpcklps %xmm0,%xmm1
movaps 0x20(%rsp),%xmm0
movlhps %xmm1,%xmm0
movaps %xmm0,0x20(%rsp)
mov    (%rsp),%esi
lea    0xd9b(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movdqa 0x30(%rsp),%xmm1
movdqa %xmm1,%xmm0
movdqa 0xcfa(%rip),%xmm4
pcmpgtd %xmm4,%xmm0
pand   %xmm0,%xmm1
movdqa %xmm1,%xmm2
movdqa 0x20(%rsp),%xmm3
movdqa %xmm3,%xmm1
pcmpgtd %xmm4,%xmm1
pand   %xmm1,%xmm3
paddd  %xmm2,%xmm3
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%eax
mov    %eax,%ecx
shr    %cl
and    $0x55,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%esi
pshufd $0xee,%xmm3,%xmm0
paddd  %xmm3,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
lea    0xcb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xcc7(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movdqa (%rsp),%xmm0
paddd  0x10(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%esi
lea    0xcc2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xcdb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0ADigite um valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\09%d\00"
@.str.3 = [33 x i8] c"\0A\0A %d Numeros sao maiores que 30\00"
@.str.4 = [44 x i8] c"\0A\0A A Soma dos numeros maiores que 30 e = %d\00"
@.str.5 = [39 x i8] c"\0A\0A A Soma dos numeros digitados e = %d\00"
@.str.6 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %3
br label %7
7: ; preds = %31, %0
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %34
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp sgt i32 %19, 30
br i1 %20, label %21, label %30
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = add nsw i32 %24, %28
store i32 %29, i32* %5
br label %30
30: ; preds = %21, %10
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %7
34: ; preds = %7
store i32 0, i32* %3
br label %35
35: ; preds = %44, %34
%36 = load i32, i32* %3
%37 = icmp sle i32 %36, 7
br i1 %37, label %38, label %47
38: ; preds = %35
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %38
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %35
47: ; preds = %35
%48 = load i32, i32* %4
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %5
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i32 %50)
store i32 0, i32* %3
br label %52
52: ; preds = %62, %47
%53 = load i32, i32* %3
%54 = icmp sle i32 %53, 7
br i1 %54, label %55, label %65
55: ; preds = %52
%56 = load i32, i32* %6
%57 = load i32, i32* %3
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = add nsw i32 %56, %60
store i32 %61, i32* %6
br label %62
62: ; preds = %55
%63 = load i32, i32* %3
%64 = add nsw i32 %63, 1
store i32 %64, i32* %3
br label %52
65: ; preds = %52
%66 = load i32, i32* %6
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0ADigite um valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\09%d\00"
@.str.3 = [33 x i8] c"\0A\0A %d Numeros sao maiores que 30\00"
@.str.4 = [44 x i8] c"\0A\0A A Soma dos numeros maiores que 30 e = %d\00"
@.str.5 = [39 x i8] c"\0A\0A A Soma dos numeros digitados e = %d\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca <8 x i32>
%2 = bitcast <8 x i32>* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = bitcast <8 x i32>* %1 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = shufflevector <4 x i32> %7, <4 x i32> poison, <8 x i32> <i32 0, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32, i32* %10
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 2
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %14
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 3
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = load i32, i32* %18
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%22 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 4
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = load i32, i32* %22
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%26 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 5
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %26)
%28 = load i32, i32* %26
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%30 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 6
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %30)
%32 = load i32, i32* %30
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%34 = getelementptr inbounds <8 x i32>, <8 x i32>* %1, i64 0, i64 7
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %34)
%36 = load i32, i32* %34
%37 = insertelement <8 x i32> %8, i32 %12, i64 1
%38 = insertelement <8 x i32> %37, i32 %16, i64 2
%39 = insertelement <8 x i32> %38, i32 %20, i64 3
%40 = insertelement <8 x i32> %39, i32 %24, i64 4
%41 = insertelement <8 x i32> %40, i32 %28, i64 5
%42 = insertelement <8 x i32> %41, i32 %32, i64 6
%43 = insertelement <8 x i32> %42, i32 %36, i64 7
%44 = icmp sgt <8 x i32> %43, <i32 30, i32 30, i32 30, i32 30, i32 30, i32 30, i32 30, i32 30>
%45 = load i32, i32* %4
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %10
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %14
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %18
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %22
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %26
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %30
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %34
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %59)
%61 = select <8 x i1> %44, <8 x i32> %43, <8 x i32> zeroinitializer
%62 = bitcast <8 x i1> %44 to i8
%63 = call i8 @llvm.ctpop.i8(i8 %62)
%64 = zext i8 %63 to i32
%65 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %61)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %64)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i32 %65)
%68 = load <8 x i32>, <8 x i32>* %1
%69 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %68)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %69)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}