#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 vet[20] = {0};
  int i;
  int aux;
  int cont = 0;
  float media = 0;
  printf("Digite o numero seguinte, maximo 20\n");
  for (i = 0; i < 20; i++) {
    scanf("%d", &aux);
    if (aux == 0) {
      break;
    }
    vet[i] = aux;
    cont++;
    media = media + vet[i];
  }
  media = media / cont;
  for (i = 0; i < cont - 1; i++) {
    if (vet[i] >= media) {
      printf("%d", vet[i]);
      printf("\n");
    }
  }
}


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   1040 <memset@plt>
movl   $0x0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x14,-0x64(%rbp)
jge    11d6 <main+0xa6>
lea    0xea1(%rip),%rdi
lea    -0x68(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x68(%rbp)
jne    119c <main+0x6c>
jmp    11d6 <main+0xa6>
mov    -0x68(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
movss  -0x70(%rbp),%xmm0
movslq -0x64(%rbp),%rax
cvtsi2ssl -0x60(%rbp,%rax,4),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1173 <main+0x43>
movss  -0x70(%rbp),%xmm0
cvtsi2ssl -0x6c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x6c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    124c <main+0x11c>
movslq -0x64(%rbp),%rax
cvtsi2ssl -0x60(%rbp,%rax,4),%xmm0
ucomiss -0x70(%rbp),%xmm0
jb     1239 <main+0x109>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <main+0x10e>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11f0 <main+0xc0>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
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)
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
xorps  %xmm1,%xmm1
xor    %r12d,%r12d
lea    0xe84(%rip),%r14
lea    0xc(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
movss  %xmm1,0x8(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11d9 <main+0x99>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    %eax,0x10(%rsp,%r12,4)
add    $0x1,%r12
movss  0x8(%rsp),%xmm1
addss  %xmm0,%xmm1
cmp    $0x14,%r12
jne    1190 <main+0x50>
divss  0xe2f(%rip),%xmm1
mov    $0x14,%r12d
jmp    11f1 <main+0xb1>
cmp    $0x2,%r12d
movss  0x8(%rsp),%xmm1
jl     1245 <main+0x105>
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
divss  %xmm0,%xmm1
add    $0xffffffff,%r12d
lea    0xe08(%rip),%r14
xor    %ebx,%ebx
movss  %xmm1,0x8(%rsp)
jmp    1219 <main+0xd9>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r12
je     1245 <main+0x105>
mov    0x10(%rsp,%rbx,4),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
ucomiss %xmm1,%xmm0
jb     1210 <main+0xd0>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x8(%rsp),%xmm1
jmp    1210 <main+0xd0>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Digite o numero seguinte, maximo 20\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
%7 = bitcast [20 x i32]* %2 to i8*
store i32 0, i32* %5
store float 0.000000e+00, float* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %9
9: ; preds = %31, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %34
12: ; preds = %9
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %34
17: ; preds = %12
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
%24 = load float, float* %6
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = sitofp i32 %28 to float
%30 = fadd float %24, %29
store float %30, float* %6
br label %31
31: ; preds = %17
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %9
34: ; preds = %16, %9
%35 = load float, float* %6
%36 = load i32, i32* %5
%37 = sitofp i32 %36 to float
%38 = fdiv float %35, %37
store float %38, float* %6
store i32 0, i32* %3
br label %39
39: ; preds = %60, %34
%40 = load i32, i32* %3
%41 = load i32, i32* %5
%42 = sub nsw i32 %41, 1
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %63
44: ; preds = %39
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = sitofp i32 %48 to float
%50 = load float, float* %6
%51 = fcmp oge float %49, %50
br i1 %51, label %52, label %59
52: ; preds = %44
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %59
59: ; preds = %52, %44
br label %60
60: ; preds = %59
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %39
63: ; preds = %39
%64 = load i32, i32* %1
ret i32 %64
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [36 x i8] c"Digite o numero seguinte, maximo 20\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 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %0, %12
%7 = phi i64 [ 0, %0 ], [ %14, %12 ]
%8 = phi float [ 0.000000e+00, %0 ], [ %16, %12 ]
%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 = icmp eq i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %6
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %7
store i32 %10, i32* %13
%14 = add nuw nsw i64 %7, 1
%15 = sitofp i32 %10 to float
%16 = fadd float %8, %15
%17 = icmp eq i64 %14, 20
br i1 %17, label %18, label %6
18: ; preds = %12
%19 = fdiv float %16, 2.000000e+01
br label %25
20: ; preds = %6
%21 = trunc i64 %7 to i32
%22 = sitofp i32 %21 to float
%23 = fdiv float %8, %22
%24 = icmp sgt i32 %21, 1
br i1 %24, label %25, label %42
25: ; preds = %18, %20
%26 = phi float [ %19, %18 ], [ %23, %20 ]
%27 = phi i64 [ 20, %18 ], [ %7, %20 ]
%28 = add nuw i64 %27, 4294967295
%29 = and i64 %28, 4294967295
br label %30
30: ; preds = %25, %39
%31 = phi i64 [ 0, %25 ], [ %40, %39 ]
%32 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = sitofp i32 %33 to float
%35 = fcmp ugt float %26, %34
br i1 %35, label %39, label %36
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%38 = call i32 @putchar(i32 10)
br label %39
39: ; preds = %30, %36
%40 = add nuw nsw i64 %31, 1
%41 = icmp eq i64 %40, %29
br i1 %41, label %42, label %30
42: ; preds = %39, %20
ret i32 0
}