#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 *acc_deviceptr(int *);
int main(int argc, char *argv[]) {
  int x[1024], y[1024], *yp;
  yp = y + 1;
#pragma acc data copyin(x [0:N])
  {
    int *xp, *yp2;
#pragma acc host_data use_device(x)
    {
#pragma acc data copyin(y)
      {
#pragma acc host_data use_device(yp)
        {
          xp = x;
          yp2 = yp;
        }
        if (yp2 != acc_deviceptr(yp))
          abort();
      }
    }
    if (xp != acc_deviceptr(x))
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2010(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x2018(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x2020(%rbp)
mov    -0x2018(%rbp),%rax
mov    %rax,-0x2028(%rbp)
mov    -0x2028(%rbp),%rax
mov    %rax,-0x2030(%rbp)
mov    -0x2018(%rbp),%rdi
call   1040 <acc_deviceptr@plt>
mov    %rax,%rcx
mov    -0x2030(%rbp),%rax
cmp    %rcx,%rax
je     119b <main+0x7b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x2020(%rbp),%rax
mov    %rax,-0x2038(%rbp)
lea    -0x1010(%rbp),%rdi
call   1040 <acc_deviceptr@plt>
mov    %rax,%rcx
mov    -0x2038(%rbp),%rax
cmp    %rcx,%rax
je     11cf <main+0xaf>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x2040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2000,%rsp
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <acc_deviceptr@plt>
cmp    %rax,%rbx
jne    115a <main+0x3a>
lea    0x1000(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <acc_deviceptr@plt>
cmp    %rax,%rbx
jne    115a <main+0x3a>
xor    %eax,%eax
add    $0x2000,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i32]
%7 = alloca [1024 x i32]
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = getelementptr inbounds [1024 x i32], [1024 x i32]* %7, i64 0, i64 0
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32* %12, i32** %8
%13 = getelementptr inbounds [1024 x i32], [1024 x i32]* %6, i64 0, i64 0
store i32* %13, i32** %9
%14 = load i32*, i32** %8
store i32* %14, i32** %10
%15 = load i32*, i32** %10
%16 = load i32*, i32** %8
%17 = call i32* @acc_deviceptr(i32* %16)
%18 = icmp ne i32* %15, %17
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %2
%22 = load i32*, i32** %9
%23 = getelementptr inbounds [1024 x i32], [1024 x i32]* %6, i64 0, i64 0
%24 = call i32* @acc_deviceptr(i32* %23)
%25 = icmp ne i32* %22, %24
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i32]
%4 = alloca [1024 x i32]
%5 = bitcast [1024 x i32]* %3 to i8*
%6 = bitcast [1024 x i32]* %4 to i8*
%7 = getelementptr inbounds [1024 x i32], [1024 x i32]* %4, i64 0, i64 1
%8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 0
%9 = call i32* @acc_deviceptr(i32* %7)
%10 = icmp eq i32* %7, %9
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = call i32* @acc_deviceptr(i32* %8)
%15 = icmp eq i32* %8, %14
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %13
ret i32 0
}