#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(void) {
  printf("\n ** Calculo da media ponderada da disciplina de Programação de "
         "Compuradores **\n");
  float n1, n2, n3, n4, P;
  printf("\nInforme a nota da 1 avaliação: ");
  scanf("%f", &n1);
  printf("Informe a nota da 2 avaliação: ");
  scanf("%f", &n2);
  printf("Informe a nota da 3 avaliação: ");
  scanf("%f", &n3);
  printf("Informe a nota da 4 avaliação: ");
  scanf("%f", &n4);
  P = (n1 * 2.0 + n2 * 4.0 + n3 * 6.0 + n4 * 8.0) / (2.0 + 4.0 + 6.0 + 8.0);
  printf("\nA media Ponderada do aluno da seguinte disciplina é: %.2f.\n", P);
  printf("\n<<Marco Tulio>>\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4b(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe50(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe2b(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdf2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xfae(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeed(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe32(%rip),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe20(%rip),%xmm1
movss  (%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xe17(%rip),%xmm2
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
divsd  0xe0f(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [83 x i8] c"\0A ** Calculo da media ponderada da disciplina de Programa\C3\A7\C3\A3o de Compuradores **\0A\00"
@.str.1 = [35 x i8] c"\0AInforme a nota da 1 avalia\C3\A7\C3\A3o: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [34 x i8] c"Informe a nota da 2 avalia\C3\A7\C3\A3o: \00"
@.str.4 = [34 x i8] c"Informe a nota da 3 avalia\C3\A7\C3\A3o: \00"
@.str.5 = [34 x i8] c"Informe a nota da 4 avalia\C3\A7\C3\A3o: \00"
@.str.6 = [62 x i8] c"\0AA media Ponderada do aluno da seguinte disciplina \C3\A9: %.2f.\0A\00"
@.str.7 = [18 x i8] c"\0A<<Marco Tulio>>\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%15 = load float, float* %1
%16 = fpext float %15 to double
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fmul double %18, 4.000000e+00
%20 = call double @llvm.fmuladd.f64(double %16, double 2.000000e+00, double %19)
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = call double @llvm.fmuladd.f64(double %22, double 6.000000e+00, double %20)
%24 = load float, float* %4
%25 = fpext float %24 to double
%26 = call double @llvm.fmuladd.f64(double %25, double 8.000000e+00, double %23)
%27 = fdiv double %26, 2.000000e+01
%28 = fptrunc double %27 to float
store float %28, float* %5
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0), double %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"\0AInforme a nota da 1 avalia\C3\A7\C3\A3o: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [34 x i8] c"Informe a nota da 2 avalia\C3\A7\C3\A3o: \00"
@.str.4 = [34 x i8] c"Informe a nota da 3 avalia\C3\A7\C3\A3o: \00"
@.str.5 = [34 x i8] c"Informe a nota da 4 avalia\C3\A7\C3\A3o: \00"
@.str.6 = [62 x i8] c"\0AA media Ponderada do aluno da seguinte disciplina \C3\A9: %.2f.\0A\00"
@str = [82 x i8] c"\0A ** Calculo da media ponderada da disciplina de Programa\C3\A7\C3\A3o de Compuradores **\00"
@str.8 = [17 x i8] c"\0A<<Marco Tulio>>\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 ([82 x i8], [82 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 ([35 x i8], [35 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 ([34 x i8], [34 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 ([34 x i8], [34 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 ([34 x i8], [34 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 = fpext float %18 to double
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = fmul double %21, 4.000000e+00
%23 = call double @llvm.fmuladd.f64(double %19, double 2.000000e+00, double %22)
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = call double @llvm.fmuladd.f64(double %25, double 6.000000e+00, double %23)
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = call double @llvm.fmuladd.f64(double %28, double 8.000000e+00, double %26)
%30 = fdiv double %29, 2.000000e+01
%31 = fptrunc double %30 to float
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0), double %32)
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}