int main(void) {
  int i;
  int result, array[1000];
  int lresult;
#pragma acc parallel
#pragma acc loop gang worker vector reduction(+ : result)
  for (i = 0; i < 1000; i++)
    result += array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(* : result)
  for (i = 0; i < 1000; i++)
    result *= array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(max : result)
  for (i = 0; i < 1000; i++)
    result = result > array[i] ? result : array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(min : result)
  for (i = 0; i < 1000; i++)
    result = result < array[i] ? result : array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(& : result)
  for (i = 0; i < 1000; i++)
    result &= array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(| : result)
  for (i = 0; i < 1000; i++)
    result |= array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(^ : result)
  for (i = 0; i < 1000; i++)
    result ^= array[i];
#pragma acc parallel
#pragma acc loop gang worker vector reduction(&& : lresult)
  for (i = 0; i < 1000; i++)
    lresult = lresult && (result > array[i]);
#pragma acc parallel
#pragma acc loop gang worker vector reduction(|| : lresult)
  for (i = 0; i < 1000; i++)
    lresult = lresult || (result > array[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1145 <main+0x45>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1179 <main+0x79>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x4c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11d7 <main+0xd7>
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0xfb0(%rbp,%rcx,4),%eax
jle    11af <main+0xaf>
mov    -0xc(%rbp),%eax
mov    %eax,-0xfb8(%rbp)
jmp    11c0 <main+0xc0>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
mov    %eax,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <main+0x80>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1235 <main+0x135>
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0xfb0(%rbp,%rcx,4),%eax
jge    120d <main+0x10d>
mov    -0xc(%rbp),%eax
mov    %eax,-0xfbc(%rbp)
jmp    121e <main+0x11e>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
mov    %eax,-0xfbc(%rbp)
mov    -0xfbc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11de <main+0xde>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1268 <main+0x168>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    123c <main+0x13c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    129b <main+0x19b>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126f <main+0x16f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    12ce <main+0x1ce>
movslq -0x8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12a2 <main+0x1a2>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    132d <main+0x22d>
xor    %eax,%eax
cmpl   $0x0,-0xfb4(%rbp)
mov    %al,-0xfbd(%rbp)
je     130e <main+0x20e>
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0xfb0(%rbp,%rcx,4),%eax
setg   %al
mov    %al,-0xfbd(%rbp)
mov    -0xfbd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xfb4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d5 <main+0x1d5>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    138c <main+0x28c>
mov    $0x1,%al
cmpl   $0x0,-0xfb4(%rbp)
mov    %al,-0xfbe(%rbp)
jne    136d <main+0x26d>
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0xfb0(%rbp,%rcx,4),%eax
setg   %al
mov    %al,-0xfbe(%rbp)
mov    -0xfbe(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xfb4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1334 <main+0x234>
xor    %eax,%eax
add    $0xf40,%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 [1000 x i32]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
store i32 0, i32* %2
br label %20
20: ; preds = %30, %19
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 1000
br i1 %22, label %23, label %33
23: ; preds = %20
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %3
%29 = mul nsw i32 %28, %27
store i32 %29, i32* %3
br label %30
30: ; preds = %23
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %20
33: ; preds = %20
store i32 0, i32* %2
br label %34
34: ; preds = %53, %33
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 1000
br i1 %36, label %37, label %56
37: ; preds = %34
%38 = load i32, i32* %3
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = icmp sgt i32 %38, %42
br i1 %43, label %44, label %46
44: ; preds = %37
%45 = load i32, i32* %3
br label %51
46: ; preds = %37
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
br label %51
51: ; preds = %46, %44
%52 = phi i32 [ %45, %44 ], [ %50, %46 ]
store i32 %52, i32* %3
br label %53
53: ; preds = %51
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
br label %34
56: ; preds = %34
store i32 0, i32* %2
br label %57
57: ; preds = %76, %56
%58 = load i32, i32* %2
%59 = icmp slt i32 %58, 1000
br i1 %59, label %60, label %79
60: ; preds = %57
%61 = load i32, i32* %3
%62 = load i32, i32* %2
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = icmp slt i32 %61, %65
br i1 %66, label %67, label %69
67: ; preds = %60
%68 = load i32, i32* %3
br label %74
69: ; preds = %60
%70 = load i32, i32* %2
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %71
%73 = load i32, i32* %72
br label %74
74: ; preds = %69, %67
%75 = phi i32 [ %68, %67 ], [ %73, %69 ]
store i32 %75, i32* %3
br label %76
76: ; preds = %74
%77 = load i32, i32* %2
%78 = add nsw i32 %77, 1
store i32 %78, i32* %2
br label %57
79: ; preds = %57
store i32 0, i32* %2
br label %80
80: ; preds = %90, %79
%81 = load i32, i32* %2
%82 = icmp slt i32 %81, 1000
br i1 %82, label %83, label %93
83: ; preds = %80
%84 = load i32, i32* %2
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %85
%87 = load i32, i32* %86
%88 = load i32, i32* %3
%89 = and i32 %88, %87
store i32 %89, i32* %3
br label %90
90: ; preds = %83
%91 = load i32, i32* %2
%92 = add nsw i32 %91, 1
store i32 %92, i32* %2
br label %80
93: ; preds = %80
store i32 0, i32* %2
br label %94
94: ; preds = %104, %93
%95 = load i32, i32* %2
%96 = icmp slt i32 %95, 1000
br i1 %96, label %97, label %107
97: ; preds = %94
%98 = load i32, i32* %2
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %99
%101 = load i32, i32* %100
%102 = load i32, i32* %3
%103 = or i32 %102, %101
store i32 %103, i32* %3
br label %104
104: ; preds = %97
%105 = load i32, i32* %2
%106 = add nsw i32 %105, 1
store i32 %106, i32* %2
br label %94
107: ; preds = %94
store i32 0, i32* %2
br label %108
108: ; preds = %118, %107
%109 = load i32, i32* %2
%110 = icmp slt i32 %109, 1000
br i1 %110, label %111, label %121
111: ; preds = %108
%112 = load i32, i32* %2
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %113
%115 = load i32, i32* %114
%116 = load i32, i32* %3
%117 = xor i32 %116, %115
store i32 %117, i32* %3
br label %118
118: ; preds = %111
%119 = load i32, i32* %2
%120 = add nsw i32 %119, 1
store i32 %120, i32* %2
br label %108
121: ; preds = %108
store i32 0, i32* %2
br label %122
122: ; preds = %138, %121
%123 = load i32, i32* %2
%124 = icmp slt i32 %123, 1000
br i1 %124, label %125, label %141
125: ; preds = %122
%126 = load i32, i32* %5
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %135
128: ; preds = %125
%129 = load i32, i32* %3
%130 = load i32, i32* %2
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %131
%133 = load i32, i32* %132
%134 = icmp sgt i32 %129, %133
br label %135
135: ; preds = %128, %125
%136 = phi i1 [ false, %125 ], [ %134, %128 ]
%137 = zext i1 %136 to i32
store i32 %137, i32* %5
br label %138
138: ; preds = %135
%139 = load i32, i32* %2
%140 = add nsw i32 %139, 1
store i32 %140, i32* %2
br label %122
141: ; preds = %122
store i32 0, i32* %2
br label %142
142: ; preds = %158, %141
%143 = load i32, i32* %2
%144 = icmp slt i32 %143, 1000
br i1 %144, label %145, label %161
145: ; preds = %142
%146 = load i32, i32* %5
%147 = icmp ne i32 %146, 0
br i1 %147, label %155, label %148
148: ; preds = %145
%149 = load i32, i32* %3
%150 = load i32, i32* %2
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %151
%153 = load i32, i32* %152
%154 = icmp sgt i32 %149, %153
br label %155
155: ; preds = %148, %145
%156 = phi i1 [ true, %145 ], [ %154, %148 ]
%157 = zext i1 %156 to i32
store i32 %157, i32* %5
br label %158
158: ; preds = %155
%159 = load i32, i32* %2
%160 = add nsw i32 %159, 1
store i32 %160, i32* %2
br label %142
161: ; preds = %142
ret i32 0
}

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