#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*/ abort();
int main(int argc, char *argv[]) {
  int a[5] = {1, 2, 3, 4, 5};
  int i;
#pragma omp task inout(a[2])
  a[2]++;
#pragma omp task input(a[2])
  {
    if (a[2] != 4) {
      abort();
    }
  }
#pragma omp task inout([5] a)
  {
    for (i = 0; i < 5; i++)
      a[i]++;
  }
#pragma omp task input([5] a)
  {
    int b[5] = {2, 3, 5, 5, 6};
    for (i = 0; i < 5; i++) {
      if (a[i] != b[i]) {
        abort();
      }
    }
  }
#pragma omp taskwait
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
je     115f <main+0x4f>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    118d <main+0x7d>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1166 <main+0x56>
mov    0xe8c(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe87(%rip),%eax
mov    %eax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    11ed <main+0xdd>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
movslq -0x34(%rbp),%rcx
cmp    -0x50(%rbp,%rcx,4),%eax
je     11da <main+0xca>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11df <main+0xcf>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b3 <main+0xa3>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.b = [5 x i32] [i32 2, i32 3, i32 5, i32 5, i32 6]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca i32
%8 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [5 x i32]* %6 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 2
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 2
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 4
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
store i32 0, i32* %7
br label %19
19: ; preds = %28, %18
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 5
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %25
br label %28
28: ; preds = %22
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %19
31: ; preds = %19
%32 = bitcast [5 x i32]* %8 to i8*
store i32 0, i32* %7
br label %33
33: ; preds = %49, %31
%34 = load i32, i32* %7
%35 = icmp slt i32 %34, 5
br i1 %35, label %36, label %52
36: ; preds = %33
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = icmp ne i32 %40, %44
br i1 %45, label %46, label %48
46: ; preds = %36
%47 = call i32 (...) @abort()
unreachable
48: ; preds = %36
br label %49
49: ; preds = %48
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %33
52: ; preds = %33
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}