#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 /*<<< orphan*/ foo1(int *);
int /*<<< orphan*/ foo2(int *);
int /*<<< orphan*/ foo3(int *);
int /*<<< orphan*/ foo4(int *);
int main(int argc, char *argv[]) {
  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  foo1(a);
#pragma omp taskwait
  if (a[0] != 3)
    abort();
  a[0] = 0;
  foo2(a);
#pragma omp taskwait
  if (a[0] != 3)
    abort();
  a[0] = 0;
  foo3(a);
#pragma omp taskwait
  if (a[3] != 13 || a[4] != 48)
    abort();
  a[3] = 3;
  a[4] = 4;
  foo4(a);
#pragma omp taskwait
  if (a[3] != 13 || a[4] != 48)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1080 <foo1@plt>
cmpl   $0x3,-0x40(%rbp)
je     11a5 <main+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x0,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <foo2@plt>
cmpl   $0x3,-0x40(%rbp)
je     11c6 <main+0x66>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x0,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
call   1070 <foo3@plt>
cmpl   $0xd,-0x34(%rbp)
jne    11ea <main+0x8a>
cmpl   $0x30,-0x30(%rbp)
je     11f1 <main+0x91>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x3,-0x34(%rbp)
movl   $0x4,-0x30(%rbp)
lea    -0x40(%rbp),%rdi
call   1040 <foo4@plt>
cmpl   $0xd,-0x34(%rbp)
jne    121c <main+0xbc>
cmpl   $0x30,-0x30(%rbp)
je     1223 <main+0xc3>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xec5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1070 <foo1@plt>
cmpl   $0x3,(%rsp)
jne    11e3 <main+0x93>
movl   $0x0,(%rsp)
mov    %rsp,%rdi
call   1050 <foo2@plt>
cmpl   $0x3,(%rsp)
jne    11e3 <main+0x93>
movl   $0x0,(%rsp)
mov    %rsp,%rdi
call   1060 <foo3@plt>
cmpl   $0xd,0xc(%rsp)
jne    11e3 <main+0x93>
cmpl   $0x30,0x10(%rsp)
jne    11e3 <main+0x93>
movabs $0x400000003,%rax
mov    %rax,0xc(%rsp)
mov    %rsp,%rdi
call   1040 <foo4@plt>
cmpl   $0xd,0xc(%rsp)
jne    11e3 <main+0x93>
cmpl   $0x30,0x10(%rsp)
jne    11e3 <main+0x93>
xor    %eax,%eax
add    $0x28,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = call i32 @foo1(i32* %5)
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 3
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
store i32 0, i32* %5
%12 = call i32 @foo2(i32* %5)
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 3
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %11
store i32 0, i32* %5
%18 = call i32 @foo3(i32* %5)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 13
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%23 = load i32, i32* %22
%24 = icmp ne i32 %23, 48
%25 = select i1 %21, i1 true, i1 %24
br i1 %25, label %26, label %28
26: ; preds = %17
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %17
store i32 3, i32* %19
store i32 4, i32* %22
%29 = call i32 @foo4(i32* %5)
%30 = load i32, i32* %19
%31 = icmp ne i32 %30, 13
%32 = load i32, i32* %22
%33 = icmp ne i32 %32, 48
%34 = select i1 %31, i1 true, i1 %33
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 (...) @abort()
unreachable
37: ; preds = %28
ret i32 0
}