#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 getchar();
double pow(float, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
float sqrt(double);
int main(void) {
  printf("\n ** Calculo das medias: Aritmetica,Harmonica,Geometrica e "
         "Quadratica ** \n\n");
  float a, b, c, d, A, H, G, Q;
  printf("Informe a nota da prova 1: ");
  scanf("%f", &a);
  printf("Informe a nota da prova 2: ");
  scanf("%f", &b);
  printf("Informe a nota da prova 3: ");
  scanf("%f", &c);
  printf("Informe a nota da prova 4: ");
  scanf("%f", &d);
  A = (a + b + c + d) / 4.0;
  H = 4.0 / (1.0 / a + 1.0 / b + 1.0 / c + 1.0 / d);
  G = pow(a * b * c * d, 1.0 / 4.0);
  Q = sqrt((pow(a, 2.0) + pow(b, 2.0) + pow(c, 2.0) + pow(d, 3.0)) / 4.0);
  printf("\nA media Aritmetica é: %.2f;\nA media Harmonica  é: %.2f;\nA media "
         "Geometrica é: %.2f;\nA media Quadratica é: %.2f.\n\n",
         A, H, G, Q);
  printf("<<Marco Tulio>>");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xf06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe02(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe04(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xdef(%rip),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xdd6(%rip),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xdbd(%rip),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movsd  0xd8d(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movsd  0xd7c(%rip),%xmm1
call   1060 <pow@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xd59(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xd42(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0xc(%rbp),%xmm0
movsd  0xd1f(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
movsd  0xcf4(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xcd3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x20(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xd81(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xfce(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm2
movaps %xmm0,%xmm4
addss  %xmm2,%xmm4
movss  0xc(%rsp),%xmm3
addss  %xmm3,%xmm4
movss  0x8(%rsp),%xmm1
addss  %xmm1,%xmm4
mulss  0xded(%rip),%xmm4
movaps %xmm4,0x20(%rsp)
movaps %xmm0,%xmm4
unpcklps %xmm2,%xmm4
cvtps2pd %xmm4,%xmm4
movapd 0xde7(%rip),%xmm5
movapd %xmm5,%xmm6
mulss  %xmm2,%xmm0
mulss  %xmm3,%xmm0
unpcklps %xmm1,%xmm3
cvtps2pd %xmm3,%xmm2
divpd  %xmm4,%xmm6
divpd  %xmm2,%xmm5
movapd %xmm6,%xmm2
unpckhpd %xmm6,%xmm2
addsd  %xmm6,%xmm2
addsd  %xmm5,%xmm2
unpckhpd %xmm5,%xmm5
addsd  %xmm2,%xmm5
movsd  0xdbd(%rip),%xmm2
divsd  %xmm5,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  %xmm2,0x1c(%rsp)
mulss  %xmm1,%xmm0
movsd  0xdab(%rip),%xmm1
call   1070 <pow@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x14(%rsp),%xmm0
movsd  0xd96(%rip),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,(%rsp)
movss  0x10(%rsp),%xmm0
movsd  0xd7e(%rip),%xmm1
call   1070 <pow@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movss  0xc(%rsp),%xmm0
movsd  0xd61(%rip),%xmm1
call   1070 <pow@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movss  0x8(%rsp),%xmm0
movsd  0xd4c(%rip),%xmm1
call   1070 <pow@plt>
addsd  (%rsp),%xmm0
mulsd  0xd2a(%rip),%xmm0
call   1080 <sqrt@plt>
movaps 0x20(%rsp),%xmm1
xorps  %xmm4,%xmm4
cvtss2sd %xmm1,%xmm4
movss  0x1c(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x18(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
xorps  %xmm3,%xmm3
cvtss2sd %xmm0,%xmm3
lea    0xd82(%rip),%rdi
movaps %xmm4,%xmm0
mov    $0x4,%al
call   1040 <printf@plt>
lea    0xde8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"\0A ** Calculo das medias: Aritmetica,Harmonica,Geometrica e Quadratica ** \0A\0A\00"
@.str.1 = [28 x i8] c"Informe a nota da prova 1: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [28 x i8] c"Informe a nota da prova 2: \00"
@.str.4 = [28 x i8] c"Informe a nota da prova 3: \00"
@.str.5 = [28 x i8] c"Informe a nota da prova 4: \00"
@.str.6 = [119 x i8] c"\0AA media Aritmetica \C3\A9: %.2f;\0AA media Harmonica \C3\A9: %.2f;\0AA media Geometrica \C3\A9: %.2f;\0AA media Quadratica \C3\A9: %.2f.\0A\0A\00"
@.str.7 = [16 x i8] c"<<Marco Tulio>>\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%18 = load float, float* %1
%19 = load float, float* %2
%20 = fadd float %18, %19
%21 = load float, float* %3
%22 = fadd float %20, %21
%23 = load float, float* %4
%24 = fadd float %22, %23
%25 = fpext float %24 to double
%26 = fdiv double %25, 4.000000e+00
%27 = fptrunc double %26 to float
store float %27, float* %5
%28 = load float, float* %1
%29 = fpext float %28 to double
%30 = fdiv double 1.000000e+00, %29
%31 = load float, float* %2
%32 = fpext float %31 to double
%33 = fdiv double 1.000000e+00, %32
%34 = fadd double %30, %33
%35 = load float, float* %3
%36 = fpext float %35 to double
%37 = fdiv double 1.000000e+00, %36
%38 = fadd double %34, %37
%39 = load float, float* %4
%40 = fpext float %39 to double
%41 = fdiv double 1.000000e+00, %40
%42 = fadd double %38, %41
%43 = fdiv double 4.000000e+00, %42
%44 = fptrunc double %43 to float
store float %44, float* %6
%45 = load float, float* %1
%46 = load float, float* %2
%47 = fmul float %45, %46
%48 = load float, float* %3
%49 = fmul float %47, %48
%50 = load float, float* %4
%51 = fmul float %49, %50
%52 = call double @pow(float %51, double 2.500000e-01)
%53 = fptrunc double %52 to float
store float %53, float* %7
%54 = load float, float* %1
%55 = call double @pow(float %54, double 2.000000e+00)
%56 = load float, float* %2
%57 = call double @pow(float %56, double 2.000000e+00)
%58 = fadd double %55, %57
%59 = load float, float* %3
%60 = call double @pow(float %59, double 2.000000e+00)
%61 = fadd double %58, %60
%62 = load float, float* %4
%63 = call double @pow(float %62, double 3.000000e+00)
%64 = fadd double %61, %63
%65 = fdiv double %64, 4.000000e+00
%66 = call float @sqrt(double %65)
store float %66, float* %8
%67 = load float, float* %5
%68 = fpext float %67 to double
%69 = load float, float* %6
%70 = fpext float %69 to double
%71 = load float, float* %7
%72 = fpext float %71 to double
%73 = load float, float* %8
%74 = fpext float %73 to double
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str.6, i64 0, i64 0), double %68, double %70, double %72, double %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%77 = call i32 (...) @getchar()
%78 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Informe a nota da prova 1: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [28 x i8] c"Informe a nota da prova 2: \00"
@.str.4 = [28 x i8] c"Informe a nota da prova 3: \00"
@.str.5 = [28 x i8] c"Informe a nota da prova 4: \00"
@.str.6 = [119 x i8] c"\0AA media Aritmetica \C3\A9: %.2f;\0AA media Harmonica \C3\A9: %.2f;\0AA media Geometrica \C3\A9: %.2f;\0AA media Quadratica \C3\A9: %.2f.\0A\0A\00"
@.str.7 = [16 x i8] c"<<Marco Tulio>>\00"
@str = [75 x i8] c"\0A ** Calculo das medias: Aritmetica,Harmonica,Geometrica e Quadratica ** \0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%18 = load float, float* %1
%19 = load float, float* %2
%20 = fadd float %18, %19
%21 = load float, float* %3
%22 = fadd float %20, %21
%23 = load float, float* %4
%24 = fadd float %22, %23
%25 = fmul float %24, 2.500000e-01
%26 = insertelement <2 x float> poison, float %18, i64 0
%27 = insertelement <2 x float> %26, float %19, i64 1
%28 = fpext <2 x float> %27 to <2 x double>
%29 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %28
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%31 = fadd <2 x double> %29, %30
%32 = insertelement <2 x float> poison, float %21, i64 0
%33 = insertelement <2 x float> %32, float %23, i64 1
%34 = fpext <2 x float> %33 to <2 x double>
%35 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %34
%36 = fadd <2 x double> %31, %35
%37 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%38 = fadd <2 x double> %36, %37
%39 = extractelement <2 x double> %38, i64 0
%40 = fdiv double 4.000000e+00, %39
%41 = fptrunc double %40 to float
%42 = fmul float %18, %19
%43 = fmul float %42, %21
%44 = fmul float %43, %23
%45 = call double @pow(float %44, double 2.500000e-01)
%46 = fptrunc double %45 to float
%47 = load float, float* %1
%48 = call double @pow(float %47, double 2.000000e+00)
%49 = load float, float* %2
%50 = call double @pow(float %49, double 2.000000e+00)
%51 = fadd double %48, %50
%52 = load float, float* %3
%53 = call double @pow(float %52, double 2.000000e+00)
%54 = fadd double %51, %53
%55 = load float, float* %4
%56 = call double @pow(float %55, double 3.000000e+00)
%57 = fadd double %54, %56
%58 = fmul double %57, 2.500000e-01
%59 = call float @sqrt(double %58)
%60 = fpext float %25 to double
%61 = fpext float %41 to double
%62 = fpext float %46 to double
%63 = fpext float %59 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([119 x i8], [119 x i8]* @.str.6, i64 0, i64 0), double %60, double %61, double %62, double %63)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%66 = call i32 (...) @getchar()
%67 = call i32 (...) @getchar()
ret i32 0
}