#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*/ bar(int);
void foo(void) {
  int i, j, k, l, m, n, o, p, q;
#pragma omp task
  {
    i = 2;
    bar(i);
  }
#pragma omp taskloop
  for (j = 0; j < 10; j++) {
    k = 7;
    bar(k);
  }
#pragma omp task firstprivate(l)
  {
    l = 2;
    bar(l);
  }
#pragma omp taskloop firstprivate(m)
  for (j = 0; j < 10; j++) {
    m = 7;
    bar(m);
  }
#pragma omp task shared(n)
  {
    n = 2;
    bar(n);
  }
#pragma omp taskloop shared(o)
  for (j = 0; j < 10; j++) {
    o = 7;
    bar(o);
  }
#pragma omp task private(p)
  {
    p = 2;
    bar(p);
  }
#pragma omp taskloop shared(q)
  for (j = 0; j < 10; j++) {
    q = 7;
    bar(q);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1155 <foo+0x45>
movl   $0x7,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <foo+0x1e>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1192 <foo+0x82>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <foo+0x5b>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11cf <foo+0xbf>
movl   $0x7,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a8 <foo+0x98>
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    120c <foo+0xfc>
movl   $0x7,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e5 <foo+0xd5>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 2, i32* %1
%10 = load i32, i32* %1
%11 = call i32 @bar(i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %18, %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %21
15: ; preds = %12
store i32 7, i32* %3
%16 = load i32, i32* %3
%17 = call i32 @bar(i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %12
21: ; preds = %12
store i32 2, i32* %4
%22 = load i32, i32* %4
%23 = call i32 @bar(i32 %22)
store i32 0, i32* %2
br label %24
24: ; preds = %30, %21
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 10
br i1 %26, label %27, label %33
27: ; preds = %24
store i32 7, i32* %5
%28 = load i32, i32* %5
%29 = call i32 @bar(i32 %28)
br label %30
30: ; preds = %27
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %24
33: ; preds = %24
store i32 2, i32* %6
%34 = load i32, i32* %6
%35 = call i32 @bar(i32 %34)
store i32 0, i32* %2
br label %36
36: ; preds = %42, %33
%37 = load i32, i32* %2
%38 = icmp slt i32 %37, 10
br i1 %38, label %39, label %45
39: ; preds = %36
store i32 7, i32* %7
%40 = load i32, i32* %7
%41 = call i32 @bar(i32 %40)
br label %42
42: ; preds = %39
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %36
45: ; preds = %36
store i32 2, i32* %8
%46 = load i32, i32* %8
%47 = call i32 @bar(i32 %46)
store i32 0, i32* %2
br label %48
48: ; preds = %54, %45
%49 = load i32, i32* %2
%50 = icmp slt i32 %49, 10
br i1 %50, label %51, label %57
51: ; preds = %48
store i32 7, i32* %9
%52 = load i32, i32* %9
%53 = call i32 @bar(i32 %52)
br label %54
54: ; preds = %51
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %48
57: ; preds = %48
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 2)
%2 = tail call i32 @bar(i32 7)
%3 = tail call i32 @bar(i32 7)
%4 = tail call i32 @bar(i32 7)
%5 = tail call i32 @bar(i32 7)
%6 = tail call i32 @bar(i32 7)
%7 = tail call i32 @bar(i32 7)
%8 = tail call i32 @bar(i32 7)
%9 = tail call i32 @bar(i32 7)
%10 = tail call i32 @bar(i32 7)
%11 = tail call i32 @bar(i32 7)
%12 = tail call i32 @bar(i32 2)
%13 = tail call i32 @bar(i32 7)
%14 = tail call i32 @bar(i32 7)
%15 = tail call i32 @bar(i32 7)
%16 = tail call i32 @bar(i32 7)
%17 = tail call i32 @bar(i32 7)
%18 = tail call i32 @bar(i32 7)
%19 = tail call i32 @bar(i32 7)
%20 = tail call i32 @bar(i32 7)
%21 = tail call i32 @bar(i32 7)
%22 = tail call i32 @bar(i32 7)
%23 = tail call i32 @bar(i32 2)
%24 = tail call i32 @bar(i32 7)
%25 = tail call i32 @bar(i32 7)
%26 = tail call i32 @bar(i32 7)
%27 = tail call i32 @bar(i32 7)
%28 = tail call i32 @bar(i32 7)
%29 = tail call i32 @bar(i32 7)
%30 = tail call i32 @bar(i32 7)
%31 = tail call i32 @bar(i32 7)
%32 = tail call i32 @bar(i32 7)
%33 = tail call i32 @bar(i32 7)
%34 = tail call i32 @bar(i32 2)
%35 = tail call i32 @bar(i32 7)
%36 = tail call i32 @bar(i32 7)
%37 = tail call i32 @bar(i32 7)
%38 = tail call i32 @bar(i32 7)
%39 = tail call i32 @bar(i32 7)
%40 = tail call i32 @bar(i32 7)
%41 = tail call i32 @bar(i32 7)
%42 = tail call i32 @bar(i32 7)
%43 = tail call i32 @bar(i32 7)
%44 = tail call i32 @bar(i32 7)
ret void
}