#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 *, float *);
int main() {
  float num[10], media, cont = 0, soma_vet = 0;
  int i;
  for (i = 0; i < 10; i++) {
    printf("Digite um numero:\n");
    scanf("%f", &num[i]);
    cont = cont + 1;
    soma_vet = soma_vet + num[i];
  }
  media = soma_vet / cont;
  printf("A media é %.2f", media);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0xa,-0x40(%rbp)
jge    11ad <main+0x8d>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x40(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
movss  0xe7f(%rip),%xmm0
addss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x3c(%rbp),%xmm0
movslq -0x40(%rbp),%rax
addss  -0x30(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1146 <main+0x26>
movss  -0x3c(%rbp),%xmm0
divss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4e(%rip),%rdi
mov    $0x1,%al
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    0xed9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x1c(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x1c(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x20(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x24(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x24(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x28(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x28(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x2c(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x2c(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x30(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x34(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x34(%rsp),%xmm0
divss  0xd36(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd32(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"A media \C3\A9 %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store i32 0, i32* %6
br label %7
7: ; preds = %24, %0
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %27
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* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %14)
%16 = load float, float* %4
%17 = fadd float %16, 1.000000e+00
store float %17, float* %4
%18 = load float, float* %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %20
%22 = load float, float* %21
%23 = fadd float %18, %22
store float %23, float* %5
br label %24
24: ; preds = %10
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %7
27: ; preds = %7
%28 = load float, float* %5
%29 = load float, float* %4
%30 = fdiv float %28, %29
store float %30, float* %3
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %32)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"A media \C3\A9 %.2f\00"
@str = [18 x i8] c"Digite um numero:\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%6 = load float, float* %4
%7 = fadd float %6, 0.000000e+00
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%11 = load float, float* %9
%12 = fadd float %7, %11
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%14 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 2
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %14)
%16 = load float, float* %14
%17 = fadd float %12, %16
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%19 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 3
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %19)
%21 = load float, float* %19
%22 = fadd float %17, %21
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%24 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 4
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %24)
%26 = load float, float* %24
%27 = fadd float %22, %26
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%29 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 5
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %29)
%31 = load float, float* %29
%32 = fadd float %27, %31
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%34 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 6
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %34)
%36 = load float, float* %34
%37 = fadd float %32, %36
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%39 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 7
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %39)
%41 = load float, float* %39
%42 = fadd float %37, %41
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%44 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 8
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %44)
%46 = load float, float* %44
%47 = fadd float %42, %46
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%49 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 9
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %49)
%51 = load float, float* %49
%52 = fadd float %47, %51
%53 = fdiv float %52, 1.000000e+01
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %54)
ret i32 0
}