#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*/ __tgt_register_requires(int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int fails;
  void *host_alloc, *device_alloc;
  void *host_data, *device_data;
  int *alloc = (int *)malloc(1024 * sizeof(int));
  int data[1024];
  __tgt_register_requires(8);
  for (int i = 0; i < 1024; ++i) {
    alloc[i] = 10;
    data[i] = 1;
  }
  host_data = &data[0];
  host_alloc = &alloc[0];
#pragma omp target map(tofrom : device_data, device_alloc)
  {
    device_data = &data[0];
    device_alloc = &alloc[0];
    for (int i = 0; i < 1024; i++) {
      alloc[i] += 1;
      data[i] += 1;
    }
  }
  if (device_alloc == host_alloc)
    printf("Address of alloc on device matches host address.\n");
  if (device_data == host_data)
    printf("Address of data on device matches host address.\n");
  fails = 0;
  for (int i = 0; i < 1024; i++) {
    if (alloc[i] != 11)
      fails++;
  }
  printf("Alloc device values updated: %s\n",
         (fails == 0) ? "Succeeded" : "Failed");
  fails = 0;
  for (int i = 0; i < 1024; i++) {
    if (data[i] != 2)
      fails++;
  }
  printf("Data device values updated: %s\n",
         (fails == 0) ? "Succeeded" : "Failed");
  for (int i = 0; i < 1024; ++i) {
    alloc[i] += 1;
    data[i] += 1;
  }
