#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 conceito(float);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float media;
  printf("Informe a media final do aluno: ");
  scanf("%f", &media);
  switch (conceito(media)) {
  case 1:
    printf("Conceito D\n");
    break;
  case 2:
    printf("Conceito C\n");
    break;
  case 3:
    printf("Conceito B\n");
    break;
  case 4:
    printf("Conceito A\n");
    break;
  case 5:
    printf("O valor informado esta fora do intervalo![0 a 10]\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <conceito@plt>
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11db <main+0xab>
mov    -0x10(%rbp),%rax
lea    0xe7e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
jmp    11db <main+0xab>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
jmp    11db <main+0xab>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
jmp    11db <main+0xab>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    11db <main+0xab>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1030 <conceito@plt>
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1186 <main+0x46>
cltq
lea    0xf0a(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Informe a media final do aluno: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Conceito D\0A\00"
@.str.3 = [12 x i8] c"Conceito C\0A\00"
@.str.4 = [12 x i8] c"Conceito B\0A\00"
@.str.5 = [12 x i8] c"Conceito A\0A\00"
@.str.6 = [51 x i8] c"O valor informado esta fora do intervalo![0 a 10]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call i32 @conceito(float %5)
switch i32 %6, label %17 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
]
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %17
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %17
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %17
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
br label %17
17: ; preds = %0, %15, %13, %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Informe a media final do aluno: \00"
@.str.1 = [3 x i8] c"%f\00"
@str = [50 x i8] c"O valor informado esta fora do intervalo![0 a 10]\00"
@str.7 = [11 x i8] c"Conceito A\00"
@str.8 = [11 x i8] c"Conceito B\00"
@str.9 = [11 x i8] c"Conceito C\00"
@str.10 = [11 x i8] c"Conceito D\00"
@reltable.main = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.10 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.9 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.8 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.7 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([50 x i8]* @str to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @conceito(float %5)
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 5
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = sext i32 %7 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.main to i8*), i64 %11)
%13 = call i32 @puts(i8* dereferenceable(1) %12)
br label %14
14: ; preds = %0, %9
ret i32 0
}