#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 suspes = 0;
  int aprovat = 0;
  int notable = 0;
  int excelent = 0;
  printf("Entra les notes dels alumnes(nota+<enter>), per acabar entra una "
         "nota no valida.\n");
  scanf("%f", &nota);
  while (nota <= 10 && nota >= 0) {
    if (nota < 5) {
      suspes += 1;
    } else if (nota < 7) {
      aprovat += 1;
    } else if (nota < 9) {
      notable += 1;
    } else {
      excelent += 1;
    }
    scanf("%f", &nota);
  }
  printf("Resultats:\n\n\tSuspesos-->%d\n\tAprovats-->%d\n\tNotables-->%"
         "d\n\tExcelents-->%d\n",
         suspes, aprovat, notable, excelent);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
movss  0xe8d(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
mov    %al,-0x19(%rbp)
jb     1191 <main+0x71>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11a1 <main+0x81>
jmp    1229 <main+0x109>
movss  0xe5b(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11c1 <main+0xa1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1214 <main+0xf4>
movss  0xe3f(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11e1 <main+0xc1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    120f <main+0xef>
movss  0xe23(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1201 <main+0xe1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    120a <main+0xea>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120f <main+0xef>
jmp    1214 <main+0xf4>
lea    0xe47(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1169 <main+0x49>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
xor    %ebx,%ebx
movss  0xe98(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     123d <main+0x10d>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    $0x0,%ebp
mov    $0x0,%r15d
mov    $0x0,%r14d
jb     1245 <main+0x115>
xor    %r14d,%r14d
lea    0xe7c(%rip),%r12
lea    0x4(%rsp),%r13
xor    %r15d,%r15d
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  0xe4c(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11d0 <main+0xa0>
add    $0x1,%ebx
jmp    1210 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0xe30(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11f0 <main+0xc0>
add    $0x1,%ebp
jmp    1210 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0xe14(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1203 <main+0xd3>
add    $0x1,%r15d
jmp    1210 <main+0xe0>
add    $0x1,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  0xdd7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1245 <main+0x115>
ucomiss 0xddb(%rip),%xmm0
jae    11b0 <main+0x80>
jmp    1245 <main+0x115>
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %r14d,%r14d
lea    0xdcb(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [82 x i8] c"Entra les notes dels alumnes(nota+<enter>), per acabar entra una nota no valida.\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [74 x i8] c"Resultats:\0A\0A\09Suspesos-->%d\0A\09Aprovats-->%d\0A\09Notables-->%d\0A\09Excelents-->%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 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* %2)
br label %9
9: ; preds = %40, %0
%10 = load float, float* %2
%11 = fcmp ole float %10, 1.000000e+01
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load float, float* %2
%14 = fcmp oge float %13, 0.000000e+00
br label %15
15: ; preds = %12, %9
%16 = phi i1 [ false, %9 ], [ %14, %12 ]
br i1 %16, label %17, label %42
17: ; preds = %15
%18 = load float, float* %2
%19 = fcmp olt float %18, 5.000000e+00
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %40
23: ; preds = %17
%24 = load float, float* %2
%25 = fcmp olt float %24, 7.000000e+00
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %39
29: ; preds = %23
%30 = load float, float* %2
%31 = fcmp olt float %30, 9.000000e+00
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %38
35: ; preds = %29
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %38
38: ; preds = %35, %32
br label %39
39: ; preds = %38, %26
br label %40
40: ; preds = %39, %20
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %9
42: ; preds = %15
%43 = load i32, i32* %3
%44 = load i32, i32* %4
%45 = load i32, i32* %5
%46 = load i32, i32* %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %44, i32 %45, i32 %46)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [74 x i8] c"Resultats:\0A\0A\09Suspesos-->%d\0A\09Aprovats-->%d\0A\09Notables-->%d\0A\09Excelents-->%d\0A\00"
@str = [81 x i8] c"Entra les notes dels alumnes(nota+<enter>), per acabar entra una nota no valida.\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 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 = fcmp ole float %5, 1.000000e+01
%7 = fcmp oge float %5, 0.000000e+00
%8 = and i1 %6, %7
br i1 %8, label %9, label %38
9: ; preds = %0, %28
%10 = phi float [ %34, %28 ], [ %5, %0 ]
%11 = phi i32 [ %32, %28 ], [ 0, %0 ]
%12 = phi i32 [ %31, %28 ], [ 0, %0 ]
%13 = phi i32 [ %30, %28 ], [ 0, %0 ]
%14 = phi i32 [ %29, %28 ], [ 0, %0 ]
%15 = fcmp olt float %10, 5.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = add nsw i32 %14, 1
br label %28
18: ; preds = %9
%19 = fcmp olt float %10, 7.000000e+00
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = add nsw i32 %13, 1
br label %28
22: ; preds = %18
%23 = fcmp olt float %10, 9.000000e+00
br i1 %23, label %24, label %26
24: ; preds = %22
%25 = add nsw i32 %12, 1
br label %28
26: ; preds = %22
%27 = add nsw i32 %11, 1
br label %28
28: ; preds = %20, %26, %24, %16
%29 = phi i32 [ %17, %16 ], [ %14, %20 ], [ %14, %24 ], [ %14, %26 ]
%30 = phi i32 [ %13, %16 ], [ %21, %20 ], [ %13, %24 ], [ %13, %26 ]
%31 = phi i32 [ %12, %16 ], [ %12, %20 ], [ %25, %24 ], [ %12, %26 ]
%32 = phi i32 [ %11, %16 ], [ %11, %20 ], [ %11, %24 ], [ %27, %26 ]
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%34 = load float, float* %1
%35 = fcmp ole float %34, 1.000000e+01
%36 = fcmp oge float %34, 0.000000e+00
%37 = and i1 %35, %36
br i1 %37, label %9, label %38
38: ; preds = %28, %0
%39 = phi i32 [ 0, %0 ], [ %29, %28 ]
%40 = phi i32 [ 0, %0 ], [ %30, %28 ]
%41 = phi i32 [ 0, %0 ], [ %31, %28 ]
%42 = phi i32 [ 0, %0 ], [ %32, %28 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0), i32 %39, i32 %40, i32 %41, i32 %42)
ret i32 0
}