#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 *, double *);
int main() {
  double nota1, nota2;
  printf("Escreva a nota 1: ");
  scanf("%lf", &nota1);
  printf("\nEscreva a nota 2: ");
  scanf("%lf", &nota2);
  printf("\nA media ponderada e: ");
  printf("%.2lf", (nota1 * 2 + nota2 * 3) / 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6c(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeb3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee9(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0xe7f(%rip),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
divsd  0xe77(%rip),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Escreva a nota 1: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"\0AEscreva a nota 2: \00"
@.str.3 = [23 x i8] c"\0AA media ponderada e: \00"
@.str.4 = [6 x i8] c"%.2lf\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%8 = load double, double* %1
%9 = load double, double* %2
%10 = fmul double %9, 3.000000e+00
%11 = call double @llvm.fmuladd.f64(double %8, double 2.000000e+00, double %10)
%12 = fdiv double %11, 5.000000e+00
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Escreva a nota 1: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"\0AEscreva a nota 2: \00"
@.str.3 = [23 x i8] c"\0AA media ponderada e: \00"
@.str.4 = [6 x i8] c"%.2lf\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%10 = load double, double* %1
%11 = load double, double* %2
%12 = fmul double %11, 3.000000e+00
%13 = call double @llvm.fmuladd.f64(double %10, double 2.000000e+00, double %12)
%14 = fdiv double %13, 5.000000e+00
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %14)
ret i32 0
}