#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*/ assert(int);
int /*<<< orphan*/ foo(int **);
int main() {
  int x[5] = {-1, -1, -1, -1, -1};
  foo(&x);
#pragma omp taskwait
  assert(x[0] == -1);
  int i;
  for (i = 1; i < 5; ++i) {
    assert(x[i] == i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <foo@plt>
cmpl   $0xffffffff,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    119f <main+0x7f>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116f <main+0x4f>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,(%rsp)
movl   $0xffffffff,0x10(%rsp)
ff
mov    %rsp,%rdi
call   1040 <foo@plt>
xor    %edi,%edi
cmpl   $0xffffffff,(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x2,0x8(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x3,0xc(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x4,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [5 x i32] [i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = bitcast [5 x i32]* %2 to i32**
%6 = call i32 @foo(i32** %5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
store i32 1, i32* %3
br label %12
12: ; preds = %24, %0
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %3
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %12
27: ; preds = %12
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = bitcast [5 x i32]* %1 to i32**
%4 = call i32 @foo(i32** %3)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 2
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 3
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 4
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
ret i32 0
}