#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*/ acc_device_host;
int /*<<< orphan*/ acc_device_none;
int /*<<< orphan*/ acc_device_not_host;
int /*<<< orphan*/ acc_device_nvidia;
scalar_t__ acc_on_device(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  {
    if (!acc_on_device(acc_device_none))
      abort();
    if (!acc_on_device(acc_device_host))
      abort();
    if (acc_on_device(acc_device_not_host))
      abort();
    if (acc_on_device(acc_device_nvidia))
      abort();
  }
#pragma acc parallel if (0)
  {
    if (!acc_on_device(acc_device_none))
      abort();
    if (!acc_on_device(acc_device_host))
      abort();
    if (acc_on_device(acc_device_not_host))
      abort();
    if (acc_on_device(acc_device_nvidia))
      abort();
  }
#pragma acc parallel
  {
    if (acc_on_device(acc_device_none))
      abort();
    if (acc_on_device(acc_device_host))
      abort();
    if (!acc_on_device(acc_device_not_host))
      abort();
    if (acc_on_device(acc_device_nvidia))
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
jne    1155 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
jne    1174 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     1193 <main+0x73>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     11b2 <main+0x92>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
jne    11d1 <main+0xb1>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
jne    11f0 <main+0xd0>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     120f <main+0xef>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     122e <main+0x10e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     124d <main+0x12d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     126c <main+0x14c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2d75(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
jne    128b <main+0x16b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_on_device@plt>
cmp    $0x0,%rax
je     12aa <main+0x18a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb1(%rip),%r14
mov    (%r14),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
je     11fa <main+0xda>
mov    0x2e89(%rip),%r15
mov    (%r15),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
je     11fa <main+0xda>
mov    0x2e89(%rip),%r12
mov    (%r12),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
mov    0x2e50(%rip),%rbx
mov    (%rbx),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
mov    (%r14),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
je     11fa <main+0xda>
mov    (%r15),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
je     11fa <main+0xda>
mov    (%r12),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
mov    (%rbx),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
mov    (%r14),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
mov    (%r15),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
mov    (%r12),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
je     11fa <main+0xda>
mov    (%rbx),%edi
call   1040 <acc_on_device@plt>
test   %rax,%rax
jne    11fa <main+0xda>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@acc_device_none = global i32 0
@acc_device_host = global i32 0
@acc_device_not_host = global i32 0
@acc_device_nvidia = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @acc_device_none
%7 = call i64 @acc_on_device(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = load i32, i32* @acc_device_host
%13 = call i64 @acc_on_device(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %11
%18 = load i32, i32* @acc_device_not_host
%19 = call i64 @acc_on_device(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %17
%24 = load i32, i32* @acc_device_nvidia
%25 = call i64 @acc_on_device(i32 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 (...) @abort()
unreachable
29: ; preds = %23
%30 = load i32, i32* @acc_device_none
%31 = call i64 @acc_on_device(i32 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = call i32 (...) @abort()
unreachable
35: ; preds = %29
%36 = load i32, i32* @acc_device_host
%37 = call i64 @acc_on_device(i32 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = call i32 (...) @abort()
unreachable
41: ; preds = %35
%42 = load i32, i32* @acc_device_not_host
%43 = call i64 @acc_on_device(i32 %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 (...) @abort()
unreachable
47: ; preds = %41
%48 = load i32, i32* @acc_device_nvidia
%49 = call i64 @acc_on_device(i32 %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 (...) @abort()
unreachable
53: ; preds = %47
%54 = load i32, i32* @acc_device_none
%55 = call i64 @acc_on_device(i32 %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = call i32 (...) @abort()
unreachable
59: ; preds = %53
%60 = load i32, i32* @acc_device_host
%61 = call i64 @acc_on_device(i32 %60)
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (...) @abort()
unreachable
65: ; preds = %59
%66 = load i32, i32* @acc_device_not_host
%67 = call i64 @acc_on_device(i32 %66)
%68 = icmp ne i64 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %65
%70 = call i32 (...) @abort()
unreachable
71: ; preds = %65
%72 = load i32, i32* @acc_device_nvidia
%73 = call i64 @acc_on_device(i32 %72)
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 (...) @abort()
unreachable
77: ; preds = %71
ret i32 0
}

LLVM IR (-O2):
@acc_device_none = global i32 0
@acc_device_host = global i32 0
@acc_device_not_host = global i32 0
@acc_device_nvidia = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @acc_device_none
%4 = tail call i64 @acc_on_device(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
%9 = load i32, i32* @acc_device_host
%10 = tail call i64 @acc_on_device(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %8
%15 = load i32, i32* @acc_device_not_host
%16 = tail call i64 @acc_on_device(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %14
%21 = load i32, i32* @acc_device_nvidia
%22 = tail call i64 @acc_on_device(i32 %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %20
%25 = tail call i32 (...) @abort()
unreachable
26: ; preds = %20
%27 = load i32, i32* @acc_device_none
%28 = tail call i64 @acc_on_device(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i32 (...) @abort()
unreachable
32: ; preds = %26
%33 = load i32, i32* @acc_device_host
%34 = tail call i64 @acc_on_device(i32 %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = tail call i32 (...) @abort()
unreachable
38: ; preds = %32
%39 = load i32, i32* @acc_device_not_host
%40 = tail call i64 @acc_on_device(i32 %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %38
%43 = tail call i32 (...) @abort()
unreachable
44: ; preds = %38
%45 = load i32, i32* @acc_device_nvidia
%46 = tail call i64 @acc_on_device(i32 %45)
%47 = icmp eq i64 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = tail call i32 (...) @abort()
unreachable
50: ; preds = %44
%51 = load i32, i32* @acc_device_none
%52 = tail call i64 @acc_on_device(i32 %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %50
%55 = tail call i32 (...) @abort()
unreachable
56: ; preds = %50
%57 = load i32, i32* @acc_device_host
%58 = tail call i64 @acc_on_device(i32 %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %56
%61 = tail call i32 (...) @abort()
unreachable
62: ; preds = %56
%63 = load i32, i32* @acc_device_not_host
%64 = tail call i64 @acc_on_device(i32 %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = tail call i32 (...) @abort()
unreachable
68: ; preds = %62
%69 = load i32, i32* @acc_device_nvidia
%70 = tail call i64 @acc_on_device(i32 %69)
%71 = icmp eq i64 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %68
%73 = tail call i32 (...) @abort()
unreachable
74: ; preds = %68
ret i32 0
}