#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 n1, n2, n3, me = 0, ma = 0;
  char nota;
  printf("Qual sua av1?");
  scanf("%f", &n1);
  printf("Qual sua av2?");
  scanf("%f", &n2);
  printf("Qual sua av3?");
  scanf("%f", &n3);
  me = (n1 + n2 + n3) / 3;
  ma = (n1 + (n2 * 2) + (n3 * 3) + me) / 7;
  printf("%.2f", ma);
  if (ma >= 9) {
    printf("\nA");
  }
  if (ma >= 7.5 && ma < 9) {
    printf("\nB");
  }
  if (ma >= 6 && ma < 7.5) {
    printf("\nC");
  }
  if (ma >= 4 && ma < 6) {
    printf("\nD");
  }
  if (ma < 4) {
    printf("\nE");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xe58(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
addss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
movss  0xe30(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0x14(%rbp),%xmm0
movss  0xe17(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe47(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
movss  0xde6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1231 <main+0x111>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     126c <main+0x14c>
movss  0xdac(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    126c <main+0x14c>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
movss  0xd93(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12ab <main+0x18b>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd85(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ab <main+0x18b>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
movss  0xd58(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12e1 <main+0x1c1>
movss  0xd43(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    12e1 <main+0x1c1>
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xd27(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    1301 <main+0x1e1>
lea    0xd64(%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    0xeec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  0x4(%rsp),%xmm4
addss  %xmm4,%xmm2
movss  0xe5e(%rip),%xmm3
divss  %xmm3,%xmm2
addss  %xmm1,%xmm1
addss  %xmm0,%xmm1
mulss  %xmm3,%xmm4
addss  %xmm1,%xmm4
addss  %xmm2,%xmm4
divss  0xe42(%rip),%xmm4
movss  %xmm4,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
lea    0xe70(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  (%rsp),%xmm1
ucomiss 0xe20(%rip),%xmm1
jb     11fd <main+0xdd>
lea    0xe59(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%rsp),%xmm1
ucomiss 0xe08(%rip),%xmm1
jb     1226 <main+0x106>
movss  0xdfa(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1226 <main+0x106>
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%rsp),%xmm1
ucomiss 0xde3(%rip),%xmm1
jb     124f <main+0x12f>
movss  0xdd5(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    124f <main+0x12f>
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%rsp),%xmm1
ucomiss 0xdbe(%rip),%xmm1
jb     1278 <main+0x158>
movss  0xdb0(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1278 <main+0x158>
lea    0xde7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%rsp),%xmm1
movss  0xd94(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1293 <main+0x173>
lea    0xdca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Qual sua av1?\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"Qual sua av2?\00"
@.str.3 = [14 x i8] c"Qual sua av3?\00"
@.str.4 = [5 x i8] c"%.2f\00"
@.str.5 = [3 x i8] c"\0AA\00"
@.str.6 = [3 x i8] c"\0AB\00"
@.str.7 = [3 x i8] c"\0AC\00"
@.str.8 = [3 x i8] c"\0AD\00"
@.str.9 = [3 x i8] c"\0AE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i8
store i32 0, i32* %1
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fadd float %14, %15
%17 = load float, float* %4
%18 = fadd float %16, %17
%19 = fdiv float %18, 3.000000e+00
store float %19, float* %5
%20 = load float, float* %2
%21 = load float, float* %3
%22 = call float @llvm.fmuladd.f32(float %21, float 2.000000e+00, float %20)
%23 = load float, float* %4
%24 = call float @llvm.fmuladd.f32(float %23, float 3.000000e+00, float %22)
%25 = load float, float* %5
%26 = fadd float %24, %25
%27 = fdiv float %26, 7.000000e+00
store float %27, float* %6
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %29)
%31 = load float, float* %6
%32 = fcmp oge float %31, 9.000000e+00
br i1 %32, label %33, label %35
33: ; preds = %0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %35
35: ; preds = %33, %0
%36 = load float, float* %6
%37 = fpext float %36 to double
%38 = fcmp oge double %37, 7.500000e+00
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = load float, float* %6
%41 = fcmp olt float %40, 9.000000e+00
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %44
44: ; preds = %42, %39, %35
%45 = load float, float* %6
%46 = fcmp oge float %45, 6.000000e+00
br i1 %46, label %47, label %53
47: ; preds = %44
%48 = load float, float* %6
%49 = fpext float %48 to double
%50 = fcmp olt double %49, 7.500000e+00
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %53
53: ; preds = %51, %47, %44
%54 = load float, float* %6
%55 = fcmp oge float %54, 4.000000e+00
br i1 %55, label %56, label %61
56: ; preds = %53
%57 = load float, float* %6
%58 = fcmp olt float %57, 6.000000e+00
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %61
61: ; preds = %59, %56, %53
%62 = load float, float* %6
%63 = fcmp olt float %62, 4.000000e+00
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %66
66: ; preds = %64, %61
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Qual sua av1?\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"Qual sua av2?\00"
@.str.3 = [14 x i8] c"Qual sua av3?\00"
@.str.4 = [5 x i8] c"%.2f\00"
@.str.5 = [3 x i8] c"\0AA\00"
@.str.6 = [3 x i8] c"\0AB\00"
@.str.7 = [3 x i8] c"\0AC\00"
@.str.8 = [3 x i8] c"\0AD\00"
@.str.9 = [3 x i8] c"\0AE\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fadd float %13, %14
%16 = load float, float* %3
%17 = fadd float %15, %16
%18 = fdiv float %17, 3.000000e+00
%19 = call float @llvm.fmuladd.f32(float %14, float 2.000000e+00, float %13)
%20 = call float @llvm.fmuladd.f32(float %16, float 3.000000e+00, float %19)
%21 = fadd float %20, %18
%22 = fdiv float %21, 7.000000e+00
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %23)
%25 = fcmp ult float %22, 9.000000e+00
br i1 %25, label %28, label %26
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %28
28: ; preds = %26, %0
%29 = fcmp oge float %22, 7.500000e+00
%30 = fcmp olt float %22, 9.000000e+00
%31 = and i1 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = fcmp oge float %22, 6.000000e+00
%36 = fcmp olt float %22, 7.500000e+00
%37 = and i1 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
%41 = fcmp oge float %22, 4.000000e+00
%42 = fcmp olt float %22, 6.000000e+00
%43 = and i1 %41, %42
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
%47 = fcmp olt float %22, 4.000000e+00
br i1 %47, label %48, label %50
48: ; preds = %46
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
ret i32 0
}