#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*/ free(unsigned int *);
scalar_t__ malloc(int);
int main(void) {
  unsigned int *a = (unsigned int *)malloc(2 * sizeof(unsigned int));
  unsigned int *b = a;
  unsigned int *c = (unsigned int *)malloc(2 * sizeof(unsigned int));
#pragma acc kernels pcopyout(a [0:N], b [0:N], c [0:N])
  {
    a[0] = 0;
    b[0] = 1;
    c[0] = a[0];
  }
  if (a[0] != 1 || b[0] != 1 || c[0] != 1)
    abort();
  free(a);
  free(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    11a3 <main+0x73>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    11a3 <main+0x73>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
je     11aa <main+0x7a>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%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    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x8,%edi
call   1050 <malloc@plt>
movl   $0x1,(%rbx)
movl   $0x1,(%rax)
cmpl   $0x1,(%rbx)
jne    1179 <main+0x49>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %1
%6 = load i32*, i32** %1
store i32* %6, i32** %2
%7 = call i64 @malloc(i32 8)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 0, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 1, i32* %12
%13 = load i32*, i32** %1
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 %15, i32* %17
%18 = load i32*, i32** %1
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 1
br i1 %21, label %32, label %22
22: ; preds = %0
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 0
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 1
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 0
%30 = load i32, i32* %29
%31 = icmp ne i32 %30, 1
br i1 %31, label %32, label %34
32: ; preds = %27, %22, %0
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %27
%35 = load i32*, i32** %1
%36 = call i32 @free(i32* %35)
%37 = load i32*, i32** %3
%38 = call i32 @free(i32* %37)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to i32*
store i32 1, i32* %2
store i32 1, i32* %4
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = tail call i32 @free(i32* %2)
%11 = tail call i32 @free(i32* %4)
ret i32 0
}