#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 /*<<< orphan*/ system(char *);
main() {
  int I, aux;
  double A;
  aux = 0;
  for (I = 0; I < 6; I++) {
    scanf("%lf", &A);
    if (A > 0)
      aux++;
  }
  printf("%d valores positivos\n", aux);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1195 <main+0x65>
lea    0xea2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1182 <main+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1187 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xec9(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movaps 0x20(%rsp),%xmm0
movhps 0x8(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movaps 0x10(%rsp),%xmm0
movhps 0x8(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
xor    %ebp,%ebp
ucomisd %xmm1,%xmm0
seta   %bpl
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
xor    %eax,%eax
ucomisd 0xe22(%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    0xde0(%rip),%rdi
call   1040 <printf@plt>
lea    0xdea(%rip),%rdi
call   1030 <system@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"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%10 = load double, double* %4
%11 = fcmp ogt double %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)
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [22 x i8] c"%d valores positivos\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = load double, double* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%8 = load double, double* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%10 = load double, double* %1
%11 = insertelement <4 x double> poison, double %4, i64 0
%12 = insertelement <4 x double> %11, double %6, i64 1
%13 = insertelement <4 x double> %12, double %8, i64 2
%14 = insertelement <4 x double> %13, double %10, i64 3
%15 = fcmp ogt <4 x double> %14, zeroinitializer
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%17 = load double, double* %1
%18 = fcmp ogt double %17, 0.000000e+00
%19 = zext i1 %18 to i32
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%21 = load double, double* %1
%22 = fcmp ogt double %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)
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}