#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 acc_is_present(char *, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  char *block1 = (char *)malloc(1024);
  char *block2 = (char *)malloc(1024);
#pragma acc enter data copyin(block1 [0:SIZE], block2 [0:SIZE])
#pragma acc data copy(block1 [0:SIZE], block2 [0:SIZE])
  {
#pragma acc exit data copyout(block1 [0:SIZE], block2 [0:SIZE])
    assert(acc_is_present(block1, 1024));
    assert(acc_is_present(block2, 1024));
  }
  assert(!acc_is_present(block1, 1024));
  assert(!acc_is_present(block2, 1024));
  free(block1);
  free(block2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    -0x20(%rbp),%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x20(%rbp),%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    %r14,%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <acc_is_present@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 1024)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = call i64 @malloc(i32 1024)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %6
%13 = call i32 @acc_is_present(i8* %12, i32 1024)
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %7
%16 = call i32 @acc_is_present(i8* %15, i32 1024)
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %6
%19 = call i32 @acc_is_present(i8* %18, i32 1024)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i8*, i8** %7
%25 = call i32 @acc_is_present(i8* %24, i32 1024)
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i8*, i8** %6
%31 = call i32 @free(i8* %30)
%32 = load i8*, i8** %7
%33 = call i32 @free(i8* %32)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1024)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @malloc(i32 1024)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @acc_is_present(i8* %4, i32 1024)
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @acc_is_present(i8* %6, i32 1024)
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @acc_is_present(i8* %4, i32 1024)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @acc_is_present(i8* %6, i32 1024)
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 @free(i8* %4)
%20 = tail call i32 @free(i8* %6)
ret i32 0
}