#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ abort();
int omp_get_default_device();
int omp_get_initial_device();
int omp_get_num_devices();
void *omp_target_alloc(int, int);
scalar_t__ omp_target_associate_ptr(int *, void *, int, int, int);
scalar_t__ omp_target_disassociate_ptr(int *, int);
int /*<<< orphan*/ omp_target_free(void *, int);
int omp_target_is_present(int *, int);
scalar_t__ omp_target_memcpy(void *, void *, int, int, int, int, int);
scalar_t__ omp_target_memcpy_rect(void *, int *, int, int, size_t *, size_t *,
                                  size_t *, size_t *, size_t *, int, int);
int main() {
  int d = omp_get_default_device();
  int id = omp_get_initial_device();
  int err;
  int q[128], i;
  void *p;
  if (d < 0 || d >= omp_get_num_devices())
    d = id;
  for (i = 0; i < 128; i++)
    q[i] = i;
  p = omp_target_alloc(130 * sizeof(int), d);
  if (p == NULL)
    return 0;
  if (omp_target_memcpy_rect(NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, d,
                             id) < 3 ||
      omp_target_memcpy_rect(NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, id,
                             d) < 3 ||
      omp_target_memcpy_rect(NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, id,
                             id) < 3)
    abort();
  if (omp_target_associate_ptr(q, p, 128 * sizeof(int), sizeof(int), d) == 0) {
    size_t volume[3] = {128, 0, 0};
    size_t dst_offsets[3] = {0, 0, 0};
    size_t src_offsets[3] = {1, 0, 0};
    size_t dst_dimensions[3] = {128, 0, 0};
    size_t src_dimensions[3] = {128, 0, 0};
    if (omp_target_associate_ptr(q, p, 128 * sizeof(int), sizeof(int), d) != 0)
      abort();
    if (omp_target_is_present(q, d) != 1 ||
        omp_target_is_present(&q[32], d) != 1 ||
        omp_target_is_present(&q[127], d) != 1)
      abort();
    if (omp_target_memcpy(p, q, 128 * sizeof(int), sizeof(int), 0, d, id) != 0)
      abort();
#pragma omp target if (d >= 0) device(d >= 0 ? d : 0) map(alloc                \
                                                          : q [0:32])          \
    map(from                                                                   \
        : err)
    {
      int j;
      err = 0;
      for (j = 0; j < 128; j++)
        if (q[j] != j)
          err = 1;
        else
          q[j] += 4;
    }
    if (err)
      abort();
    if (omp_target_memcpy_rect(q, p, sizeof(int), 1, volume, dst_offsets,
                               src_offsets, dst_dimensions, src_dimensions, id,
                               d) != 0)
      abort();
    for (i = 0; i < 128; i++)
      if (q[i] != i + 4)
        abort();
    volume[2] = 2;
    volume[1] = 3;
    volume[0] = 6;
    dst_offsets[2] = 1;
    dst_offsets[1] = 0;
    dst_offsets[0] = 0;
    src_offsets[2] = 1;
    src_offsets[1] = 0;
    src_offsets[0] = 3;
    dst_dimensions[2] = 2;
    dst_dimensions[1] = 3;
    dst_dimensions[0] = 6;
    src_dimensions[2] = 3;
    src_dimensions[1] = 4;
    src_dimensions[0] = 6;
    if (omp_target_memcpy_rect(p, q, sizeof(int), 3, volume, dst_offsets,
                               src_offsets, dst_dimensions, src_dimensions, d,
                               id) != 0)
      abort();
#pragma omp target if (d >= 0) device(d >= 0 ? d : 0) map(alloc                \
                                                          : q [0:32])          \
    map(from                                                                   \
        : err)
    {
      int j, k, l;
      err = 0;
      for (j = 0; j < 6; j++)
        for (k = 0; k < 3; k++)
          for (l = 0; l < 2; l++)
            if (q[j * 6 + k * 2 + l] != 3 * 12 + 4 + 1 + l + k * 3 + j * 12)
              err = 1;
    }
    if (err)
      abort();
    if (omp_target_memcpy(p, p, 10 * sizeof(int), 51 * sizeof(int),
                          111 * sizeof(int), d, d) != 0)
      abort();
