#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 *);
scalar_t__ strcmp(char *, char *);
int reveNota(void) {
  float n1, n2, n3, n4, nF;
  char *conceito;
  printf("Insira a primeira nota: \n");
  scanf("%f", &n1);
  printf("Insira a segunda nota: \n");
  scanf("%f", &n2);
  printf("Insira a terceira nota: \n");
  scanf("%f", &n3);
  printf("Insira a quarta nota: \n");
  scanf("%f", &n4);
  nF = (n1 + n2 + n3 + n4) / 4;
  if (nF <= 4)
    conceito = "e";
  else if (nF > 4 && nF <= 6)
    conceito = "d";
  else if (nF > 6 && nF <= 7.5)
    conceito = "c";
  else if (nF > 7.5 && nF <= 9)
    conceito = "b";
  else if (nF > 9)
    conceito = "a";
  if (strcmp(conceito, "e") == 0)
    printf("Reprovado\n");
  else if (strcmp(conceito, "d") == 0)
    printf("Aprovado pelo conselho\n");
  else if (strcmp(conceito, "c") == 0)
    printf("Aprovado\n");
  else if (strcmp(conceito, "b") == 0)
    printf("Aprovado com tranquilidade\n");
  else if (strcmp(conceito, "a") == 0)
    printf("Aprovado com distinção =D\n");
  return 0;
}


