#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 _nota;
  int nota;
  printf("\n\t\t-------		\n\t\t-NOTES-		\n\t\t-------\n\n");
  printf("Entra la teva nota:");
  scanf("%f", &_nota);
  nota = (int)_nota;
  if (nota < 0 || nota > 10) {
    printf("La nota donada no es troba entre el 0 i el 10.\n");
    main();
  }
  if (nota >= 5) {
    if (nota < 10) {
      if (nota < 9) {
        if (nota < 7) {
          printf("%s aprovat.\n", "La seva calificacio es de");
        } else {
          printf("%s notable.\n", "La seva calificacio es de");
        }
      } else {
        printf("%s exel.lent.\n", "La seva calificacio es de");
      }
    } else {
      printf("%s matricula.\n", "La seva calificacio es de");
    }
  } else {
    printf("%s suspens.\n", "La seva calificacio es de");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1187 <main+0x57>
cmpl   $0xa,-0xc(%rbp)
jle    119a <main+0x6a>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
call   1040 <main@plt>
cmpl   $0x5,-0xc(%rbp)
jl     122a <main+0xfa>
cmpl   $0xa,-0xc(%rbp)
jge    1210 <main+0xe0>
cmpl   $0x9,-0xc(%rbp)
jge    11f6 <main+0xc6>
cmpl   $0x7,-0xc(%rbp)
jge    11dc <main+0xac>
lea    0xea3(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f1 <main+0xc1>
lea    0xeb0(%rip),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120b <main+0xdb>
lea    0xea3(%rip),%rdi
lea    0xe75(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1225 <main+0xf5>
lea    0xe98(%rip),%rdi
lea    0xe5b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123f <main+0x10f>
lea    0xe8d(%rip),%rdi
lea    0xe41(%rip),%rsi
mov    $0x0,%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    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cvttss2si 0xc(%rsp),%ebx
cmp    $0xb,%ebx
jb     118c <main+0x4c>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
call   1050 <main@plt>
cmp    $0x5,%ebx
jl     11a1 <main+0x61>
cmp    $0x9,%ebx
ja     11aa <main+0x6a>
jne    11b3 <main+0x73>
lea    0xeac(%rip),%rdi
jmp    11c8 <main+0x88>
lea    0xec1(%rip),%rdi
jmp    11c8 <main+0x88>
lea    0xea9(%rip),%rdi
jmp    11c8 <main+0x88>
cmp    $0x7,%ebx
lea    0xe5a(%rip),%rax
lea    0xe7a(%rip),%rdi
cmovb  %rax,%rdi
lea    0xe55(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\09\09-------\09\09\0A\09\09-NOTES-\09\09\0A\09\09-------\0A\0A\00"
@.str.1 = [20 x i8] c"Entra la teva nota:\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [48 x i8] c"La nota donada no es troba entre el 0 i el 10.\0A\00"
@.str.4 = [13 x i8] c"%s aprovat.\0A\00"
@.str.5 = [26 x i8] c"La seva calificacio es de\00"
@.str.6 = [13 x i8] c"%s notable.\0A\00"
@.str.7 = [15 x i8] c"%s exel.lent.\0A\00"
@.str.8 = [15 x i8] c"%s matricula.\0A\00"
@.str.9 = [13 x i8] c"%s suspens.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = fptosi float %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %11, %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @main()
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 5
br i1 %19, label %20, label %40
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %37
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp slt i32 %24, 9
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, 7
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %33
31: ; preds = %26
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
br label %36
34: ; preds = %23
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %36
36: ; preds = %34, %33
br label %39
37: ; preds = %20
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %39
39: ; preds = %37, %36
br label %42
40: ; preds = %17
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %40, %39
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"Entra la teva nota:\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.4 = [13 x i8] c"%s aprovat.\0A\00"
@.str.5 = [26 x i8] c"La seva calificacio es de\00"
@.str.6 = [13 x i8] c"%s notable.\0A\00"
@.str.7 = [15 x i8] c"%s exel.lent.\0A\00"
@.str.8 = [15 x i8] c"%s matricula.\0A\00"
@.str.9 = [13 x i8] c"%s suspens.\0A\00"
@str = [36 x i8] c"\0A\09\09-------\09\09\0A\09\09-NOTES-\09\09\0A\09\09-------\0A\00"
@str.10 = [47 x i8] c"La nota donada no es troba entre el 0 i el 10.\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fptosi float %6 to i32
%8 = icmp ugt i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.10, i64 0, i64 0))
%11 = call i32 @main()
br label %12
12: ; preds = %0, %9
%13 = icmp sgt i32 %7, 4
br i1 %13, label %14, label %21
14: ; preds = %12
%15 = icmp ult i32 %7, 10
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = icmp eq i32 %7, 9
br i1 %17, label %21, label %18
18: ; preds = %16
%19 = icmp ult i32 %7, 7
%20 = select i1 %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0)
br label %21
21: ; preds = %12, %14, %16, %18
%22 = phi i8* [ %20, %18 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %16 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), %12 ]
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %22, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}