int s6test(double s[6]) {
  int retval = 0;
  if (s[0] > 0.)
    retval |= 0x1;
  if (s[1] > 0.)
    retval |= 0x2;
  if (s[2] > 0.)
    retval |= 0x4;
  if (s[3] > 0.)
    retval |= 0x8;
  if (s[4] > 0.)
    retval |= 0x10;
  if (s[5] > 0.)
    retval |= 0x20;
  return retval;
}


x86 assembly (clang, -O0):
<s6test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <s6test+0x2d>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114c <s6test+0x4c>
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    116b <s6test+0x6b>
mov    -0xc(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    118a <s6test+0x8a>
mov    -0xc(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11a9 <s6test+0xa9>
mov    -0xc(%rbp),%eax
or     $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11c8 <s6test+0xc8>
mov    -0xc(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s6test>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
xorpd  %xmm2,%xmm2
xor    %eax,%eax
ucomisd %xmm2,%xmm0
seta   %al
ucomisd %xmm2,%xmm1
lea    0x2(%rax),%ecx
cmovbe %eax,%ecx
movsd  0x10(%rdi),%xmm0
ucomisd %xmm2,%xmm0
lea    0x4(%rcx),%eax
cmovbe %ecx,%eax
movsd  0x18(%rdi),%xmm0
ucomisd %xmm2,%xmm0
lea    0x8(%rax),%ecx
cmovbe %eax,%ecx
movsd  0x20(%rdi),%xmm0
mov    %ecx,%edx
or     $0x10,%edx
ucomisd %xmm2,%xmm0
cmovbe %ecx,%edx
movsd  0x28(%rdi),%xmm0
mov    %edx,%eax
or     $0x20,%eax
ucomisd %xmm2,%xmm0
cmovbe %edx,%eax
ret

LLVM IR (-O0):
define i32 @s6test(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = or i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %3
%18 = or i32 %17, 2
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %11
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i32, i32* %3
%26 = or i32 %25, 4
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %19
%28 = load double*, double** %2
%29 = getelementptr inbounds double, double* %28, i64 3
%30 = load double, double* %29
%31 = fcmp ogt double %30, 0.000000e+00
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = load i32, i32* %3
%34 = or i32 %33, 8
store i32 %34, i32* %3
br label %35
35: ; preds = %32, %27
%36 = load double*, double** %2
%37 = getelementptr inbounds double, double* %36, i64 4
%38 = load double, double* %37
%39 = fcmp ogt double %38, 0.000000e+00
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = load i32, i32* %3
%42 = or i32 %41, 16
store i32 %42, i32* %3
br label %43
43: ; preds = %40, %35
%44 = load double*, double** %2
%45 = getelementptr inbounds double, double* %44, i64 5
%46 = load double, double* %45
%47 = fcmp ogt double %46, 0.000000e+00
br i1 %47, label %48, label %51
48: ; preds = %43
%49 = load i32, i32* %3
%50 = or i32 %49, 32
store i32 %50, i32* %3
br label %51
51: ; preds = %48, %43
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
define i32 @s6test(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp ogt double %2, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = fcmp ogt double %6, 0.000000e+00
%8 = or i32 %4, 2
%9 = select i1 %7, i32 %8, i32 %4
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = fcmp ogt double %11, 0.000000e+00
%13 = or i32 %9, 4
%14 = select i1 %12, i32 %13, i32 %9
%15 = getelementptr inbounds double, double* %0, i64 3
%16 = load double, double* %15
%17 = fcmp ogt double %16, 0.000000e+00
%18 = or i32 %14, 8
%19 = select i1 %17, i32 %18, i32 %14
%20 = getelementptr inbounds double, double* %0, i64 4
%21 = load double, double* %20
%22 = fcmp ogt double %21, 0.000000e+00
%23 = or i32 %19, 16
%24 = select i1 %22, i32 %23, i32 %19
%25 = getelementptr inbounds double, double* %0, i64 5
%26 = load double, double* %25
%27 = fcmp ogt double %26, 0.000000e+00
%28 = or i32 %24, 32
%29 = select i1 %27, i32 %28, i32 %24
ret i32 %29
}