#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 worker_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 kx = 0; kx < 1; kx++)
#pragma acc loop auto
      for (int jx = 0; jx < size / 64; jx++)
#pragma acc loop vector
        for (int ix = 0; ix < 64; ix++)
          ary[ix + jx * 64] = place();
  }
  return check(ary, size, 0, 1, 1);
}


x86 assembly (clang, -O0):
<worker_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    11e4 <worker_1+0xb4>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11d1 <worker_1+0xa1>
movl   $0x0,-0x18(%rbp)
cmpl   $0x40,-0x18(%rbp)
jge    11be <worker_1+0x8e>
mov    $0x0,%al
call   1030 <place@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%esi
shl    $0x6,%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1188 <worker_1+0x58>
jmp    11c3 <worker_1+0x93>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <worker_1+0x33>
jmp    11d6 <worker_1+0xa6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <worker_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):
<worker_1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
call   1050 <clear@plt>
cmp    $0x40,%r15d
jl     1195 <worker_1+0x65>
mov    %r15d,%r12d
shr    $0x6,%r12d
mov    %r14,%rbp
xor    %r13d,%r13d
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <place@plt>
mov    %eax,0x0(%rbp,%rbx,4)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1170 <worker_1+0x40>
add    $0x1,%r13
add    $0x100,%rbp
cmp    %r12,%r13
jne    1160 <worker_1+0x30>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <check@plt>

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

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