#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*/ check_offloading();
scalar_t__ offloading_disabled();
int omp_get_default_device();
int omp_get_initial_device();
scalar_t__ omp_get_num_devices();
scalar_t__ omp_is_initial_device();
int /*<<< orphan*/ omp_set_default_device(int const);
void *omp_target_alloc(int, int);
int omp_target_associate_ptr(double *, double *, int, int, int);
int omp_target_disassociate_ptr(double *, int);
int /*<<< orphan*/ omp_target_free(void *, int);
scalar_t__ omp_target_is_present(double *, int);
int /*<<< orphan*/ omp_target_memcpy(double *, double *, int, int, int, int,
                                     int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  check_offloading();
  printf("Is%s initial device\n", omp_is_initial_device() ? "" : " not");
  printf("Initial device: %d\n", omp_get_initial_device());
  omp_set_default_device(1);
  printf("Default device before task: %d\n", omp_get_default_device());
#pragma omp task
  {
    printf("Default device inside task: %d\n", omp_get_default_device());
    omp_set_default_device(2);
    printf("Default device inside task after resetting: %d\n",
           omp_get_default_device());
  }
#pragma omp taskwait
  printf("Default device outside task: %d\n", omp_get_default_device());
  const int default_device = 0;
  omp_set_default_device(default_device);
  int default_device_omp_target_call = default_device;
  if (omp_get_num_devices() == 0) {
    default_device_omp_target_call = omp_get_initial_device();
  }
  double A[(992)], B[(992)], C[(992)], D[(992)], E[(992)];
  double *pA, *pB, *pC, *pD, *pE;
  pA = &A[0];
  pB = &B[0];
  pC = &C[0];
  pD = &D[0];
  pE = &E[0];
  {
    int i;
    for (i = 0; i < (992); i++) {
      {
        A[i] = 0;
        C[i] = 1;
        D[i] = i;
        E[i] = -i;
      }
    }
  };
  pA = pA - 10;
  pC = pC - 20;
  pD = pD - 30;
  void *device_A =
      omp_target_alloc((992) * sizeof(double), default_device_omp_target_call);
  void *device_C =
      omp_target_alloc((992) * sizeof(double), default_device_omp_target_call);
  void *device_D =
      omp_target_alloc((992) * sizeof(double), default_device_omp_target_call);
  double *dpA = (double *)device_A - 100;
  double *dpC = (double *)device_C - 200;
  double *dpD = (double *)device_D - 300;
  printf("omp_target_alloc %s\n",
         device_A && device_C && device_D ? "succeeded" : "failed");
  omp_target_memcpy(dpC, pC, (992) * sizeof(double), 200 * sizeof(double),
                    20 * sizeof(double), default_device_omp_target_call,
                    omp_get_initial_device());
  omp_target_memcpy(dpD, pD, (992) * sizeof(double), 300 * sizeof(double),
                    30 * sizeof(double), default_device_omp_target_call,
                    omp_get_initial_device());
#pragma omp target is_device_ptr(dpA, dpC, dpD) device(default_device)
  {
#pragma omp parallel for schedule(static, 1)
    for (int i = 0; i < 992; i++)
      dpA[i + 100] = dpC[i + 200] + dpD[i + 300] + 1;
  }
  omp_target_memcpy(pA, dpA, (992) * sizeof(double), 10 * sizeof(double),
                    100 * sizeof(double), omp_get_initial_device(),
                    default_device_omp_target_call);
  int fail = 0;
  {
    int i;
    int errorNum = 0;
    for (i = 0; i < (992); i++) {
      if (A[i] != (double)(i + 2)) {
        printf("Failed at %3d with %s, expected %f, got %f\n", i, "A[i]",
               (double)(i + 2), A[i]);
        fail = 1;
        if (errorNum++ > 10)
          break;
      }
    }
  };
  if (fail) {
    printf("Test omp_target_memcpy: Failed\n");
  } else {
    printf("Test omp_target_memcpy: Succeeded\n");
  }
  {
    int i;
    for (i = 0; i < (992); i++) {
      {
        A[i] = 0;
        C[i] = 1;
        D[i] = i;
        E[i] = -i;
      }
    }
  };
  if (offloading_disabled()) {
    printf("C is not present, associating it...\n");
    printf("omp_target_associate_ptr C %s\n", 1 ? "succeeded" : "failed");
  } else if (!omp_target_is_present(C, default_device_omp_target_call)) {
    printf("C is not present, associating it...\n");
    int rc = omp_target_associate_ptr(C, dpC, (992) * sizeof(double),
                                      200 * sizeof(double),
                                      default_device_omp_target_call);
    printf("omp_target_associate_ptr C %s\n", !rc ? "succeeded" : "failed");
  }
  if (offloading_disabled()) {
    printf("D is not present, associating it...\n");
    printf("omp_target_associate_ptr D %s\n", 1 ? "succeeded" : "failed");
  } else if (!omp_target_is_present(D, default_device_omp_target_call)) {
    printf("D is not present, associating it...\n");
    int rc = omp_target_associate_ptr(D, dpD, (992) * sizeof(double),
                                      300 * sizeof(double),
                                      default_device_omp_target_call);
    printf("omp_target_associate_ptr D %s\n", !rc ? "succeeded" : "failed");
  }
#pragma omp target data map(from : C, D) device(default_device)
  {
    printf("Inside target data: A is%s present\n",
           (omp_target_is_present(A, default_device_omp_target_call) &&
            !offloading_disabled())
               ? ""
               : " not");
    printf("Inside target data: C is%s present\n",
           omp_target_is_present(C, default_device_omp_target_call) ? ""
                                                                    : " not");
    printf("Inside target data: D is%s present\n",
           omp_target_is_present(D, default_device_omp_target_call) ? ""
                                                                    : " not");
#pragma omp target map(from : A) device(default_device)
    {
#pragma omp parallel for schedule(static, 1)
      for (int i = 0; i < 992; i++)
        A[i] = C[i] + D[i] + 1;
    }
  }
  if (offloading_disabled()) {
    printf("C is present, disassociating it...\n");
    printf("omp_target_disassociate_ptr C %s\n", 1 ? "succeeded" : "failed");
  } else if (omp_target_is_present(C, default_device_omp_target_call)) {
    printf("C is present, disassociating it...\n");
    int rc = omp_target_disassociate_ptr(C, default_device_omp_target_call);
    printf("omp_target_disassociate_ptr C %s\n", !rc ? "succeeded" : "failed");
  }
  if (offloading_disabled()) {
    printf("D is present, disassociating it...\n");
    printf("omp_target_disassociate_ptr D %s\n", 1 ? "succeeded" : "failed");
  } else if (omp_target_is_present(D, default_device_omp_target_call)) {
    printf("D is present, disassociating it...\n");
    int rc = omp_target_disassociate_ptr(D, default_device_omp_target_call);
    printf("omp_target_disassociate_ptr D %s\n", !rc ? "succeeded" : "failed");
  }
  fail = 0;
  {
    int i;
    int errorNum = 0;
    for (i = 0; i < (992); i++) {
      if (A[i] != (double)(i + 2)) {
        printf("Failed at %3d with %s, expected %f, got %f\n", i, "A[i]",
               (double)(i + 2), A[i]);
        fail = 1;
        if (errorNum++ > 10)
          break;
      }
    }
  };
  if (fail) {
    printf("Test omp_target_associate_ptr: Failed\n");
  } else {
    printf("Test omp_target_associate_ptr: Succeeded\n");
  }
  omp_target_free(device_A, default_device_omp_target_call);
  omp_target_free(device_C, default_device_omp_target_call);
  omp_target_free(device_D, default_device_omp_target_call);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9bf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10c0 <check_offloading@plt>
mov    $0x0,%al
call   1100 <omp_is_initial_device@plt>
mov    %rax,%rcx
lea    0xe13(%rip),%rsi
lea    0xf74(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <omp_get_initial_device@plt>
mov    %eax,%esi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <omp_set_default_device@plt>
mov    $0x0,%al
call   1060 <omp_get_default_device@plt>
mov    %eax,%esi
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <omp_get_default_device@plt>
mov    %eax,%esi
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x2,%edi
call   10b0 <omp_set_default_device@plt>
mov    $0x0,%al
call   1060 <omp_get_default_device@plt>
mov    %eax,%esi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <omp_get_default_device@plt>
mov    %eax,%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
xor    %edi,%edi
call   10b0 <omp_set_default_device@plt>
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   10d0 <omp_get_num_devices@plt>
cmp    $0x0,%rax
jne    12de <main+0xfe>
mov    $0x0,%al
call   10a0 <omp_get_initial_device@plt>
mov    %eax,-0xc(%rbp)
lea    -0x1f10(%rbp),%rax
mov    %rax,-0x9b18(%rbp)
lea    -0x3e10(%rbp),%rax
mov    %rax,-0x9b20(%rbp)
lea    -0x5d10(%rbp),%rax
mov    %rax,-0x9b28(%rbp)
lea    -0x7c10(%rbp),%rax
mov    %rax,-0x9b30(%rbp)
lea    -0x9b10(%rbp),%rax
mov    %rax,-0x9b38(%rbp)
movl   $0x0,-0x9b3c(%rbp)
cmpl   $0x3e0,-0x9b3c(%rbp)
jge    13b1 <main+0x1d1>
movslq -0x9b3c(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1f10(%rbp,%rax,8)
ff ff
movslq -0x9b3c(%rbp),%rax
movsd  0xca0(%rip),%xmm0
movsd  %xmm0,-0x5d10(%rbp,%rax,8)
ff ff
cvtsi2sdl -0x9b3c(%rbp),%xmm0
ff
movslq -0x9b3c(%rbp),%rax
movsd  %xmm0,-0x7c10(%rbp,%rax,8)
ff ff
xor    %eax,%eax
sub    -0x9b3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
movslq -0x9b3c(%rbp),%rax
movsd  %xmm0,-0x9b10(%rbp,%rax,8)
ff ff
mov    -0x9b3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9b3c(%rbp)
jmp    132e <main+0x14e>
mov    -0x9b18(%rbp),%rax
add    $0xffffffffffffffb0,%rax
mov    %rax,-0x9b18(%rbp)
mov    -0x9b28(%rbp),%rax
add    $0xffffffffffffff60,%rax
mov    %rax,-0x9b28(%rbp)
mov    -0x9b30(%rbp),%rax
add    $0xffffffffffffff10,%rax
mov    %rax,-0x9b30(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1f00,%edi
call   10f0 <omp_target_alloc@plt>
mov    %rax,-0x9b48(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1f00,%edi
call   10f0 <omp_target_alloc@plt>
mov    %rax,-0x9b50(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1f00,%edi
call   10f0 <omp_target_alloc@plt>
mov    %rax,-0x9b58(%rbp)
mov    -0x9b48(%rbp),%rax
add    $0xfffffffffffffce0,%rax
mov    %rax,-0x9b60(%rbp)
mov    -0x9b50(%rbp),%rax
add    $0xfffffffffffff9c0,%rax
mov    %rax,-0x9b68(%rbp)
mov    -0x9b58(%rbp),%rax
add    $0xfffffffffffff6a0,%rax
mov    %rax,-0x9b70(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x9b48(%rbp)
mov    %al,-0x9ba1(%rbp)
je     14a0 <main+0x2c0>
xor    %eax,%eax
cmpq   $0x0,-0x9b50(%rbp)
mov    %al,-0x9ba1(%rbp)
je     14a0 <main+0x2c0>
cmpq   $0x0,-0x9b58(%rbp)
setne  %al
mov    %al,-0x9ba1(%rbp)
mov    -0x9ba1(%rbp),%cl
lea    0xc39(%rip),%rsi
lea    0xc28(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x9b68(%rbp),%rax
mov    %rax,-0x9bd0(%rbp)
mov    -0x9b28(%rbp),%rax
mov    %rax,-0x9bc8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x9bbc(%rbp)
mov    $0x0,%al
call   10a0 <omp_get_initial_device@plt>
mov    -0x9bd0(%rbp),%rdi
mov    -0x9bc8(%rbp),%rsi
mov    -0x9bbc(%rbp),%r9d
mov    $0x1f00,%edx
mov    $0x640,%ecx
mov    $0xa0,%r8d
mov    %eax,(%rsp)
call   1040 <omp_target_memcpy@plt>
mov    -0x9b70(%rbp),%rax
mov    %rax,-0x9bb8(%rbp)
mov    -0x9b30(%rbp),%rax
mov    %rax,-0x9bb0(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x9ba8(%rbp)
mov    $0x0,%al
call   10a0 <omp_get_initial_device@plt>
mov    -0x9bb8(%rbp),%rdi
mov    -0x9bb0(%rbp),%rsi
mov    -0x9ba8(%rbp),%r9d
mov    $0x1f00,%edx
mov    $0x960,%ecx
mov    $0xf0,%r8d
mov    %eax,(%rsp)
call   1040 <omp_target_memcpy@plt>
movl   $0x0,-0x9b74(%rbp)
cmpl   $0x3e0,-0x9b74(%rbp)
jge    1603 <main+0x423>
mov    -0x9b68(%rbp),%rax
mov    -0x9b74(%rbp),%ecx
add    $0xc8,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x9b70(%rbp),%rax
mov    -0x9b74(%rbp),%ecx
add    $0x12c,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xa2d(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x9b60(%rbp),%rax
mov    -0x9b74(%rbp),%ecx
add    $0x64,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x9b74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9b74(%rbp)
jmp    1585 <main+0x3a5>
mov    -0x9b18(%rbp),%rax
mov    %rax,-0x9be0(%rbp)
mov    -0x9b60(%rbp),%rax
mov    %rax,-0x9bd8(%rbp)
mov    $0x0,%al
call   10a0 <omp_get_initial_device@plt>
mov    -0x9be0(%rbp),%rdi
mov    -0x9bd8(%rbp),%rsi
mov    %eax,%r9d
mov    -0xc(%rbp),%eax
mov    $0x1f00,%edx
mov    $0x50,%ecx
mov    $0x320,%r8d
mov    %eax,(%rsp)
call   1040 <omp_target_memcpy@plt>
movl   $0x0,-0x9b78(%rbp)
movl   $0x0,-0x9b80(%rbp)
movl   $0x0,-0x9b7c(%rbp)
cmpl   $0x3e0,-0x9b7c(%rbp)
jge    1731 <main+0x551>
movslq -0x9b7c(%rbp),%rax
movsd  -0x1f10(%rbp,%rax,8),%xmm0
ff ff
mov    -0x9b7c(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm1
ucomisd %xmm1,%xmm0
jne    16b2 <main+0x4d2>
jp     16b2 <main+0x4d2>
jmp    1718 <main+0x538>
mov    -0x9b7c(%rbp),%esi
mov    -0x9b7c(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
movslq -0x9b7c(%rbp),%rax
movsd  -0x1f10(%rbp,%rax,8),%xmm1
ff ff
lea    0xa11(%rip),%rdi
lea    0xa36(%rip),%rdx
mov    $0x2,%al
call   1050 <printf@plt>
movl   $0x1,-0x9b78(%rbp)
mov    -0x9b80(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x9b80(%rbp)
cmp    $0xa,%eax
jle    1713 <main+0x533>
jmp    1731 <main+0x551>
jmp    1718 <main+0x538>
jmp    171d <main+0x53d>
mov    -0x9b7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9b7c(%rbp)
jmp    1670 <main+0x490>
cmpl   $0x0,-0x9b78(%rbp)
je     1751 <main+0x571>
lea    0x9d9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    175f <main+0x57f>
lea    0x9e6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x9b84(%rbp)
cmpl   $0x3e0,-0x9b84(%rbp)
jge    17ec <main+0x60c>
movslq -0x9b84(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1f10(%rbp,%rax,8)
ff ff
movslq -0x9b84(%rbp),%rax
movsd  0x865(%rip),%xmm0
movsd  %xmm0,-0x5d10(%rbp,%rax,8)
ff ff
cvtsi2sdl -0x9b84(%rbp),%xmm0
ff
movslq -0x9b84(%rbp),%rax
movsd  %xmm0,-0x7c10(%rbp,%rax,8)
ff ff
xor    %eax,%eax
sub    -0x9b84(%rbp),%eax
cvtsi2sd %eax,%xmm0
movslq -0x9b84(%rbp),%rax
movsd  %xmm0,-0x9b10(%rbp,%rax,8)
ff ff
mov    -0x9b84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9b84(%rbp)
jmp    1769 <main+0x589>
mov    $0x0,%al
call   10e0 <offloading_disabled@plt>
cmp    $0x0,%rax
je     1825 <main+0x645>
lea    0x95d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x974(%rip),%rdi
lea    0x8c3(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    18a8 <main+0x6c8>
lea    -0x5d10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x0,%rax
jne    18a3 <main+0x6c3>
lea    0x91c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5d10(%rbp),%rdi
mov    -0x9b68(%rbp),%rsi
mov    -0xc(%rbp),%r8d
mov    $0x1f00,%edx
mov    $0x640,%ecx
call   1090 <omp_target_associate_ptr@plt>
mov    %eax,-0x9b88(%rbp)
cmpl   $0x0,-0x9b88(%rbp)
setne  %cl
xor    $0xff,%cl
lea    0x85f(%rip),%rsi
lea    0x84e(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0x8ea(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    18a8 <main+0x6c8>
mov    $0x0,%al
call   10e0 <offloading_disabled@plt>
cmp    $0x0,%rax
je     18e1 <main+0x701>
lea    0x8e5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x8fc(%rip),%rdi
lea    0x807(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1964 <main+0x784>
lea    -0x7c10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x0,%rax
jne    195f <main+0x77f>
lea    0x8a4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x7c10(%rbp),%rdi
mov    -0x9b70(%rbp),%rsi
mov    -0xc(%rbp),%r8d
mov    $0x1f00,%edx
mov    $0x960,%ecx
call   1090 <omp_target_associate_ptr@plt>
mov    %eax,-0x9b8c(%rbp)
cmpl   $0x0,-0x9b8c(%rbp)
setne  %cl
xor    $0xff,%cl
lea    0x7a3(%rip),%rsi
lea    0x792(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0x872(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1964 <main+0x784>
lea    -0x1f10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9be1(%rbp)
je     199e <main+0x7be>
mov    $0x0,%al
call   10e0 <offloading_disabled@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9be1(%rbp)
mov    -0x9be1(%rbp),%cl
lea    0x672(%rip),%rsi
lea    0x7d3(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0x829(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5d10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
mov    %rax,%rcx
lea    0x63d(%rip),%rsi
lea    0x79e(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0x817(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x7c10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
mov    %rax,%rcx
lea    0x607(%rip),%rsi
lea    0x768(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0x805(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x9b90(%rbp)
cmpl   $0x3e0,-0x9b90(%rbp)
jge    1a9d <main+0x8bd>
movslq -0x9b90(%rbp),%rax
movsd  -0x5d10(%rbp,%rax,8),%xmm0
ff ff
movslq -0x9b90(%rbp),%rax
addsd  -0x7c10(%rbp,%rax,8),%xmm0
ff ff
movsd  0x58b(%rip),%xmm1
addsd  %xmm1,%xmm0
movslq -0x9b90(%rbp),%rax
movsd  %xmm0,-0x1f10(%rbp,%rax,8)
ff ff
mov    -0x9b90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9b90(%rbp)
jmp    1a3d <main+0x85d>
mov    $0x0,%al
call   10e0 <offloading_disabled@plt>
cmp    $0x0,%rax
je     1ad6 <main+0x8f6>
lea    0x7a0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x7b6(%rip),%rdi
lea    0x612(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1b47 <main+0x967>
lea    -0x5d10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x0,%rax
je     1b42 <main+0x962>
lea    0x75f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5d10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <omp_target_disassociate_ptr@plt>
mov    %eax,-0x9b94(%rbp)
cmpl   $0x0,-0x9b94(%rbp)
setne  %cl
xor    $0xff,%cl
lea    0x5c0(%rip),%rsi
lea    0x5af(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0x73e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1b47 <main+0x967>
mov    $0x0,%al
call   10e0 <offloading_disabled@plt>
cmp    $0x0,%rax
je     1b80 <main+0x9a0>
lea    0x73c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x752(%rip),%rdi
lea    0x568(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1bf1 <main+0xa11>
lea    -0x7c10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x0,%rax
je     1bec <main+0xa0c>
lea    0x6fb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x7c10(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <omp_target_disassociate_ptr@plt>
mov    %eax,-0x9b98(%rbp)
cmpl   $0x0,-0x9b98(%rbp)
setne  %cl
xor    $0xff,%cl
lea    0x516(%rip),%rsi
lea    0x505(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0x6da(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1bf1 <main+0xa11>
movl   $0x0,-0x9b78(%rbp)
movl   $0x0,-0x9ba0(%rbp)
movl   $0x0,-0x9b9c(%rbp)
cmpl   $0x3e0,-0x9b9c(%rbp)
jge    1cd0 <main+0xaf0>
movslq -0x9b9c(%rbp),%rax
movsd  -0x1f10(%rbp,%rax,8),%xmm0
ff ff
mov    -0x9b9c(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm1
ucomisd %xmm1,%xmm0
jne    1c51 <main+0xa71>
jp     1c51 <main+0xa71>
jmp    1cb7 <main+0xad7>
mov    -0x9b9c(%rbp),%esi
mov    -0x9b9c(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
movslq -0x9b9c(%rbp),%rax
movsd  -0x1f10(%rbp,%rax,8),%xmm1
ff ff
lea    0x472(%rip),%rdi
lea    0x497(%rip),%rdx
mov    $0x2,%al
call   1050 <printf@plt>
movl   $0x1,-0x9b78(%rbp)
mov    -0x9ba0(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x9ba0(%rbp)
cmp    $0xa,%eax
jle    1cb2 <main+0xad2>
jmp    1cd0 <main+0xaf0>
jmp    1cb7 <main+0xad7>
jmp    1cbc <main+0xadc>
mov    -0x9b9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9b9c(%rbp)
jmp    1c0f <main+0xa2f>
cmpl   $0x0,-0x9b78(%rbp)
je     1cf0 <main+0xb10>
lea    0x5fd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1cfe <main+0xb1e>
lea    0x611(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x9b48(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <omp_target_free@plt>
mov    -0x9b50(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <omp_target_free@plt>
mov    -0x9b58(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <omp_target_free@plt>
xor    %eax,%eax
add    $0x9bf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5d38,%rsp
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
call   10e0 <check_offloading@plt>
xor    %eax,%eax
call   1120 <omp_is_initial_device@plt>
test   %rax,%rax
lea    0xe4c(%rip),%rax
lea    0xe5d(%rip),%rsi
cmove  %rax,%rsi
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10c0 <omp_get_initial_device@plt>
lea    0xe2a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <omp_set_default_device@plt>
xor    %eax,%eax
call   1070 <omp_get_default_device@plt>
lea    0xe1d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <omp_get_default_device@plt>
lea    0xe26(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2,%edi
call   10d0 <omp_set_default_device@plt>
xor    %eax,%eax
call   1070 <omp_get_default_device@plt>
lea    0xe25(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <omp_get_default_device@plt>
lea    0xe3e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10d0 <omp_set_default_device@plt>
xor    %eax,%eax
call   10f0 <omp_get_num_devices@plt>
test   %rax,%rax
jne    12ef <main+0xef>
xor    %eax,%eax
call   10c0 <omp_get_initial_device@plt>
mov    %eax,0x14(%rsp)
lea    0x3e30(%rsp),%rdi
mov    $0x1f00,%edx
xor    %esi,%esi
call   1080 <memset@plt>
movdqa 0xcf5(%rip),%xmm0
mov    $0x6,%eax
movapd 0xd08(%rip),%xmm3
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm1
paddd  0xce4(%rip),%xmm1
movapd %xmm3,0x1f00(%rsp,%rax,8)
cvtdq2pd %xmm0,%xmm2
cvtdq2pd %xmm1,%xmm1
movapd %xmm3,0x1f10(%rsp,%rax,8)
movaps %xmm2,(%rsp,%rax,8)
movaps %xmm1,0x10(%rsp,%rax,8)
movdqa %xmm0,%xmm1
paddd  0xcd5(%rip),%xmm1
movdqa %xmm0,%xmm2
paddd  0xcd9(%rip),%xmm2
movapd %xmm3,0x1f20(%rsp,%rax,8)
cvtdq2pd %xmm1,%xmm1
movapd %xmm3,0x1f30(%rsp,%rax,8)
cvtdq2pd %xmm2,%xmm2
movapd %xmm1,0x20(%rsp,%rax,8)
movapd %xmm2,0x30(%rsp,%rax,8)
paddd  0xcbb(%rip),%xmm0
add    $0x8,%rax
cmp    $0x3e6,%rax
jne    1320 <main+0x120>
mov    $0x1f00,%edi
mov    0x14(%rsp),%r14d
mov    %r14d,%esi
call   1110 <omp_target_alloc@plt>
mov    %rax,%rbx
mov    $0x1f00,%edi
mov    %r14d,%esi
call   1110 <omp_target_alloc@plt>
mov    %rax,%r15
mov    $0x1f00,%edi
mov    %r14d,%esi
call   1110 <omp_target_alloc@plt>
mov    %rax,%rbp
lea    -0x320(%rbx),%rax
mov    %rax,0x28(%rsp)
test   %rbp,%rbp
lea    0xd4c(%rip),%rcx
lea    0xd4f(%rip),%rax
mov    %rax,%rsi
cmovne %rcx,%rsi
lea    -0x640(%r15),%r13
test   %r15,%r15
cmove  %rax,%rsi
lea    -0x960(%rbp),%r12
test   %rbx,%rbx
cmove  %rax,%rsi
lea    0xd06(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10c0 <omp_get_initial_device@plt>
mov    %eax,(%rsp)
mov    %r13,0x18(%rsp)
mov    %r13,%rdi
lea    0x1e90(%rsp),%rsi
mov    $0x1f00,%edx
mov    $0x640,%ecx
mov    $0xa0,%r8d
mov    %r14d,%r9d
call   1050 <omp_target_memcpy@plt>
xor    %eax,%eax
call   10c0 <omp_get_initial_device@plt>
mov    %eax,(%rsp)
mov    %r12,0x20(%rsp)
mov    %r12,%rdi
lea    -0xc0(%rsp),%rsi
ff
mov    $0x1f00,%edx
mov    $0x960,%ecx
mov    $0xf0,%r8d
mov    %r14d,%r9d
call   1050 <omp_target_memcpy@plt>
lea    0x1f00(%rbx),%rcx
lea    0x1f00(%r15),%rax
lea    0x1f00(%rbp),%rdx
cmp    %rax,%rbx
setb   %sil
cmp    %rcx,%r15
setb   %dil
cmp    %rdx,%rbx
setb   %al
cmp    %rcx,%rbp
setb   %cl
test   %dil,%sil
jne    1522 <main+0x322>
and    %cl,%al
jne    1522 <main+0x322>
mov    $0x2,%eax
movapd 0xb4f(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movupd -0x10(%r15,%rax,8),%xmm0
movupd (%r15,%rax,8),%xmm1
movupd -0x10(%rbp,%rax,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x0(%rbp,%rax,8),%xmm0
addpd  %xmm1,%xmm0
addpd  %xmm3,%xmm2
addpd  %xmm3,%xmm0
movupd %xmm2,-0x10(%rbx,%rax,8)
movupd %xmm0,(%rbx,%rax,8)
add    $0x4,%rax
cmp    $0x3e2,%rax
jne    14e0 <main+0x2e0>
jmp    1568 <main+0x368>
mov    $0x1,%eax
movsd  0xb31(%rip),%xmm0
nop
movsd  -0x8(%r15,%rax,8),%xmm1
addsd  -0x8(%rbp,%rax,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rbx,%rax,8)
movsd  (%r15,%rax,8),%xmm1
addsd  0x0(%rbp,%rax,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
add    $0x2,%rax
cmp    $0x3e1,%rax
jne    1530 <main+0x330>
lea    0x3de0(%rsp),%r13
xor    %r12d,%r12d
xor    %eax,%eax
call   10c0 <omp_get_initial_device@plt>
mov    0x14(%rsp),%ecx
mov    %ecx,(%rsp)
mov    %r13,%rdi
mov    0x28(%rsp),%rsi
mov    $0x1f00,%edx
mov    $0x50,%ecx
mov    $0x320,%r8d
mov    %eax,%r9d
call   1050 <omp_target_memcpy@plt>
lea    0xcc4(%rip),%rdi
lea    0xb9e(%rip),%rcx
lea    0xbc3(%rip),%rdx
xor    %r13d,%r13d
add    $0x1,%r12
nopl   (%rax)
movsd  0x3e28(%rsp,%r12,8),%xmm1
lea    0x1(%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd %xmm0,%xmm1
jne    15f0 <main+0x3f0>
jp     15f0 <main+0x3f0>
add    $0x1,%r12
cmp    $0x3e1,%r12
jne    15c0 <main+0x3c0>
jmp    1635 <main+0x435>
nopl   (%rax)
lea    -0x1(%r12),%esi
mov    %rcx,%rdi
mov    %rdx,%r14
mov    $0x2,%al
call   1060 <printf@plt>
cmp    $0xa,%r13d
ja     162e <main+0x42e>
add    $0x1,%r13d
lea    0xd58(%rip),%rax
mov    %rax,%rdi
cmp    $0x3e0,%r12
lea    0xb29(%rip),%rcx
mov    %r14,%rdx
jne    15b9 <main+0x3b9>
mov    %rax,%rdi
jmp    1635 <main+0x435>
lea    0xd36(%rip),%rdi
call   1040 <puts@plt>
lea    0x3e30(%rsp),%rdi
mov    $0x1f00,%edx
xor    %esi,%esi
call   1080 <memset@plt>
movdqa 0x9aa(%rip),%xmm0
mov    $0x6,%eax
lea    0xa33(%rip),%r12
lea    0xa14(%rip),%r13
movapd 0x9af(%rip),%xmm3
movdqa 0x997(%rip),%xmm4
movdqa 0x9af(%rip),%xmm5
movdqa 0x9b7(%rip),%xmm6
movdqa 0x9bf(%rip),%xmm7
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm1
paddd  %xmm4,%xmm1
movapd %xmm3,0x1f00(%rsp,%rax,8)
cvtdq2pd %xmm0,%xmm2
cvtdq2pd %xmm1,%xmm1
movapd %xmm3,0x1f10(%rsp,%rax,8)
movaps %xmm2,(%rsp,%rax,8)
movaps %xmm1,0x10(%rsp,%rax,8)
movdqa %xmm0,%xmm1
paddd  %xmm5,%xmm1
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movapd %xmm3,0x1f20(%rsp,%rax,8)
cvtdq2pd %xmm1,%xmm1
movapd %xmm3,0x1f30(%rsp,%rax,8)
cvtdq2pd %xmm2,%xmm2
movapd %xmm1,0x20(%rsp,%rax,8)
movapd %xmm2,0x30(%rsp,%rax,8)
paddd  %xmm7,%xmm0
add    $0x8,%rax
cmp    $0x3e6,%rax
jne    16a0 <main+0x4a0>
xor    %eax,%eax
call   1100 <offloading_disabled@plt>
test   %rax,%rax
je     1740 <main+0x540>
lea    0xc23(%rip),%rdi
call   1040 <puts@plt>
lea    0xa0c(%rip),%rsi
lea    0xa47(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    175a <main+0x55a>
lea    0x1f30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   1090 <omp_target_is_present@plt>
test   %rax,%rax
je     1a35 <main+0x835>
xor    %eax,%eax
call   1100 <offloading_disabled@plt>
test   %rax,%rax
je     1789 <main+0x589>
lea    0xbb6(%rip),%rdi
call   1040 <puts@plt>
lea    0x9c3(%rip),%rsi
lea    0xa1d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    17a0 <main+0x5a0>
lea    0x30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   1090 <omp_target_is_present@plt>
test   %rax,%rax
je     1a7b <main+0x87b>
lea    0x3e30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   1090 <omp_target_is_present@plt>
mov    %r13,%rsi
test   %rax,%rax
je     17ce <main+0x5ce>
xor    %eax,%eax
call   1100 <offloading_disabled@plt>
test   %rax,%rax
lea    0x8b3(%rip),%rsi
cmove  %r12,%rsi
lea    0x9e7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x1f30(%rsp),%rdi
mov    0x14(%rsp),%r14d
mov    %r14d,%esi
call   1090 <omp_target_is_present@plt>
test   %rax,%rax
mov    %r12,%rsi
cmove  %r13,%rsi
lea    0x9de(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x30(%rsp),%rdi
mov    %r14d,%esi
call   1090 <omp_target_is_present@plt>
test   %rax,%rax
cmove  %r13,%r12
lea    0x9e0(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x6,%eax
movapd 0x7e5(%rip),%xmm4
nopl   0x0(%rax,%rax,1)
movapd 0x1f00(%rsp,%rax,8),%xmm0
movapd 0x1f10(%rsp,%rax,8),%xmm1
movapd 0x1f20(%rsp,%rax,8),%xmm2
movapd 0x1f30(%rsp,%rax,8),%xmm3
addpd  (%rsp,%rax,8),%xmm0
addpd  0x10(%rsp,%rax,8),%xmm1
addpd  %xmm4,%xmm0
addpd  %xmm4,%xmm1
movapd %xmm0,0x3e00(%rsp,%rax,8)
movapd %xmm1,0x3e10(%rsp,%rax,8)
addpd  0x20(%rsp,%rax,8),%xmm2
addpd  0x30(%rsp,%rax,8),%xmm3
addpd  %xmm4,%xmm2
addpd  %xmm4,%xmm3
movapd %xmm2,0x3e20(%rsp,%rax,8)
movapd %xmm3,0x3e30(%rsp,%rax,8)
add    $0x8,%rax
cmp    $0x3e6,%rax
jne    1840 <main+0x640>
xor    %eax,%eax
call   1100 <offloading_disabled@plt>
test   %rax,%rax
je     18dc <main+0x6dc>
lea    0xa32(%rip),%rdi
call   1040 <puts@plt>
lea    0x862(%rip),%rsi
jmp    1923 <main+0x723>
lea    0x1f30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   1090 <omp_target_is_present@plt>
test   %rax,%rax
je     1931 <main+0x731>
lea    0xa07(%rip),%rdi
call   1040 <puts@plt>
lea    0x1f30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   10a0 <omp_target_disassociate_ptr@plt>
test   %eax,%eax
lea    0x824(%rip),%rsi
lea    0x827(%rip),%rax
cmovne %rax,%rsi
lea    0x8fe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1100 <offloading_disabled@plt>
test   %rax,%rax
je     1952 <main+0x752>
lea    0x999(%rip),%rdi
call   1040 <puts@plt>
lea    0x7ec(%rip),%rsi
jmp    1993 <main+0x793>
lea    0x30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   1090 <omp_target_is_present@plt>
test   %rax,%rax
je     19a1 <main+0x7a1>
lea    0x971(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rdi
mov    0x14(%rsp),%esi
call   10a0 <omp_target_disassociate_ptr@plt>
test   %eax,%eax
lea    0x7b4(%rip),%rax
lea    0x7b7(%rip),%rsi
cmove  %rax,%rsi
lea    0x8b0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x8e6(%rip),%rdi
xor    %r12d,%r12d
lea    0x79b(%rip),%rcx
lea    0x7c0(%rip),%rdx
xor    %r13d,%r13d
add    $0x1,%r12
movsd  0x3e28(%rsp,%r12,8),%xmm1
lea    0x1(%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd %xmm0,%xmm1
jne    19f0 <main+0x7f0>
jp     19f0 <main+0x7f0>
add    $0x1,%r12
cmp    $0x3e1,%r12
jne    19c0 <main+0x7c0>
jmp    1ac5 <main+0x8c5>
lea    -0x1(%r12),%esi
mov    %rcx,%rdi
mov    %rdx,%r14
mov    $0x2,%al
call   1060 <printf@plt>
cmp    $0xa,%r13d
ja     1abe <main+0x8be>
add    $0x1,%r13d
lea    0x8a0(%rip),%rax
mov    %rax,%rdi
cmp    $0x3e0,%r12
lea    0x725(%rip),%rcx
mov    %r14,%rdx
jne    19bc <main+0x7bc>
mov    %rax,%rdi
jmp    1ac5 <main+0x8c5>
lea    0x90b(%rip),%rdi
call   1040 <puts@plt>
lea    0x1f30(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    $0x1f00,%edx
mov    $0x640,%ecx
mov    0x14(%rsp),%r8d
call   10b0 <omp_target_associate_ptr@plt>
test   %eax,%eax
lea    0x6d1(%rip),%rsi
lea    0x6d4(%rip),%rax
cmovne %rax,%rsi
jmp    1730 <main+0x530>
lea    0x8a1(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rdi
mov    0x20(%rsp),%rsi
mov    $0x1f00,%edx
mov    $0x960,%ecx
mov    0x14(%rsp),%r8d
call   10b0 <omp_target_associate_ptr@plt>
test   %eax,%eax
lea    0x68e(%rip),%rsi
lea    0x691(%rip),%rax
cmovne %rax,%rsi
jmp    1779 <main+0x579>
lea    0x7f2(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    0x14(%rsp),%ebx
mov    %ebx,%esi
call   1030 <omp_target_free@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <omp_target_free@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1030 <omp_target_free@plt>
xor    %eax,%eax
add    $0x5d38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Is%s initial device\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c" not\00"
@.str.3 = [20 x i8] c"Initial device: %d\0A\00"
@.str.4 = [32 x i8] c"Default device before task: %d\0A\00"
@.str.5 = [32 x i8] c"Default device inside task: %d\0A\00"
@.str.6 = [48 x i8] c"Default device inside task after resetting: %d\0A\00"
@.str.7 = [33 x i8] c"Default device outside task: %d\0A\00"
@.str.8 = [21 x i8] c"omp_target_alloc %s\0A\00"
@.str.9 = [10 x i8] c"succeeded\00"
@.str.10 = [7 x i8] c"failed\00"
@.str.11 = [44 x i8] c"Failed at %3d with %s, expected %f, got %f\0A\00"
@.str.12 = [5 x i8] c"A[i]\00"
@.str.13 = [32 x i8] c"Test omp_target_memcpy: Failed\0A\00"
@.str.14 = [35 x i8] c"Test omp_target_memcpy: Succeeded\0A\00"
@.str.15 = [37 x i8] c"C is not present, associating it...\0A\00"
@.str.16 = [31 x i8] c"omp_target_associate_ptr C %s\0A\00"
@.str.17 = [37 x i8] c"D is not present, associating it...\0A\00"
@.str.18 = [31 x i8] c"omp_target_associate_ptr D %s\0A\00"
@.str.19 = [36 x i8] c"Inside target data: A is%s present\0A\00"
@.str.20 = [36 x i8] c"Inside target data: C is%s present\0A\00"
@.str.21 = [36 x i8] c"Inside target data: D is%s present\0A\00"
@.str.22 = [36 x i8] c"C is present, disassociating it...\0A\00"
@.str.23 = [34 x i8] c"omp_target_disassociate_ptr C %s\0A\00"
@.str.24 = [36 x i8] c"D is present, disassociating it...\0A\00"
@.str.25 = [34 x i8] c"omp_target_disassociate_ptr D %s\0A\00"
@.str.26 = [39 x i8] c"Test omp_target_associate_ptr: Failed\0A\00"
@.str.27 = [42 x i8] c"Test omp_target_associate_ptr: Succeeded\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [992 x double]
%5 = alloca [992 x double]
%6 = alloca [992 x double]
%7 = alloca [992 x double]
%8 = alloca [992 x double]
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
store i32 0, i32* %1
%33 = call i32 (...) @check_offloading()
%34 = call i64 (...) @omp_is_initial_device()
%35 = icmp ne i64 %34, 0
%36 = zext i1 %35 to i64
%37 = select i1 %35, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %37)
%39 = call i32 (...) @omp_get_initial_device()
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = call i32 @omp_set_default_device(i32 1)
%42 = call i32 (...) @omp_get_default_device()
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %42)
%44 = call i32 (...) @omp_get_default_device()
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%46 = call i32 @omp_set_default_device(i32 2)
%47 = call i32 (...) @omp_get_default_device()
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %47)
%49 = call i32 (...) @omp_get_default_device()
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %49)
store i32 0, i32* %2
%51 = call i32 @omp_set_default_device(i32 0)
store i32 0, i32* %3
%52 = call i64 (...) @omp_get_num_devices()
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %0
%55 = call i32 (...) @omp_get_initial_device()
store i32 %55, i32* %3
br label %56
56: ; preds = %54, %0
%57 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 0
store double* %57, double** %9
%58 = getelementptr inbounds [992 x double], [992 x double]* %5, i64 0, i64 0
store double* %58, double** %10
%59 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 0
store double* %59, double** %11
%60 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 0
store double* %60, double** %12
%61 = getelementptr inbounds [992 x double], [992 x double]* %8, i64 0, i64 0
store double* %61, double** %13
store i32 0, i32* %14
br label %62
62: ; preds = %83, %56
%63 = load i32, i32* %14
%64 = icmp slt i32 %63, 992
br i1 %64, label %65, label %86
65: ; preds = %62
%66 = load i32, i32* %14
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %67
store double 0.000000e+00, double* %68
%69 = load i32, i32* %14
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 %70
store double 1.000000e+00, double* %71
%72 = load i32, i32* %14
%73 = sitofp i32 %72 to double
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 %75
store double %73, double* %76
%77 = load i32, i32* %14
%78 = sub nsw i32 0, %77
%79 = sitofp i32 %78 to double
%80 = load i32, i32* %14
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [992 x double], [992 x double]* %8, i64 0, i64 %81
store double %79, double* %82
br label %83
83: ; preds = %65
%84 = load i32, i32* %14
%85 = add nsw i32 %84, 1
store i32 %85, i32* %14
br label %62
86: ; preds = %62
%87 = load double*, double** %9
%88 = getelementptr inbounds double, double* %87, i64 -10
store double* %88, double** %9
%89 = load double*, double** %11
%90 = getelementptr inbounds double, double* %89, i64 -20
store double* %90, double** %11
%91 = load double*, double** %12
%92 = getelementptr inbounds double, double* %91, i64 -30
store double* %92, double** %12
%93 = load i32, i32* %3
%94 = call i8* @omp_target_alloc(i32 7936, i32 %93)
store i8* %94, i8** %15
%95 = load i32, i32* %3
%96 = call i8* @omp_target_alloc(i32 7936, i32 %95)
store i8* %96, i8** %16
%97 = load i32, i32* %3
%98 = call i8* @omp_target_alloc(i32 7936, i32 %97)
store i8* %98, i8** %17
%99 = load i8*, i8** %15
%100 = bitcast i8* %99 to double*
%101 = getelementptr inbounds double, double* %100, i64 -100
store double* %101, double** %18
%102 = load i8*, i8** %16
%103 = bitcast i8* %102 to double*
%104 = getelementptr inbounds double, double* %103, i64 -200
store double* %104, double** %19
%105 = load i8*, i8** %17
%106 = bitcast i8* %105 to double*
%107 = getelementptr inbounds double, double* %106, i64 -300
store double* %107, double** %20
%108 = load i8*, i8** %15
%109 = icmp ne i8* %108, null
br i1 %109, label %110, label %116
110: ; preds = %86
%111 = load i8*, i8** %16
%112 = icmp ne i8* %111, null
br i1 %112, label %113, label %116
113: ; preds = %110
%114 = load i8*, i8** %17
%115 = icmp ne i8* %114, null
br label %116
116: ; preds = %113, %110, %86
%117 = phi i1 [ false, %110 ], [ false, %86 ], [ %115, %113 ]
%118 = zext i1 %117 to i64
%119 = select i1 %117, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %119)
%121 = load double*, double** %19
%122 = load double*, double** %11
%123 = load i32, i32* %3
%124 = call i32 (...) @omp_get_initial_device()
%125 = call i32 @omp_target_memcpy(double* %121, double* %122, i32 7936, i32 1600, i32 160, i32 %123, i32 %124)
%126 = load double*, double** %20
%127 = load double*, double** %12
%128 = load i32, i32* %3
%129 = call i32 (...) @omp_get_initial_device()
%130 = call i32 @omp_target_memcpy(double* %126, double* %127, i32 7936, i32 2400, i32 240, i32 %128, i32 %129)
store i32 0, i32* %21
br label %131
131: ; preds = %154, %116
%132 = load i32, i32* %21
%133 = icmp slt i32 %132, 992
br i1 %133, label %134, label %157
134: ; preds = %131
%135 = load double*, double** %19
%136 = load i32, i32* %21
%137 = add nsw i32 %136, 200
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %135, i64 %138
%140 = load double, double* %139
%141 = load double*, double** %20
%142 = load i32, i32* %21
%143 = add nsw i32 %142, 300
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %141, i64 %144
%146 = load double, double* %145
%147 = fadd double %140, %146
%148 = fadd double %147, 1.000000e+00
%149 = load double*, double** %18
%150 = load i32, i32* %21
%151 = add nsw i32 %150, 100
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %149, i64 %152
store double %148, double* %153
br label %154
154: ; preds = %134
%155 = load i32, i32* %21
%156 = add nsw i32 %155, 1
store i32 %156, i32* %21
br label %131
157: ; preds = %131
%158 = load double*, double** %9
%159 = load double*, double** %18
%160 = call i32 (...) @omp_get_initial_device()
%161 = load i32, i32* %3
%162 = call i32 @omp_target_memcpy(double* %158, double* %159, i32 7936, i32 80, i32 800, i32 %160, i32 %161)
store i32 0, i32* %22
store i32 0, i32* %24
store i32 0, i32* %23
br label %163
163: ; preds = %191, %157
%164 = load i32, i32* %23
%165 = icmp slt i32 %164, 992
br i1 %165, label %166, label %194
166: ; preds = %163
%167 = load i32, i32* %23
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %168
%170 = load double, double* %169
%171 = load i32, i32* %23
%172 = add nsw i32 %171, 2
%173 = sitofp i32 %172 to double
%174 = fcmp une double %170, %173
br i1 %174, label %175, label %190
175: ; preds = %166
%176 = load i32, i32* %23
%177 = load i32, i32* %23
%178 = add nsw i32 %177, 2
%179 = sitofp i32 %178 to double
%180 = load i32, i32* %23
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %181
%183 = load double, double* %182
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %176, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), double %179, double %183)
store i32 1, i32* %22
%185 = load i32, i32* %24
%186 = add nsw i32 %185, 1
store i32 %186, i32* %24
%187 = icmp sgt i32 %185, 10
br i1 %187, label %188, label %189
188: ; preds = %175
br label %194
189: ; preds = %175
br label %190
190: ; preds = %189, %166
br label %191
191: ; preds = %190
%192 = load i32, i32* %23
%193 = add nsw i32 %192, 1
store i32 %193, i32* %23
br label %163
194: ; preds = %188, %163
%195 = load i32, i32* %22
%196 = icmp ne i32 %195, 0
br i1 %196, label %197, label %199
197: ; preds = %194
%198 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0))
br label %201
199: ; preds = %194
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
br label %201
201: ; preds = %199, %197
store i32 0, i32* %25
br label %202
202: ; preds = %223, %201
%203 = load i32, i32* %25
%204 = icmp slt i32 %203, 992
br i1 %204, label %205, label %226
205: ; preds = %202
%206 = load i32, i32* %25
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %207
store double 0.000000e+00, double* %208
%209 = load i32, i32* %25
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 %210
store double 1.000000e+00, double* %211
%212 = load i32, i32* %25
%213 = sitofp i32 %212 to double
%214 = load i32, i32* %25
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 %215
store double %213, double* %216
%217 = load i32, i32* %25
%218 = sub nsw i32 0, %217
%219 = sitofp i32 %218 to double
%220 = load i32, i32* %25
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [992 x double], [992 x double]* %8, i64 0, i64 %221
store double %219, double* %222
br label %223
223: ; preds = %205
%224 = load i32, i32* %25
%225 = add nsw i32 %224, 1
store i32 %225, i32* %25
br label %202
226: ; preds = %202
%227 = call i64 (...) @offloading_disabled()
%228 = icmp ne i64 %227, 0
br i1 %228, label %229, label %232
229: ; preds = %226
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0))
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %250
232: ; preds = %226
%233 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 0
%234 = load i32, i32* %3
%235 = call i64 @omp_target_is_present(double* %233, i32 %234)
%236 = icmp ne i64 %235, 0
br i1 %236, label %249, label %237
237: ; preds = %232
%238 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0))
%239 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 0
%240 = load double*, double** %19
%241 = load i32, i32* %3
%242 = call i32 @omp_target_associate_ptr(double* %239, double* %240, i32 7936, i32 1600, i32 %241)
store i32 %242, i32* %26
%243 = load i32, i32* %26
%244 = icmp ne i32 %243, 0
%245 = xor i1 %244, true
%246 = zext i1 %245 to i64
%247 = select i1 %245, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%248 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %247)
br label %249
249: ; preds = %237, %232
br label %250
250: ; preds = %249, %229
%251 = call i64 (...) @offloading_disabled()
%252 = icmp ne i64 %251, 0
br i1 %252, label %253, label %256
253: ; preds = %250
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.17, i64 0, i64 0))
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %274
256: ; preds = %250
%257 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 0
%258 = load i32, i32* %3
%259 = call i64 @omp_target_is_present(double* %257, i32 %258)
%260 = icmp ne i64 %259, 0
br i1 %260, label %273, label %261
261: ; preds = %256
%262 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.17, i64 0, i64 0))
%263 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 0
%264 = load double*, double** %20
%265 = load i32, i32* %3
%266 = call i32 @omp_target_associate_ptr(double* %263, double* %264, i32 7936, i32 2400, i32 %265)
store i32 %266, i32* %27
%267 = load i32, i32* %27
%268 = icmp ne i32 %267, 0
%269 = xor i1 %268, true
%270 = zext i1 %269 to i64
%271 = select i1 %269, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%272 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.18, i64 0, i64 0), i8* %271)
br label %273
273: ; preds = %261, %256
br label %274
274: ; preds = %273, %253
%275 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 0
%276 = load i32, i32* %3
%277 = call i64 @omp_target_is_present(double* %275, i32 %276)
%278 = icmp ne i64 %277, 0
br i1 %278, label %279, label %283
279: ; preds = %274
%280 = call i64 (...) @offloading_disabled()
%281 = icmp ne i64 %280, 0
%282 = xor i1 %281, true
br label %283
283: ; preds = %279, %274
%284 = phi i1 [ false, %274 ], [ %282, %279 ]
%285 = zext i1 %284 to i64
%286 = select i1 %284, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%287 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i8* %286)
%288 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 0
%289 = load i32, i32* %3
%290 = call i64 @omp_target_is_present(double* %288, i32 %289)
%291 = icmp ne i64 %290, 0
%292 = zext i1 %291 to i64
%293 = select i1 %291, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%294 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* %293)
%295 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 0
%296 = load i32, i32* %3
%297 = call i64 @omp_target_is_present(double* %295, i32 %296)
%298 = icmp ne i64 %297, 0
%299 = zext i1 %298 to i64
%300 = select i1 %298, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%301 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i64 0, i64 0), i8* %300)
store i32 0, i32* %28
br label %302
302: ; preds = %319, %283
%303 = load i32, i32* %28
%304 = icmp slt i32 %303, 992
br i1 %304, label %305, label %322
305: ; preds = %302
%306 = load i32, i32* %28
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 %307
%309 = load double, double* %308
%310 = load i32, i32* %28
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 %311
%313 = load double, double* %312
%314 = fadd double %309, %313
%315 = fadd double %314, 1.000000e+00
%316 = load i32, i32* %28
%317 = sext i32 %316 to i64
%318 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %317
store double %315, double* %318
br label %319
319: ; preds = %305
%320 = load i32, i32* %28
%321 = add nsw i32 %320, 1
store i32 %321, i32* %28
br label %302
322: ; preds = %302
%323 = call i64 (...) @offloading_disabled()
%324 = icmp ne i64 %323, 0
br i1 %324, label %325, label %328
325: ; preds = %322
%326 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.22, i64 0, i64 0))
%327 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %345
328: ; preds = %322
%329 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 0
%330 = load i32, i32* %3
%331 = call i64 @omp_target_is_present(double* %329, i32 %330)
%332 = icmp ne i64 %331, 0
br i1 %332, label %333, label %344
333: ; preds = %328
%334 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.22, i64 0, i64 0))
%335 = getelementptr inbounds [992 x double], [992 x double]* %6, i64 0, i64 0
%336 = load i32, i32* %3
%337 = call i32 @omp_target_disassociate_ptr(double* %335, i32 %336)
store i32 %337, i32* %29
%338 = load i32, i32* %29
%339 = icmp ne i32 %338, 0
%340 = xor i1 %339, true
%341 = zext i1 %340 to i64
%342 = select i1 %340, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%343 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0), i8* %342)
br label %344
344: ; preds = %333, %328
br label %345
345: ; preds = %344, %325
%346 = call i64 (...) @offloading_disabled()
%347 = icmp ne i64 %346, 0
br i1 %347, label %348, label %351
348: ; preds = %345
%349 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0))
%350 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %368
351: ; preds = %345
%352 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 0
%353 = load i32, i32* %3
%354 = call i64 @omp_target_is_present(double* %352, i32 %353)
%355 = icmp ne i64 %354, 0
br i1 %355, label %356, label %367
356: ; preds = %351
%357 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0))
%358 = getelementptr inbounds [992 x double], [992 x double]* %7, i64 0, i64 0
%359 = load i32, i32* %3
%360 = call i32 @omp_target_disassociate_ptr(double* %358, i32 %359)
store i32 %360, i32* %30
%361 = load i32, i32* %30
%362 = icmp ne i32 %361, 0
%363 = xor i1 %362, true
%364 = zext i1 %363 to i64
%365 = select i1 %363, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%366 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.25, i64 0, i64 0), i8* %365)
br label %367
367: ; preds = %356, %351
br label %368
368: ; preds = %367, %348
store i32 0, i32* %22
store i32 0, i32* %32
store i32 0, i32* %31
br label %369
369: ; preds = %397, %368
%370 = load i32, i32* %31
%371 = icmp slt i32 %370, 992
br i1 %371, label %372, label %400
372: ; preds = %369
%373 = load i32, i32* %31
%374 = sext i32 %373 to i64
%375 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %374
%376 = load double, double* %375
%377 = load i32, i32* %31
%378 = add nsw i32 %377, 2
%379 = sitofp i32 %378 to double
%380 = fcmp une double %376, %379
br i1 %380, label %381, label %396
381: ; preds = %372
%382 = load i32, i32* %31
%383 = load i32, i32* %31
%384 = add nsw i32 %383, 2
%385 = sitofp i32 %384 to double
%386 = load i32, i32* %31
%387 = sext i32 %386 to i64
%388 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %387
%389 = load double, double* %388
%390 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %382, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), double %385, double %389)
store i32 1, i32* %22
%391 = load i32, i32* %32
%392 = add nsw i32 %391, 1
store i32 %392, i32* %32
%393 = icmp sgt i32 %391, 10
br i1 %393, label %394, label %395
394: ; preds = %381
br label %400
395: ; preds = %381
br label %396
396: ; preds = %395, %372
br label %397
397: ; preds = %396
%398 = load i32, i32* %31
%399 = add nsw i32 %398, 1
store i32 %399, i32* %31
br label %369
400: ; preds = %394, %369
%401 = load i32, i32* %22
%402 = icmp ne i32 %401, 0
br i1 %402, label %403, label %405
403: ; preds = %400
%404 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.26, i64 0, i64 0))
br label %407
405: ; preds = %400
%406 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.27, i64 0, i64 0))
br label %407
407: ; preds = %405, %403
%408 = load i8*, i8** %15
%409 = load i32, i32* %3
%410 = call i32 @omp_target_free(i8* %408, i32 %409)
%411 = load i8*, i8** %16
%412 = load i32, i32* %3
%413 = call i32 @omp_target_free(i8* %411, i32 %412)
%414 = load i8*, i8** %17
%415 = load i32, i32* %3
%416 = call i32 @omp_target_free(i8* %414, i32 %415)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Is%s initial device\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c" not\00"
@.str.3 = [20 x i8] c"Initial device: %d\0A\00"
@.str.4 = [32 x i8] c"Default device before task: %d\0A\00"
@.str.5 = [32 x i8] c"Default device inside task: %d\0A\00"
@.str.6 = [48 x i8] c"Default device inside task after resetting: %d\0A\00"
@.str.7 = [33 x i8] c"Default device outside task: %d\0A\00"
@.str.8 = [21 x i8] c"omp_target_alloc %s\0A\00"
@.str.9 = [10 x i8] c"succeeded\00"
@.str.10 = [7 x i8] c"failed\00"
@.str.11 = [44 x i8] c"Failed at %3d with %s, expected %f, got %f\0A\00"
@.str.12 = [5 x i8] c"A[i]\00"
@.str.16 = [31 x i8] c"omp_target_associate_ptr C %s\0A\00"
@.str.18 = [31 x i8] c"omp_target_associate_ptr D %s\0A\00"
@.str.19 = [36 x i8] c"Inside target data: A is%s present\0A\00"
@.str.20 = [36 x i8] c"Inside target data: C is%s present\0A\00"
@.str.21 = [36 x i8] c"Inside target data: D is%s present\0A\00"
@.str.23 = [34 x i8] c"omp_target_disassociate_ptr C %s\0A\00"
@.str.25 = [34 x i8] c"omp_target_disassociate_ptr D %s\0A\00"
@str = [34 x i8] c"Test omp_target_memcpy: Succeeded\00"
@str.30 = [41 x i8] c"Test omp_target_associate_ptr: Succeeded\00"
@str.31 = [38 x i8] c"Test omp_target_associate_ptr: Failed\00"
@str.33 = [35 x i8] c"D is present, disassociating it...\00"
@str.35 = [35 x i8] c"C is present, disassociating it...\00"
@str.36 = [36 x i8] c"D is not present, associating it...\00"
@str.37 = [36 x i8] c"C is not present, associating it...\00"
@str.38 = [31 x i8] c"Test omp_target_memcpy: Failed\00"
define i32 @main() {
%1 = alloca [992 x double]
%2 = bitcast [992 x double]* %1 to i8*
%3 = alloca [992 x double]
%4 = alloca [992 x double]
%5 = tail call i32 (...) @check_offloading()
%6 = tail call i64 (...) @omp_is_initial_device()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 (...) @omp_get_initial_device()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = tail call i32 @omp_set_default_device(i32 1)
%13 = tail call i32 (...) @omp_get_default_device()
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%15 = tail call i32 (...) @omp_get_default_device()
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%17 = tail call i32 @omp_set_default_device(i32 2)
%18 = tail call i32 (...) @omp_get_default_device()
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%20 = tail call i32 (...) @omp_get_default_device()
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %20)
%22 = tail call i32 @omp_set_default_device(i32 0)
%23 = tail call i64 (...) @omp_get_num_devices()
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %0
%26 = tail call i32 (...) @omp_get_initial_device()
br label %27
27: ; preds = %25, %0
%28 = phi i32 [ %26, %25 ], [ 0, %0 ]
%29 = bitcast [992 x double]* %3 to i8*
%30 = bitcast [992 x double]* %4 to i8*
%31 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 0
br label %32
32: ; preds = %32, %27
%33 = phi i64 [ 0, %27 ], [ %59, %32 ]
%34 = phi <2 x i32> [ <i32 0, i32 1>, %27 ], [ %60, %32 ]
%35 = add <2 x i32> %34, <i32 2, i32 2>
%36 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 %33
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %37
%38 = getelementptr inbounds double, double* %36, i64 2
%39 = bitcast double* %38 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %39
%40 = sitofp <2 x i32> %34 to <2 x double>
%41 = sitofp <2 x i32> %35 to <2 x double>
%42 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %33
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %40, <2 x double>* %43
%44 = getelementptr inbounds double, double* %42, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %41, <2 x double>* %45
%46 = or i64 %33, 4
%47 = add <2 x i32> %34, <i32 4, i32 4>
%48 = add <2 x i32> %34, <i32 6, i32 6>
%49 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 %46
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %50
%51 = getelementptr inbounds double, double* %49, i64 2
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %52
%53 = sitofp <2 x i32> %47 to <2 x double>
%54 = sitofp <2 x i32> %48 to <2 x double>
%55 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %46
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %53, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %54, <2 x double>* %58
%59 = add nuw nsw i64 %33, 8
%60 = add <2 x i32> %34, <i32 8, i32 8>
%61 = icmp eq i64 %59, 992
br i1 %61, label %62, label %32
62: ; preds = %32
%63 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 0
%64 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 -20
%65 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 -30
%66 = tail call i8* @omp_target_alloc(i32 7936, i32 %28)
%67 = tail call i8* @omp_target_alloc(i32 7936, i32 %28)
%68 = tail call i8* @omp_target_alloc(i32 7936, i32 %28)
%69 = getelementptr inbounds i8, i8* %66, i64 -800
%70 = bitcast i8* %69 to double*
%71 = getelementptr inbounds i8, i8* %67, i64 -1600
%72 = bitcast i8* %71 to double*
%73 = getelementptr inbounds i8, i8* %68, i64 -2400
%74 = bitcast i8* %73 to double*
%75 = icmp ne i8* %66, null
%76 = icmp ne i8* %67, null
%77 = select i1 %75, i1 %76, i1 false
%78 = icmp ne i8* %68, null
%79 = select i1 %77, i1 %78, i1 false
%80 = select i1 %79, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %80)
%82 = tail call i32 (...) @omp_get_initial_device()
%83 = call i32 @omp_target_memcpy(double* %72, double* %64, i32 7936, i32 1600, i32 160, i32 %28, i32 %82)
%84 = call i32 (...) @omp_get_initial_device()
%85 = call i32 @omp_target_memcpy(double* %74, double* %65, i32 7936, i32 2400, i32 240, i32 %28, i32 %84)
%86 = getelementptr i8, i8* %66, i64 7936
%87 = getelementptr i8, i8* %67, i64 7936
%88 = getelementptr i8, i8* %68, i64 7936
%89 = icmp ult i8* %66, %87
%90 = icmp ult i8* %67, %86
%91 = and i1 %89, %90
%92 = icmp ult i8* %66, %88
%93 = icmp ult i8* %68, %86
%94 = and i1 %92, %93
%95 = or i1 %91, %94
br i1 %95, label %132, label %96
96: ; preds = %62, %96
%97 = phi i64 [ %121, %96 ], [ 0, %62 ]
%98 = add nuw nsw i64 %97, 200
%99 = getelementptr inbounds double, double* %72, i64 %98
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %99, i64 2
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = add nuw nsw i64 %97, 300
%106 = getelementptr inbounds double, double* %74, i64 %105
%107 = bitcast double* %106 to <2 x double>*
%108 = load <2 x double>, <2 x double>* %107
%109 = getelementptr inbounds double, double* %106, i64 2
%110 = bitcast double* %109 to <2 x double>*
%111 = load <2 x double>, <2 x double>* %110
%112 = fadd <2 x double> %101, %108
%113 = fadd <2 x double> %104, %111
%114 = fadd <2 x double> %112, <double 1.000000e+00, double 1.000000e+00>
%115 = fadd <2 x double> %113, <double 1.000000e+00, double 1.000000e+00>
%116 = add nuw nsw i64 %97, 100
%117 = getelementptr inbounds double, double* %70, i64 %116
%118 = bitcast double* %117 to <2 x double>*
store <2 x double> %114, <2 x double>* %118
%119 = getelementptr inbounds double, double* %117, i64 2
%120 = bitcast double* %119 to <2 x double>*
store <2 x double> %115, <2 x double>* %120
%121 = add nuw i64 %97, 4
%122 = icmp eq i64 %121, 992
br i1 %122, label %123, label %96
123: ; preds = %96, %132
%124 = getelementptr inbounds [992 x double], [992 x double]* %1, i64 0, i64 0
%125 = getelementptr inbounds [992 x double], [992 x double]* %1, i64 0, i64 -10
%126 = call i32 (...) @omp_get_initial_device()
%127 = call i32 @omp_target_memcpy(double* %125, double* %70, i32 7936, i32 80, i32 800, i32 %126, i32 %28)
br label %128
128: ; preds = %164, %123
%129 = phi i64 [ 0, %123 ], [ %169, %164 ]
%130 = phi i32 [ 0, %123 ], [ %167, %164 ]
%131 = phi i8* [ getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0), %123 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @str.38, i64 0, i64 0), %164 ]
br label %156
132: ; preds = %62, %132
%133 = phi i64 [ %154, %132 ], [ 0, %62 ]
%134 = add nuw nsw i64 %133, 200
%135 = getelementptr inbounds double, double* %72, i64 %134
%136 = load double, double* %135
%137 = add nuw nsw i64 %133, 300
%138 = getelementptr inbounds double, double* %74, i64 %137
%139 = load double, double* %138
%140 = fadd double %136, %139
%141 = fadd double %140, 1.000000e+00
%142 = add nuw nsw i64 %133, 100
%143 = getelementptr inbounds double, double* %70, i64 %142
store double %141, double* %143
%144 = add nuw nsw i64 %133, 201
%145 = getelementptr inbounds double, double* %72, i64 %144
%146 = load double, double* %145
%147 = add nuw nsw i64 %133, 301
%148 = getelementptr inbounds double, double* %74, i64 %147
%149 = load double, double* %148
%150 = fadd double %146, %149
%151 = fadd double %150, 1.000000e+00
%152 = add nuw nsw i64 %133, 101
%153 = getelementptr inbounds double, double* %70, i64 %152
store double %151, double* %153
%154 = add nuw nsw i64 %133, 2
%155 = icmp eq i64 %154, 992
br i1 %155, label %123, label %132
156: ; preds = %128, %172
%157 = phi i64 [ %173, %172 ], [ %129, %128 ]
%158 = getelementptr inbounds [992 x double], [992 x double]* %1, i64 0, i64 %157
%159 = load double, double* %158
%160 = trunc i64 %157 to i32
%161 = add i32 %160, 2
%162 = sitofp i32 %161 to double
%163 = fcmp une double %159, %162
br i1 %163, label %164, label %172
164: ; preds = %156
%165 = trunc i64 %157 to i32
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %165, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), double %162, double %159)
%167 = add nuw nsw i32 %130, 1
%168 = icmp ugt i32 %130, 10
%169 = add nuw nsw i64 %157, 1
%170 = icmp eq i64 %169, 992
%171 = select i1 %168, i1 true, i1 %170
br i1 %171, label %175, label %128
172: ; preds = %156
%173 = add nuw nsw i64 %157, 1
%174 = icmp eq i64 %173, 992
br i1 %174, label %175, label %156
175: ; preds = %164, %172
%176 = phi i8* [ %131, %172 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @str.38, i64 0, i64 0), %164 ]
%177 = call i32 @puts(i8* dereferenceable(1) %176)
br label %178
178: ; preds = %178, %175
%179 = phi i64 [ 0, %175 ], [ %205, %178 ]
%180 = phi <2 x i32> [ <i32 0, i32 1>, %175 ], [ %206, %178 ]
%181 = add <2 x i32> %180, <i32 2, i32 2>
%182 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 %179
%183 = bitcast double* %182 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %183
%184 = getelementptr inbounds double, double* %182, i64 2
%185 = bitcast double* %184 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %185
%186 = sitofp <2 x i32> %180 to <2 x double>
%187 = sitofp <2 x i32> %181 to <2 x double>
%188 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %179
%189 = bitcast double* %188 to <2 x double>*
store <2 x double> %186, <2 x double>* %189
%190 = getelementptr inbounds double, double* %188, i64 2
%191 = bitcast double* %190 to <2 x double>*
store <2 x double> %187, <2 x double>* %191
%192 = or i64 %179, 4
%193 = add <2 x i32> %180, <i32 4, i32 4>
%194 = add <2 x i32> %180, <i32 6, i32 6>
%195 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 %192
%196 = bitcast double* %195 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %196
%197 = getelementptr inbounds double, double* %195, i64 2
%198 = bitcast double* %197 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %198
%199 = sitofp <2 x i32> %193 to <2 x double>
%200 = sitofp <2 x i32> %194 to <2 x double>
%201 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %192
%202 = bitcast double* %201 to <2 x double>*
store <2 x double> %199, <2 x double>* %202
%203 = getelementptr inbounds double, double* %201, i64 2
%204 = bitcast double* %203 to <2 x double>*
store <2 x double> %200, <2 x double>* %204
%205 = add nuw nsw i64 %179, 8
%206 = add <2 x i32> %180, <i32 8, i32 8>
%207 = icmp eq i64 %205, 992
br i1 %207, label %208, label %178
208: ; preds = %178
%209 = call i64 (...) @offloading_disabled()
%210 = icmp eq i64 %209, 0
br i1 %210, label %213, label %211
211: ; preds = %208
%212 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.37, i64 0, i64 0))
br label %221
213: ; preds = %208
%214 = call i64 @omp_target_is_present(double* %31, i32 %28)
%215 = icmp eq i64 %214, 0
br i1 %215, label %216, label %224
216: ; preds = %213
%217 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.37, i64 0, i64 0))
%218 = call i32 @omp_target_associate_ptr(double* %31, double* %72, i32 7936, i32 1600, i32 %28)
%219 = icmp eq i32 %218, 0
%220 = select i1 %219, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
br label %221
221: ; preds = %211, %216
%222 = phi i8* [ %220, %216 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %211 ]
%223 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %222)
br label %224
224: ; preds = %221, %213
%225 = call i64 (...) @offloading_disabled()
%226 = icmp eq i64 %225, 0
br i1 %226, label %229, label %227
227: ; preds = %224
%228 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.36, i64 0, i64 0))
br label %237
229: ; preds = %224
%230 = call i64 @omp_target_is_present(double* %63, i32 %28)
%231 = icmp eq i64 %230, 0
br i1 %231, label %232, label %240
232: ; preds = %229
%233 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.36, i64 0, i64 0))
%234 = call i32 @omp_target_associate_ptr(double* %63, double* %74, i32 7936, i32 2400, i32 %28)
%235 = icmp eq i32 %234, 0
%236 = select i1 %235, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
br label %237
237: ; preds = %227, %232
%238 = phi i8* [ %236, %232 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %227 ]
%239 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.18, i64 0, i64 0), i8* %238)
br label %240
240: ; preds = %237, %229
%241 = call i64 @omp_target_is_present(double* %124, i32 %28)
%242 = icmp eq i64 %241, 0
br i1 %242, label %247, label %243
243: ; preds = %240
%244 = call i64 (...) @offloading_disabled()
%245 = icmp eq i64 %244, 0
%246 = select i1 %245, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
br label %247
247: ; preds = %243, %240
%248 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %240 ], [ %246, %243 ]
%249 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i8* %248)
%250 = call i64 @omp_target_is_present(double* %31, i32 %28)
%251 = icmp eq i64 %250, 0
%252 = select i1 %251, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* %252)
%254 = call i64 @omp_target_is_present(double* %63, i32 %28)
%255 = icmp eq i64 %254, 0
%256 = select i1 %255, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%257 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i64 0, i64 0), i8* %256)
br label %258
258: ; preds = %258, %247
%259 = phi i64 [ 0, %247 ], [ %301, %258 ]
%260 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 %259
%261 = bitcast double* %260 to <2 x double>*
%262 = load <2 x double>, <2 x double>* %261
%263 = getelementptr inbounds double, double* %260, i64 2
%264 = bitcast double* %263 to <2 x double>*
%265 = load <2 x double>, <2 x double>* %264
%266 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %259
%267 = bitcast double* %266 to <2 x double>*
%268 = load <2 x double>, <2 x double>* %267
%269 = getelementptr inbounds double, double* %266, i64 2
%270 = bitcast double* %269 to <2 x double>*
%271 = load <2 x double>, <2 x double>* %270
%272 = fadd <2 x double> %262, %268
%273 = fadd <2 x double> %265, %271
%274 = fadd <2 x double> %272, <double 1.000000e+00, double 1.000000e+00>
%275 = fadd <2 x double> %273, <double 1.000000e+00, double 1.000000e+00>
%276 = getelementptr inbounds [992 x double], [992 x double]* %1, i64 0, i64 %259
%277 = bitcast double* %276 to <2 x double>*
store <2 x double> %274, <2 x double>* %277
%278 = getelementptr inbounds double, double* %276, i64 2
%279 = bitcast double* %278 to <2 x double>*
store <2 x double> %275, <2 x double>* %279
%280 = or i64 %259, 4
%281 = getelementptr inbounds [992 x double], [992 x double]* %3, i64 0, i64 %280
%282 = bitcast double* %281 to <2 x double>*
%283 = load <2 x double>, <2 x double>* %282
%284 = getelementptr inbounds double, double* %281, i64 2
%285 = bitcast double* %284 to <2 x double>*
%286 = load <2 x double>, <2 x double>* %285
%287 = getelementptr inbounds [992 x double], [992 x double]* %4, i64 0, i64 %280
%288 = bitcast double* %287 to <2 x double>*
%289 = load <2 x double>, <2 x double>* %288
%290 = getelementptr inbounds double, double* %287, i64 2
%291 = bitcast double* %290 to <2 x double>*
%292 = load <2 x double>, <2 x double>* %291
%293 = fadd <2 x double> %283, %289
%294 = fadd <2 x double> %286, %292
%295 = fadd <2 x double> %293, <double 1.000000e+00, double 1.000000e+00>
%296 = fadd <2 x double> %294, <double 1.000000e+00, double 1.000000e+00>
%297 = getelementptr inbounds [992 x double], [992 x double]* %1, i64 0, i64 %280
%298 = bitcast double* %297 to <2 x double>*
store <2 x double> %295, <2 x double>* %298
%299 = getelementptr inbounds double, double* %297, i64 2
%300 = bitcast double* %299 to <2 x double>*
store <2 x double> %296, <2 x double>* %300
%301 = add nuw nsw i64 %259, 8
%302 = icmp eq i64 %301, 992
br i1 %302, label %303, label %258
303: ; preds = %258
%304 = call i64 (...) @offloading_disabled()
%305 = icmp eq i64 %304, 0
br i1 %305, label %308, label %306
306: ; preds = %303
%307 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.35, i64 0, i64 0))
br label %316
308: ; preds = %303
%309 = call i64 @omp_target_is_present(double* %31, i32 %28)
%310 = icmp eq i64 %309, 0
br i1 %310, label %319, label %311
311: ; preds = %308
%312 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.35, i64 0, i64 0))
%313 = call i32 @omp_target_disassociate_ptr(double* %31, i32 %28)
%314 = icmp eq i32 %313, 0
%315 = select i1 %314, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
br label %316
316: ; preds = %306, %311
%317 = phi i8* [ %315, %311 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %306 ]
%318 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0), i8* %317)
br label %319
319: ; preds = %316, %308
%320 = call i64 (...) @offloading_disabled()
%321 = icmp eq i64 %320, 0
br i1 %321, label %324, label %322
322: ; preds = %319
%323 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.33, i64 0, i64 0))
br label %332
324: ; preds = %319
%325 = call i64 @omp_target_is_present(double* %63, i32 %28)
%326 = icmp eq i64 %325, 0
br i1 %326, label %335, label %327
327: ; preds = %324
%328 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.33, i64 0, i64 0))
%329 = call i32 @omp_target_disassociate_ptr(double* %63, i32 %28)
%330 = icmp eq i32 %329, 0
%331 = select i1 %330, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
br label %332
332: ; preds = %322, %327
%333 = phi i8* [ %331, %327 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %322 ]
%334 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.25, i64 0, i64 0), i8* %333)
br label %335
335: ; preds = %332, %324
br label %336
336: ; preds = %335, %348
%337 = phi i64 [ %353, %348 ], [ 0, %335 ]
%338 = phi i32 [ %351, %348 ], [ 0, %335 ]
%339 = phi i8* [ getelementptr inbounds ([38 x i8], [38 x i8]* @str.31, i64 0, i64 0), %348 ], [ getelementptr inbounds ([41 x i8], [41 x i8]* @str.30, i64 0, i64 0), %335 ]
br label %340
340: ; preds = %336, %356
%341 = phi i64 [ %357, %356 ], [ %337, %336 ]
%342 = getelementptr inbounds [992 x double], [992 x double]* %1, i64 0, i64 %341
%343 = load double, double* %342
%344 = trunc i64 %341 to i32
%345 = add i32 %344, 2
%346 = sitofp i32 %345 to double
%347 = fcmp une double %343, %346
br i1 %347, label %348, label %356
348: ; preds = %340
%349 = trunc i64 %341 to i32
%350 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %349, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), double %346, double %343)
%351 = add nuw nsw i32 %338, 1
%352 = icmp ugt i32 %338, 10
%353 = add nuw nsw i64 %341, 1
%354 = icmp eq i64 %353, 992
%355 = select i1 %352, i1 true, i1 %354
br i1 %355, label %359, label %336
356: ; preds = %340
%357 = add nuw nsw i64 %341, 1
%358 = icmp eq i64 %357, 992
br i1 %358, label %359, label %340
359: ; preds = %348, %356
%360 = phi i8* [ %339, %356 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @str.31, i64 0, i64 0), %348 ]
%361 = call i32 @puts(i8* dereferenceable(1) %360)
%362 = call i32 @omp_target_free(i8* %66, i32 %28)
%363 = call i32 @omp_target_free(i8* %67, i32 %28)
%364 = call i32 @omp_target_free(i8* %68, i32 %28)
ret i32 0
}