#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);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int i, sum = 0;
  float n;
  for (i = 1; i <= 6; i++) {
    scanf("%f", &n);
    if (n > 0) {
      sum++;
    }
  }
  printf("%d valores positivos\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     1184 <main+0x64>
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1171 <main+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x56>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xed5(%rip),%rbx
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
unpcklps %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
unpcklps %xmm0,%xmm1
movaps 0x10(%rsp),%xmm0
movlhps %xmm1,%xmm0
xorps  %xmm1,%xmm1
cmpltps %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
xor    %ebp,%ebp
ucomiss %xmm1,%xmm0
seta   %bpl
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
xor    %eax,%eax
ucomiss 0xe1e(%rip),%xmm0
seta   %al
movaps 0x10(%rsp),%xmm0
movmskps %xmm0,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x5,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%esi
add    %ebp,%esi
add    %eax,%esi
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.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 i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%8 = load float, float* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%10 = load float, float* %1
%11 = insertelement <4 x float> poison, float %4, i64 0
%12 = insertelement <4 x float> %11, float %6, i64 1
%13 = insertelement <4 x float> %12, float %8, i64 2
%14 = insertelement <4 x float> %13, float %10, i64 3
%15 = fcmp ogt <4 x float> %14, zeroinitializer
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%17 = load float, float* %1
%18 = fcmp ogt float %17, 0.000000e+00
%19 = zext i1 %18 to i32
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%21 = load float, float* %1
%22 = fcmp ogt float %21, 0.000000e+00
%23 = zext i1 %22 to i32
%24 = bitcast <4 x i1> %15 to i4
%25 = call i4 @llvm.ctpop.i4(i4 %24)
%26 = zext i4 %25 to i32
%27 = add nuw nsw i32 %26, %19
%28 = add nuw nsw i32 %27, %23
%29 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %28)
ret i32 0
}