#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, float *, float *);
int main() {
  int total = 0;
  int noFreq = 0;
  int approved = 0;
  float freq, mini;
  while (scanf("%f %f", &freq, &mini) != EOF) {
    ++total;
    if (freq < 40) {
      ++noFreq;
      continue;
    }
    float final = 0.4f * freq + 0.6f * mini;
    final /= 5.0f;
    if (final >= 9.5f) {
      ++approved;
    }
  }
  printf("Estudantes sem frequencia: %d\n", noFreq);
  printf("Aprovacoes: %.1f %%\n", approved / (float)total * 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
je     11f2 <main+0xd2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  0xe8b(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1191 <main+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
movss  -0x14(%rbp),%xmm0
movss  0xe76(%rip),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  0xe65(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe47(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe2d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11ed <main+0xcd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xde9(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
lea    0xe17(%rip),%rdi
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
sub    $0x18,%rsp
lea    0xee3(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9d(%rip),%r13
xor    %esi,%esi
mov    $0x0,%r14d
mov    $0x0,%ebp
cmp    0x0(%r13),%rax
je     1217 <main+0xf7>
xor    %ebp,%ebp
lea    0xead(%rip),%r15
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%rbx
xor    %r14d,%r14d
xor    %esi,%esi
mov    %esi,0xc(%rsp)
add    $0x1,%ebp
mov    %ebp,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ecx,%ebp
movss  0x14(%rsp),%xmm0
movss  0xe60(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     11f0 <main+0xd0>
movss  0x10(%rsp),%xmm1
mulss  0xe51(%rip),%xmm1
mulss  0xe4d(%rip),%xmm0
addss  %xmm1,%xmm0
divss  0xe45(%rip),%xmm0
ucomiss 0xe42(%rip),%xmm0
sbb    $0xffffffff,%r14d
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
lea    0x1(%rbp),%ecx
cmp    0x0(%r13),%rax
jne    1190 <main+0x70>
jmp    1213 <main+0xf3>
nopl   0x0(%rax,%rax,1)
addl   $0x1,0xc(%rsp)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    0x0(%r13),%rax
jne    117a <main+0x5a>
jmp    1217 <main+0xf7>
mov    0xc(%rsp),%esi
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
divss  %xmm1,%xmm0
mulss  0xdd6(%rip),%xmm0
cvttss2si %xmm0,%esi
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@EOF = global i64 0
@.str.1 = [31 x i8] c"Estudantes sem frequencia: %d\0A\00"
@.str.2 = [21 x i8] c"Aprovacoes: %.1f %%\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %8
8: ; preds = %32, %17, %0
%9 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %5, float* %6)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %33
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
%15 = load float, float* %5
%16 = fcmp olt float %15, 4.000000e+01
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %8
20: ; preds = %12
%21 = load float, float* %5
%22 = load float, float* %6
%23 = fmul float 0x3FE3333340000000, %22
%24 = call float @llvm.fmuladd.f32(float 0x3FD99999A0000000, float %21, float %23)
store float %24, float* %7
%25 = load float, float* %7
%26 = fdiv float %25, 5.000000e+00
store float %26, float* %7
%27 = load float, float* %7
%28 = fcmp oge float %27, 9.500000e+00
br i1 %28, label %29, label %32
29: ; preds = %20
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %32
32: ; preds = %29, %20
br label %8
33: ; preds = %8
%34 = load i32, i32* %3
%35 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %4
%37 = sitofp i32 %36 to float
%38 = load i32, i32* %2
%39 = sitofp i32 %38 to float
%40 = fdiv float %37, %39
%41 = fmul float %40, 1.000000e+02
%42 = fptosi float %41 to i32
%43 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@EOF = global i64 0
@.str.1 = [31 x i8] c"Estudantes sem frequencia: %d\0A\00"
@.str.2 = [21 x i8] c"Aprovacoes: %.1f %%\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %34, label %8
8: ; preds = %0, %18
%9 = phi i32 [ %15, %18 ], [ 0, %0 ]
%10 = phi i32 [ %14, %18 ], [ 0, %0 ]
%11 = phi i32 [ %19, %18 ], [ 0, %0 ]
br label %12
12: ; preds = %8, %23
%13 = phi i32 [ %9, %8 ], [ %15, %23 ]
%14 = phi i32 [ %10, %8 ], [ %30, %23 ]
%15 = add nsw i32 %13, 1
%16 = load float, float* %1
%17 = fcmp olt float %16, 4.000000e+01
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = add nuw nsw i32 %11, 1
%20 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%21 = load i64, i64* @EOF
%22 = icmp eq i64 %20, %21
br i1 %22, label %34, label %8
23: ; preds = %12
%24 = load float, float* %2
%25 = fmul float %24, 0x3FE3333340000000
%26 = call float @llvm.fmuladd.f32(float %16, float 0x3FD99999A0000000, float %25)
%27 = fdiv float %26, 5.000000e+00
%28 = fcmp oge float %27, 9.500000e+00
%29 = zext i1 %28 to i32
%30 = add nsw i32 %14, %29
%31 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%32 = load i64, i64* @EOF
%33 = icmp eq i64 %31, %32
br i1 %33, label %34, label %12
34: ; preds = %18, %23, %0
%35 = phi i32 [ 0, %0 ], [ %11, %23 ], [ %19, %18 ]
%36 = phi i32 [ 0, %0 ], [ %30, %23 ], [ %14, %18 ]
%37 = phi i32 [ 0, %0 ], [ %15, %23 ], [ %15, %18 ]
%38 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%39 = sitofp i32 %36 to float
%40 = sitofp i32 %37 to float
%41 = fdiv float %39, %40
%42 = fmul float %41, 1.000000e+02
%43 = fptosi float %42 to i32
%44 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %43)
ret i32 0
}