#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() {
  char continuar;
  float nota = 0, media = 0, totalnotas = 0, notacima = 0, notabaixo = 0;
  int alunos = 0;
  do {
    printf("\nInsira a nota do aluno:\n");
    scanf("%f", &nota);
    if (nota > 5) {
      notacima = notacima + 1;
    } else {
      notabaixo = notabaixo + 1;
    }
    alunos = alunos + 1;
    totalnotas = totalnotas + nota;
    printf("\n Deseja continuar: s/n\n");
    scanf(" %c", &continuar);
  } while (continuar == 's');
  media = (float)totalnotas / alunos;
  printf("\nMedia Aritmetica é %.2f.\n", media);
  if (notacima >= 1) {
    if (notacima == 1) {
      printf("\nTemos %.0f aluno com nota acima de 5.\n", notacima);
    } else {
      printf("\nTemos %.0f alunos com notas acima de 5.\n", notacima);
    }
  }
  if (notacima < 1) {
    printf("\nNão há nenhum aluno com nota acima de 5.\n");
  }
  if (notabaixo >= 1) {
    if (notabaixo == 1) {
      printf("\nTemos %.0f aluno com nota abaixo de 5.\n", notabaixo);
    } else {
      printf("\nTemos %.0f alunos com notas abaixo de 5.\n", notabaixo);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  0xe75(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ab <main+0x8b>
movss  0xe68(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11bd <main+0x9d>
movss  0xe51(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x73,%eax
je     115e <main+0x3e>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe1d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
movss  0xdcb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1296 <main+0x176>
movss  -0x18(%rbp),%xmm0
movss  0xdb5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    127a <main+0x15a>
jp     127a <main+0x15a>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1291 <main+0x171>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1296 <main+0x176>
movss  0xd66(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    12b6 <main+0x196>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
movss  0xd41(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1320 <main+0x200>
movss  -0x1c(%rbp),%xmm0
movss  0xd2b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1304 <main+0x1e4>
jp     1304 <main+0x1e4>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131b <main+0x1fb>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1320 <main+0x200>
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
sub    $0x28,%rsp
movl   $0x0,0xc(%rsp)
xor    %r14d,%r14d
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xeb7(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xf8d(%rip),%r13
lea    0xea7(%rip),%rbx
lea    0x3(%rsp),%rbp
xorps  %xmm2,%xmm2
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
jmp    11ec <main+0xbc>
nop
movss  0x8(%rsp),%xmm1
movss  0xe76(%rip),%xmm2
addss  %xmm2,%xmm1
movss  %xmm1,0x8(%rsp)
movss  0x4(%rsp),%xmm3
movaps 0x10(%rsp),%xmm5
movaps %xmm5,%xmm1
addss  %xmm2,%xmm1
cmpltss %xmm0,%xmm4
andps  %xmm4,%xmm1
andnps %xmm5,%xmm4
orps   %xmm1,%xmm4
movaps %xmm4,0x10(%rsp)
add    $0x1,%r14d
addss  %xmm0,%xmm3
movss  %xmm3,0x4(%rsp)
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movaps 0x10(%rsp),%xmm2
cmpb   $0x73,0x3(%rsp)
jne    1231 <main+0x101>
movaps %xmm2,0x10(%rsp)
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0xde8(%rip),%xmm1
ucomiss %xmm1,%xmm0
movaps %xmm1,%xmm4
jbe    1180 <main+0x50>
movss  0xdd8(%rip),%xmm2
jmp    1198 <main+0x68>
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xdc6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x10(%rsp),%xmm1
ucomiss 0xda0(%rip),%xmm1
jb     1295 <main+0x165>
jne    127b <main+0x14b>
jp     127b <main+0x14b>
lea    0xdc2(%rip),%rdi
movsd  0xd8f(%rip),%xmm0
jmp    1289 <main+0x159>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xdd2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x10(%rsp),%xmm1
movss  0xd67(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    12ae <main+0x17e>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm0
ucomiss 0xd49(%rip),%xmm0
jb     12e4 <main+0x1b4>
jne    12d2 <main+0x1a2>
jp     12d2 <main+0x1a2>
lea    0xdbd(%rip),%rdi
movsd  0xd38(%rip),%xmm0
jmp    12dd <main+0x1ad>
cvtss2sd %xmm0,%xmm0
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0AInsira a nota do aluno:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"\0A Deseja continuar: s/n\0A\00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [28 x i8] c"\0AMedia Aritmetica \C3\A9 %.2f.\0A\00"
@.str.5 = [40 x i8] c"\0ATemos %.0f aluno com nota acima de 5.\0A\00"
@.str.6 = [42 x i8] c"\0ATemos %.0f alunos com notas acima de 5.\0A\00"
@.str.7 = [45 x i8] c"\0AN\C3\A3o h\C3\A1 nenhum aluno com nota acima de 5.\0A\00"
@.str.8 = [41 x i8] c"\0ATemos %.0f aluno com nota abaixo de 5.\0A\00"
@.str.9 = [43 x i8] c"\0ATemos %.0f alunos com notas abaixo de 5.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
store i32 0, i32* %8
br label %9
9: ; preds = %28, %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = load float, float* %3
%13 = fcmp ogt float %12, 5.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load float, float* %6
%16 = fadd float %15, 1.000000e+00
store float %16, float* %6
br label %20
17: ; preds = %9
%18 = load float, float* %7
%19 = fadd float %18, 1.000000e+00
store float %19, float* %7
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
%23 = load float, float* %5
%24 = load float, float* %3
%25 = fadd float %23, %24
store float %25, float* %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %28
28: ; preds = %20
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 115
br i1 %31, label %9, label %32
32: ; preds = %28
%33 = load float, float* %5
%34 = load i32, i32* %8
%35 = sitofp i32 %34 to float
%36 = fdiv float %33, %35
store float %36, float* %4
%37 = load float, float* %4
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), double %38)
%40 = load float, float* %6
%41 = fcmp oge float %40, 1.000000e+00
br i1 %41, label %42, label %54
42: ; preds = %32
%43 = load float, float* %6
%44 = fcmp oeq float %43, 1.000000e+00
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load float, float* %6
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), double %47)
br label %53
49: ; preds = %42
%50 = load float, float* %6
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), double %51)
br label %53
53: ; preds = %49, %45
br label %54
54: ; preds = %53, %32
%55 = load float, float* %6
%56 = fcmp olt float %55, 1.000000e+00
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %59
59: ; preds = %57, %54
%60 = load float, float* %7
%61 = fcmp oge float %60, 1.000000e+00
br i1 %61, label %62, label %74
62: ; preds = %59
%63 = load float, float* %7
%64 = fcmp oeq float %63, 1.000000e+00
br i1 %64, label %65, label %69
65: ; preds = %62
%66 = load float, float* %7
%67 = fpext float %66 to double
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), double %67)
br label %73
69: ; preds = %62
%70 = load float, float* %7
%71 = fpext float %70 to double
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), double %71)
br label %73
73: ; preds = %69, %65
br label %74
74: ; preds = %73, %59
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [28 x i8] c"\0AMedia Aritmetica \C3\A9 %.2f.\0A\00"
@.str.5 = [40 x i8] c"\0ATemos %.0f aluno com nota acima de 5.\0A\00"
@.str.6 = [42 x i8] c"\0ATemos %.0f alunos com notas acima de 5.\0A\00"
@.str.8 = [41 x i8] c"\0ATemos %.0f aluno com nota abaixo de 5.\0A\00"
@.str.9 = [43 x i8] c"\0ATemos %.0f alunos com notas abaixo de 5.\0A\00"
@str = [25 x i8] c"\0AInsira a nota do aluno:\00"
@str.10 = [24 x i8] c"\0A Deseja continuar: s/n\00"
@str.11 = [44 x i8] c"\0AN\C3\A3o h\C3\A1 nenhum aluno com nota acima de 5.\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca float
%3 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
br label %4
4: ; preds = %4, %0
%5 = phi float [ 0.000000e+00, %0 ], [ %18, %4 ]
%6 = phi float [ 0.000000e+00, %0 ], [ %15, %4 ]
%7 = phi float [ 0.000000e+00, %0 ], [ %16, %4 ]
%8 = phi i32 [ 0, %0 ], [ %17, %4 ]
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = load float, float* %2
%12 = fcmp ogt float %11, 5.000000e+00
%13 = fadd float %6, 1.000000e+00
%14 = fadd float %7, 1.000000e+00
%15 = select i1 %12, float %13, float %6
%16 = select i1 %12, float %7, float %14
%17 = add nuw nsw i32 %8, 1
%18 = fadd float %5, %11
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%21 = load i8, i8* %1
%22 = icmp eq i8 %21, 115
br i1 %22, label %4, label %23
23: ; preds = %4
%24 = sitofp i32 %17 to float
%25 = fdiv float %18, %24
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), double %26)
%28 = fcmp ult float %15, 1.000000e+00
br i1 %28, label %36, label %29
29: ; preds = %23
%30 = fcmp oeq float %15, 1.000000e+00
br i1 %30, label %31, label %33
31: ; preds = %29
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), double 1.000000e+00)
br label %36
33: ; preds = %29
%34 = fpext float %15 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), double %34)
br label %36
36: ; preds = %31, %33, %23
%37 = fcmp olt float %15, 1.000000e+00
br i1 %37, label %38, label %40
38: ; preds = %36
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.11, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
%41 = fcmp ult float %16, 1.000000e+00
br i1 %41, label %49, label %42
42: ; preds = %40
%43 = fcmp oeq float %16, 1.000000e+00
br i1 %43, label %44, label %46
44: ; preds = %42
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), double 1.000000e+00)
br label %49
46: ; preds = %42
%47 = fpext float %16 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), double %47)
br label %49
49: ; preds = %44, %46, %40
ret i32 0
}