#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*/ f(int, int *);
int main(int argc, char *argv[]) {
  int i;
  int w[10];
  for (i = 0; i < 10; i++)
    w[i] = i;
  f(10, w);
#pragma omp taskwait
  for (i = 0; i < 10; i++) {
    if (w[i] != (i + 1))
      abort();
  }
}


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)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1160 <main+0x40>
mov    -0x14(%rbp),%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
lea    -0x40(%rbp),%rsi
mov    $0xa,%edi
call   1040 <f@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11af <main+0x8f>
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     119c <main+0x7c>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11a1 <main+0x81>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1175 <main+0x55>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x900000008,%rax
mov    %rax,0x20(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1040 <f@plt>
movdqa (%rsp),%xmm0
movdqa 0x10(%rsp),%xmm1
pcmpeqd 0xeb6(%rip),%xmm1
pcmpeqd %xmm2,%xmm2
pxor   %xmm2,%xmm1
pcmpeqd 0xeb6(%rip),%xmm0
pxor   %xmm2,%xmm0
packssdw %xmm1,%xmm0
pmovmskb %xmm0,%eax
test   %eax,%eax
jne    119f <main+0x7f>
cmpl   $0x9,0x20(%rsp)
jne    119f <main+0x7f>
cmpl   $0xa,0x24(%rsp)
jne    119f <main+0x7f>
xor    %eax,%eax
add    $0x28,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %6
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %8
19: ; preds = %8
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%21 = call i32 @f(i32 10, i32* %20)
store i32 0, i32* %6
br label %22
22: ; preds = %36, %19
%23 = load i32, i32* %6
%24 = icmp slt i32 %23, 10
br i1 %24, label %25, label %39
25: ; preds = %22
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
%32 = icmp ne i32 %29, %31
br i1 %32, label %33, label %35
33: ; preds = %25
%34 = call i32 (...) @abort()
unreachable
35: ; preds = %25
br label %36
36: ; preds = %35
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %22
39: ; preds = %22
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
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 = bitcast [10 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
store i32 8, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
store i32 9, i32* %10
%11 = call i32 @f(i32 10, i32* %5)
%12 = bitcast [10 x i32]* %3 to <8 x i32>*
%13 = load <8 x i32>, <8 x i32>* %12
%14 = freeze <8 x i32> %13
%15 = icmp ne <8 x i32> %14, <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
%16 = bitcast <8 x i1> %15 to i8
%17 = icmp eq i8 %16, 0
%18 = load i32, i32* %9
%19 = icmp eq i32 %18, 9
%20 = select i1 %17, i1 %19, i1 false
%21 = load i32, i32* %10
%22 = icmp eq i32 %21, 10
%23 = select i1 %20, i1 %22, i1 false
br i1 %23, label %26, label %24
24: ; preds = %2
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %2
ret i32 0
}