#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 *, double *);
int main(int argc, char const *argv[]) {
  int i;
  int positive_count = 0;
  for (i = 1; i <= 6; ++i) {
    double current_number = 0;
    scanf("%lf", &current_number);
    if (current_number > 0) {
      positive_count++;
    }
  }
  printf("%d valores positivos\n", positive_count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jg     1194 <main+0x74>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1181 <main+0x61>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1186 <main+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x18(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movq   $0x0,0x8(%rsp)
lea    0xed0(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movaps 0x20(%rsp),%xmm0
movhps 0x8(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movaps 0x10(%rsp),%xmm0
movhps 0x8(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
xor    %ebp,%ebp
ucomisd %xmm1,%xmm0
seta   %bpl
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
xor    %eax,%eax
ucomisd 0xdfc(%rip),%xmm0
seta   %al
xorpd  %xmm0,%xmm0
cmpltpd 0x20(%rsp),%xmm0
xorpd  %xmm1,%xmm1
cmpltpd 0x10(%rsp),%xmm1
packssdw %xmm1,%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    0xdba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [22 x i8] c"%d valores positivos\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
store double 0.000000e+00, double* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%8 = load double, double* %3
store double 0.000000e+00, double* %3
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%10 = load double, double* %3
store double 0.000000e+00, double* %3
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%12 = load double, double* %3
%13 = insertelement <4 x double> poison, double %6, i64 0
%14 = insertelement <4 x double> %13, double %8, i64 1
%15 = insertelement <4 x double> %14, double %10, i64 2
%16 = insertelement <4 x double> %15, double %12, i64 3
%17 = fcmp ogt <4 x double> %16, zeroinitializer
store double 0.000000e+00, double* %3
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%19 = load double, double* %3
%20 = fcmp ogt double %19, 0.000000e+00
%21 = zext i1 %20 to i32
store double 0.000000e+00, double* %3
%22 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%23 = load double, double* %3
%24 = fcmp ogt double %23, 0.000000e+00
%25 = zext i1 %24 to i32
%26 = bitcast <4 x i1> %17 to i4
%27 = call i4 @llvm.ctpop.i4(i4 %26)
%28 = zext i4 %27 to i32
%29 = add nuw nsw i32 %28, %21
%30 = add nuw nsw i32 %29, %25
%31 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %30)
ret i32 0
}