#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;
void check_not_present() {
  int arr[100];
  for (int i = 0; i < 100; ++i)
    arr[i] = 99;
  fprintf(stderr, "checking not present\n");
#pragma omp target data map(tofrom : arr[LARGE])
  {
#pragma omp target exit data map(delete : arr[LARGE])
#pragma omp target enter data map(alloc : arr[SMALL])
#pragma omp target map(alloc : arr[SMALL])
    for (int i = (100 - 2); i < 100; ++i)
      arr[i] = 88;
  }
  for (int i = 0; i < 100; ++i) {
    if (arr[i] != 99)
      fprintf(stderr, "error: arr[%d]=%d\n", i, arr[i]);
  }
}


x86 assembly (clang, -O0):
<check_not_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x194(%rbp)
cmpl   $0x64,-0x194(%rbp)
jge    1158 <check_not_present+0x48>
movslq -0x194(%rbp),%rax
movl   $0x63,-0x190(%rbp,%rax,4)
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1125 <check_not_present+0x15>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x62,-0x198(%rbp)
cmpl   $0x64,-0x198(%rbp)
jge    11ac <check_not_present+0x9c>
movslq -0x198(%rbp),%rax
movl   $0x58,-0x190(%rbp,%rax,4)
mov    -0x198(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x198(%rbp)
jmp    1179 <check_not_present+0x69>
movl   $0x0,-0x19c(%rbp)
cmpl   $0x64,-0x19c(%rbp)
jge    121c <check_not_present+0x10c>
movslq -0x19c(%rbp),%rax
cmpl   $0x63,-0x190(%rbp,%rax,4)
63
je     1203 <check_not_present+0xf3>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    -0x19c(%rbp),%edx
movslq -0x19c(%rbp),%rax
mov    -0x190(%rbp,%rax,4),%ecx
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1208 <check_not_present+0xf8>
mov    -0x19c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19c(%rbp)
jmp    11b6 <check_not_present+0xa6>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_not_present>:
push   %r15
push   %r14
push   %rbx
sub    $0x190,%rsp
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x180(%rsp)
mov    0x2e07(%rip),%r15
mov    (%r15),%edi
lea    0xe2d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
movabs $0x5800000058,%rax
mov    %rax,0x188(%rsp)
lea    0xe23(%rip),%r14
xor    %ebx,%ebx
jmp    121a <check_not_present+0x10a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x64,%rbx
je     1233 <check_not_present+0x123>
mov    (%rsp,%rbx,4),%ecx
cmp    $0x63,%ecx
je     1210 <check_not_present+0x100>
mov    (%r15),%edi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    1210 <check_not_present+0x100>
add    $0x190,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"checking not present\0A\00"
@.str.1 = [19 x i8] c"error: arr[%d]=%d\0A\00"
define void @check_not_present() {
%1 = alloca [100 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %10
store i32 99, i32* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %5
15: ; preds = %5
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 98, i32* %3
br label %18
18: ; preds = %25, %15
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 100
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %23
store i32 88, i32* %24
br label %25
25: ; preds = %21
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %18
28: ; preds = %18
store i32 0, i32* %4
br label %29
29: ; preds = %47, %28
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 100
br i1 %31, label %32, label %50
32: ; preds = %29
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = icmp ne i32 %36, 99
br i1 %37, label %38, label %46
38: ; preds = %32
%39 = load i32, i32* @stderr
%40 = load i32, i32* %4
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %40, i32 %44)
br label %46
46: ; preds = %38, %32
br label %47
47: ; preds = %46
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %29
50: ; preds = %29
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"checking not present\0A\00"
@.str.1 = [19 x i8] c"error: arr[%d]=%d\0A\00"
define void @check_not_present() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = bitcast [100 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %3
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %11
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 20
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %13
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 24
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %15
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 28
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 32
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %19
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 36
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %21
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 40
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %23
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 44
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %25
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 48
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %27
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 52
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %29
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 56
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %31
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 60
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %33
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 64
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %35
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 68
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %37
%38 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 72
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %39
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 76
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %41
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 80
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %43
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 84
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %45
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 88
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %47
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 92
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %49
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 96
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 99, i32 99, i32 99, i32 99>, <4 x i32>* %51
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%54 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 98
store i32 88, i32* %54
%55 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 99
store i32 88, i32* %55
br label %57
56: ; preds = %66
ret void
57: ; preds = %0, %66
%58 = phi i64 [ 0, %0 ], [ %67, %66 ]
%59 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = icmp eq i32 %60, 99
br i1 %61, label %66, label %62
62: ; preds = %57
%63 = load i32, i32* @stderr
%64 = trunc i64 %58 to i32
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %64, i32 %60)
br label %66
66: ; preds = %57, %62
%67 = add nuw nsw i64 %58, 1
%68 = icmp eq i64 %67, 100
br i1 %68, label %56, label %57
}