#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);
int /*<<< orphan*/ baz(int);
void foo(int k) {
  int i;
#pragma omp for schedule(dynamic)
  for (i = 0; i < 10; ++i)
    bar(i);
#pragma omp parallel for schedule(static)
  for (i = 0; i < 10; ++i)
    bar(i);
#pragma omp parallel for schedule(static, 4)
  for (i = 0; i < 10; ++i)
    bar(i);
  if (k)
#pragma omp for schedule(dynamic)
    for (i = 0; i < 10; ++i)
      baz(i);
#pragma omp parallel
  for (i = 0; i < 10; ++i)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1152 <foo+0x32>
mov    -0x8(%rbp),%edi
call   1040 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <foo+0x12>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1179 <foo+0x59>
mov    -0x8(%rbp),%edi
call   1040 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <foo+0x39>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11a0 <foo+0x80>
mov    -0x8(%rbp),%edi
call   1040 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <foo+0x60>
cmpl   $0x0,-0x4(%rbp)
je     11d6 <foo+0xb6>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11d1 <foo+0xb1>
mov    -0x8(%rbp),%edi
call   1030 <baz@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b1 <foo+0x91>
jmp    11d6 <foo+0xb6>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11fd <foo+0xdd>
mov    -0x8(%rbp),%edi
call   1040 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dd <foo+0xbd>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <bar@plt>
mov    $0x1,%edi
call   1040 <bar@plt>
mov    $0x2,%edi
call   1040 <bar@plt>
mov    $0x3,%edi
call   1040 <bar@plt>
mov    $0x4,%edi
call   1040 <bar@plt>
mov    $0x5,%edi
call   1040 <bar@plt>
mov    $0x6,%edi
call   1040 <bar@plt>
mov    $0x7,%edi
call   1040 <bar@plt>
mov    $0x8,%edi
call   1040 <bar@plt>
mov    $0x9,%edi
call   1040 <bar@plt>
xor    %edi,%edi
call   1040 <bar@plt>
mov    $0x1,%edi
call   1040 <bar@plt>
mov    $0x2,%edi
call   1040 <bar@plt>
mov    $0x3,%edi
call   1040 <bar@plt>
mov    $0x4,%edi
call   1040 <bar@plt>
mov    $0x5,%edi
call   1040 <bar@plt>
mov    $0x6,%edi
call   1040 <bar@plt>
mov    $0x7,%edi
call   1040 <bar@plt>
mov    $0x8,%edi
call   1040 <bar@plt>
mov    $0x9,%edi
call   1040 <bar@plt>
xor    %edi,%edi
call   1040 <bar@plt>
mov    $0x1,%edi
call   1040 <bar@plt>
mov    $0x2,%edi
call   1040 <bar@plt>
mov    $0x3,%edi
call   1040 <bar@plt>
mov    $0x4,%edi
call   1040 <bar@plt>
mov    $0x5,%edi
call   1040 <bar@plt>
mov    $0x6,%edi
call   1040 <bar@plt>
mov    $0x7,%edi
call   1040 <bar@plt>
mov    $0x8,%edi
call   1040 <bar@plt>
mov    $0x9,%edi
call   1040 <bar@plt>
test   %ebx,%ebx
je     12ab <foo+0x18b>
xor    %edi,%edi
call   1030 <baz@plt>
mov    $0x1,%edi
call   1030 <baz@plt>
mov    $0x2,%edi
call   1030 <baz@plt>
mov    $0x3,%edi
call   1030 <baz@plt>
mov    $0x4,%edi
call   1030 <baz@plt>
mov    $0x5,%edi
call   1030 <baz@plt>
mov    $0x6,%edi
call   1030 <baz@plt>
mov    $0x7,%edi
call   1030 <baz@plt>
mov    $0x8,%edi
call   1030 <baz@plt>
mov    $0x9,%edi
call   1030 <baz@plt>
xor    %edi,%edi
call   1040 <bar@plt>
mov    $0x1,%edi
call   1040 <bar@plt>
mov    $0x2,%edi
call   1040 <bar@plt>
mov    $0x3,%edi
call   1040 <bar@plt>
mov    $0x4,%edi
call   1040 <bar@plt>
mov    $0x5,%edi
call   1040 <bar@plt>
mov    $0x6,%edi
call   1040 <bar@plt>
mov    $0x7,%edi
call   1040 <bar@plt>
mov    $0x8,%edi
call   1040 <bar@plt>
mov    $0x9,%edi
pop    %rbx
jmp    1040 <bar@plt>

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

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