#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 */
typedef int int16_t;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, float *);
int main() {
  float n;
  int16_t c = 0;
  while (scanf("%f", &n) != EOF) {
    if (n > 0) {
      c++;
    }
  }
  printf("%d valores positivos\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     1175 <main+0x55>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1170 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
xor    %ebx,%ebx
cmp    (%r12),%rax
je     1185 <main+0x65>
xor    %ebx,%ebx
lea    0xeb3(%rip),%r14
lea    0x4(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
movss  0x4(%rsp),%xmm0
xor    %eax,%eax
ucomiss 0xe91(%rip),%xmm0
seta   %al
add    %eax,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
lea    0xe7b(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@EOF = global i64 0
@.str.1 = [22 x i8] c"%d valores positivos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %14, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load float, float* %2
%10 = fcmp ogt float %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@EOF = global i64 0
@.str.1 = [22 x i8] c"%d valores positivos\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ 0, %0 ]
%8 = load float, float* %1
%9 = fcmp ogt float %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %6
15: ; preds = %6, %0
%16 = phi i32 [ 0, %0 ], [ %11, %6 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}