#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 *, ...);
int main() {
  float nota;
  int falta;
  char conceito;
  printf("Digite a Nota do aluno: ");
  scanf("%f", &nota);
  printf("Digite a quantidade de falta(s) do aluno: ");
  scanf("%d", &falta);
  if (nota <= 3.9) {
    if (falta <= 20) {
      conceito = 'D';
    } else {
      conceito = 'E';
    }
  } else if (nota <= 4.9) {
    if (falta <= 20) {
      conceito = 'D';
    } else {
      conceito = 'E';
    }
  } else if (nota <= 7.4) {
    if (falta <= 20) {
      conceito = 'C';
    } else {
      conceito = 'D';
    }
  } else if (nota <= 8.9) {
    if (falta <= 20) {
      conceito = 'B';
    } else {
      conceito = 'C';
    }
  } else {
    if (falta <= 20) {
      conceito = 'A';
    } else {
      conceito = 'B';
    }
  }
  printf("Conceito: %c", conceito);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe80(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11a6 <main+0x86>
cmpl   $0x14,-0xc(%rbp)
jg     119d <main+0x7d>
movb   $0x44,-0xd(%rbp)
jmp    11a1 <main+0x81>
movb   $0x45,-0xd(%rbp)
jmp    1276 <main+0x156>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe51(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11dd <main+0xbd>
cmpl   $0x14,-0xc(%rbp)
jg     11d4 <main+0xb4>
movb   $0x44,-0xd(%rbp)
jmp    11d8 <main+0xb8>
movb   $0x45,-0xd(%rbp)
jmp    1271 <main+0x151>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe22(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1214 <main+0xf4>
cmpl   $0x14,-0xc(%rbp)
jg     120b <main+0xeb>
movb   $0x43,-0xd(%rbp)
jmp    120f <main+0xef>
movb   $0x44,-0xd(%rbp)
jmp    126c <main+0x14c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdf3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     124b <main+0x12b>
cmpl   $0x14,-0xc(%rbp)
jg     1242 <main+0x122>
movb   $0x42,-0xd(%rbp)
jmp    1246 <main+0x126>
movb   $0x43,-0xd(%rbp)
jmp    1267 <main+0x147>
cmpl   $0x14,-0xc(%rbp)
jg     125e <main+0x13e>
movb   $0x41,-0xd(%rbp)
jmp    1262 <main+0x142>
movb   $0x42,-0xd(%rbp)
jmp    1267 <main+0x147>
jmp    126c <main+0x14c>
jmp    1271 <main+0x151>
jmp    1276 <main+0x156>
movsbl -0xd(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xef3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11b7 <main+0x97>
movsd  0xe87(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11b7 <main+0x97>
movsd  0xe81(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11d6 <main+0xb6>
movsd  0xe7b(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    (%rsp),%eax
jae    11e8 <main+0xc8>
xor    %ecx,%ecx
cmp    $0x15,%eax
setl   %cl
mov    $0x42,%esi
sub    %ecx,%esi
jmp    11c4 <main+0xa4>
xor    %esi,%esi
cmpl   $0x15,(%rsp)
setl   %sil
xor    $0x45,%esi
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
cmpl   $0x15,(%rsp)
setl   %al
mov    $0x44,%esi
sub    %eax,%esi
jmp    11c4 <main+0xa4>
xor    %esi,%esi
cmp    $0x15,%eax
setl   %sil
xor    $0x43,%esi
jmp    11c4 <main+0xa4>

LLVM IR (-O0):
@.str = [25 x i8] c"Digite a Nota do aluno: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [43 x i8] c"Digite a quantidade de falta(s) do aluno: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [13 x i8] c"Conceito: %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fcmp ole double %10, 3.900000e+00
br i1 %11, label %12, label %18
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 20
br i1 %14, label %15, label %16
15: ; preds = %12
store i8 68, i8* %4
br label %17
16: ; preds = %12
store i8 69, i8* %4
br label %17
17: ; preds = %16, %15
br label %57
18: ; preds = %0
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = fcmp ole double %20, 4.900000e+00
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load i32, i32* %3
%24 = icmp sle i32 %23, 20
br i1 %24, label %25, label %26
25: ; preds = %22
store i8 68, i8* %4
br label %27
26: ; preds = %22
store i8 69, i8* %4
br label %27
27: ; preds = %26, %25
br label %56
28: ; preds = %18
%29 = load float, float* %2
%30 = fpext float %29 to double
%31 = fcmp ole double %30, 7.400000e+00
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load i32, i32* %3
%34 = icmp sle i32 %33, 20
br i1 %34, label %35, label %36
35: ; preds = %32
store i8 67, i8* %4
br label %37
36: ; preds = %32
store i8 68, i8* %4
br label %37
37: ; preds = %36, %35
br label %55
38: ; preds = %28
%39 = load float, float* %2
%40 = fpext float %39 to double
%41 = fcmp ole double %40, 8.900000e+00
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i32, i32* %3
%44 = icmp sle i32 %43, 20
br i1 %44, label %45, label %46
45: ; preds = %42
store i8 66, i8* %4
br label %47
46: ; preds = %42
store i8 67, i8* %4
br label %47
47: ; preds = %46, %45
br label %54
48: ; preds = %38
%49 = load i32, i32* %3
%50 = icmp sle i32 %49, 20
br i1 %50, label %51, label %52
51: ; preds = %48
store i8 65, i8* %4
br label %53
52: ; preds = %48
store i8 66, i8* %4
br label %53
53: ; preds = %52, %51
br label %54
54: ; preds = %53, %47
br label %55
55: ; preds = %54, %37
br label %56
56: ; preds = %55, %27
br label %57
57: ; preds = %56, %17
%58 = load i8, i8* %4
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %59)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Digite a Nota do aluno: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [43 x i8] c"Digite a quantidade de falta(s) do aluno: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [13 x i8] c"Conceito: %c\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%9 = load float, float* %1
%10 = fpext float %9 to double
%11 = fcmp ugt double %10, 3.900000e+00
br i1 %11, label %16, label %12
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 21
%15 = select i1 %14, i32 68, i32 69
br label %36
16: ; preds = %0
%17 = fcmp ugt double %10, 4.900000e+00
br i1 %17, label %22, label %18
18: ; preds = %16
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 21
%21 = select i1 %20, i32 68, i32 69
br label %36
22: ; preds = %16
%23 = fcmp ugt double %10, 7.400000e+00
br i1 %23, label %28, label %24
24: ; preds = %22
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 21
%27 = select i1 %26, i32 67, i32 68
br label %36
28: ; preds = %22
%29 = fcmp ugt double %10, 8.900000e+00
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 21
br i1 %29, label %34, label %32
32: ; preds = %28
%33 = select i1 %31, i32 66, i32 67
br label %36
34: ; preds = %28
%35 = select i1 %31, i32 65, i32 66
br label %36
36: ; preds = %34, %32, %24, %18, %12
%37 = phi i32 [ %15, %12 ], [ %21, %18 ], [ %27, %24 ], [ %33, %32 ], [ %35, %34 ]
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %37)
ret i32 0
}