#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*/ acc_device_not_host;
int acc_on_device(int /*<<< orphan*/);
scalar_t__ gang_vector_1(int *, int);
scalar_t__ gang_vector_2a(int *, int);
scalar_t__ gang_vector_2b(int *, int);
scalar_t__ gang_worker_vector_2a(int *, int);
scalar_t__ gang_worker_vector_2b(int *, int);
scalar_t__ gang_worker_vector_star_2a(int *, int);
scalar_t__ gang_worker_vector_star_2b(int *, int);
scalar_t__ worker_vector_2a(int *, int);
scalar_t__ worker_vector_2b(int *, int);
int main() {
  int ondev = 0;
#pragma acc parallel copy(ondev)
  { ondev = acc_on_device(acc_device_not_host); }
  if (!ondev)
    return 0;
  int ary[(32 * 32 * 32 * 8)];
  if (gang_vector_1(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (gang_vector_2a(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (worker_vector_2a(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (gang_worker_vector_2a(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (gang_worker_vector_star_2a(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (gang_vector_2b(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (worker_vector_2b(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (gang_worker_vector_2b(ary, (32 * 32 * 32 * 8)))
    return 1;
  if (gang_worker_vector_star_2b(ary, (32 * 32 * 32 * 8)))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100010,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
call   1030 <acc_on_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11e0 <main+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   1060 <gang_vector_1@plt>
cmp    $0x0,%rax
je     1207 <main+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   1040 <gang_vector_2a@plt>
cmp    $0x0,%rax
je     122e <main+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   1080 <worker_vector_2a@plt>
cmp    $0x0,%rax
je     1255 <main+0xb5>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   10b0 <gang_worker_vector_2a@plt>
cmp    $0x0,%rax
je     127c <main+0xdc>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   1050 <gang_worker_vector_star_2a@plt>
cmp    $0x0,%rax
je     12a3 <main+0x103>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   10a0 <gang_vector_2b@plt>
cmp    $0x0,%rax
je     12ca <main+0x12a>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   10c0 <worker_vector_2b@plt>
cmp    $0x0,%rax
je     12f1 <main+0x151>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   1070 <gang_worker_vector_2b@plt>
cmp    $0x0,%rax
je     1318 <main+0x178>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
lea    -0x100010(%rbp),%rdi
mov    $0x40000,%esi
call   1090 <gang_worker_vector_star_2b@plt>
cmp    $0x0,%rax
je     133f <main+0x19f>
movl   $0x1,-0x4(%rbp)
jmp    1346 <main+0x1a6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100000,%rsp
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1030 <acc_on_device@plt>
test   %eax,%eax
je     1272 <main+0xd2>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   1060 <gang_vector_1@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   1040 <gang_vector_2a@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   1080 <worker_vector_2a@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   10b0 <gang_worker_vector_2a@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   1050 <gang_worker_vector_star_2a@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   10a0 <gang_vector_2b@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   10c0 <worker_vector_2b@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   1070 <gang_worker_vector_2b@plt>
test   %rax,%rax
jne    1274 <main+0xd4>
mov    %rsp,%rdi
mov    $0x40000,%esi
call   1090 <gang_worker_vector_star_2b@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
jmp    1274 <main+0xd4>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x100000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@acc_device_not_host = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [262144 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* @acc_device_not_host
%5 = call i32 @acc_on_device(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
store i32 0, i32* %1
br label %55
9: ; preds = %0
%10 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%11 = call i64 @gang_vector_1(i32* %10, i32 262144)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %55
14: ; preds = %9
%15 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%16 = call i64 @gang_vector_2a(i32* %15, i32 262144)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %1
br label %55
19: ; preds = %14
%20 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%21 = call i64 @worker_vector_2a(i32* %20, i32 262144)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %1
br label %55
24: ; preds = %19
%25 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%26 = call i64 @gang_worker_vector_2a(i32* %25, i32 262144)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 1, i32* %1
br label %55
29: ; preds = %24
%30 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%31 = call i64 @gang_worker_vector_star_2a(i32* %30, i32 262144)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 1, i32* %1
br label %55
34: ; preds = %29
%35 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%36 = call i64 @gang_vector_2b(i32* %35, i32 262144)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
store i32 1, i32* %1
br label %55
39: ; preds = %34
%40 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%41 = call i64 @worker_vector_2b(i32* %40, i32 262144)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %39
store i32 1, i32* %1
br label %55
44: ; preds = %39
%45 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%46 = call i64 @gang_worker_vector_2b(i32* %45, i32 262144)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %44
store i32 1, i32* %1
br label %55
49: ; preds = %44
%50 = getelementptr inbounds [262144 x i32], [262144 x i32]* %3, i64 0, i64 0
%51 = call i64 @gang_worker_vector_star_2b(i32* %50, i32 262144)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %49
store i32 1, i32* %1
br label %55
54: ; preds = %49
store i32 0, i32* %1
br label %55
55: ; preds = %54, %53, %48, %43, %38, %33, %28, %23, %18, %13, %8
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@acc_device_not_host = global i32 0
define i32 @main() {
%1 = alloca [262144 x i32]
%2 = load i32, i32* @acc_device_not_host
%3 = tail call i32 @acc_on_device(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %37, label %5
5: ; preds = %0
%6 = bitcast [262144 x i32]* %1 to i8*
%7 = getelementptr inbounds [262144 x i32], [262144 x i32]* %1, i64 0, i64 0
%8 = call i64 @gang_vector_1(i32* %7, i32 262144)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %35
10: ; preds = %5
%11 = call i64 @gang_vector_2a(i32* %7, i32 262144)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %35
13: ; preds = %10
%14 = call i64 @worker_vector_2a(i32* %7, i32 262144)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %35
16: ; preds = %13
%17 = call i64 @gang_worker_vector_2a(i32* %7, i32 262144)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = call i64 @gang_worker_vector_star_2a(i32* %7, i32 262144)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = call i64 @gang_vector_2b(i32* %7, i32 262144)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = call i64 @worker_vector_2b(i32* %7, i32 262144)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %35
28: ; preds = %25
%29 = call i64 @gang_worker_vector_2b(i32* %7, i32 262144)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = call i64 @gang_worker_vector_star_2b(i32* %7, i32 262144)
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i32
br label %35
35: ; preds = %31, %28, %25, %22, %19, %16, %13, %10, %5
%36 = phi i32 [ 1, %5 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ 1, %22 ], [ 1, %25 ], [ 1, %28 ], [ %34, %31 ]
br label %37
37: ; preds = %0, %35
%38 = phi i32 [ %36, %35 ], [ 0, %0 ]
ret i32 %38
}