#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);
void t1() {
  int n = 0, arr[32], i;
  for (i = 0; i < 32; i++)
    arr[i] = 0;
#pragma acc parallel copy(n, arr) num_gangs(1) num_workers(1) vector_length(32)
  {
    int j;
    n++;
#pragma acc loop vector
    for (j = 0; j < 32; j++)
      arr[j]++;
    n++;
  }
  assert(n == 2);
  for (i = 0; i < 32; i++)
    assert(arr[i] == 1);
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    115f <t1+0x4f>
movslq -0x94(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    112c <t1+0x1c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x98(%rbp)
cmpl   $0x20,-0x98(%rbp)
jge    11ab <t1+0x9b>
movslq -0x98(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1172 <t1+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    120c <t1+0xfc>
movslq -0x94(%rbp),%rax
cmpl   $0x1,-0x90(%rbp,%rax,4)
01
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11cf <t1+0xbf>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movdqa (%rsp),%xmm0
pcmpeqd %xmm1,%xmm1
psubd  %xmm1,%xmm0
movdqa %xmm0,(%rsp)
movdqa 0x10(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa 0x20(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x20(%rsp)
movdqa 0x30(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x30(%rsp)
movdqa 0x40(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x40(%rsp)
movdqa 0x50(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x50(%rsp)
movdqa 0x60(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x60(%rsp)
movdqa 0x70(%rsp),%xmm0
psubd  %xmm1,%xmm0
movdqa %xmm0,0x70(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %ebx,%ebx
xor    %edi,%edi
cmpl   $0x1,(%rsp,%rbx,4)
sete   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    11d0 <t1+0xc0>
add    $0x80,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @t1() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = bitcast [32 x i32]* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = add nsw <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%6 = bitcast [32 x i32]* %1 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = add nsw <4 x i32> %9, <i32 1, i32 1, i32 1, i32 1>
%11 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %11
%12 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 8
%13 = bitcast i32* %12 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = add nsw <4 x i32> %14, <i32 1, i32 1, i32 1, i32 1>
%16 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %15, <4 x i32>* %16
%17 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 12
%18 = bitcast i32* %17 to <4 x i32>*
%19 = load <4 x i32>, <4 x i32>* %18
%20 = add nsw <4 x i32> %19, <i32 1, i32 1, i32 1, i32 1>
%21 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> %20, <4 x i32>* %21
%22 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 16
%23 = bitcast i32* %22 to <4 x i32>*
%24 = load <4 x i32>, <4 x i32>* %23
%25 = add nsw <4 x i32> %24, <i32 1, i32 1, i32 1, i32 1>
%26 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> %25, <4 x i32>* %26
%27 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 20
%28 = bitcast i32* %27 to <4 x i32>*
%29 = load <4 x i32>, <4 x i32>* %28
%30 = add nsw <4 x i32> %29, <i32 1, i32 1, i32 1, i32 1>
%31 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> %30, <4 x i32>* %31
%32 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 24
%33 = bitcast i32* %32 to <4 x i32>*
%34 = load <4 x i32>, <4 x i32>* %33
%35 = add nsw <4 x i32> %34, <i32 1, i32 1, i32 1, i32 1>
%36 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> %35, <4 x i32>* %36
%37 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 28
%38 = bitcast i32* %37 to <4 x i32>*
%39 = load <4 x i32>, <4 x i32>* %38
%40 = add nsw <4 x i32> %39, <i32 1, i32 1, i32 1, i32 1>
%41 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> %40, <4 x i32>* %41
%42 = tail call i32 @assert(i32 1)
br label %43
43: ; preds = %0, %43
%44 = phi i64 [ 0, %0 ], [ %50, %43 ]
%45 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, 1
%48 = zext i1 %47 to i32
%49 = tail call i32 @assert(i32 %48)
%50 = add nuw nsw i64 %44, 1
%51 = icmp eq i64 %50, 32
br i1 %51, label %52, label %43
52: ; preds = %43
ret void
}