int main(void) {
  const int n = 1000;
  int i;
  __complex__ double result, array[n];
  int lresult;
#pragma acc parallel vector_length(vl)
#pragma acc loop reduction(+ : result)
  for (i = 0; i < n; i++)
    result += array[i];
#pragma acc parallel vector_length(vl)
#pragma acc loop reduction(&& : lresult)
  for (i = 0; i < n; i++)
    lresult = lresult && (__real__(result) > __real__(array[i]));
#pragma acc parallel vector_length(vl)
#pragma acc loop reduction(|| : lresult)
  for (i = 0; i < n; i++)
    lresult = lresult || (__real__(result) > __real__(array[i]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3e40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1179 <main+0x79>
movslq -0xc(%rbp),%rcx
lea    -0x3eb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm3
movsd  0x8(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <main+0x27>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    11df <main+0xdf>
xor    %eax,%eax
cmpl   $0x0,-0x2c(%rbp)
mov    %al,-0x3eb1(%rbp)
je     11c3 <main+0xc3>
movsd  -0x20(%rbp),%xmm0
movslq -0xc(%rbp),%rcx
lea    -0x3eb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
ucomisd (%rax),%xmm0
seta   %al
mov    %al,-0x3eb1(%rbp)
mov    -0x3eb1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1180 <main+0x80>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1245 <main+0x145>
mov    $0x1,%al
cmpl   $0x0,-0x2c(%rbp)
mov    %al,-0x3eb2(%rbp)
jne    1229 <main+0x129>
movsd  -0x20(%rbp),%xmm0
movslq -0xc(%rbp),%rcx
lea    -0x3eb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
ucomisd (%rax),%xmm0
seta   %al
mov    %al,-0x3eb2(%rbp)
mov    -0x3eb2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e6 <main+0xe6>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x3e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca { double, double }
%5 = alloca i8*
%6 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %5
%8 = alloca { double, double }, i64 1000
store i32 0, i32* %3
br label %9
9: ; preds = %28, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 1000
br i1 %11, label %12, label %31
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds { double, double }, { double, double }* %8, i64 %14
%16 = getelementptr inbounds { double, double }, { double, double }* %15, i32 0, i32 0
%17 = load double, double* %16
%18 = getelementptr inbounds { double, double }, { double, double }* %15, i32 0, i32 1
%19 = load double, double* %18
%20 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%21 = load double, double* %20
%22 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%23 = load double, double* %22
%24 = fadd double %21, %17
%25 = fadd double %23, %19
%26 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%27 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %24, double* %26
store double %25, double* %27
br label %28
28: ; preds = %12
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %9
31: ; preds = %9
store i32 0, i32* %3
br label %32
32: ; preds = %50, %31
%33 = load i32, i32* %3
%34 = icmp slt i32 %33, 1000
br i1 %34, label %35, label %53
35: ; preds = %32
%36 = load i32, i32* %6
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %47
38: ; preds = %35
%39 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%40 = load double, double* %39
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds { double, double }, { double, double }* %8, i64 %42
%44 = getelementptr inbounds { double, double }, { double, double }* %43, i32 0, i32 0
%45 = load double, double* %44
%46 = fcmp ogt double %40, %45
br label %47
47: ; preds = %38, %35
%48 = phi i1 [ false, %35 ], [ %46, %38 ]
%49 = zext i1 %48 to i32
store i32 %49, i32* %6
br label %50
50: ; preds = %47
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %32
53: ; preds = %32
store i32 0, i32* %3
br label %54
54: ; preds = %72, %53
%55 = load i32, i32* %3
%56 = icmp slt i32 %55, 1000
br i1 %56, label %57, label %75
57: ; preds = %54
%58 = load i32, i32* %6
%59 = icmp ne i32 %58, 0
br i1 %59, label %69, label %60
60: ; preds = %57
%61 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%62 = load double, double* %61
%63 = load i32, i32* %3
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds { double, double }, { double, double }* %8, i64 %64
%66 = getelementptr inbounds { double, double }, { double, double }* %65, i32 0, i32 0
%67 = load double, double* %66
%68 = fcmp ogt double %62, %67
br label %69
69: ; preds = %60, %57
%70 = phi i1 [ true, %57 ], [ %68, %60 ]
%71 = zext i1 %70 to i32
store i32 %71, i32* %6
br label %72
72: ; preds = %69
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %54
75: ; preds = %54
store i32 0, i32* %1
%76 = load i8*, i8** %5
%77 = load i32, i32* %1
ret i32 %77
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}