#pragma omp target if (d >= 0) device(d >= 0 ? d : 0) map(alloc                \
                                                          : q [0:32])          \
    map(from                                                                   \
        : err)
    {
      int j;
      err = 0;
      for (j = 0; j < 10; j++)
        if (q[50 + j] != q[110 + j])
          err = 1;
    }
    if (err)
      abort();
    if (omp_target_disassociate_ptr(q, d) != 0)
      abort();
  }
  omp_target_free(p, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x300,%rsp
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1060 <omp_get_default_device@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   10c0 <omp_get_initial_device@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1213 <main+0x53>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2e8(%rbp)
mov    $0x0,%al
call   10d0 <omp_get_num_devices@plt>
mov    %eax,%ecx
mov    -0x2e8(%rbp),%eax
cmp    %ecx,%eax
jl     1219 <main+0x59>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x224(%rbp)
cmpl   $0x80,-0x224(%rbp)
jge    125b <main+0x9b>
mov    -0x224(%rbp),%ecx
movslq -0x224(%rbp),%rax
mov    %ecx,-0x220(%rbp,%rax,4)
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    1223 <main+0x63>
mov    -0x18(%rbp),%esi
mov    $0x208,%edi
call   10e0 <omp_target_alloc@plt>
mov    %rax,-0x230(%rbp)
cmpq   $0x0,-0x230(%rbp)
jne    1289 <main+0xc9>
movl   $0x0,-0x14(%rbp)
jmp    196c <main+0x7ac>
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%r9d
xor    %ecx,%ecx
mov    %r9,%rdi
mov    %r9,%rsi
mov    %ecx,%edx
mov    %r9,%r8
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   10b0 <omp_target_memcpy_rect@plt>
cmp    $0x3,%rax
jl     136a <main+0x1aa>
mov    -0x1c(%rbp),%r10d
mov    -0x18(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%r9d
xor    %ecx,%ecx
mov    %r9,%rdi
mov    %r9,%rsi
mov    %ecx,%edx
mov    %r9,%r8
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   10b0 <omp_target_memcpy_rect@plt>
cmp    $0x3,%rax
jl     136a <main+0x1aa>
mov    -0x1c(%rbp),%r10d
mov    -0x1c(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%r9d
xor    %ecx,%ecx
mov    %r9,%rdi
mov    %r9,%rsi
mov    %ecx,%edx
mov    %r9,%r8
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   10b0 <omp_target_memcpy_rect@plt>
cmp    $0x3,%rax
jge    1371 <main+0x1b1>
mov    $0x0,%al
call   1040 <abort@plt>
lea    -0x220(%rbp),%rdi
mov    -0x230(%rbp),%rsi
mov    -0x18(%rbp),%r8d
mov    $0x200,%edx
mov    $0x4,%ecx
call   10a0 <omp_target_associate_ptr@plt>
cmp    $0x0,%rax
jne    1956 <main+0x796>
mov    0xc5d(%rip),%rax
mov    %rax,-0x250(%rbp)
mov    0xc57(%rip),%rax
mov    %rax,-0x248(%rbp)
mov    0xc51(%rip),%rax
mov    %rax,-0x240(%rbp)
lea    -0x270(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0xc40(%rip),%rax
mov    %rax,-0x290(%rbp)
mov    0xc3a(%rip),%rax
mov    %rax,-0x288(%rbp)
mov    0xc34(%rip),%rax
mov    %rax,-0x280(%rbp)
mov    0xc36(%rip),%rax
mov    %rax,-0x2b0(%rbp)
mov    0xc30(%rip),%rax
mov    %rax,-0x2a8(%rbp)
mov    0xc2a(%rip),%rax
mov    %rax,-0x2a0(%rbp)
mov    0xc2c(%rip),%rax
mov    %rax,-0x2d0(%rbp)
mov    0xc26(%rip),%rax
mov    %rax,-0x2c8(%rbp)
mov    0xc20(%rip),%rax
mov    %rax,-0x2c0(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x230(%rbp),%rsi
mov    -0x18(%rbp),%r8d
mov    $0x200,%edx
mov    $0x4,%ecx
call   10a0 <omp_target_associate_ptr@plt>
cmp    $0x0,%rax
je     1489 <main+0x2c9>
mov    $0x0,%al
call   1040 <abort@plt>
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1080 <omp_target_is_present@plt>
cmp    $0x1,%eax
jne    14df <main+0x31f>
lea    -0x220(%rbp),%rdi
add    $0x80,%rdi
mov    -0x18(%rbp),%esi
call   1080 <omp_target_is_present@plt>
cmp    $0x1,%eax
jne    14df <main+0x31f>
lea    -0x220(%rbp),%rdi
add    $0x1fc,%rdi
mov    -0x18(%rbp),%esi
call   1080 <omp_target_is_present@plt>
cmp    $0x1,%eax
je     14e6 <main+0x326>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x230(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%eax
mov    $0x200,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    %eax,(%rsp)
call   1050 <omp_target_memcpy@plt>
cmp    $0x0,%rax
je     1521 <main+0x361>
mov    $0x0,%al
call   1040 <abort@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x2d4(%rbp)
cmpl   $0x80,-0x2d4(%rbp)
jge    1599 <main+0x3d9>
movslq -0x2d4(%rbp),%rax
mov    -0x220(%rbp,%rax,4),%eax
cmp    -0x2d4(%rbp),%eax
je     1568 <main+0x3a8>
movl   $0x1,-0x20(%rbp)
jmp    1580 <main+0x3c0>
movslq -0x2d4(%rbp),%rax
mov    -0x220(%rbp,%rax,4),%ecx
add    $0x4,%ecx
mov    %ecx,-0x220(%rbp,%rax,4)
jmp    1585 <main+0x3c5>
mov    -0x2d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2d4(%rbp)
jmp    1532 <main+0x372>
cmpl   $0x0,-0x20(%rbp)
je     15aa <main+0x3ea>
mov    $0x0,%al
call   1040 <abort@plt>
lea    -0x220(%rbp),%rdi
mov    -0x230(%rbp),%rsi
lea    -0x250(%rbp),%r8
lea    -0x270(%rbp),%r9
lea    -0x290(%rbp),%r14
lea    -0x2b0(%rbp),%rbx
lea    -0x2d0(%rbp),%r11
mov    -0x1c(%rbp),%r10d
mov    -0x18(%rbp),%eax
mov    $0x4,%edx
mov    $0x1,%ecx
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   10b0 <omp_target_memcpy_rect@plt>
cmp    $0x0,%rax
je     1619 <main+0x459>
mov    $0x0,%al
call   1040 <abort@plt>
movl   $0x0,-0x224(%rbp)
cmpl   $0x80,-0x224(%rbp)
jge    1672 <main+0x4b2>
movslq -0x224(%rbp),%rax
mov    -0x220(%rbp,%rax,4),%eax
mov    -0x224(%rbp),%ecx
add    $0x4,%ecx
cmp    %ecx,%eax
je     1659 <main+0x499>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    165e <main+0x49e>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    1623 <main+0x463>
movq   $0x2,-0x240(%rbp)
movq   $0x3,-0x248(%rbp)
movq   $0x6,-0x250(%rbp)
movq   $0x1,-0x260(%rbp)
movq   $0x0,-0x268(%rbp)
movq   $0x0,-0x270(%rbp)
movq   $0x1,-0x280(%rbp)
movq   $0x0,-0x288(%rbp)
movq   $0x3,-0x290(%rbp)
movq   $0x2,-0x2a0(%rbp)
movq   $0x3,-0x2a8(%rbp)
movq   $0x6,-0x2b0(%rbp)
movq   $0x3,-0x2c0(%rbp)
movq   $0x4,-0x2c8(%rbp)
movq   $0x6,-0x2d0(%rbp)
mov    -0x230(%rbp),%rdi
lea    -0x220(%rbp),%rsi
lea    -0x250(%rbp),%r8
lea    -0x270(%rbp),%r9
lea    -0x290(%rbp),%r14
lea    -0x2b0(%rbp),%rbx
lea    -0x2d0(%rbp),%r11
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0x4,%edx
mov    $0x3,%ecx
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   10b0 <omp_target_memcpy_rect@plt>
cmp    $0x0,%rax
je     1786 <main+0x5c6>
mov    $0x0,%al
call   1040 <abort@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x2d8(%rbp)
cmpl   $0x6,-0x2d8(%rbp)
jge    1868 <main+0x6a8>
movl   $0x0,-0x2dc(%rbp)
cmpl   $0x3,-0x2dc(%rbp)
jge    184f <main+0x68f>
movl   $0x0,-0x2e0(%rbp)
cmpl   $0x2,-0x2e0(%rbp)
jge    1836 <main+0x676>
imul   $0x6,-0x2d8(%rbp),%eax
mov    -0x2dc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    -0x2e0(%rbp),%eax
cltq
mov    -0x220(%rbp,%rax,4),%eax
mov    -0x2e0(%rbp),%ecx
add    $0x29,%ecx
imul   $0x3,-0x2dc(%rbp),%edx
add    %edx,%ecx
imul   $0xc,-0x2d8(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
je     181d <main+0x65d>
movl   $0x1,-0x20(%rbp)
jmp    1822 <main+0x662>
mov    -0x2e0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2e0(%rbp)
jmp    17c5 <main+0x605>
jmp    183b <main+0x67b>
mov    -0x2dc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2dc(%rbp)
jmp    17ae <main+0x5ee>
jmp    1854 <main+0x694>
mov    -0x2d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2d8(%rbp)
jmp    1797 <main+0x5d7>
cmpl   $0x0,-0x20(%rbp)
je     1879 <main+0x6b9>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x230(%rbp),%rdi
mov    -0x230(%rbp),%rsi
mov    -0x18(%rbp),%r9d
mov    -0x18(%rbp),%eax
mov    $0x28,%edx
mov    $0xcc,%ecx
mov    $0x1bc,%r8d
mov    %eax,(%rsp)
call   1050 <omp_target_memcpy@plt>
cmp    $0x0,%rax
je     18b7 <main+0x6f7>
mov    $0x0,%al
call   1040 <abort@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x2e4(%rbp)
cmpl   $0xa,-0x2e4(%rbp)
jge    1920 <main+0x760>
mov    -0x2e4(%rbp),%eax
add    $0x32,%eax
cltq
mov    -0x220(%rbp,%rax,4),%eax
mov    -0x2e4(%rbp),%ecx
add    $0x6e,%ecx
movslq %ecx,%rcx
cmp    -0x220(%rbp,%rcx,4),%eax
je     1907 <main+0x747>
movl   $0x1,-0x20(%rbp)
jmp    190c <main+0x74c>
mov    -0x2e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2e4(%rbp)
jmp    18c8 <main+0x708>
cmpl   $0x0,-0x20(%rbp)
je     1931 <main+0x771>
mov    $0x0,%al
call   1040 <abort@plt>
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1090 <omp_target_disassociate_ptr@plt>
cmp    $0x0,%rax
je     1951 <main+0x791>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    1956 <main+0x796>
mov    -0x230(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <omp_target_free@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x300,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2d8,%rsp
xor    %eax,%eax
call   1060 <omp_get_default_device@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10b0 <omp_get_initial_device@plt>
mov    %eax,%ebp
test   %ebx,%ebx
js     11e2 <main+0x32>
xor    %eax,%eax
call   10c0 <omp_get_num_devices@plt>
cmp    %eax,%ebx
jl     11e4 <main+0x34>
mov    %ebp,%ebx
movaps 0xe15(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xe16(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xe17(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xe18(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xe19(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xe1a(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe1b(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe1c(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xe1d(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xe1e(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xe1f(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xe20(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xe21(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
movaps 0xe22(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xe23(%rip),%xmm0
movaps %xmm0,0x1b0(%rsp)
movaps 0xe24(%rip),%xmm0
movaps %xmm0,0x1c0(%rsp)
movaps 0xe25(%rip),%xmm0
movaps %xmm0,0x1d0(%rsp)
movaps 0xe26(%rip),%xmm0
movaps %xmm0,0x1e0(%rsp)
movaps 0xe27(%rip),%xmm0
movaps %xmm0,0x1f0(%rsp)
movaps 0xe28(%rip),%xmm0
movaps %xmm0,0x200(%rsp)
movaps 0xe29(%rip),%xmm0
movaps %xmm0,0x210(%rsp)
movaps 0xe2a(%rip),%xmm0
movaps %xmm0,0x220(%rsp)
movaps 0xe2b(%rip),%xmm0
movaps %xmm0,0x230(%rsp)
movaps 0xe2c(%rip),%xmm0
movaps %xmm0,0x240(%rsp)
movaps 0xe2d(%rip),%xmm0
movaps %xmm0,0x250(%rsp)
movaps 0xe2e(%rip),%xmm0
movaps %xmm0,0x260(%rsp)
movaps 0xe2f(%rip),%xmm0
movaps %xmm0,0x270(%rsp)
movaps 0xe30(%rip),%xmm0
movaps %xmm0,0x280(%rsp)
movaps 0xe31(%rip),%xmm0
movaps %xmm0,0x290(%rsp)
movaps 0xe32(%rip),%xmm0
movaps %xmm0,0x2a0(%rsp)
movaps 0xe33(%rip),%xmm0
movaps %xmm0,0x2b0(%rsp)
movdqa 0xe33(%rip),%xmm0
movdqa %xmm0,0x2c0(%rsp)
mov    $0x208,%edi
mov    %ebx,%esi
call   10d0 <omp_target_alloc@plt>
test   %rax,%rax
je     1924 <main+0x774>
mov    %rax,%r14
mov    %ebp,0x20(%rsp)
mov    %ebx,0x18(%rsp)
pxor   %xmm0,%xmm0
movdqu %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10a0 <omp_target_memcpy_rect@plt>
cmp    $0x3,%rax
jl     1938 <main+0x788>
mov    %ebx,0x20(%rsp)
mov    %ebp,0x18(%rsp)
pxor   %xmm0,%xmm0
movdqu %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10a0 <omp_target_memcpy_rect@plt>
cmp    $0x3,%rax
jl     1938 <main+0x788>
mov    %ebp,0x20(%rsp)
mov    %ebp,0x18(%rsp)
pxor   %xmm0,%xmm0
movdqu %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10a0 <omp_target_memcpy_rect@plt>
cmp    $0x2,%rax
jle    1938 <main+0x788>
lea    0xd0(%rsp),%rdi
mov    %r14,%rsi
mov    $0x200,%edx
mov    $0x4,%ecx
mov    %ebx,%r8d
call   1090 <omp_target_associate_ptr@plt>
test   %rax,%rax
jne    191a <main+0x76a>
mov    0xe40(%rip),%rax
mov    %rax,0x60(%rsp)
movdqa 0xe23(%rip),%xmm0
movdqa %xmm0,0x50(%rsp)
xorps  %xmm1,%xmm1
movaps %xmm1,0x30(%rsp)
movq   $0x0,0x40(%rsp)
mov    0xdf5(%rip),%rcx
mov    %rcx,0xc0(%rsp)
movdqa 0xdd5(%rip),%xmm1
movdqa %xmm1,0xb0(%rsp)
mov    %rax,0xa0(%rsp)
movdqa %xmm0,0x90(%rsp)
mov    %rax,0x80(%rsp)
movdqa %xmm0,0x70(%rsp)
lea    0xd0(%rsp),%rdi
mov    %r14,%rsi
mov    $0x200,%edx
mov    $0x4,%ecx
mov    %ebx,%r8d
call   1090 <omp_target_associate_ptr@plt>
test   %rax,%rax
jne    1938 <main+0x788>
lea    0xd0(%rsp),%rdi
mov    %ebx,%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x1,%eax
jne    1938 <main+0x788>
lea    0x150(%rsp),%rdi
mov    %ebx,%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x1,%eax
jne    1938 <main+0x788>
lea    0x2cc(%rsp),%rdi
mov    %ebx,%esi
call   1070 <omp_target_is_present@plt>
cmp    $0x1,%eax
jne    1938 <main+0x788>
mov    %ebp,(%rsp)
lea    0xd0(%rsp),%rsi
mov    %r14,%rdi
mov    $0x200,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    %ebx,%r9d
call   1050 <omp_target_memcpy@plt>
test   %rax,%rax
jne    1938 <main+0x788>
mov    $0x1,%al
xor    %ecx,%ecx
jmp    15d0 <main+0x420>
lea    0x1(%rcx),%rdx
xor    %eax,%eax
cmp    $0x7f,%rcx
mov    %rdx,%rcx
je     1938 <main+0x788>
cs nopw 0x0(%rax,%rax,1)
mov    0xd0(%rsp,%rcx,4),%edx
cmp    %rdx,%rcx
jne    15b3 <main+0x403>
add    $0x4,%edx
mov    %edx,0xd0(%rsp,%rcx,4)
add    $0x1,%rcx
cmp    $0x80,%rcx
jne    15d0 <main+0x420>
test   $0x1,%al
je     1938 <main+0x788>
mov    %ebx,0x20(%rsp)
mov    %ebp,0x18(%rsp)
lea    0x70(%rsp),%r15
mov    %r15,0x10(%rsp)
lea    0x90(%rsp),%r12
mov    %r12,0x8(%rsp)
lea    0xb0(%rsp),%r13
mov    %r13,(%rsp)
lea    0xd0(%rsp),%rdi
lea    0x50(%rsp),%r8
lea    0x30(%rsp),%r9
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   10a0 <omp_target_memcpy_rect@plt>
test   %rax,%rax
jne    1938 <main+0x788>
mov    $0x7,%eax
nopl   0x0(%rax,%rax,1)
mov    0xb4(%rsp,%rax,4),%ecx
lea    -0x3(%rax),%rdx
cmp    %rcx,%rdx
jne    1938 <main+0x788>
mov    0xb8(%rsp,%rax,4),%ecx
lea    -0x2(%rax),%rdx
cmp    %rcx,%rdx
jne    1938 <main+0x788>
mov    0xbc(%rsp,%rax,4),%ecx
lea    -0x1(%rax),%rdx
cmp    %rcx,%rdx
jne    1938 <main+0x788>
mov    0xc0(%rsp,%rax,4),%ecx
cmp    %rcx,%rax
jne    1938 <main+0x788>
add    $0x4,%rax
cmp    $0x87,%rax
jne    1660 <main+0x4b0>
movq   $0x2,0x60(%rsp)
movaps 0xb38(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movq   $0x1,0x40(%rsp)
pxor   %xmm1,%xmm1
movdqa %xmm1,0x30(%rsp)
movq   $0x1,0xc0(%rsp)
movdqa 0xb1c(%rip),%xmm1
movdqa %xmm1,0xb0(%rsp)
movq   $0x2,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movq   $0x3,0x80(%rsp)
movdqa 0xafb(%rip),%xmm0
movdqa %xmm0,0x70(%rsp)
mov    %ebp,0x20(%rsp)
mov    %ebx,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %r12,0x8(%rsp)
mov    %r13,(%rsp)
lea    0xd0(%rsp),%rsi
lea    0x50(%rsp),%r8
lea    0x30(%rsp),%r9
mov    %r14,%rdi
mov    $0x4,%edx
mov    $0x3,%ecx
call   10a0 <omp_target_memcpy_rect@plt>
test   %rax,%rax
jne    1938 <main+0x788>
movdqa 0x150(%rsp),%xmm6
movdqa 0x140(%rsp),%xmm7
movdqa 0x130(%rsp),%xmm4
movdqa 0x120(%rsp),%xmm0
movdqa 0x110(%rsp),%xmm5
movdqa 0x100(%rsp),%xmm2
movdqa 0xf0(%rsp),%xmm3
movdqa 0xe0(%rsp),%xmm1
pcmpeqd 0xa72(%rip),%xmm6
pcmpeqd %xmm8,%xmm8
pxor   %xmm8,%xmm6
pcmpeqd 0xa70(%rip),%xmm7
pxor   %xmm8,%xmm7
packssdw %xmm6,%xmm7
pcmpeqd 0xa6f(%rip),%xmm4
pxor   %xmm8,%xmm4
pcmpeqd 0xa72(%rip),%xmm0
pxor   %xmm8,%xmm0
packssdw %xmm4,%xmm0
packsswb %xmm7,%xmm0
pcmpeqd 0xa6d(%rip),%xmm5
pxor   %xmm8,%xmm5
pcmpeqd 0xa70(%rip),%xmm2
pxor   %xmm8,%xmm2
packssdw %xmm5,%xmm2
pcmpeqd 0xa6f(%rip),%xmm3
pxor   %xmm8,%xmm3
pcmpeqd 0xa72(%rip),%xmm1
pxor   %xmm8,%xmm1
packssdw %xmm3,%xmm1
packsswb %xmm2,%xmm1
por    %xmm0,%xmm1
pmovmskb %xmm1,%eax
test   %eax,%eax
jne    1938 <main+0x788>
cmpl   $0x2d,0xdc(%rsp)
2d
jne    1938 <main+0x788>
cmpl   $0x2c,0xd8(%rsp)
2c
jne    1938 <main+0x788>
cmpl   $0x2a,0xd4(%rsp)
2a
jne    1938 <main+0x788>
cmpl   $0x29,0xd0(%rsp)
29
jne    1938 <main+0x788>
mov    %ebx,(%rsp)
mov    %r14,%rdi
mov    %r14,%rsi
mov    $0x28,%edx
mov    $0xcc,%ecx
mov    $0x1bc,%r8d
mov    %ebx,%r9d
call   1050 <omp_target_memcpy@plt>
test   %rax,%rax
jne    1938 <main+0x788>
movdqa 0x1b0(%rsp),%xmm0
pcmpeqd 0x2a0(%rsp),%xmm0
movdqa 0x1a0(%rsp),%xmm1
pcmpeqd 0x290(%rsp),%xmm1
packssdw %xmm0,%xmm1
psllw  $0xf,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%eax
cmp    $0xff,%al
jne    1938 <main+0x788>
mov    0x28c(%rsp),%eax
cmp    %eax,0x19c(%rsp)
jne    1938 <main+0x788>
mov    0x288(%rsp),%eax
cmp    %eax,0x198(%rsp)
jne    1938 <main+0x788>
lea    0xd0(%rsp),%rdi
mov    %ebx,%esi
call   1080 <omp_target_disassociate_ptr@plt>
test   %rax,%rax
jne    1938 <main+0x788>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <omp_target_free@plt>
xor    %eax,%eax
add    $0x2d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@__const.main.volume = [3 x i64] [i64 128, i64 0, i64 0]
@__const.main.src_offsets = [3 x i64] [i64 1, i64 0, i64 0]
@__const.main.dst_dimensions = [3 x i64] [i64 128, i64 0, i64 0]
@__const.main.src_dimensions = [3 x i64] [i64 128, i64 0, i64 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [128 x i32]
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [3 x i64]
%9 = alloca [3 x i64]
%10 = alloca [3 x i64]
%11 = alloca [3 x i64]
%12 = alloca [3 x i64]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %1
%18 = call i32 (...) @omp_get_default_device()
store i32 %18, i32* %2
%19 = call i32 (...) @omp_get_initial_device()
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %0
%23 = load i32, i32* %2
%24 = call i32 (...) @omp_get_num_devices()
%25 = icmp sge i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22, %0
%27 = load i32, i32* %3
store i32 %27, i32* %2
br label %28
28: ; preds = %26, %22
store i32 0, i32* %6
br label %29
29: ; preds = %37, %28
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 128
br i1 %31, label %32, label %40
32: ; preds = %29
%33 = load i32, i32* %6
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %35
store i32 %33, i32* %36
br label %37
37: ; preds = %32
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %29
40: ; preds = %29
%41 = load i32, i32* %2
%42 = call i8* @omp_target_alloc(i32 520, i32 %41)
store i8* %42, i8** %7
%43 = load i8*, i8** %7
%44 = icmp eq i8* %43, null
br i1 %44, label %45, label %46
45: ; preds = %40
store i32 0, i32* %1
br label %296
46: ; preds = %40
%47 = load i32, i32* %2
%48 = load i32, i32* %3
%49 = call i64 @omp_target_memcpy_rect(i8* null, i32* null, i32 0, i32 0, i64* null, i64* null, i64* null, i64* null, i64* null, i32 %47, i32 %48)
%50 = icmp slt i64 %49, 3
br i1 %50, label %61, label %51
51: ; preds = %46
%52 = load i32, i32* %3
%53 = load i32, i32* %2
%54 = call i64 @omp_target_memcpy_rect(i8* null, i32* null, i32 0, i32 0, i64* null, i64* null, i64* null, i64* null, i64* null, i32 %52, i32 %53)
%55 = icmp slt i64 %54, 3
br i1 %55, label %61, label %56
56: ; preds = %51
%57 = load i32, i32* %3
%58 = load i32, i32* %3
%59 = call i64 @omp_target_memcpy_rect(i8* null, i32* null, i32 0, i32 0, i64* null, i64* null, i64* null, i64* null, i64* null, i32 %57, i32 %58)
%60 = icmp slt i64 %59, 3
br i1 %60, label %61, label %63
61: ; preds = %56, %51, %46
%62 = call i32 (...) @abort()
unreachable
63: ; preds = %56
%64 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%65 = load i8*, i8** %7
%66 = load i32, i32* %2
%67 = call i64 @omp_target_associate_ptr(i32* %64, i8* %65, i32 512, i32 4, i32 %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %292
69: ; preds = %63
%70 = bitcast [3 x i64]* %8 to i8*
%71 = bitcast [3 x i64]* %9 to i8*
%72 = bitcast [3 x i64]* %10 to i8*
%73 = bitcast [3 x i64]* %11 to i8*
%74 = bitcast [3 x i64]* %12 to i8*
%75 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%76 = load i8*, i8** %7
%77 = load i32, i32* %2
%78 = call i64 @omp_target_associate_ptr(i32* %75, i8* %76, i32 512, i32 4, i32 %77)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %69
%81 = call i32 (...) @abort()
unreachable
82: ; preds = %69
%83 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%84 = load i32, i32* %2
%85 = call i32 @omp_target_is_present(i32* %83, i32 %84)
%86 = icmp ne i32 %85, 1
br i1 %86, label %97, label %87
87: ; preds = %82
%88 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 32
%89 = load i32, i32* %2
%90 = call i32 @omp_target_is_present(i32* %88, i32 %89)
%91 = icmp ne i32 %90, 1
br i1 %91, label %97, label %92
92: ; preds = %87
%93 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 127
%94 = load i32, i32* %2
%95 = call i32 @omp_target_is_present(i32* %93, i32 %94)
%96 = icmp ne i32 %95, 1
br i1 %96, label %97, label %99
97: ; preds = %92, %87, %82
%98 = call i32 (...) @abort()
unreachable
99: ; preds = %92
%100 = load i8*, i8** %7
%101 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%102 = bitcast i32* %101 to i8*
%103 = load i32, i32* %2
%104 = load i32, i32* %3
%105 = call i64 @omp_target_memcpy(i8* %100, i8* %102, i32 512, i32 4, i32 0, i32 %103, i32 %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %99
%108 = call i32 (...) @abort()
unreachable
109: ; preds = %99
store i32 0, i32* %4
store i32 0, i32* %13
br label %110
110: ; preds = %128, %109
%111 = load i32, i32* %13
%112 = icmp slt i32 %111, 128
br i1 %112, label %113, label %131
113: ; preds = %110
%114 = load i32, i32* %13
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %115
%117 = load i32, i32* %116
%118 = load i32, i32* %13
%119 = icmp ne i32 %117, %118
br i1 %119, label %120, label %121
120: ; preds = %113
store i32 1, i32* %4
br label %127
121: ; preds = %113
%122 = load i32, i32* %13
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %123
%125 = load i32, i32* %124
%126 = add nsw i32 %125, 4
store i32 %126, i32* %124
br label %127
127: ; preds = %121, %120
br label %128
128: ; preds = %127
%129 = load i32, i32* %13
%130 = add nsw i32 %129, 1
store i32 %130, i32* %13
br label %110
131: ; preds = %110
%132 = load i32, i32* %4
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %131
%135 = call i32 (...) @abort()
unreachable
136: ; preds = %131
%137 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%138 = bitcast i32* %137 to i8*
%139 = load i8*, i8** %7
%140 = bitcast i8* %139 to i32*
%141 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 0
%142 = getelementptr inbounds [3 x i64], [3 x i64]* %9, i64 0, i64 0
%143 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 0
%144 = getelementptr inbounds [3 x i64], [3 x i64]* %11, i64 0, i64 0
%145 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 0
%146 = load i32, i32* %3
%147 = load i32, i32* %2
%148 = call i64 @omp_target_memcpy_rect(i8* %138, i32* %140, i32 4, i32 1, i64* %141, i64* %142, i64* %143, i64* %144, i64* %145, i32 %146, i32 %147)
%149 = icmp ne i64 %148, 0
br i1 %149, label %150, label %152
150: ; preds = %136
%151 = call i32 (...) @abort()
unreachable
152: ; preds = %136
store i32 0, i32* %6
br label %153
153: ; preds = %167, %152
%154 = load i32, i32* %6
%155 = icmp slt i32 %154, 128
br i1 %155, label %156, label %170
156: ; preds = %153
%157 = load i32, i32* %6
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %158
%160 = load i32, i32* %159
%161 = load i32, i32* %6
%162 = add nsw i32 %161, 4
%163 = icmp ne i32 %160, %162
br i1 %163, label %164, label %166
164: ; preds = %156
%165 = call i32 (...) @abort()
unreachable
166: ; preds = %156
br label %167
167: ; preds = %166
%168 = load i32, i32* %6
%169 = add nsw i32 %168, 1
store i32 %169, i32* %6
br label %153
170: ; preds = %153
%171 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 2
store i64 2, i64* %171
%172 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 1
store i64 3, i64* %172
%173 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 0
store i64 6, i64* %173
%174 = getelementptr inbounds [3 x i64], [3 x i64]* %9, i64 0, i64 2
store i64 1, i64* %174
%175 = getelementptr inbounds [3 x i64], [3 x i64]* %9, i64 0, i64 1
store i64 0, i64* %175
%176 = getelementptr inbounds [3 x i64], [3 x i64]* %9, i64 0, i64 0
store i64 0, i64* %176
%177 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 2
store i64 1, i64* %177
%178 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 1
store i64 0, i64* %178
%179 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 0
store i64 3, i64* %179
%180 = getelementptr inbounds [3 x i64], [3 x i64]* %11, i64 0, i64 2
store i64 2, i64* %180
%181 = getelementptr inbounds [3 x i64], [3 x i64]* %11, i64 0, i64 1
store i64 3, i64* %181
%182 = getelementptr inbounds [3 x i64], [3 x i64]* %11, i64 0, i64 0
store i64 6, i64* %182
%183 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 2
store i64 3, i64* %183
%184 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 1
store i64 4, i64* %184
%185 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 0
store i64 6, i64* %185
%186 = load i8*, i8** %7
%187 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%188 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 0
%189 = getelementptr inbounds [3 x i64], [3 x i64]* %9, i64 0, i64 0
%190 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 0
%191 = getelementptr inbounds [3 x i64], [3 x i64]* %11, i64 0, i64 0
%192 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 0
%193 = load i32, i32* %2
%194 = load i32, i32* %3
%195 = call i64 @omp_target_memcpy_rect(i8* %186, i32* %187, i32 4, i32 3, i64* %188, i64* %189, i64* %190, i64* %191, i64* %192, i32 %193, i32 %194)
%196 = icmp ne i64 %195, 0
br i1 %196, label %197, label %199
197: ; preds = %170
%198 = call i32 (...) @abort()
unreachable
199: ; preds = %170
store i32 0, i32* %4
store i32 0, i32* %14
br label %200
200: ; preds = %241, %199
%201 = load i32, i32* %14
%202 = icmp slt i32 %201, 6
br i1 %202, label %203, label %244
203: ; preds = %200
store i32 0, i32* %15
br label %204
204: ; preds = %237, %203
%205 = load i32, i32* %15
%206 = icmp slt i32 %205, 3
br i1 %206, label %207, label %240
207: ; preds = %204
store i32 0, i32* %16
br label %208
208: ; preds = %233, %207
%209 = load i32, i32* %16
%210 = icmp slt i32 %209, 2
br i1 %210, label %211, label %236
211: ; preds = %208
%212 = load i32, i32* %14
%213 = mul nsw i32 %212, 6
%214 = load i32, i32* %15
%215 = mul nsw i32 %214, 2
%216 = add nsw i32 %213, %215
%217 = load i32, i32* %16
%218 = add nsw i32 %216, %217
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %219
%221 = load i32, i32* %220
%222 = load i32, i32* %16
%223 = add nsw i32 41, %222
%224 = load i32, i32* %15
%225 = mul nsw i32 %224, 3
%226 = add nsw i32 %223, %225
%227 = load i32, i32* %14
%228 = mul nsw i32 %227, 12
%229 = add nsw i32 %226, %228
%230 = icmp ne i32 %221, %229
br i1 %230, label %231, label %232
231: ; preds = %211
store i32 1, i32* %4
br label %232
232: ; preds = %231, %211
br label %233
233: ; preds = %232
%234 = load i32, i32* %16
%235 = add nsw i32 %234, 1
store i32 %235, i32* %16
br label %208
236: ; preds = %208
br label %237
237: ; preds = %236
%238 = load i32, i32* %15
%239 = add nsw i32 %238, 1
store i32 %239, i32* %15
br label %204
240: ; preds = %204
br label %241
241: ; preds = %240
%242 = load i32, i32* %14
%243 = add nsw i32 %242, 1
store i32 %243, i32* %14
br label %200
244: ; preds = %200
%245 = load i32, i32* %4
%246 = icmp ne i32 %245, 0
br i1 %246, label %247, label %249
247: ; preds = %244
%248 = call i32 (...) @abort()
unreachable
249: ; preds = %244
%250 = load i8*, i8** %7
%251 = load i8*, i8** %7
%252 = load i32, i32* %2
%253 = load i32, i32* %2
%254 = call i64 @omp_target_memcpy(i8* %250, i8* %251, i32 40, i32 204, i32 444, i32 %252, i32 %253)
%255 = icmp ne i64 %254, 0
br i1 %255, label %256, label %258
256: ; preds = %249
%257 = call i32 (...) @abort()
unreachable
258: ; preds = %249
store i32 0, i32* %4
store i32 0, i32* %17
br label %259
259: ; preds = %276, %258
%260 = load i32, i32* %17
%261 = icmp slt i32 %260, 10
br i1 %261, label %262, label %279
262: ; preds = %259
%263 = load i32, i32* %17
%264 = add nsw i32 50, %263
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %265
%267 = load i32, i32* %266
%268 = load i32, i32* %17
%269 = add nsw i32 110, %268
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 %270
%272 = load i32, i32* %271
%273 = icmp ne i32 %267, %272
br i1 %273, label %274, label %275
274: ; preds = %262
store i32 1, i32* %4
br label %275
275: ; preds = %274, %262
br label %276
276: ; preds = %275
%277 = load i32, i32* %17
%278 = add nsw i32 %277, 1
store i32 %278, i32* %17
br label %259
279: ; preds = %259
%280 = load i32, i32* %4
%281 = icmp ne i32 %280, 0
br i1 %281, label %282, label %284
282: ; preds = %279
%283 = call i32 (...) @abort()
unreachable
284: ; preds = %279
%285 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%286 = load i32, i32* %2
%287 = call i64 @omp_target_disassociate_ptr(i32* %285, i32 %286)
%288 = icmp ne i64 %287, 0
br i1 %288, label %289, label %291
289: ; preds = %284
%290 = call i32 (...) @abort()
unreachable
291: ; preds = %284
br label %292
292: ; preds = %291, %63
%293 = load i8*, i8** %7
%294 = load i32, i32* %2
%295 = call i32 @omp_target_free(i8* %293, i32 %294)
store i32 0, i32* %1
br label %296
296: ; preds = %292, %45
%297 = load i32, i32* %1
ret i32 %297
}

LLVM IR (-O2):
@__const.main.src_offsets = [3 x i64] [i64 1, i64 0, i64 0]
@__const.main.src_dimensions = [3 x i64] [i64 128, i64 0, i64 0]
define i32 @main() {
%1 = alloca [128 x i32]
%2 = alloca [3 x i64]
%3 = alloca [3 x i64]
%4 = alloca [3 x i64]
%5 = alloca [3 x i64]
%6 = alloca [3 x i64]
%7 = tail call i32 (...) @omp_get_default_device()
%8 = tail call i32 (...) @omp_get_initial_device()
%9 = bitcast [128 x i32]* %1 to i8*
%10 = icmp slt i32 %7, 0
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = tail call i32 (...) @omp_get_num_devices()
%13 = icmp slt i32 %7, %12
br i1 %13, label %15, label %14
14: ; preds = %11, %0
br label %15
15: ; preds = %14, %11
%16 = phi i32 [ %8, %14 ], [ %7, %11 ]
%17 = bitcast [128 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %17
%18 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 4
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %19
%20 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 8
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %21
%22 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 12
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %23
%24 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 16
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %25
%26 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 20
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %27
%28 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 24
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %29
%30 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 28
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, <4 x i32>* %31
%32 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 32
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, <4 x i32>* %33
%34 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 36
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, <4 x i32>* %35
%36 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 40
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, <4 x i32>* %37
%38 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 44
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, <4 x i32>* %39
%40 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 48
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, <4 x i32>* %41
%42 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 52
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, <4 x i32>* %43
%44 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 56
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, <4 x i32>* %45
%46 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 60
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 60, i32 61, i32 62, i32 63>, <4 x i32>* %47
%48 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 64
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 64, i32 65, i32 66, i32 67>, <4 x i32>* %49
%50 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 68
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 68, i32 69, i32 70, i32 71>, <4 x i32>* %51
%52 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 72
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> <i32 72, i32 73, i32 74, i32 75>, <4 x i32>* %53
%54 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 76
%55 = bitcast i32* %54 to <4 x i32>*
store <4 x i32> <i32 76, i32 77, i32 78, i32 79>, <4 x i32>* %55
%56 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 80
%57 = bitcast i32* %56 to <4 x i32>*
store <4 x i32> <i32 80, i32 81, i32 82, i32 83>, <4 x i32>* %57
%58 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 84
%59 = bitcast i32* %58 to <4 x i32>*
store <4 x i32> <i32 84, i32 85, i32 86, i32 87>, <4 x i32>* %59
%60 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 88
%61 = bitcast i32* %60 to <4 x i32>*
store <4 x i32> <i32 88, i32 89, i32 90, i32 91>, <4 x i32>* %61
%62 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 92
%63 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> <i32 92, i32 93, i32 94, i32 95>, <4 x i32>* %63
%64 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 96
%65 = bitcast i32* %64 to <4 x i32>*
store <4 x i32> <i32 96, i32 97, i32 98, i32 99>, <4 x i32>* %65
%66 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 100
%67 = bitcast i32* %66 to <4 x i32>*
store <4 x i32> <i32 100, i32 101, i32 102, i32 103>, <4 x i32>* %67
%68 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 104
%69 = bitcast i32* %68 to <4 x i32>*
store <4 x i32> <i32 104, i32 105, i32 106, i32 107>, <4 x i32>* %69
%70 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 108
%71 = bitcast i32* %70 to <4 x i32>*
store <4 x i32> <i32 108, i32 109, i32 110, i32 111>, <4 x i32>* %71
%72 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 112
%73 = bitcast i32* %72 to <4 x i32>*
store <4 x i32> <i32 112, i32 113, i32 114, i32 115>, <4 x i32>* %73
%74 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 116
%75 = bitcast i32* %74 to <4 x i32>*
store <4 x i32> <i32 116, i32 117, i32 118, i32 119>, <4 x i32>* %75
%76 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 120
%77 = bitcast i32* %76 to <4 x i32>*
store <4 x i32> <i32 120, i32 121, i32 122, i32 123>, <4 x i32>* %77
%78 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 124
%79 = bitcast i32* %78 to <4 x i32>*
store <4 x i32> <i32 124, i32 125, i32 126, i32 127>, <4 x i32>* %79
%80 = tail call i8* @omp_target_alloc(i32 520, i32 %16)
%81 = icmp eq i8* %80, null
br i1 %81, label %266, label %82
82: ; preds = %15
%83 = tail call i64 @omp_target_memcpy_rect(i8* null, i32* null, i32 0, i32 0, i64* null, i64* null, i64* null, i64* null, i64* null, i32 %16, i32 %8)
%84 = icmp slt i64 %83, 3
br i1 %84, label %91, label %85
85: ; preds = %82
%86 = tail call i64 @omp_target_memcpy_rect(i8* null, i32* null, i32 0, i32 0, i64* null, i64* null, i64* null, i64* null, i64* null, i32 %8, i32 %16)
%87 = icmp slt i64 %86, 3
br i1 %87, label %91, label %88
88: ; preds = %85
%89 = tail call i64 @omp_target_memcpy_rect(i8* null, i32* null, i32 0, i32 0, i64* null, i64* null, i64* null, i64* null, i64* null, i32 %8, i32 %8)
%90 = icmp slt i64 %89, 3
br i1 %90, label %91, label %93
91: ; preds = %88, %85, %82
%92 = tail call i32 (...) @abort()
unreachable
93: ; preds = %88
%94 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 0
%95 = call i64 @omp_target_associate_ptr(i32* %94, i8* %80, i32 512, i32 4, i32 %16)
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %264
97: ; preds = %93
%98 = bitcast [3 x i64]* %2 to i8*
%99 = bitcast [3 x i64]* %3 to i8*
%100 = bitcast [3 x i64]* %4 to i8*
%101 = bitcast [3 x i64]* %5 to i8*
%102 = bitcast [3 x i64]* %6 to i8*
%103 = call i64 @omp_target_associate_ptr(i32* %94, i8* %80, i32 512, i32 4, i32 %16)
%104 = icmp eq i64 %103, 0
br i1 %104, label %107, label %105
105: ; preds = %97
%106 = call i32 (...) @abort()
unreachable
107: ; preds = %97
%108 = call i32 @omp_target_is_present(i32* %94, i32 %16)
%109 = icmp eq i32 %108, 1
br i1 %109, label %110, label %118
110: ; preds = %107
%111 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 32
%112 = call i32 @omp_target_is_present(i32* %111, i32 %16)
%113 = icmp eq i32 %112, 1
br i1 %113, label %114, label %118
114: ; preds = %110
%115 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 127
%116 = call i32 @omp_target_is_present(i32* %115, i32 %16)
%117 = icmp eq i32 %116, 1
br i1 %117, label %120, label %118
118: ; preds = %114, %110, %107
%119 = call i32 (...) @abort()
unreachable
120: ; preds = %114
%121 = call i64 @omp_target_memcpy(i8* %80, i8* %9, i32 512, i32 4, i32 0, i32 %16, i32 %8)
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %126
123: ; preds = %120, %138
%124 = phi i64 [ %139, %138 ], [ 0, %120 ]
%125 = phi i1 [ false, %138 ], [ true, %120 ]
br label %128
126: ; preds = %120
%127 = call i32 (...) @abort()
unreachable
128: ; preds = %123, %134
%129 = phi i64 [ %136, %134 ], [ %124, %123 ]
%130 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = zext i32 %131 to i64
%133 = icmp eq i64 %129, %132
br i1 %133, label %134, label %138
134: ; preds = %128
%135 = add nsw i32 %131, 4
store i32 %135, i32* %130
%136 = add nuw nsw i64 %129, 1
%137 = icmp eq i64 %136, 128
br i1 %137, label %141, label %128
138: ; preds = %128
%139 = add nuw nsw i64 %129, 1
%140 = icmp eq i64 %139, 128
br i1 %140, label %142, label %123
141: ; preds = %134
br i1 %125, label %144, label %142
142: ; preds = %138, %141
%143 = call i32 (...) @abort()
unreachable
144: ; preds = %141
%145 = bitcast i8* %80 to i32*
%146 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%147 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 0
%148 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
%149 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
%150 = getelementptr inbounds [3 x i64], [3 x i64]* %6, i64 0, i64 0
%151 = call i64 @omp_target_memcpy_rect(i8* %9, i32* %145, i32 4, i32 1, i64* %146, i64* %147, i64* %148, i64* %149, i64* %150, i32 %8, i32 %16)
%152 = icmp eq i64 %151, 0
br i1 %152, label %179, label %153
153: ; preds = %144
%154 = call i32 (...) @abort()
unreachable
155: ; preds = %179
%156 = or i64 %180, 1
%157 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %156
%158 = load i32, i32* %157
%159 = add nuw nsw i64 %180, 5
%160 = zext i32 %158 to i64
%161 = icmp eq i64 %159, %160
br i1 %161, label %162, label %186
162: ; preds = %155
%163 = or i64 %180, 2
%164 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %163
%165 = load i32, i32* %164
%166 = add nuw nsw i64 %180, 6
%167 = zext i32 %165 to i64
%168 = icmp eq i64 %166, %167
br i1 %168, label %169, label %186
169: ; preds = %162
%170 = or i64 %180, 3
%171 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %170
%172 = load i32, i32* %171
%173 = add nuw nsw i64 %180, 7
%174 = zext i32 %172 to i64
%175 = icmp eq i64 %173, %174
br i1 %175, label %176, label %186
176: ; preds = %169
%177 = add nuw nsw i64 %180, 4
%178 = icmp eq i64 %177, 128
br i1 %178, label %188, label %179
179: ; preds = %144, %176
%180 = phi i64 [ %177, %176 ], [ 0, %144 ]
%181 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %180
%182 = load i32, i32* %181
%183 = add nuw nsw i64 %180, 4
%184 = zext i32 %182 to i64
%185 = icmp eq i64 %183, %184
br i1 %185, label %155, label %186
186: ; preds = %169, %162, %155, %179
%187 = call i32 (...) @abort()
unreachable
188: ; preds = %176
%189 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
store i64 2, i64* %189
%190 = bitcast [3 x i64]* %2 to <2 x i64>*
store <2 x i64> <i64 6, i64 3>, <2 x i64>* %190
%191 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 2
store i64 1, i64* %191
%192 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
%193 = bitcast [3 x i64]* %3 to i8*
store i64 1, i64* %192
%194 = bitcast [3 x i64]* %4 to <2 x i64>*
store <2 x i64> <i64 3, i64 0>, <2 x i64>* %194
%195 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 2
store i64 2, i64* %195
%196 = bitcast [3 x i64]* %5 to <2 x i64>*
store <2 x i64> <i64 6, i64 3>, <2 x i64>* %196
%197 = getelementptr inbounds [3 x i64], [3 x i64]* %6, i64 0, i64 2
store i64 3, i64* %197
%198 = bitcast [3 x i64]* %6 to <2 x i64>*
store <2 x i64> <i64 6, i64 4>, <2 x i64>* %198
%199 = call i64 @omp_target_memcpy_rect(i8* %80, i32* %94, i32 4, i32 3, i64* %146, i64* %147, i64* %148, i64* %149, i64* %150, i32 %16, i32 %8)
%200 = icmp eq i64 %199, 0
br i1 %200, label %201, label %224
201: ; preds = %188
%202 = load i32, i32* %94
%203 = icmp eq i32 %202, 41
%204 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 1
%205 = load i32, i32* %204
%206 = icmp eq i32 %205, 42
%207 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 2
%208 = load i32, i32* %207
%209 = icmp eq i32 %208, 44
%210 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 3
%211 = load i32, i32* %210
%212 = icmp eq i32 %211, 45
%213 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 4
%214 = bitcast i32* %213 to <32 x i32>*
%215 = load <32 x i32>, <32 x i32>* %214
%216 = freeze <32 x i32> %215
%217 = icmp ne <32 x i32> %216, <i32 47, i32 48, i32 53, i32 54, i32 56, i32 57, i32 59, i32 60, i32 65, i32 66, i32 68, i32 69, i32 71, i32 72, i32 77, i32 78, i32 80, i32 81, i32 83, i32 84, i32 89, i32 90, i32 92, i32 93, i32 95, i32 96, i32 101, i32 102, i32 104, i32 105, i32 107, i32 108>
%218 = bitcast <32 x i1> %217 to i32
%219 = icmp eq i32 %218, 0
%220 = select i1 %219, i1 %212, i1 false
%221 = select i1 %220, i1 %209, i1 false
%222 = select i1 %221, i1 %206, i1 false
%223 = select i1 %222, i1 %203, i1 false
br i1 %223, label %228, label %226
224: ; preds = %188
%225 = call i32 (...) @abort()
unreachable
226: ; preds = %201
%227 = call i32 (...) @abort()
unreachable
228: ; preds = %201
%229 = call i64 @omp_target_memcpy(i8* %80, i8* %80, i32 40, i32 204, i32 444, i32 %16, i32 %16)
%230 = icmp eq i64 %229, 0
br i1 %230, label %231, label %254
231: ; preds = %228
%232 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 50
%233 = load i32, i32* %232
%234 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 110
%235 = load i32, i32* %234
%236 = icmp eq i32 %233, %235
%237 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 51
%238 = load i32, i32* %237
%239 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 111
%240 = load i32, i32* %239
%241 = icmp eq i32 %238, %240
%242 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 52
%243 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 112
%244 = bitcast i32* %242 to <8 x i32>*
%245 = load <8 x i32>, <8 x i32>* %244
%246 = bitcast i32* %243 to <8 x i32>*
%247 = load <8 x i32>, <8 x i32>* %246
%248 = icmp eq <8 x i32> %245, %247
%249 = freeze <8 x i1> %248
%250 = bitcast <8 x i1> %249 to i8
%251 = icmp eq i8 %250, -1
%252 = select i1 %251, i1 %241, i1 false
%253 = select i1 %252, i1 %236, i1 false
br i1 %253, label %258, label %256
254: ; preds = %228
%255 = call i32 (...) @abort()
unreachable
256: ; preds = %231
%257 = call i32 (...) @abort()
unreachable
258: ; preds = %231
%259 = call i64 @omp_target_disassociate_ptr(i32* %94, i32 %16)
%260 = icmp eq i64 %259, 0
br i1 %260, label %263, label %261
261: ; preds = %258
%262 = call i32 (...) @abort()
unreachable
263: ; preds = %258
br label %264
264: ; preds = %263, %93
%265 = call i32 @omp_target_free(i8* %80, i32 %16)
br label %266
266: ; preds = %15, %264
ret i32 0
}