#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main() {
  int arr[100];
  fprintf(stderr, "addr=%p, size=%ld\n", &arr[(100 - 2)],
          (100 - (100 - 2)) * sizeof arr[0]);
  fprintf(stderr, "addr=%p, size=%ld\n", &arr[0], (100 - 0) * sizeof arr[0]);
#pragma omp target data map(alloc : arr[LARGE])
  {
#pragma omp target data map(present, tofrom : arr[SMALL])
    ;
  }
  fprintf(stderr, "arr is present\n");
#pragma omp target data map(alloc : arr[SMALL])
  {
#pragma omp target data map(present, tofrom : arr[LARGE])
    ;
  }
  fprintf(stderr, "arr is present\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    -0x1a0(%rbp),%rdx
add    $0x188,%rdx
lea    0xec0(%rip),%rsi
mov    $0x8,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    -0x1a0(%rbp),%rdx
lea    0xe9d(%rip),%rsi
mov    $0x190,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    0x2ebf(%rip),%r14
mov    (%r14),%edi
lea    0x188(%rsp),%rdx
lea    0xecd(%rip),%rbx
mov    $0x8,%ecx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rsp,%rdx
mov    $0x190,%ecx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb2(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"addr=%p, size=%ld\0A\00"
@.str.1 = [16 x i8] c"arr is present\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 98
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %4, i64 8)
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %7, i64 400)
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"addr=%p, size=%ld\0A\00"
@.str.1 = [16 x i8] c"arr is present\0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = load i32, i32* @stderr
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 98
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %4, i64 8)
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %7, i64 400)
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}