x86 assembly (clang, -O0):
<reveNota>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%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
movss  0xe3c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe2b(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jb     11ef <reveNota+0xbf>
lea    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    12da <reveNota+0x1aa>
movss  -0x14(%rbp),%xmm0
movss  0xe04(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1227 <reveNota+0xf7>
movss  0xdf7(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jb     1227 <reveNota+0xf7>
lea    0xe64(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    12d5 <reveNota+0x1a5>
movss  -0x14(%rbp),%xmm0
movss  0xdd0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1268 <reveNota+0x138>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdc2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1268 <reveNota+0x138>
lea    0xe25(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    12d0 <reveNota+0x1a0>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12a5 <reveNota+0x175>
movss  0xd7d(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jb     12a5 <reveNota+0x175>
lea    0xdea(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    12cb <reveNota+0x19b>
movss  -0x14(%rbp),%xmm0
movss  0xd56(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12c6 <reveNota+0x196>
lea    0xdc6(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    12cb <reveNota+0x19b>
jmp    12d0 <reveNota+0x1a0>
jmp    12d5 <reveNota+0x1a5>
jmp    12da <reveNota+0x1aa>
mov    -0x20(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1305 <reveNota+0x1d5>
lea    0xd8f(%rip),%rdi
call   1030 <printf@plt>
jmp    13c0 <reveNota+0x290>
mov    -0x20(%rbp),%rdi
lea    0xd72(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1330 <reveNota+0x200>
lea    0xd6f(%rip),%rdi
call   1030 <printf@plt>
jmp    13bb <reveNota+0x28b>
mov    -0x20(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    135b <reveNota+0x22b>
lea    0xd5c(%rip),%rdi
call   1030 <printf@plt>
jmp    13b6 <reveNota+0x286>
mov    -0x20(%rbp),%rdi
lea    0xd20(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1386 <reveNota+0x256>
lea    0xd3b(%rip),%rdi
call   1030 <printf@plt>
jmp    13b1 <reveNota+0x281>
mov    -0x20(%rbp),%rdi
lea    0xcf7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13ac <reveNota+0x27c>
lea    0xd2c(%rip),%rdi
call   1030 <printf@plt>
jmp    13b1 <reveNota+0x281>
jmp    13b6 <reveNota+0x286>
jmp    13bb <reveNota+0x28b>
jmp    13c0 <reveNota+0x290>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reveNota>:
push   %rbx
sub    $0x10,%rsp
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
mulss  0xe43(%rip),%xmm0
movss  0xe3f(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11e9 <reveNota+0xb9>
ucomiss 0xe33(%rip),%xmm0
jbe    11f2 <reveNota+0xc2>
movss  0xe2d(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     11f2 <reveNota+0xc2>
lea    0xe30(%rip),%rbx
jmp    1239 <reveNota+0x109>
lea    0xec5(%rip),%rbx
jmp    1239 <reveNota+0x109>
ucomiss 0xe0f(%rip),%xmm0
jbe    1211 <reveNota+0xe1>
movss  0xe09(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1211 <reveNota+0xe1>
lea    0xe0a(%rip),%rbx
jmp    1239 <reveNota+0x109>
movss  0xdf7(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xdf8(%rip),%rbx
lea    0xdf3(%rip),%rax
cmovb  %rax,%rbx
ucomiss 0xdd7(%rip),%xmm0
cmovbe %rax,%rbx
lea    0xe75(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12a6 <reveNota+0x176>
lea    0xdc3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12af <reveNota+0x17f>
lea    0xdb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12b8 <reveNota+0x188>
lea    0xd9f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12c1 <reveNota+0x191>
lea    0xd8d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12cd <reveNota+0x19d>
lea    0xddc(%rip),%rdi
jmp    12c8 <reveNota+0x198>
lea    0xe2a(%rip),%rdi
jmp    12c8 <reveNota+0x198>
lea    0xe0a(%rip),%rdi
jmp    12c8 <reveNota+0x198>
lea    0xdf8(%rip),%rdi
jmp    12c8 <reveNota+0x198>
lea    0xdd4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Insira a primeira nota: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Insira a segunda nota: \0A\00"
@.str.3 = [26 x i8] c"Insira a terceira nota: \0A\00"
@.str.4 = [24 x i8] c"Insira a quarta nota: \0A\00"
@.str.5 = [2 x i8] c"e\00"
@.str.6 = [2 x i8] c"d\00"
@.str.7 = [2 x i8] c"c\00"
@.str.8 = [2 x i8] c"b\00"
@.str.9 = [2 x i8] c"a\00"
@.str.10 = [11 x i8] c"Reprovado\0A\00"
@.str.11 = [24 x i8] c"Aprovado pelo conselho\0A\00"
@.str.12 = [10 x i8] c"Aprovado\0A\00"
@.str.13 = [28 x i8] c"Aprovado com tranquilidade\0A\00"
@.str.14 = [29 x i8] c"Aprovado com distin\C3\A7\C3\A3o =D\0A\00"
define i32 @reveNota() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 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 @printf(i8* getelementptr inbounds ([25 x i8], [25 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 @printf(i8* getelementptr inbounds ([26 x i8], [26 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 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = load float, float* %1
%16 = load float, float* %2
%17 = fadd float %15, %16
%18 = load float, float* %3
%19 = fadd float %17, %18
%20 = load float, float* %4
%21 = fadd float %19, %20
%22 = fdiv float %21, 4.000000e+00
store float %22, float* %5
%23 = load float, float* %5
%24 = fcmp ole float %23, 4.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6
br label %57
26: ; preds = %0
%27 = load float, float* %5
%28 = fcmp ogt float %27, 4.000000e+00
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load float, float* %5
%31 = fcmp ole float %30, 6.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %29
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %6
br label %56
33: ; preds = %29, %26
%34 = load float, float* %5
%35 = fcmp ogt float %34, 6.000000e+00
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = fcmp ole double %38, 7.500000e+00
br i1 %39, label %40, label %41
40: ; preds = %36
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %6
br label %55
41: ; preds = %36, %33
%42 = load float, float* %5
%43 = fpext float %42 to double
%44 = fcmp ogt double %43, 7.500000e+00
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load float, float* %5
%47 = fcmp ole float %46, 9.000000e+00
br i1 %47, label %48, label %49
48: ; preds = %45
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8** %6
br label %54
49: ; preds = %45, %41
%50 = load float, float* %5
%51 = fcmp ogt float %50, 9.000000e+00
br i1 %51, label %52, label %53
52: ; preds = %49
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %6
br label %53
53: ; preds = %52, %49
br label %54
54: ; preds = %53, %48
br label %55
55: ; preds = %54, %40
br label %56
56: ; preds = %55, %32
br label %57
57: ; preds = %56, %25
%58 = load i8*, i8** %6
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br label %91
63: ; preds = %57
%64 = load i8*, i8** %6
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %90
69: ; preds = %63
%70 = load i8*, i8** %6
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
br label %89
75: ; preds = %69
%76 = load i8*, i8** %6
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
br label %88
81: ; preds = %75
%82 = load i8*, i8** %6
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %81
%86 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0))
br label %87
87: ; preds = %85, %81
br label %88
88: ; preds = %87, %79
br label %89
89: ; preds = %88, %73
br label %90
90: ; preds = %89, %67
br label %91
91: ; preds = %90, %61
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.5 = [2 x i8] c"e\00"
@.str.6 = [2 x i8] c"d\00"
@.str.7 = [2 x i8] c"c\00"
@.str.8 = [2 x i8] c"b\00"
@.str.9 = [2 x i8] c"a\00"
@str = [25 x i8] c"Insira a primeira nota: \00"
@str.15 = [24 x i8] c"Insira a segunda nota: \00"
@str.16 = [25 x i8] c"Insira a terceira nota: \00"
@str.17 = [23 x i8] c"Insira a quarta nota: \00"
@str.18 = [28 x i8] c"Aprovado com distin\C3\A7\C3\A3o =D\00"
@str.19 = [27 x i8] c"Aprovado com tranquilidade\00"
@str.20 = [9 x i8] c"Aprovado\00"
@str.21 = [23 x i8] c"Aprovado pelo conselho\00"
@str.22 = [10 x i8] c"Reprovado\00"
define i32 @reveNota() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.15, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.16, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.17, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%17 = load float, float* %1
%18 = load float, float* %2
%19 = fadd float %17, %18
%20 = load float, float* %3
%21 = fadd float %19, %20
%22 = load float, float* %4
%23 = fadd float %21, %22
%24 = fmul float %23, 2.500000e-01
%25 = fcmp ugt float %24, 4.000000e+00
br i1 %25, label %26, label %39
26: ; preds = %0
%27 = fcmp ogt float %24, 4.000000e+00
%28 = fcmp ole float %24, 6.000000e+00
%29 = and i1 %27, %28
br i1 %29, label %39, label %30
30: ; preds = %26
%31 = fcmp ule float %24, 6.000000e+00
%32 = fcmp ugt float %24, 7.500000e+00
%33 = or i1 %31, %32
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = fcmp ogt float %24, 7.500000e+00
%36 = fcmp ole float %24, 9.000000e+00
%37 = and i1 %35, %36
%38 = select i1 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
br label %39
39: ; preds = %34, %30, %26, %0
%40 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %0 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), %26 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), %30 ], [ %38, %34 ]
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %55, label %43
43: ; preds = %39
%44 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %55, label %46
46: ; preds = %43
%47 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %55, label %49
49: ; preds = %46
%50 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %49
%53 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52, %49, %46, %43, %39
%56 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.22, i64 0, i64 0), %39 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.21, i64 0, i64 0), %43 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.20, i64 0, i64 0), %46 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.19, i64 0, i64 0), %49 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @str.18, i64 0, i64 0), %52 ]
%57 = call i32 @puts(i8* dereferenceable(1) %56)
br label %58
58: ; preds = %55, %52
ret i32 0
}