#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();
__attribute__((no, noclone)) void f1(int ifval) {
  int x = 1, y = 2, z = 3;
#pragma omp parallel
#pragma omp single
  {
#pragma omp task shared(x) depend(out : x)
    x = 2;
#pragma omp task shared(x) depend(inout : x)
    {
      if (x != 2)
        abort();
      x = 3;
    }
#pragma omp task shared(x) depend(inout : x)
    {
      if (x != 3)
        abort();
      x = 4;
    }
#pragma omp task shared(z) depend(in : z)
    if (z != 3)
      abort();
#pragma omp task shared(z) depend(in : z)
    if (z != 3)
      abort();
#pragma omp task shared(z) depend(in : z)
    if (z != 3)
      abort();
#pragma omp task shared(z) depend(in : z)
    if (z != 3)
      abort();
#pragma omp task shared(z) depend(in : z)
    if (z != 3)
      abort();
#pragma omp task shared(z) depend(in : z)
    if (z != 3)
      abort();
#pragma omp task shared(y) depend(in : y)
    if (y != 2)
      abort();
#pragma omp task shared(y) depend(in : y)
    if (y != 2)
      abort();
#pragma omp task shared(y) depend(in : y)
    if (y != 2)
      abort();
#pragma omp task shared(y) depend(in : y)
    if (y != 2)
      abort();
#pragma omp task if (ifval) shared(x, y) depend(in : x) depend(inout : y)
    {
      if (x != 4 || y != 2)
        abort();
      y = 3;
    }
    if (ifval == 0) {
      if (x != 4 || y != 3)
        abort();
      x = 5;
      y = 4;
    }
#pragma omp task shared(z) depend(inout : z)
    {
      if (z != 3)
        abort();
      z = 4;
    }
#pragma omp task shared(z) depend(inout : z)
    {
      if (z != 4)
        abort();
      z = 5;
    }
#pragma omp taskwait
    if (x != (ifval ? 4 : 5) || y != (ifval ? 3 : 4) || z != 5)
      abort();
#pragma omp task if (ifval) shared(x, y) depend(in : x) depend(inout : y)
    {
      if (x != (ifval ? 4 : 5) || y != (ifval ? 3 : 4))
        abort();
    }
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1148 <f1+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1160 <f1+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x4,-0x8(%rbp)
cmpl   $0x3,-0x10(%rbp)
je     1178 <f1+0x68>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x10(%rbp)
je     1189 <f1+0x79>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x10(%rbp)
je     119a <f1+0x8a>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x10(%rbp)
je     11ab <f1+0x9b>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x10(%rbp)
je     11bc <f1+0xac>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x10(%rbp)
je     11cd <f1+0xbd>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0xc(%rbp)
je     11de <f1+0xce>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0xc(%rbp)
je     11ef <f1+0xdf>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0xc(%rbp)
je     1200 <f1+0xf0>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0xc(%rbp)
je     1211 <f1+0x101>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x4,-0x8(%rbp)
jne    1225 <f1+0x115>
cmpl   $0x2,-0xc(%rbp)
je     122c <f1+0x11c>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1266 <f1+0x156>
cmpl   $0x4,-0x8(%rbp)
jne    1251 <f1+0x141>
cmpl   $0x3,-0xc(%rbp)
je     1258 <f1+0x148>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x5,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
cmpl   $0x3,-0x10(%rbp)
je     1277 <f1+0x167>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x4,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
je     128f <f1+0x17f>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x5,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x5,%ecx
mov    $0x4,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jne    12dc <f1+0x1cc>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x4,%ecx
mov    $0x3,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jne    12dc <f1+0x1cc>
cmpl   $0x5,-0x10(%rbp)
je     12e3 <f1+0x1d3>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x5,%ecx
mov    $0x4,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jne    131f <f1+0x20f>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x4,%ecx
mov    $0x3,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
je     1326 <f1+0x216>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
ret

LLVM IR (-O0):
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
store i32 3, i32* %5
store i32 2, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
store i32 3, i32* %3
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
store i32 4, i32* %3
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %15
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 3
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %20
%26 = load i32, i32* %5
%27 = icmp ne i32 %26, 3
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @abort()
unreachable
30: ; preds = %25
%31 = load i32, i32* %5
%32 = icmp ne i32 %31, 3
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (...) @abort()
unreachable
35: ; preds = %30
%36 = load i32, i32* %5
%37 = icmp ne i32 %36, 3
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 (...) @abort()
unreachable
40: ; preds = %35
%41 = load i32, i32* %5
%42 = icmp ne i32 %41, 3
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (...) @abort()
unreachable
45: ; preds = %40
%46 = load i32, i32* %4
%47 = icmp ne i32 %46, 2
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (...) @abort()
unreachable
50: ; preds = %45
%51 = load i32, i32* %4
%52 = icmp ne i32 %51, 2
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = call i32 (...) @abort()
unreachable
55: ; preds = %50
%56 = load i32, i32* %4
%57 = icmp ne i32 %56, 2
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (...) @abort()
unreachable
60: ; preds = %55
%61 = load i32, i32* %4
%62 = icmp ne i32 %61, 2
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 (...) @abort()
unreachable
65: ; preds = %60
%66 = load i32, i32* %3
%67 = icmp ne i32 %66, 4
br i1 %67, label %71, label %68
68: ; preds = %65
%69 = load i32, i32* %4
%70 = icmp ne i32 %69, 2
br i1 %70, label %71, label %73
71: ; preds = %68, %65
%72 = call i32 (...) @abort()
unreachable
73: ; preds = %68
store i32 3, i32* %4
%74 = load i32, i32* %2
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %85
76: ; preds = %73
%77 = load i32, i32* %3
%78 = icmp ne i32 %77, 4
br i1 %78, label %82, label %79
79: ; preds = %76
%80 = load i32, i32* %4
%81 = icmp ne i32 %80, 3
br i1 %81, label %82, label %84
82: ; preds = %79, %76
%83 = call i32 (...) @abort()
unreachable
84: ; preds = %79
store i32 5, i32* %3
store i32 4, i32* %4
br label %85
85: ; preds = %84, %73
%86 = load i32, i32* %5
%87 = icmp ne i32 %86, 3
br i1 %87, label %88, label %90
88: ; preds = %85
%89 = call i32 (...) @abort()
unreachable
90: ; preds = %85
store i32 4, i32* %5
%91 = load i32, i32* %5
%92 = icmp ne i32 %91, 4
br i1 %92, label %93, label %95
93: ; preds = %90
%94 = call i32 (...) @abort()
unreachable
95: ; preds = %90
store i32 5, i32* %5
%96 = load i32, i32* %3
%97 = load i32, i32* %2
%98 = icmp ne i32 %97, 0
%99 = zext i1 %98 to i64
%100 = select i1 %98, i32 4, i32 5
%101 = icmp ne i32 %96, %100
br i1 %101, label %112, label %102
102: ; preds = %95
%103 = load i32, i32* %4
%104 = load i32, i32* %2
%105 = icmp ne i32 %104, 0
%106 = zext i1 %105 to i64
%107 = select i1 %105, i32 3, i32 4
%108 = icmp ne i32 %103, %107
br i1 %108, label %112, label %109
109: ; preds = %102
%110 = load i32, i32* %5
%111 = icmp ne i32 %110, 5
br i1 %111, label %112, label %114
112: ; preds = %109, %102, %95
%113 = call i32 (...) @abort()
unreachable
114: ; preds = %109
%115 = load i32, i32* %3
%116 = load i32, i32* %2
%117 = icmp ne i32 %116, 0
%118 = zext i1 %117 to i64
%119 = select i1 %117, i32 4, i32 5
%120 = icmp ne i32 %115, %119
br i1 %120, label %128, label %121
121: ; preds = %114
%122 = load i32, i32* %4
%123 = load i32, i32* %2
%124 = icmp ne i32 %123, 0
%125 = zext i1 %124 to i64
%126 = select i1 %124, i32 3, i32 4
%127 = icmp ne i32 %122, %126
br i1 %127, label %128, label %130
128: ; preds = %121, %114
%129 = call i32 (...) @abort()
unreachable
130: ; preds = %121
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0) {
ret void
}