#pragma omp target
  {
    fails = 0;
    for (int i = 0; i < 1024; i++) {
      if (alloc[i] != 12)
        fails++;
    }
    printf("Alloc host values updated: %s\n",
           (fails == 0) ? "Succeeded" : "Failed");
    fails = 0;
    for (int i = 0; i < 1024; i++) {
      if (data[i] != 3)
        fails++;
    }
    printf("Data host values updated: %s\n",
           (fails == 0) ? "Succeeded" : "Failed");
  }
  free(alloc);
  printf("Done!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x8,%edi
call   1060 <__tgt_register_requires@plt>
movl   $0x0,-0x1044(%rbp)
cmpl   $0x400,-0x1044(%rbp)
jge    11c3 <main+0x83>
mov    -0x40(%rbp),%rax
movslq -0x1044(%rbp),%rcx
movl   $0xa,(%rax,%rcx,4)
movslq -0x1044(%rbp),%rax
movl   $0x1,-0x1040(%rbp,%rax,4)
mov    -0x1044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1044(%rbp)
jmp    117b <main+0x3b>
lea    -0x1040(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x1040(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1048(%rbp)
cmpl   $0x400,-0x1048(%rbp)
jge    1243 <main+0x103>
mov    -0x40(%rbp),%rax
movslq -0x1048(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movslq -0x1048(%rbp),%rax
mov    -0x1040(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1040(%rbp,%rax,4)
mov    -0x1048(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1048(%rbp)
jmp    11f3 <main+0xb3>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    125f <main+0x11f>
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    127b <main+0x13b>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x104c(%rbp)
cmpl   $0x400,-0x104c(%rbp)
jge    12d3 <main+0x193>
mov    -0x40(%rbp),%rax
movslq -0x104c(%rbp),%rcx
cmpl   $0xb,(%rax,%rcx,4)
je     12ba <main+0x17a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12bf <main+0x17f>
mov    -0x104c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104c(%rbp)
jmp    128c <main+0x14c>
mov    -0x14(%rbp),%ecx
lea    0xdb1(%rip),%rsi
lea    0xda0(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x1050(%rbp)
cmpl   $0x400,-0x1050(%rbp)
jge    1351 <main+0x211>
movslq -0x1050(%rbp),%rax
cmpl   $0x2,-0x1040(%rbp,%rax,4)
02
je     1338 <main+0x1f8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    133d <main+0x1fd>
mov    -0x1050(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1050(%rbp)
jmp    130a <main+0x1ca>
mov    -0x14(%rbp),%ecx
lea    0xd33(%rip),%rsi
lea    0xd22(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1054(%rbp)
cmpl   $0x400,-0x1054(%rbp)
jge    13d1 <main+0x291>
mov    -0x40(%rbp),%rax
movslq -0x1054(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movslq -0x1054(%rbp),%rax
mov    -0x1040(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1040(%rbp,%rax,4)
mov    -0x1054(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1054(%rbp)
jmp    1381 <main+0x241>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x1058(%rbp)
cmpl   $0x400,-0x1058(%rbp)
jge    1429 <main+0x2e9>
mov    -0x40(%rbp),%rax
movslq -0x1058(%rbp),%rcx
cmpl   $0xc,(%rax,%rcx,4)
je     1410 <main+0x2d0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1415 <main+0x2d5>
mov    -0x1058(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1058(%rbp)
jmp    13e2 <main+0x2a2>
mov    -0x14(%rbp),%ecx
lea    0xc5b(%rip),%rsi
lea    0xc4a(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x105c(%rbp)
cmpl   $0x400,-0x105c(%rbp)
jge    14a7 <main+0x367>
movslq -0x105c(%rbp),%rax
cmpl   $0x3,-0x1040(%rbp,%rax,4)
03
je     148e <main+0x34e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1493 <main+0x353>
mov    -0x105c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x105c(%rbp)
jmp    1460 <main+0x320>
mov    -0x14(%rbp),%ecx
lea    0xbdd(%rip),%rsi
lea    0xbcc(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
lea    0xc0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
lea    0xc15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1008,%rsp
mov    $0x1000,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    $0x8,%edi
call   1070 <__tgt_register_requires@plt>
mov    $0x1c,%eax
movdqa 0xe7e(%rip),%xmm0
movdqa 0xe86(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movdqu %xmm0,-0x70(%r12,%rax,4)
movdqu %xmm0,-0x60(%r12,%rax,4)
movdqa %xmm1,-0x70(%rsp,%rax,4)
movdqa %xmm1,-0x60(%rsp,%rax,4)
movdqu %xmm0,-0x50(%r12,%rax,4)
movdqu %xmm0,-0x40(%r12,%rax,4)
movdqa %xmm1,-0x50(%rsp,%rax,4)
movdqa %xmm1,-0x40(%rsp,%rax,4)
movdqu %xmm0,-0x30(%r12,%rax,4)
movdqu %xmm0,-0x20(%r12,%rax,4)
movdqa %xmm1,-0x30(%rsp,%rax,4)
movdqa %xmm1,-0x20(%rsp,%rax,4)
movdqu %xmm0,-0x10(%r12,%rax,4)
movdqu %xmm0,(%r12,%rax,4)
movdqa %xmm1,-0x10(%rsp,%rax,4)
movdqa %xmm1,(%rsp,%rax,4)
add    $0x20,%rax
cmp    $0x41c,%rax
jne    1190 <main+0x40>
mov    $0xc,%eax
pcmpeqd %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
movdqu -0x30(%r12,%rax,4),%xmm1
movdqu -0x20(%r12,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqu %xmm1,-0x30(%r12,%rax,4)
movdqu %xmm2,-0x20(%r12,%rax,4)
movdqa -0x30(%rsp,%rax,4),%xmm1
movdqa -0x20(%rsp,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqa %xmm1,-0x30(%rsp,%rax,4)
movdqa %xmm2,-0x20(%rsp,%rax,4)
movdqu -0x10(%r12,%rax,4),%xmm1
movdqu (%r12,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqu %xmm1,-0x10(%r12,%rax,4)
movdqu %xmm2,(%r12,%rax,4)
movdqa -0x10(%rsp,%rax,4),%xmm1
movdqa (%rsp,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqa %xmm1,-0x10(%rsp,%rax,4)
movdqa %xmm2,(%rsp,%rax,4)
add    $0x10,%rax
cmp    $0x40c,%rax
jne    1210 <main+0xc0>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
pxor   %xmm1,%xmm1
mov    $0xc,%eax
movdqa 0xd53(%rip),%xmm0
movdqa 0xd5b(%rip),%xmm5
pxor   %xmm2,%xmm2
nopl   0x0(%rax)
movdqu -0x30(%r12,%rax,4),%xmm3
movdqu -0x20(%r12,%rax,4),%xmm4
pcmpeqd %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqu -0x10(%r12,%rax,4),%xmm1
pcmpeqd %xmm0,%xmm4
paddd  %xmm2,%xmm4
movdqu (%r12,%rax,4),%xmm2
pcmpeqd %xmm0,%xmm1
pcmpeqd %xmm0,%xmm2
paddd  %xmm5,%xmm1
paddd  %xmm3,%xmm1
paddd  %xmm5,%xmm2
paddd  %xmm4,%xmm2
add    $0x10,%rax
cmp    $0x40c,%rax
jne    12e0 <main+0x190>
paddd  %xmm1,%xmm2
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
test   %eax,%eax
lea    0xd2f(%rip),%r15
lea    0xd32(%rip),%r14
mov    %r14,%rsi
cmove  %r15,%rsi
lea    0xcf9(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
movdqa 0xcb8(%rip),%xmm4
pxor   %xmm1,%xmm1
pxor   %xmm0,%xmm0
movdqa (%rsp,%rbx,4),%xmm2
pcmpeqd %xmm4,%xmm2
paddd  %xmm1,%xmm2
movdqa 0x10(%rsp,%rbx,4),%xmm3
pcmpeqd %xmm4,%xmm3
paddd  %xmm0,%xmm3
movdqa 0x20(%rsp,%rbx,4),%xmm1
pcmpeqd %xmm4,%xmm1
movdqa 0x30(%rsp,%rbx,4),%xmm0
pcmpeqd %xmm4,%xmm0
paddd  %xmm4,%xmm1
paddd  %xmm2,%xmm1
paddd  %xmm4,%xmm0
paddd  %xmm3,%xmm0
add    $0x10,%rbx
cmp    $0x400,%rbx
jne    1380 <main+0x230>
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
test   %eax,%eax
mov    %r14,%rsi
cmove  %r15,%rsi
lea    0xc9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xc,%eax
pcmpeqd %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
movdqu -0x30(%r12,%rax,4),%xmm1
movdqu -0x20(%r12,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqu %xmm1,-0x30(%r12,%rax,4)
movdqu %xmm2,-0x20(%r12,%rax,4)
movdqa -0x30(%rsp,%rax,4),%xmm1
movdqa -0x20(%rsp,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqa %xmm1,-0x30(%rsp,%rax,4)
movdqa %xmm2,-0x20(%rsp,%rax,4)
movdqu -0x10(%r12,%rax,4),%xmm1
movdqu (%r12,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqu %xmm1,-0x10(%r12,%rax,4)
movdqu %xmm2,(%r12,%rax,4)
movdqa -0x10(%rsp,%rax,4),%xmm1
movdqa (%rsp,%rax,4),%xmm2
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqa %xmm1,-0x10(%rsp,%rax,4)
movdqa %xmm2,(%rsp,%rax,4)
add    $0x10,%rax
cmp    $0x40c,%rax
jne    1410 <main+0x2c0>
pxor   %xmm1,%xmm1
mov    $0xc,%eax
movdqa 0xb8b(%rip),%xmm0
pxor   %xmm2,%xmm2
movdqa 0xb6f(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqu -0x30(%r12,%rax,4),%xmm3
movdqu -0x20(%r12,%rax,4),%xmm4
pcmpeqd %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqu -0x10(%r12,%rax,4),%xmm1
pcmpeqd %xmm0,%xmm4
paddd  %xmm2,%xmm4
movdqu (%r12,%rax,4),%xmm2
pcmpeqd %xmm0,%xmm1
pcmpeqd %xmm0,%xmm2
paddd  %xmm5,%xmm1
paddd  %xmm3,%xmm1
paddd  %xmm5,%xmm2
paddd  %xmm4,%xmm2
add    $0x10,%rax
cmp    $0x40c,%rax
jne    14d0 <main+0x380>
paddd  %xmm1,%xmm2
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
test   %eax,%eax
mov    %r14,%rsi
cmove  %r15,%rsi
lea    0xb69(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
movdqa 0xad6(%rip),%xmm5
pxor   %xmm1,%xmm1
movdqa 0xaea(%rip),%xmm0
pxor   %xmm2,%xmm2
nopw   0x0(%rax,%rax,1)
movdqa (%rsp,%rbx,4),%xmm3
pcmpeqd %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqa 0x10(%rsp,%rbx,4),%xmm4
pcmpeqd %xmm0,%xmm4
paddd  %xmm2,%xmm4
movdqa 0x20(%rsp,%rbx,4),%xmm1
pcmpeqd %xmm0,%xmm1
movdqa 0x30(%rsp,%rbx,4),%xmm2
pcmpeqd %xmm0,%xmm2
paddd  %xmm5,%xmm1
paddd  %xmm3,%xmm1
paddd  %xmm5,%xmm2
paddd  %xmm4,%xmm2
add    $0x10,%rbx
cmp    $0x400,%rbx
jne    1570 <main+0x420>
paddd  %xmm1,%xmm2
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
test   %eax,%eax
cmove  %r15,%r14
lea    0xaee(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
lea    0xb54(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Address of alloc on device matches host address.\0A\00"
@.str.1 = [49 x i8] c"Address of data on device matches host address.\0A\00"
@.str.2 = [33 x i8] c"Alloc device values updated: %s\0A\00"
@.str.3 = [10 x i8] c"Succeeded\00"
@.str.4 = [7 x i8] c"Failed\00"
@.str.5 = [32 x i8] c"Data device values updated: %s\0A\00"
@.str.6 = [31 x i8] c"Alloc host values updated: %s\0A\00"
@.str.7 = [30 x i8] c"Data host values updated: %s\0A\00"
@.str.8 = [7 x i8] c"Done!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca [1024 x i32]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = call i64 @malloc(i32 4096)
%21 = inttoptr i64 %20 to i32*
store i32* %21, i32** %11
%22 = call i32 @__tgt_register_requires(i32 8)
store i32 0, i32* %13
br label %23
23: ; preds = %34, %2
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 1024
br i1 %25, label %26, label %37
26: ; preds = %23
%27 = load i32*, i32** %11
%28 = load i32, i32* %13
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 10, i32* %30
%31 = load i32, i32* %13
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 %32
store i32 1, i32* %33
br label %34
34: ; preds = %26
%35 = load i32, i32* %13
%36 = add nsw i32 %35, 1
store i32 %36, i32* %13
br label %23
37: ; preds = %23
%38 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 0
%39 = bitcast i32* %38 to i8*
store i8* %39, i8** %9
%40 = load i32*, i32** %11
%41 = getelementptr inbounds i32, i32* %40, i64 0
%42 = bitcast i32* %41 to i8*
store i8* %42, i8** %7
%43 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 0
%44 = bitcast i32* %43 to i8*
store i8* %44, i8** %10
%45 = load i32*, i32** %11
%46 = getelementptr inbounds i32, i32* %45, i64 0
%47 = bitcast i32* %46 to i8*
store i8* %47, i8** %8
store i32 0, i32* %14
br label %48
48: ; preds = %63, %37
%49 = load i32, i32* %14
%50 = icmp slt i32 %49, 1024
br i1 %50, label %51, label %66
51: ; preds = %48
%52 = load i32*, i32** %11
%53 = load i32, i32* %14
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = load i32, i32* %55
%57 = add nsw i32 %56, 1
store i32 %57, i32* %55
%58 = load i32, i32* %14
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 1
store i32 %62, i32* %60
br label %63
63: ; preds = %51
%64 = load i32, i32* %14
%65 = add nsw i32 %64, 1
store i32 %65, i32* %14
br label %48
66: ; preds = %48
%67 = load i8*, i8** %8
%68 = load i8*, i8** %7
%69 = icmp eq i8* %67, %68
br i1 %69, label %70, label %72
70: ; preds = %66
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %72
72: ; preds = %70, %66
%73 = load i8*, i8** %10
%74 = load i8*, i8** %9
%75 = icmp eq i8* %73, %74
br i1 %75, label %76, label %78
76: ; preds = %72
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %78
78: ; preds = %76, %72
store i32 0, i32* %6
store i32 0, i32* %15
br label %79
79: ; preds = %93, %78
%80 = load i32, i32* %15
%81 = icmp slt i32 %80, 1024
br i1 %81, label %82, label %96
82: ; preds = %79
%83 = load i32*, i32** %11
%84 = load i32, i32* %15
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i32, i32* %83, i64 %85
%87 = load i32, i32* %86
%88 = icmp ne i32 %87, 11
br i1 %88, label %89, label %92
89: ; preds = %82
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 1
store i32 %91, i32* %6
br label %92
92: ; preds = %89, %82
br label %93
93: ; preds = %92
%94 = load i32, i32* %15
%95 = add nsw i32 %94, 1
store i32 %95, i32* %15
br label %79
96: ; preds = %79
%97 = load i32, i32* %6
%98 = icmp eq i32 %97, 0
%99 = zext i1 %98 to i64
%100 = select i1 %98, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %100)
store i32 0, i32* %6
store i32 0, i32* %16
br label %102
102: ; preds = %115, %96
%103 = load i32, i32* %16
%104 = icmp slt i32 %103, 1024
br i1 %104, label %105, label %118
105: ; preds = %102
%106 = load i32, i32* %16
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = icmp ne i32 %109, 2
br i1 %110, label %111, label %114
111: ; preds = %105
%112 = load i32, i32* %6
%113 = add nsw i32 %112, 1
store i32 %113, i32* %6
br label %114
114: ; preds = %111, %105
br label %115
115: ; preds = %114
%116 = load i32, i32* %16
%117 = add nsw i32 %116, 1
store i32 %117, i32* %16
br label %102
118: ; preds = %102
%119 = load i32, i32* %6
%120 = icmp eq i32 %119, 0
%121 = zext i1 %120 to i64
%122 = select i1 %120, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %122)
store i32 0, i32* %17
br label %124
124: ; preds = %139, %118
%125 = load i32, i32* %17
%126 = icmp slt i32 %125, 1024
br i1 %126, label %127, label %142
127: ; preds = %124
%128 = load i32*, i32** %11
%129 = load i32, i32* %17
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i32, i32* %128, i64 %130
%132 = load i32, i32* %131
%133 = add nsw i32 %132, 1
store i32 %133, i32* %131
%134 = load i32, i32* %17
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 %135
%137 = load i32, i32* %136
%138 = add nsw i32 %137, 1
store i32 %138, i32* %136
br label %139
139: ; preds = %127
%140 = load i32, i32* %17
%141 = add nsw i32 %140, 1
store i32 %141, i32* %17
br label %124
142: ; preds = %124
store i32 0, i32* %6
store i32 0, i32* %18
br label %143
143: ; preds = %157, %142
%144 = load i32, i32* %18
%145 = icmp slt i32 %144, 1024
br i1 %145, label %146, label %160
146: ; preds = %143
%147 = load i32*, i32** %11
%148 = load i32, i32* %18
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i32, i32* %147, i64 %149
%151 = load i32, i32* %150
%152 = icmp ne i32 %151, 12
br i1 %152, label %153, label %156
153: ; preds = %146
%154 = load i32, i32* %6
%155 = add nsw i32 %154, 1
store i32 %155, i32* %6
br label %156
156: ; preds = %153, %146
br label %157
157: ; preds = %156
%158 = load i32, i32* %18
%159 = add nsw i32 %158, 1
store i32 %159, i32* %18
br label %143
160: ; preds = %143
%161 = load i32, i32* %6
%162 = icmp eq i32 %161, 0
%163 = zext i1 %162 to i64
%164 = select i1 %162, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %164)
store i32 0, i32* %6
store i32 0, i32* %19
br label %166
166: ; preds = %179, %160
%167 = load i32, i32* %19
%168 = icmp slt i32 %167, 1024
br i1 %168, label %169, label %182
169: ; preds = %166
%170 = load i32, i32* %19
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [1024 x i32], [1024 x i32]* %12, i64 0, i64 %171
%173 = load i32, i32* %172
%174 = icmp ne i32 %173, 3
br i1 %174, label %175, label %178
175: ; preds = %169
%176 = load i32, i32* %6
%177 = add nsw i32 %176, 1
store i32 %177, i32* %6
br label %178
178: ; preds = %175, %169
br label %179
179: ; preds = %178
%180 = load i32, i32* %19
%181 = add nsw i32 %180, 1
store i32 %181, i32* %19
br label %166
182: ; preds = %166
%183 = load i32, i32* %6
%184 = icmp eq i32 %183, 0
%185 = zext i1 %184 to i64
%186 = select i1 %184, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %186)
%188 = load i32*, i32** %11
%189 = call i32 @free(i32* %188)
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [33 x i8] c"Alloc device values updated: %s\0A\00"
@.str.3 = [10 x i8] c"Succeeded\00"
@.str.4 = [7 x i8] c"Failed\00"
@.str.5 = [32 x i8] c"Data device values updated: %s\0A\00"
@.str.6 = [31 x i8] c"Alloc host values updated: %s\0A\00"
@.str.7 = [30 x i8] c"Data host values updated: %s\0A\00"
@str = [49 x i8] c"Address of alloc on device matches host address.\00"
@str.9 = [48 x i8] c"Address of data on device matches host address.\00"
@str.10 = [6 x i8] c"Done!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i32]
%4 = tail call i64 @malloc(i32 4096)
%5 = inttoptr i64 %4 to i32*
%6 = bitcast [1024 x i32]* %3 to i8*
%7 = tail call i32 @__tgt_register_requires(i32 8)
br label %8
8: ; preds = %8, %2
%9 = phi i64 [ 0, %2 ], [ %45, %8 ]
%10 = getelementptr inbounds i32, i32* %5, i64 %9
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %10, i64 4
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %13
%14 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %9
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %15
%16 = getelementptr inbounds i32, i32* %14, i64 4
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %17
%18 = or i64 %9, 8
%19 = getelementptr inbounds i32, i32* %5, i64 %18
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %20
%21 = getelementptr inbounds i32, i32* %19, i64 4
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %22
%23 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %18
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %24
%25 = getelementptr inbounds i32, i32* %23, i64 4
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %26
%27 = or i64 %9, 16
%28 = getelementptr inbounds i32, i32* %5, i64 %27
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %29
%30 = getelementptr inbounds i32, i32* %28, i64 4
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %31
%32 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %27
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %33
%34 = getelementptr inbounds i32, i32* %32, i64 4
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %35
%36 = or i64 %9, 24
%37 = getelementptr inbounds i32, i32* %5, i64 %36
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %38
%39 = getelementptr inbounds i32, i32* %37, i64 4
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %40
%41 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %36
%42 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %42
%43 = getelementptr inbounds i32, i32* %41, i64 4
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %44
%45 = add nuw nsw i64 %9, 32
%46 = icmp eq i64 %45, 1024
br i1 %46, label %47, label %8
47: ; preds = %8, %47
%48 = phi i64 [ %90, %47 ], [ 0, %8 ]
%49 = getelementptr inbounds i32, i32* %5, i64 %48
%50 = bitcast i32* %49 to <4 x i32>*
%51 = load <4 x i32>, <4 x i32>* %50
%52 = getelementptr inbounds i32, i32* %49, i64 4
%53 = bitcast i32* %52 to <4 x i32>*
%54 = load <4 x i32>, <4 x i32>* %53
%55 = add nsw <4 x i32> %51, <i32 1, i32 1, i32 1, i32 1>
%56 = add nsw <4 x i32> %54, <i32 1, i32 1, i32 1, i32 1>
%57 = bitcast i32* %49 to <4 x i32>*
store <4 x i32> %55, <4 x i32>* %57
%58 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> %56, <4 x i32>* %58
%59 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %48
%60 = bitcast i32* %59 to <4 x i32>*
%61 = load <4 x i32>, <4 x i32>* %60
%62 = getelementptr inbounds i32, i32* %59, i64 4
%63 = bitcast i32* %62 to <4 x i32>*
%64 = load <4 x i32>, <4 x i32>* %63
%65 = add nsw <4 x i32> %61, <i32 1, i32 1, i32 1, i32 1>
%66 = add nsw <4 x i32> %64, <i32 1, i32 1, i32 1, i32 1>
%67 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> %65, <4 x i32>* %67
%68 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> %66, <4 x i32>* %68
%69 = or i64 %48, 8
%70 = getelementptr inbounds i32, i32* %5, i64 %69
%71 = bitcast i32* %70 to <4 x i32>*
%72 = load <4 x i32>, <4 x i32>* %71
%73 = getelementptr inbounds i32, i32* %70, i64 4
%74 = bitcast i32* %73 to <4 x i32>*
%75 = load <4 x i32>, <4 x i32>* %74
%76 = add nsw <4 x i32> %72, <i32 1, i32 1, i32 1, i32 1>
%77 = add nsw <4 x i32> %75, <i32 1, i32 1, i32 1, i32 1>
%78 = bitcast i32* %70 to <4 x i32>*
store <4 x i32> %76, <4 x i32>* %78
%79 = bitcast i32* %73 to <4 x i32>*
store <4 x i32> %77, <4 x i32>* %79
%80 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %69
%81 = bitcast i32* %80 to <4 x i32>*
%82 = load <4 x i32>, <4 x i32>* %81
%83 = getelementptr inbounds i32, i32* %80, i64 4
%84 = bitcast i32* %83 to <4 x i32>*
%85 = load <4 x i32>, <4 x i32>* %84
%86 = add nsw <4 x i32> %82, <i32 1, i32 1, i32 1, i32 1>
%87 = add nsw <4 x i32> %85, <i32 1, i32 1, i32 1, i32 1>
%88 = bitcast i32* %80 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %88
%89 = bitcast i32* %83 to <4 x i32>*
store <4 x i32> %87, <4 x i32>* %89
%90 = add nuw nsw i64 %48, 16
%91 = icmp eq i64 %90, 1024
br i1 %91, label %92, label %47
92: ; preds = %47
%93 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%94 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.9, i64 0, i64 0))
br label %95
95: ; preds = %95, %92
%96 = phi i64 [ 0, %92 ], [ %124, %95 ]
%97 = phi <4 x i32> [ zeroinitializer, %92 ], [ %122, %95 ]
%98 = phi <4 x i32> [ zeroinitializer, %92 ], [ %123, %95 ]
%99 = getelementptr inbounds i32, i32* %5, i64 %96
%100 = bitcast i32* %99 to <4 x i32>*
%101 = load <4 x i32>, <4 x i32>* %100
%102 = getelementptr inbounds i32, i32* %99, i64 4
%103 = bitcast i32* %102 to <4 x i32>*
%104 = load <4 x i32>, <4 x i32>* %103
%105 = icmp ne <4 x i32> %101, <i32 11, i32 11, i32 11, i32 11>
%106 = icmp ne <4 x i32> %104, <i32 11, i32 11, i32 11, i32 11>
%107 = zext <4 x i1> %105 to <4 x i32>
%108 = zext <4 x i1> %106 to <4 x i32>
%109 = add <4 x i32> %97, %107
%110 = add <4 x i32> %98, %108
%111 = or i64 %96, 8
%112 = getelementptr inbounds i32, i32* %5, i64 %111
%113 = bitcast i32* %112 to <4 x i32>*
%114 = load <4 x i32>, <4 x i32>* %113
%115 = getelementptr inbounds i32, i32* %112, i64 4
%116 = bitcast i32* %115 to <4 x i32>*
%117 = load <4 x i32>, <4 x i32>* %116
%118 = icmp ne <4 x i32> %114, <i32 11, i32 11, i32 11, i32 11>
%119 = icmp ne <4 x i32> %117, <i32 11, i32 11, i32 11, i32 11>
%120 = zext <4 x i1> %118 to <4 x i32>
%121 = zext <4 x i1> %119 to <4 x i32>
%122 = add <4 x i32> %109, %120
%123 = add <4 x i32> %110, %121
%124 = add nuw nsw i64 %96, 16
%125 = icmp eq i64 %124, 1024
br i1 %125, label %126, label %95
126: ; preds = %95
%127 = add <4 x i32> %123, %122
%128 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %127)
%129 = icmp eq i32 %128, 0
%130 = select i1 %129, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%131 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %130)
br label %132
132: ; preds = %132, %126
%133 = phi i64 [ 0, %126 ], [ %161, %132 ]
%134 = phi <4 x i32> [ zeroinitializer, %126 ], [ %159, %132 ]
%135 = phi <4 x i32> [ zeroinitializer, %126 ], [ %160, %132 ]
%136 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %133
%137 = bitcast i32* %136 to <4 x i32>*
%138 = load <4 x i32>, <4 x i32>* %137
%139 = getelementptr inbounds i32, i32* %136, i64 4
%140 = bitcast i32* %139 to <4 x i32>*
%141 = load <4 x i32>, <4 x i32>* %140
%142 = icmp ne <4 x i32> %138, <i32 2, i32 2, i32 2, i32 2>
%143 = icmp ne <4 x i32> %141, <i32 2, i32 2, i32 2, i32 2>
%144 = zext <4 x i1> %142 to <4 x i32>
%145 = zext <4 x i1> %143 to <4 x i32>
%146 = add <4 x i32> %134, %144
%147 = add <4 x i32> %135, %145
%148 = or i64 %133, 8
%149 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %148
%150 = bitcast i32* %149 to <4 x i32>*
%151 = load <4 x i32>, <4 x i32>* %150
%152 = getelementptr inbounds i32, i32* %149, i64 4
%153 = bitcast i32* %152 to <4 x i32>*
%154 = load <4 x i32>, <4 x i32>* %153
%155 = icmp ne <4 x i32> %151, <i32 2, i32 2, i32 2, i32 2>
%156 = icmp ne <4 x i32> %154, <i32 2, i32 2, i32 2, i32 2>
%157 = zext <4 x i1> %155 to <4 x i32>
%158 = zext <4 x i1> %156 to <4 x i32>
%159 = add <4 x i32> %146, %157
%160 = add <4 x i32> %147, %158
%161 = add nuw nsw i64 %133, 16
%162 = icmp eq i64 %161, 1024
br i1 %162, label %163, label %132
163: ; preds = %132
%164 = add <4 x i32> %160, %159
%165 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %164)
%166 = icmp eq i32 %165, 0
%167 = select i1 %166, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%168 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %167)
br label %169
169: ; preds = %169, %163
%170 = phi i64 [ 0, %163 ], [ %212, %169 ]
%171 = getelementptr inbounds i32, i32* %5, i64 %170
%172 = bitcast i32* %171 to <4 x i32>*
%173 = load <4 x i32>, <4 x i32>* %172
%174 = getelementptr inbounds i32, i32* %171, i64 4
%175 = bitcast i32* %174 to <4 x i32>*
%176 = load <4 x i32>, <4 x i32>* %175
%177 = add nsw <4 x i32> %173, <i32 1, i32 1, i32 1, i32 1>
%178 = add nsw <4 x i32> %176, <i32 1, i32 1, i32 1, i32 1>
%179 = bitcast i32* %171 to <4 x i32>*
store <4 x i32> %177, <4 x i32>* %179
%180 = bitcast i32* %174 to <4 x i32>*
store <4 x i32> %178, <4 x i32>* %180
%181 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %170
%182 = bitcast i32* %181 to <4 x i32>*
%183 = load <4 x i32>, <4 x i32>* %182
%184 = getelementptr inbounds i32, i32* %181, i64 4
%185 = bitcast i32* %184 to <4 x i32>*
%186 = load <4 x i32>, <4 x i32>* %185
%187 = add nsw <4 x i32> %183, <i32 1, i32 1, i32 1, i32 1>
%188 = add nsw <4 x i32> %186, <i32 1, i32 1, i32 1, i32 1>
%189 = bitcast i32* %181 to <4 x i32>*
store <4 x i32> %187, <4 x i32>* %189
%190 = bitcast i32* %184 to <4 x i32>*
store <4 x i32> %188, <4 x i32>* %190
%191 = or i64 %170, 8
%192 = getelementptr inbounds i32, i32* %5, i64 %191
%193 = bitcast i32* %192 to <4 x i32>*
%194 = load <4 x i32>, <4 x i32>* %193
%195 = getelementptr inbounds i32, i32* %192, i64 4
%196 = bitcast i32* %195 to <4 x i32>*
%197 = load <4 x i32>, <4 x i32>* %196
%198 = add nsw <4 x i32> %194, <i32 1, i32 1, i32 1, i32 1>
%199 = add nsw <4 x i32> %197, <i32 1, i32 1, i32 1, i32 1>
%200 = bitcast i32* %192 to <4 x i32>*
store <4 x i32> %198, <4 x i32>* %200
%201 = bitcast i32* %195 to <4 x i32>*
store <4 x i32> %199, <4 x i32>* %201
%202 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %191
%203 = bitcast i32* %202 to <4 x i32>*
%204 = load <4 x i32>, <4 x i32>* %203
%205 = getelementptr inbounds i32, i32* %202, i64 4
%206 = bitcast i32* %205 to <4 x i32>*
%207 = load <4 x i32>, <4 x i32>* %206
%208 = add nsw <4 x i32> %204, <i32 1, i32 1, i32 1, i32 1>
%209 = add nsw <4 x i32> %207, <i32 1, i32 1, i32 1, i32 1>
%210 = bitcast i32* %202 to <4 x i32>*
store <4 x i32> %208, <4 x i32>* %210
%211 = bitcast i32* %205 to <4 x i32>*
store <4 x i32> %209, <4 x i32>* %211
%212 = add nuw nsw i64 %170, 16
%213 = icmp eq i64 %212, 1024
br i1 %213, label %214, label %169
214: ; preds = %169, %214
%215 = phi i64 [ %243, %214 ], [ 0, %169 ]
%216 = phi <4 x i32> [ %241, %214 ], [ zeroinitializer, %169 ]
%217 = phi <4 x i32> [ %242, %214 ], [ zeroinitializer, %169 ]
%218 = getelementptr inbounds i32, i32* %5, i64 %215
%219 = bitcast i32* %218 to <4 x i32>*
%220 = load <4 x i32>, <4 x i32>* %219
%221 = getelementptr inbounds i32, i32* %218, i64 4
%222 = bitcast i32* %221 to <4 x i32>*
%223 = load <4 x i32>, <4 x i32>* %222
%224 = icmp ne <4 x i32> %220, <i32 12, i32 12, i32 12, i32 12>
%225 = icmp ne <4 x i32> %223, <i32 12, i32 12, i32 12, i32 12>
%226 = zext <4 x i1> %224 to <4 x i32>
%227 = zext <4 x i1> %225 to <4 x i32>
%228 = add <4 x i32> %216, %226
%229 = add <4 x i32> %217, %227
%230 = or i64 %215, 8
%231 = getelementptr inbounds i32, i32* %5, i64 %230
%232 = bitcast i32* %231 to <4 x i32>*
%233 = load <4 x i32>, <4 x i32>* %232
%234 = getelementptr inbounds i32, i32* %231, i64 4
%235 = bitcast i32* %234 to <4 x i32>*
%236 = load <4 x i32>, <4 x i32>* %235
%237 = icmp ne <4 x i32> %233, <i32 12, i32 12, i32 12, i32 12>
%238 = icmp ne <4 x i32> %236, <i32 12, i32 12, i32 12, i32 12>
%239 = zext <4 x i1> %237 to <4 x i32>
%240 = zext <4 x i1> %238 to <4 x i32>
%241 = add <4 x i32> %228, %239
%242 = add <4 x i32> %229, %240
%243 = add nuw nsw i64 %215, 16
%244 = icmp eq i64 %243, 1024
br i1 %244, label %245, label %214
245: ; preds = %214
%246 = add <4 x i32> %242, %241
%247 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %246)
%248 = icmp eq i32 %247, 0
%249 = select i1 %248, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%250 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %249)
br label %251
251: ; preds = %251, %245
%252 = phi i64 [ 0, %245 ], [ %280, %251 ]
%253 = phi <4 x i32> [ zeroinitializer, %245 ], [ %278, %251 ]
%254 = phi <4 x i32> [ zeroinitializer, %245 ], [ %279, %251 ]
%255 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %252
%256 = bitcast i32* %255 to <4 x i32>*
%257 = load <4 x i32>, <4 x i32>* %256
%258 = getelementptr inbounds i32, i32* %255, i64 4
%259 = bitcast i32* %258 to <4 x i32>*
%260 = load <4 x i32>, <4 x i32>* %259
%261 = icmp ne <4 x i32> %257, <i32 3, i32 3, i32 3, i32 3>
%262 = icmp ne <4 x i32> %260, <i32 3, i32 3, i32 3, i32 3>
%263 = zext <4 x i1> %261 to <4 x i32>
%264 = zext <4 x i1> %262 to <4 x i32>
%265 = add <4 x i32> %253, %263
%266 = add <4 x i32> %254, %264
%267 = or i64 %252, 8
%268 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %267
%269 = bitcast i32* %268 to <4 x i32>*
%270 = load <4 x i32>, <4 x i32>* %269
%271 = getelementptr inbounds i32, i32* %268, i64 4
%272 = bitcast i32* %271 to <4 x i32>*
%273 = load <4 x i32>, <4 x i32>* %272
%274 = icmp ne <4 x i32> %270, <i32 3, i32 3, i32 3, i32 3>
%275 = icmp ne <4 x i32> %273, <i32 3, i32 3, i32 3, i32 3>
%276 = zext <4 x i1> %274 to <4 x i32>
%277 = zext <4 x i1> %275 to <4 x i32>
%278 = add <4 x i32> %265, %276
%279 = add <4 x i32> %266, %277
%280 = add nuw nsw i64 %252, 16
%281 = icmp eq i64 %280, 1024
br i1 %281, label %282, label %251
282: ; preds = %251
%283 = add <4 x i32> %279, %278
%284 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %283)
%285 = icmp eq i32 %284, 0
%286 = select i1 %285, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%287 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %286)
%288 = tail call i32 @free(i32* %5)
%289 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}