#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 *, float, ...);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ system(char *);
int main() {
  int contador;
  float nota, acumulador = 0, x;
  for (contador = 1; contador <= 10; contador++) {
    printf("\nDigite a %dº nota: ", contador);
    scanf("%f", &nota);
    acumulador = acumulador + nota;
  }
  x = (acumulador / 10);
  printf("\nO valor total de notas é %.2f. A média dos números digitados é "
         "%.2f.\n\n",
         acumulador, x);
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1198 <main+0x68>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x1e>
movss  -0x10(%rbp),%xmm0
movss  0xe5b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe5a(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xee8(%rip),%r14
movss  0xeb8(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xee5(%rip),%rbx
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xe84(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xe59(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xe2e(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xe03(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xdd8(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xdad(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xd82(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xd57(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xd2c(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
movaps %xmm1,%xmm2
movaps %xmm1,%xmm0
divss  0xcfd(%rip),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xd0c(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xd4a(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0ADigite a %d\C2\BA nota: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [76 x i8] c"\0AO valor total de notas \C3\A9 %.2f. A m\C3\A9dia dos n\C3\BAmeros digitados \C3\A9 %.2f.\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store i32 1, i32* %2
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%14 = load float, float* %4
%15 = load float, float* %3
%16 = fadd float %14, %15
store float %16, float* %4
br label %17
17: ; preds = %9
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %6
20: ; preds = %6
%21 = load float, float* %4
%22 = fdiv float %21, 1.000000e+01
store float %22, float* %5
%23 = load float, float* %4
%24 = load float, float* %5
%25 = fpext float %24 to double
%26 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), float %23, double %25)
%27 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0ADigite a %d\C2\BA nota: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [76 x i8] c"\0AO valor total de notas \C3\A9 %.2f. A m\C3\A9dia dos n\C3\BAmeros digitados \C3\A9 %.2f.\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fadd float %5, 0.000000e+00
%7 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = load float, float* %1
%10 = fadd float %6, %9
%11 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%13 = load float, float* %1
%14 = fadd float %10, %13
%15 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%17 = load float, float* %1
%18 = fadd float %14, %17
%19 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%21 = load float, float* %1
%22 = fadd float %18, %21
%23 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 6.000000e+00)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%25 = load float, float* %1
%26 = fadd float %22, %25
%27 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 7.000000e+00)
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%29 = load float, float* %1
%30 = fadd float %26, %29
%31 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 8.000000e+00)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%33 = load float, float* %1
%34 = fadd float %30, %33
%35 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 9.000000e+00)
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%37 = load float, float* %1
%38 = fadd float %34, %37
%39 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 1.000000e+01)
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%41 = load float, float* %1
%42 = fadd float %38, %41
%43 = fdiv float %42, 1.000000e+01
%44 = fpext float %43 to double
%45 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), float %42, double %44)
%46 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}