#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 check(int *, int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ clear(int *, int);
int place();
int vector_1(int *ary, int size) {
  clear(ary, size);
#pragma acc parallel num_workers(32) vector_length(32) copy(ary [0:size])      \
    firstprivate(size)
  {
#pragma acc loop gang
    for (int jx = 0; jx < 1; jx++)
#pragma acc loop auto
      for (int ix = 0; ix < size; ix++)
        ary[ix] = place();
  }
  return check(ary, size, 0, 1, 1);
}


x86 assembly (clang, -O0):
<vector_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <clear@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jge    11a4 <vector_1+0x74>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1191 <vector_1+0x61>
mov    $0x0,%al
call   1030 <place@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <vector_1+0x33>
jmp    1196 <vector_1+0x66>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <vector_1+0x22>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1040 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1050 <clear@plt>
test   %r14d,%r14d
jle    1164 <vector_1+0x34>
mov    %r14d,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <place@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <vector_1+0x20>
mov    %r15,%rdi
mov    %r14d,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <check@plt>

LLVM IR (-O0):
define i32 @vector_1(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @clear(i32* %7, i32 %8)
store i32 0, i32* %5
br label %10
10: ; preds = %28, %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %31
13: ; preds = %10
store i32 0, i32* %6
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = call i32 (...) @place()
%20 = load i32*, i32** %3
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %18
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %14
27: ; preds = %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %10
31: ; preds = %10
%32 = load i32*, i32** %3
%33 = load i32, i32* %4
%34 = call i32 @check(i32* %32, i32 %33, i32 0, i32 1, i32 1)
ret i32 %34
}

LLVM IR (-O2):
define i32 @vector_1(i32* %0, i32 %1) {
%3 = tail call i32 @clear(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9, %2
%8 = tail call i32 @check(i32* %0, i32 %1, i32 0, i32 1, i32 1)
ret i32 %8
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %13, %9 ]
%11 = tail call i32 (...) @place()
%12 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %11, i32* %12
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %9
}