#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 */
struct timeval {
  int tv_sec;
  double tv_usec;
};

/* Variables and functions */
scalar_t__ RAND_MAX;
int /*<<< orphan*/ acc_device_default;
int /*<<< orphan*/ acc_init(int /*<<< orphan*/);
double fabs(double);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/);
int main() {
  int i, j, k;
  int NI, NJ, NK;
  int error;
  double *finput, *ftemp;
  double frounding_error = 1.E-9;
  struct timeval tim;
  double start, end;
  NK = 2;
  NJ = 1 << 20;
  NI = 32;
  error = 0;
  finput = (double *)malloc(NK * NJ * NI * sizeof(double));
  ftemp = (double *)malloc(NK * NJ * NI * sizeof(double));
  acc_init(acc_device_default);
  srand((unsigned)time(0));
  for (k = 0; k < NK; k++) {
    for (j = 0; j < NJ; j++) {
      for (i = 0; i < NI; i++) {
        finput[k * NJ * NI + j * NI + i] =
            (double)rand() / (double)RAND_MAX + 0.1;
      }
    }
  }
  gettimeofday(&tim, NULL);
  start = tim.tv_sec * 1000 + (tim.tv_usec / 1000.0);
#pragma acc parallel copyin(finput [0:NK * NJ * NI])                           \
    copyout(ftemp [0:NK * NJ * NI]) num_gangs(192) num_workers(8)              \
        vector_length(128)
  {
#pragma acc loop gang
    for (k = 0; k < NK; k++) {
      double j_sum = 0;
#pragma acc loop worker reduction(+ : j_sum)
      for (j = 0; j < NJ; j++) {
#pragma acc loop vector
        for (i = 0; i < NI; i++)
          ftemp[k * NJ * NI + j * NI + i] = finput[k * NJ * NI + j * NI + i];
        j_sum += ftemp[k * NJ * NI + j * NI];
      }
      ftemp[k * NJ * NI] = j_sum;
    }
  }
  gettimeofday(&tim, NULL);
  end = tim.tv_sec * 1000 + (tim.tv_usec / 1000.0);
  for (k = 0; k < NK; k++) {
    double j_sum = 0;
    for (j = 0; j < NJ; j++) {
      j_sum += finput[k * NJ * NI + j * NI];
    }
    if (fabs(ftemp[k * NJ * NI] - j_sum) > frounding_error) {
      error++;
      printf("worker + FAILED! The difference is %f\n",
             fabs(ftemp[k * NJ * NI] - j_sum));
    }
  }
  printf("worker + execution time is :%.2lf: ms\n", end - start);
  if (error == 0)
    printf("worker + SUCCESS!\n");
  free(finput);
  free(ftemp);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x100000,-0x18(%rbp)
movl   $0x20,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
call   1090 <acc_init@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12c4 <main+0x144>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    12b1 <main+0x131>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    129e <main+0x11e>
mov    $0x0,%al
call   10a0 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2d90(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xda7(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1239 <main+0xb9>
jmp    12a3 <main+0x123>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1226 <main+0xa6>
jmp    12b6 <main+0x136>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1213 <main+0x93>
lea    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
imul   $0x3e8,-0x48(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xd1f(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13ed <main+0x26d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13c3 <main+0x243>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    138b <main+0x20b>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    132b <main+0x1ab>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1318 <main+0x198>
movsd  -0x60(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12fd <main+0x17d>
lea    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
imul   $0x3e8,-0x48(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xbf6(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1508 <main+0x388>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1485 <main+0x305>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1441 <main+0x2c1>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x68(%rbp),%xmm0
movaps 0xb78(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    14f5 <main+0x375>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x68(%rbp),%xmm0
movaps 0xb3d(%rip),%xmm1
pand   %xmm1,%xmm0
lea    0xb42(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    14fa <main+0x37a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1426 <main+0x2a6>
movsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
lea    0xb3e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
jne    1538 <main+0x3b8>
lea    0xb4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x20000000,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    $0x20000000,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
call   10a0 <acc_init@plt>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    0x2e0d(%rip),%r13
mov    %r15,%rbp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   10b0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq 0x0(%r13),%xmm1
divsd  %xmm1,%xmm0
movsd  0xddc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%rbx,8)
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1200 <main+0x70>
add    $0x1,%r12
add    $0x100,%rbp
cmp    $0x100000,%r12
jne    11f0 <main+0x60>
lea    0x10000000(%r15),%rbp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   10b0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq 0x0(%r13),%xmm1
divsd  %xmm1,%xmm0
addsd  0xd6c(%rip),%xmm0
movsd  %xmm0,0x0(%rbp,%rbx,8)
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1270 <main+0xe0>
add    $0x1,%r12
add    $0x100,%rbp
cmp    $0x100000,%r12
jne    1260 <main+0xd0>
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%r8d
movsd  0x10(%rsp),%xmm0
divsd  0xd2b(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0x18(%r14),%rcx
lea    0x18(%r15),%rdx
xorpd  %xmm0,%xmm0
jmp    1446 <main+0x2b6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x0(,%rsi,8),%rdi
movups (%r15,%rsi,8),%xmm1
movups %xmm1,(%r14,%rsi,8)
mov    %rdi,%rax
or     $0x10,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x20,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x30,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x40,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x50,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x60,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x70,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x80,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0x90,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0xa0,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0xb0,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0xc0,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0xd0,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
mov    %rdi,%rax
or     $0xe0,%rax
movups (%r15,%rax,1),%xmm1
movups %xmm1,(%r14,%rax,1)
or     $0xf0,%rdi
movupd (%r15,%rdi,1),%xmm1
movupd %xmm1,(%r14,%rdi,1)
addsd  (%r14,%rsi,8),%xmm0
add    $0x1,%rbx
add    $0x100,%rcx
add    $0x100,%rdx
cmp    $0x100000,%rbx
je     14cd <main+0x33d>
mov    %rbx,%rsi
shl    $0x5,%rsi
mov    %rbx,%rdi
shl    $0x8,%rdi
lea    (%r15,%rdi,1),%rbp
add    $0x100,%rbp
lea    (%r14,%rdi,1),%rax
cmp    %rbp,%rax
jae    1300 <main+0x170>
lea    (%r15,%rdi,1),%rax
add    %r14,%rdi
add    $0x100,%rdi
cmp    %rdi,%rax
jae    1300 <main+0x170>
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x18(%rdx,%rdi,8),%xmm1
movsd  %xmm1,-0x18(%rcx,%rdi,8)
movsd  -0x10(%rdx,%rdi,8),%xmm1
movsd  %xmm1,-0x10(%rcx,%rdi,8)
movsd  -0x8(%rdx,%rdi,8),%xmm1
movsd  %xmm1,-0x8(%rcx,%rdi,8)
movsd  (%rdx,%rdi,8),%xmm1
movsd  %xmm1,(%rcx,%rdi,8)
add    $0x4,%rdi
cmp    $0x20,%rdi
jne    1490 <main+0x300>
jmp    1421 <main+0x291>
movsd  %xmm0,(%r14)
lea    0x10000018(%r14),%rcx
lea    0x10000018(%r15),%rdx
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
jmp    163b <main+0x4ab>
nopl   0x0(%rax,%rax,1)
movups 0x10000000(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000000(%r14,%rdi,8)
movups 0x10000010(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000010(%r14,%rdi,8)
movups 0x10000020(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000020(%r14,%rdi,8)
movups 0x10000030(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000030(%r14,%rdi,8)
movups 0x10000040(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000040(%r14,%rdi,8)
movups 0x10000050(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000050(%r14,%rdi,8)
movups 0x10000060(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000060(%r14,%rdi,8)
movups 0x10000070(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000070(%r14,%rdi,8)
movups 0x10000080(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000080(%r14,%rdi,8)
movups 0x10000090(%r15,%rdi,8),%xmm1
movups %xmm1,0x10000090(%r14,%rdi,8)
movups 0x100000a0(%r15,%rdi,8),%xmm1
movups %xmm1,0x100000a0(%r14,%rdi,8)
movups 0x100000b0(%r15,%rdi,8),%xmm1
movups %xmm1,0x100000b0(%r14,%rdi,8)
movups 0x100000c0(%r15,%rdi,8),%xmm1
movups %xmm1,0x100000c0(%r14,%rdi,8)
movups 0x100000d0(%r15,%rdi,8),%xmm1
movups %xmm1,0x100000d0(%r14,%rdi,8)
movups 0x100000e0(%r15,%rdi,8),%xmm1
movups %xmm1,0x100000e0(%r14,%rdi,8)
movupd 0x100000f0(%r15,%rdi,8),%xmm1
movupd %xmm1,0x100000f0(%r14,%rdi,8)
addsd  0x10000000(%r14,%rdi,8),%xmm0
add    $0x1,%rbx
add    $0x100,%rcx
add    $0x100,%rdx
cmp    $0x100000,%rbx
je     16cd <main+0x53d>
mov    %rbx,%rdi
shl    $0x5,%rdi
mov    %rbx,%rsi
shl    $0x8,%rsi
lea    (%r15,%rsi,1),%rax
add    $0x10000100,%rax
lea    (%r14,%rsi,1),%rbp
add    $0x10000000,%rbp
cmp    %rax,%rbp
jae    14f0 <main+0x360>
lea    (%r15,%rsi,1),%rax
add    $0x10000000,%rax
add    %r14,%rsi
add    $0x10000100,%rsi
cmp    %rsi,%rax
jae    14f0 <main+0x360>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movsd  -0x18(%rdx,%rbp,8),%xmm1
movsd  %xmm1,-0x18(%rcx,%rbp,8)
movsd  -0x10(%rdx,%rbp,8),%xmm1
movsd  %xmm1,-0x10(%rcx,%rbp,8)
movsd  -0x8(%rdx,%rbp,8),%xmm1
movsd  %xmm1,-0x8(%rcx,%rbp,8)
movsd  (%rdx,%rbp,8),%xmm1
movsd  %xmm1,(%rcx,%rbp,8)
add    $0x4,%rbp
cmp    $0x20,%rbp
jne    1690 <main+0x500>
jmp    1612 <main+0x482>
movsd  %xmm0,0x10000000(%r14)
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%ebx
movsd  0x10(%rsp),%xmm2
divsd  0x902(%rip),%xmm2
xorpd  %xmm1,%xmm1
mov    $0x300,%eax
nop
addsd  -0x300(%r15,%rax,1),%xmm1
fd ff ff
addsd  -0x200(%r15,%rax,1),%xmm1
fe ff ff
addsd  -0x100(%r15,%rax,1),%xmm1
ff ff ff
addsd  (%r15,%rax,1),%xmm1
add    $0x400,%rax
cmp    $0x10000300,%rax
jne    1710 <main+0x580>
movsd  (%r14),%xmm0
subsd  %xmm1,%xmm0
andpd  0x8cd(%rip),%xmm0
xor    %ebp,%ebp
ucomisd 0x8b3(%rip),%xmm0
movsd  %xmm2,(%rsp)
jbe    177c <main+0x5ec>
lea    0x8c5(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm2
mov    $0x1,%ebp
xorpd  %xmm1,%xmm1
mov    $0x10000300,%eax
cs nopw 0x0(%rax,%rax,1)
nop
addsd  -0x300(%r15,%rax,1),%xmm1
fd ff ff
addsd  -0x200(%r15,%rax,1),%xmm1
fe ff ff
addsd  -0x100(%r15,%rax,1),%xmm1
ff ff ff
addsd  (%r15,%rax,1),%xmm1
add    $0x400,%rax
cmp    $0x20000300,%rax
jne    1790 <main+0x600>
movsd  0x10000000(%r14),%xmm0
subsd  %xmm1,%xmm0
andpd  0x849(%rip),%xmm0
ucomisd 0x831(%rip),%xmm0
jbe    17f9 <main+0x669>
lea    0x848(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm2
mov    $0x1,%ebp
movsd  0x20(%rsp),%xmm1
addsd  0x18(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
lea    0x83c(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
test   %ebp,%ebp
jne    1836 <main+0x6a6>
lea    0x84d(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, double }
@acc_device_default = global i32 0
@RAND_MAX = global i64 0
@.str = [39 x i8] c"worker + FAILED! The difference is %f\0A\00"
@.str.1 = [39 x i8] c"worker + execution time is :%.2lf: ms\0A\00"
@.str.2 = [19 x i8] c"worker + SUCCESS!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca %struct.timeval
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store i32 0, i32* %1
store double 1.000000e-09, double* %11
store i32 2, i32* %7
store i32 1048576, i32* %6
store i32 32, i32* %5
store i32 0, i32* %8
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = mul nsw i32 %19, %20
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
%25 = call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to double*
store double* %26, double** %9
%27 = load i32, i32* %7
%28 = load i32, i32* %6
%29 = mul nsw i32 %27, %28
%30 = load i32, i32* %5
%31 = mul nsw i32 %29, %30
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 8
%34 = trunc i64 %33 to i32
%35 = call i64 @malloc(i32 %34)
%36 = inttoptr i64 %35 to double*
store double* %36, double** %10
%37 = load i32, i32* @acc_device_default
%38 = call i32 @acc_init(i32 %37)
%39 = call i64 @time(i32 0)
%40 = trunc i64 %39 to i32
%41 = call i32 @srand(i32 %40)
store i32 0, i32* %4
br label %42
42: ; preds = %85, %0
%43 = load i32, i32* %4
%44 = load i32, i32* %7
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %88
46: ; preds = %42
store i32 0, i32* %3
br label %47
47: ; preds = %81, %46
%48 = load i32, i32* %3
%49 = load i32, i32* %6
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %84
51: ; preds = %47
store i32 0, i32* %2
br label %52
52: ; preds = %77, %51
%53 = load i32, i32* %2
%54 = load i32, i32* %5
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %80
56: ; preds = %52
%57 = call i64 (...) @rand()
%58 = sitofp i64 %57 to double
%59 = load i64, i64* @RAND_MAX
%60 = sitofp i64 %59 to double
%61 = fdiv double %58, %60
%62 = fadd double %61, 1.000000e-01
%63 = load double*, double** %9
%64 = load i32, i32* %4
%65 = load i32, i32* %6
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %5
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %3
%70 = load i32, i32* %5
%71 = mul nsw i32 %69, %70
%72 = add nsw i32 %68, %71
%73 = load i32, i32* %2
%74 = add nsw i32 %72, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %63, i64 %75
store double %62, double* %76
br label %77
77: ; preds = %56
%78 = load i32, i32* %2
%79 = add nsw i32 %78, 1
store i32 %79, i32* %2
br label %52
80: ; preds = %52
br label %81
81: ; preds = %80
%82 = load i32, i32* %3
%83 = add nsw i32 %82, 1
store i32 %83, i32* %3
br label %47
84: ; preds = %47
br label %85
85: ; preds = %84
%86 = load i32, i32* %4
%87 = add nsw i32 %86, 1
store i32 %87, i32* %4
br label %42
88: ; preds = %42
%89 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
%90 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%91 = load i32, i32* %90
%92 = mul nsw i32 %91, 1000
%93 = sitofp i32 %92 to double
%94 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%95 = load double, double* %94
%96 = fdiv double %95, 1.000000e+03
%97 = fadd double %93, %96
store double %97, double* %13
store i32 0, i32* %4
br label %98
98: ; preds = %174, %88
%99 = load i32, i32* %4
%100 = load i32, i32* %7
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %177
102: ; preds = %98
store double 0.000000e+00, double* %15
store i32 0, i32* %3
br label %103
103: ; preds = %161, %102
%104 = load i32, i32* %3
%105 = load i32, i32* %6
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %164
107: ; preds = %103
store i32 0, i32* %2
br label %108
108: ; preds = %142, %107
%109 = load i32, i32* %2
%110 = load i32, i32* %5
%111 = icmp slt i32 %109, %110
br i1 %111, label %112, label %145
112: ; preds = %108
%113 = load double*, double** %9
%114 = load i32, i32* %4
%115 = load i32, i32* %6
%116 = mul nsw i32 %114, %115
%117 = load i32, i32* %5
%118 = mul nsw i32 %116, %117
%119 = load i32, i32* %3
%120 = load i32, i32* %5
%121 = mul nsw i32 %119, %120
%122 = add nsw i32 %118, %121
%123 = load i32, i32* %2
%124 = add nsw i32 %122, %123
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %113, i64 %125
%127 = load double, double* %126
%128 = load double*, double** %10
%129 = load i32, i32* %4
%130 = load i32, i32* %6
%131 = mul nsw i32 %129, %130
%132 = load i32, i32* %5
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %3
%135 = load i32, i32* %5
%136 = mul nsw i32 %134, %135
%137 = add nsw i32 %133, %136
%138 = load i32, i32* %2
%139 = add nsw i32 %137, %138
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %128, i64 %140
store double %127, double* %141
br label %142
142: ; preds = %112
%143 = load i32, i32* %2
%144 = add nsw i32 %143, 1
store i32 %144, i32* %2
br label %108
145: ; preds = %108
%146 = load double*, double** %10
%147 = load i32, i32* %4
%148 = load i32, i32* %6
%149 = mul nsw i32 %147, %148
%150 = load i32, i32* %5
%151 = mul nsw i32 %149, %150
%152 = load i32, i32* %3
%153 = load i32, i32* %5
%154 = mul nsw i32 %152, %153
%155 = add nsw i32 %151, %154
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %146, i64 %156
%158 = load double, double* %157
%159 = load double, double* %15
%160 = fadd double %159, %158
store double %160, double* %15
br label %161
161: ; preds = %145
%162 = load i32, i32* %3
%163 = add nsw i32 %162, 1
store i32 %163, i32* %3
br label %103
164: ; preds = %103
%165 = load double, double* %15
%166 = load double*, double** %10
%167 = load i32, i32* %4
%168 = load i32, i32* %6
%169 = mul nsw i32 %167, %168
%170 = load i32, i32* %5
%171 = mul nsw i32 %169, %170
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %166, i64 %172
store double %165, double* %173
br label %174
174: ; preds = %164
%175 = load i32, i32* %4
%176 = add nsw i32 %175, 1
store i32 %176, i32* %4
br label %98
177: ; preds = %98
%178 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
%179 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%180 = load i32, i32* %179
%181 = mul nsw i32 %180, 1000
%182 = sitofp i32 %181 to double
%183 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%184 = load double, double* %183
%185 = fdiv double %184, 1.000000e+03
%186 = fadd double %182, %185
store double %186, double* %14
store i32 0, i32* %4
br label %187
187: ; preds = %247, %177
%188 = load i32, i32* %4
%189 = load i32, i32* %7
%190 = icmp slt i32 %188, %189
br i1 %190, label %191, label %250
191: ; preds = %187
store double 0.000000e+00, double* %16
store i32 0, i32* %3
br label %192
192: ; preds = %212, %191
%193 = load i32, i32* %3
%194 = load i32, i32* %6
%195 = icmp slt i32 %193, %194
br i1 %195, label %196, label %215
196: ; preds = %192
%197 = load double*, double** %9
%198 = load i32, i32* %4
%199 = load i32, i32* %6
%200 = mul nsw i32 %198, %199
%201 = load i32, i32* %5
%202 = mul nsw i32 %200, %201
%203 = load i32, i32* %3
%204 = load i32, i32* %5
%205 = mul nsw i32 %203, %204
%206 = add nsw i32 %202, %205
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %197, i64 %207
%209 = load double, double* %208
%210 = load double, double* %16
%211 = fadd double %210, %209
store double %211, double* %16
br label %212
212: ; preds = %196
%213 = load i32, i32* %3
%214 = add nsw i32 %213, 1
store i32 %214, i32* %3
br label %192
215: ; preds = %192
%216 = load double*, double** %10
%217 = load i32, i32* %4
%218 = load i32, i32* %6
%219 = mul nsw i32 %217, %218
%220 = load i32, i32* %5
%221 = mul nsw i32 %219, %220
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %216, i64 %222
%224 = load double, double* %223
%225 = load double, double* %16
%226 = fsub double %224, %225
%227 = call double @llvm.fabs.f64(double %226)
%228 = load double, double* %11
%229 = fcmp ogt double %227, %228
br i1 %229, label %230, label %246
230: ; preds = %215
%231 = load i32, i32* %8
%232 = add nsw i32 %231, 1
store i32 %232, i32* %8
%233 = load double*, double** %10
%234 = load i32, i32* %4
%235 = load i32, i32* %6
%236 = mul nsw i32 %234, %235
%237 = load i32, i32* %5
%238 = mul nsw i32 %236, %237
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds double, double* %233, i64 %239
%241 = load double, double* %240
%242 = load double, double* %16
%243 = fsub double %241, %242
%244 = call double @llvm.fabs.f64(double %243)
%245 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %244)
br label %246
246: ; preds = %230, %215
br label %247
247: ; preds = %246
%248 = load i32, i32* %4
%249 = add nsw i32 %248, 1
store i32 %249, i32* %4
br label %187
250: ; preds = %187
%251 = load double, double* %14
%252 = load double, double* %13
%253 = fsub double %251, %252
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %253)
%255 = load i32, i32* %8
%256 = icmp eq i32 %255, 0
br i1 %256, label %257, label %259
257: ; preds = %250
%258 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %259
259: ; preds = %257, %250
%260 = load double*, double** %9
%261 = call i32 @free(double* %260)
%262 = load double*, double** %10
%263 = call i32 @free(double* %262)
ret i32 1
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
@acc_device_default = global i32 0
@RAND_MAX = global i64 0
@.str = [39 x i8] c"worker + FAILED! The difference is %f\0A\00"
@.str.1 = [39 x i8] c"worker + execution time is :%.2lf: ms\0A\00"
@str = [18 x i8] c"worker + SUCCESS!\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = tail call i64 @malloc(i32 536870912)
%4 = inttoptr i64 %3 to double*
%5 = tail call i64 @malloc(i32 536870912)
%6 = load i32, i32* @acc_device_default
%7 = tail call i32 @acc_init(i32 %6)
%8 = tail call i64 @time(i32 0)
%9 = trunc i64 %8 to i32
%10 = tail call i32 @srand(i32 %9)
br label %11
11: ; preds = %0, %26
%12 = phi i64 [ 0, %0 ], [ %27, %26 ]
%13 = shl nsw i64 %12, 5
br label %14
14: ; preds = %11, %14
%15 = phi i64 [ 0, %11 ], [ %24, %14 ]
%16 = tail call i64 (...) @rand()
%17 = sitofp i64 %16 to double
%18 = load i64, i64* @RAND_MAX
%19 = sitofp i64 %18 to double
%20 = fdiv double %17, %19
%21 = fadd double %20, 1.000000e-01
%22 = add nuw nsw i64 %13, %15
%23 = getelementptr inbounds double, double* %4, i64 %22
store double %21, double* %23
%24 = add nuw nsw i64 %15, 1
%25 = icmp eq i64 %24, 32
br i1 %25, label %26, label %14
26: ; preds = %14
%27 = add nuw nsw i64 %12, 1
%28 = icmp eq i64 %27, 1048576
br i1 %28, label %29, label %11
29: ; preds = %26, %45
%30 = phi i64 [ %46, %45 ], [ 0, %26 ]
%31 = shl nsw i64 %30, 5
%32 = add nuw nsw i64 %31, 33554432
br label %33
33: ; preds = %33, %29
%34 = phi i64 [ 0, %29 ], [ %43, %33 ]
%35 = tail call i64 (...) @rand()
%36 = sitofp i64 %35 to double
%37 = load i64, i64* @RAND_MAX
%38 = sitofp i64 %37 to double
%39 = fdiv double %36, %38
%40 = fadd double %39, 1.000000e-01
%41 = add nuw nsw i64 %32, %34
%42 = getelementptr inbounds double, double* %4, i64 %41
store double %40, double* %42
%43 = add nuw nsw i64 %34, 1
%44 = icmp eq i64 %43, 32
br i1 %44, label %45, label %33
45: ; preds = %33
%46 = add nuw nsw i64 %30, 1
%47 = icmp eq i64 %46, 1048576
br i1 %47, label %48, label %29
48: ; preds = %45
%49 = inttoptr i64 %5 to double*
%50 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%51 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%52 = load i32, i32* %51
%53 = mul nsw i32 %52, 1000
%54 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%55 = load double, double* %54
%56 = fdiv double %55, 1.000000e+03
br label %57
57: ; preds = %48, %189
%58 = phi i64 [ 0, %48 ], [ %193, %189 ]
%59 = phi double [ 0.000000e+00, %48 ], [ %192, %189 ]
%60 = shl nuw nsw i64 %58, 5
%61 = add nuw i64 %60, 32
%62 = shl nsw i64 %58, 5
%63 = getelementptr double, double* %4, i64 %61
%64 = getelementptr double, double* %4, i64 %60
%65 = getelementptr double, double* %49, i64 %61
%66 = getelementptr double, double* %49, i64 %60
%67 = icmp ult double* %66, %63
%68 = icmp ult double* %64, %65
%69 = and i1 %67, %68
br i1 %69, label %166, label %70
70: ; preds = %57
%71 = getelementptr inbounds double, double* %4, i64 %62
%72 = bitcast double* %71 to <2 x double>*
%73 = load <2 x double>, <2 x double>* %72
%74 = getelementptr inbounds double, double* %49, i64 %62
%75 = bitcast double* %74 to <2 x double>*
store <2 x double> %73, <2 x double>* %75
%76 = or i64 %62, 2
%77 = getelementptr inbounds double, double* %4, i64 %76
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %49, i64 %76
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %79, <2 x double>* %81
%82 = or i64 %62, 4
%83 = getelementptr inbounds double, double* %4, i64 %82
%84 = bitcast double* %83 to <2 x double>*
%85 = load <2 x double>, <2 x double>* %84
%86 = getelementptr inbounds double, double* %49, i64 %82
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %85, <2 x double>* %87
%88 = or i64 %62, 6
%89 = getelementptr inbounds double, double* %4, i64 %88
%90 = bitcast double* %89 to <2 x double>*
%91 = load <2 x double>, <2 x double>* %90
%92 = getelementptr inbounds double, double* %49, i64 %88
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> %91, <2 x double>* %93
%94 = or i64 %62, 8
%95 = getelementptr inbounds double, double* %4, i64 %94
%96 = bitcast double* %95 to <2 x double>*
%97 = load <2 x double>, <2 x double>* %96
%98 = getelementptr inbounds double, double* %49, i64 %94
%99 = bitcast double* %98 to <2 x double>*
store <2 x double> %97, <2 x double>* %99
%100 = or i64 %62, 10
%101 = getelementptr inbounds double, double* %4, i64 %100
%102 = bitcast double* %101 to <2 x double>*
%103 = load <2 x double>, <2 x double>* %102
%104 = getelementptr inbounds double, double* %49, i64 %100
%105 = bitcast double* %104 to <2 x double>*
store <2 x double> %103, <2 x double>* %105
%106 = or i64 %62, 12
%107 = getelementptr inbounds double, double* %4, i64 %106
%108 = bitcast double* %107 to <2 x double>*
%109 = load <2 x double>, <2 x double>* %108
%110 = getelementptr inbounds double, double* %49, i64 %106
%111 = bitcast double* %110 to <2 x double>*
store <2 x double> %109, <2 x double>* %111
%112 = or i64 %62, 14
%113 = getelementptr inbounds double, double* %4, i64 %112
%114 = bitcast double* %113 to <2 x double>*
%115 = load <2 x double>, <2 x double>* %114
%116 = getelementptr inbounds double, double* %49, i64 %112
%117 = bitcast double* %116 to <2 x double>*
store <2 x double> %115, <2 x double>* %117
%118 = or i64 %62, 16
%119 = getelementptr inbounds double, double* %4, i64 %118
%120 = bitcast double* %119 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = getelementptr inbounds double, double* %49, i64 %118
%123 = bitcast double* %122 to <2 x double>*
store <2 x double> %121, <2 x double>* %123
%124 = or i64 %62, 18
%125 = getelementptr inbounds double, double* %4, i64 %124
%126 = bitcast double* %125 to <2 x double>*
%127 = load <2 x double>, <2 x double>* %126
%128 = getelementptr inbounds double, double* %49, i64 %124
%129 = bitcast double* %128 to <2 x double>*
store <2 x double> %127, <2 x double>* %129
%130 = or i64 %62, 20
%131 = getelementptr inbounds double, double* %4, i64 %130
%132 = bitcast double* %131 to <2 x double>*
%133 = load <2 x double>, <2 x double>* %132
%134 = getelementptr inbounds double, double* %49, i64 %130
%135 = bitcast double* %134 to <2 x double>*
store <2 x double> %133, <2 x double>* %135
%136 = or i64 %62, 22
%137 = getelementptr inbounds double, double* %4, i64 %136
%138 = bitcast double* %137 to <2 x double>*
%139 = load <2 x double>, <2 x double>* %138
%140 = getelementptr inbounds double, double* %49, i64 %136
%141 = bitcast double* %140 to <2 x double>*
store <2 x double> %139, <2 x double>* %141
%142 = or i64 %62, 24
%143 = getelementptr inbounds double, double* %4, i64 %142
%144 = bitcast double* %143 to <2 x double>*
%145 = load <2 x double>, <2 x double>* %144
%146 = getelementptr inbounds double, double* %49, i64 %142
%147 = bitcast double* %146 to <2 x double>*
store <2 x double> %145, <2 x double>* %147
%148 = or i64 %62, 26
%149 = getelementptr inbounds double, double* %4, i64 %148
%150 = bitcast double* %149 to <2 x double>*
%151 = load <2 x double>, <2 x double>* %150
%152 = getelementptr inbounds double, double* %49, i64 %148
%153 = bitcast double* %152 to <2 x double>*
store <2 x double> %151, <2 x double>* %153
%154 = or i64 %62, 28
%155 = getelementptr inbounds double, double* %4, i64 %154
%156 = bitcast double* %155 to <2 x double>*
%157 = load <2 x double>, <2 x double>* %156
%158 = getelementptr inbounds double, double* %49, i64 %154
%159 = bitcast double* %158 to <2 x double>*
store <2 x double> %157, <2 x double>* %159
%160 = or i64 %62, 30
%161 = getelementptr inbounds double, double* %4, i64 %160
%162 = bitcast double* %161 to <2 x double>*
%163 = load <2 x double>, <2 x double>* %162
%164 = getelementptr inbounds double, double* %49, i64 %160
%165 = bitcast double* %164 to <2 x double>*
store <2 x double> %163, <2 x double>* %165
br label %189
166: ; preds = %57, %166
%167 = phi i64 [ %187, %166 ], [ 0, %57 ]
%168 = add nuw nsw i64 %62, %167
%169 = getelementptr inbounds double, double* %4, i64 %168
%170 = load double, double* %169
%171 = getelementptr inbounds double, double* %49, i64 %168
store double %170, double* %171
%172 = or i64 %167, 1
%173 = add nuw nsw i64 %62, %172
%174 = getelementptr inbounds double, double* %4, i64 %173
%175 = load double, double* %174
%176 = getelementptr inbounds double, double* %49, i64 %173
store double %175, double* %176
%177 = or i64 %167, 2
%178 = add nuw nsw i64 %62, %177
%179 = getelementptr inbounds double, double* %4, i64 %178
%180 = load double, double* %179
%181 = getelementptr inbounds double, double* %49, i64 %178
store double %180, double* %181
%182 = or i64 %167, 3
%183 = add nuw nsw i64 %62, %182
%184 = getelementptr inbounds double, double* %4, i64 %183
%185 = load double, double* %184
%186 = getelementptr inbounds double, double* %49, i64 %183
store double %185, double* %186
%187 = add nuw nsw i64 %167, 4
%188 = icmp eq i64 %187, 32
br i1 %188, label %189, label %166
189: ; preds = %166, %70
%190 = getelementptr inbounds double, double* %49, i64 %62
%191 = load double, double* %190
%192 = fadd double %59, %191
%193 = add nuw nsw i64 %58, 1
%194 = icmp eq i64 %193, 1048576
br i1 %194, label %195, label %57
195: ; preds = %189
store double %192, double* %49
br label %196
196: ; preds = %330, %195
%197 = phi i64 [ 0, %195 ], [ %334, %330 ]
%198 = phi double [ 0.000000e+00, %195 ], [ %333, %330 ]
%199 = shl nuw nsw i64 %197, 5
%200 = add nuw i64 %199, 33554432
%201 = add nuw i64 %199, 33554464
%202 = shl nsw i64 %197, 5
%203 = add nuw nsw i64 %202, 33554432
%204 = getelementptr double, double* %4, i64 %201
%205 = getelementptr double, double* %4, i64 %200
%206 = getelementptr double, double* %49, i64 %201
%207 = getelementptr double, double* %49, i64 %200
%208 = icmp ult double* %207, %204
%209 = icmp ult double* %205, %206
%210 = and i1 %208, %209
br i1 %210, label %307, label %211
211: ; preds = %196
%212 = getelementptr inbounds double, double* %4, i64 %203
%213 = bitcast double* %212 to <2 x double>*
%214 = load <2 x double>, <2 x double>* %213
%215 = getelementptr inbounds double, double* %49, i64 %203
%216 = bitcast double* %215 to <2 x double>*
store <2 x double> %214, <2 x double>* %216
%217 = add nuw nsw i64 %202, 33554434
%218 = getelementptr inbounds double, double* %4, i64 %217
%219 = bitcast double* %218 to <2 x double>*
%220 = load <2 x double>, <2 x double>* %219
%221 = getelementptr inbounds double, double* %49, i64 %217
%222 = bitcast double* %221 to <2 x double>*
store <2 x double> %220, <2 x double>* %222
%223 = add nuw nsw i64 %202, 33554436
%224 = getelementptr inbounds double, double* %4, i64 %223
%225 = bitcast double* %224 to <2 x double>*
%226 = load <2 x double>, <2 x double>* %225
%227 = getelementptr inbounds double, double* %49, i64 %223
%228 = bitcast double* %227 to <2 x double>*
store <2 x double> %226, <2 x double>* %228
%229 = add nuw nsw i64 %202, 33554438
%230 = getelementptr inbounds double, double* %4, i64 %229
%231 = bitcast double* %230 to <2 x double>*
%232 = load <2 x double>, <2 x double>* %231
%233 = getelementptr inbounds double, double* %49, i64 %229
%234 = bitcast double* %233 to <2 x double>*
store <2 x double> %232, <2 x double>* %234
%235 = add nuw nsw i64 %202, 33554440
%236 = getelementptr inbounds double, double* %4, i64 %235
%237 = bitcast double* %236 to <2 x double>*
%238 = load <2 x double>, <2 x double>* %237
%239 = getelementptr inbounds double, double* %49, i64 %235
%240 = bitcast double* %239 to <2 x double>*
store <2 x double> %238, <2 x double>* %240
%241 = add nuw nsw i64 %202, 33554442
%242 = getelementptr inbounds double, double* %4, i64 %241
%243 = bitcast double* %242 to <2 x double>*
%244 = load <2 x double>, <2 x double>* %243
%245 = getelementptr inbounds double, double* %49, i64 %241
%246 = bitcast double* %245 to <2 x double>*
store <2 x double> %244, <2 x double>* %246
%247 = add nuw nsw i64 %202, 33554444
%248 = getelementptr inbounds double, double* %4, i64 %247
%249 = bitcast double* %248 to <2 x double>*
%250 = load <2 x double>, <2 x double>* %249
%251 = getelementptr inbounds double, double* %49, i64 %247
%252 = bitcast double* %251 to <2 x double>*
store <2 x double> %250, <2 x double>* %252
%253 = add nuw nsw i64 %202, 33554446
%254 = getelementptr inbounds double, double* %4, i64 %253
%255 = bitcast double* %254 to <2 x double>*
%256 = load <2 x double>, <2 x double>* %255
%257 = getelementptr inbounds double, double* %49, i64 %253
%258 = bitcast double* %257 to <2 x double>*
store <2 x double> %256, <2 x double>* %258
%259 = add nuw nsw i64 %202, 33554448
%260 = getelementptr inbounds double, double* %4, i64 %259
%261 = bitcast double* %260 to <2 x double>*
%262 = load <2 x double>, <2 x double>* %261
%263 = getelementptr inbounds double, double* %49, i64 %259
%264 = bitcast double* %263 to <2 x double>*
store <2 x double> %262, <2 x double>* %264
%265 = add nuw nsw i64 %202, 33554450
%266 = getelementptr inbounds double, double* %4, i64 %265
%267 = bitcast double* %266 to <2 x double>*
%268 = load <2 x double>, <2 x double>* %267
%269 = getelementptr inbounds double, double* %49, i64 %265
%270 = bitcast double* %269 to <2 x double>*
store <2 x double> %268, <2 x double>* %270
%271 = add nuw nsw i64 %202, 33554452
%272 = getelementptr inbounds double, double* %4, i64 %271
%273 = bitcast double* %272 to <2 x double>*
%274 = load <2 x double>, <2 x double>* %273
%275 = getelementptr inbounds double, double* %49, i64 %271
%276 = bitcast double* %275 to <2 x double>*
store <2 x double> %274, <2 x double>* %276
%277 = add nuw nsw i64 %202, 33554454
%278 = getelementptr inbounds double, double* %4, i64 %277
%279 = bitcast double* %278 to <2 x double>*
%280 = load <2 x double>, <2 x double>* %279
%281 = getelementptr inbounds double, double* %49, i64 %277
%282 = bitcast double* %281 to <2 x double>*
store <2 x double> %280, <2 x double>* %282
%283 = add nuw nsw i64 %202, 33554456
%284 = getelementptr inbounds double, double* %4, i64 %283
%285 = bitcast double* %284 to <2 x double>*
%286 = load <2 x double>, <2 x double>* %285
%287 = getelementptr inbounds double, double* %49, i64 %283
%288 = bitcast double* %287 to <2 x double>*
store <2 x double> %286, <2 x double>* %288
%289 = add nuw nsw i64 %202, 33554458
%290 = getelementptr inbounds double, double* %4, i64 %289
%291 = bitcast double* %290 to <2 x double>*
%292 = load <2 x double>, <2 x double>* %291
%293 = getelementptr inbounds double, double* %49, i64 %289
%294 = bitcast double* %293 to <2 x double>*
store <2 x double> %292, <2 x double>* %294
%295 = add nuw nsw i64 %202, 33554460
%296 = getelementptr inbounds double, double* %4, i64 %295
%297 = bitcast double* %296 to <2 x double>*
%298 = load <2 x double>, <2 x double>* %297
%299 = getelementptr inbounds double, double* %49, i64 %295
%300 = bitcast double* %299 to <2 x double>*
store <2 x double> %298, <2 x double>* %300
%301 = add nuw nsw i64 %202, 33554462
%302 = getelementptr inbounds double, double* %4, i64 %301
%303 = bitcast double* %302 to <2 x double>*
%304 = load <2 x double>, <2 x double>* %303
%305 = getelementptr inbounds double, double* %49, i64 %301
%306 = bitcast double* %305 to <2 x double>*
store <2 x double> %304, <2 x double>* %306
br label %330
307: ; preds = %196, %307
%308 = phi i64 [ %328, %307 ], [ 0, %196 ]
%309 = add nuw nsw i64 %203, %308
%310 = getelementptr inbounds double, double* %4, i64 %309
%311 = load double, double* %310
%312 = getelementptr inbounds double, double* %49, i64 %309
store double %311, double* %312
%313 = or i64 %308, 1
%314 = add nuw nsw i64 %203, %313
%315 = getelementptr inbounds double, double* %4, i64 %314
%316 = load double, double* %315
%317 = getelementptr inbounds double, double* %49, i64 %314
store double %316, double* %317
%318 = or i64 %308, 2
%319 = add nuw nsw i64 %203, %318
%320 = getelementptr inbounds double, double* %4, i64 %319
%321 = load double, double* %320
%322 = getelementptr inbounds double, double* %49, i64 %319
store double %321, double* %322
%323 = or i64 %308, 3
%324 = add nuw nsw i64 %203, %323
%325 = getelementptr inbounds double, double* %4, i64 %324
%326 = load double, double* %325
%327 = getelementptr inbounds double, double* %49, i64 %324
store double %326, double* %327
%328 = add nuw nsw i64 %308, 4
%329 = icmp eq i64 %328, 32
br i1 %329, label %330, label %307
330: ; preds = %307, %211
%331 = getelementptr inbounds double, double* %49, i64 %203
%332 = load double, double* %331
%333 = fadd double %198, %332
%334 = add nuw nsw i64 %197, 1
%335 = icmp eq i64 %334, 1048576
br i1 %335, label %336, label %196
336: ; preds = %330
%337 = getelementptr inbounds double, double* %49, i64 33554432
store double %333, double* %337
%338 = sitofp i32 %53 to double
%339 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%340 = load i32, i32* %51
%341 = mul nsw i32 %340, 1000
%342 = load double, double* %54
%343 = fdiv double %342, 1.000000e+03
br label %344
344: ; preds = %344, %336
%345 = phi i64 [ 0, %336 ], [ %366, %344 ]
%346 = phi double [ 0.000000e+00, %336 ], [ %365, %344 ]
%347 = shl nuw nsw i64 %345, 5
%348 = getelementptr inbounds double, double* %4, i64 %347
%349 = load double, double* %348
%350 = fadd double %346, %349
%351 = shl i64 %345, 5
%352 = or i64 %351, 32
%353 = getelementptr inbounds double, double* %4, i64 %352
%354 = load double, double* %353
%355 = fadd double %350, %354
%356 = shl i64 %345, 5
%357 = or i64 %356, 64
%358 = getelementptr inbounds double, double* %4, i64 %357
%359 = load double, double* %358
%360 = fadd double %355, %359
%361 = shl i64 %345, 5
%362 = or i64 %361, 96
%363 = getelementptr inbounds double, double* %4, i64 %362
%364 = load double, double* %363
%365 = fadd double %360, %364
%366 = add nuw nsw i64 %345, 4
%367 = icmp eq i64 %366, 1048576
br i1 %367, label %368, label %344
368: ; preds = %344
%369 = load double, double* %49
%370 = fsub double %369, %365
%371 = tail call double @llvm.fabs.f64(double %370)
%372 = fcmp ogt double %371, 1.000000e-09
br i1 %372, label %373, label %375
373: ; preds = %368
%374 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %371)
br label %375
375: ; preds = %373, %368
%376 = phi i32 [ 1, %373 ], [ 0, %368 ]
br label %377
377: ; preds = %377, %375
%378 = phi i64 [ 0, %375 ], [ %400, %377 ]
%379 = phi double [ 0.000000e+00, %375 ], [ %399, %377 ]
%380 = shl nuw nsw i64 %378, 5
%381 = add nuw nsw i64 %380, 33554432
%382 = getelementptr inbounds double, double* %4, i64 %381
%383 = load double, double* %382
%384 = fadd double %379, %383
%385 = shl i64 %378, 5
%386 = add i64 %385, 33554464
%387 = getelementptr inbounds double, double* %4, i64 %386
%388 = load double, double* %387
%389 = fadd double %384, %388
%390 = shl i64 %378, 5
%391 = add i64 %390, 33554496
%392 = getelementptr inbounds double, double* %4, i64 %391
%393 = load double, double* %392
%394 = fadd double %389, %393
%395 = shl i64 %378, 5
%396 = add i64 %395, 33554528
%397 = getelementptr inbounds double, double* %4, i64 %396
%398 = load double, double* %397
%399 = fadd double %394, %398
%400 = add nuw nsw i64 %378, 4
%401 = icmp eq i64 %400, 1048576
br i1 %401, label %402, label %377
402: ; preds = %377
%403 = load double, double* %337
%404 = fsub double %403, %399
%405 = tail call double @llvm.fabs.f64(double %404)
%406 = fcmp ogt double %405, 1.000000e-09
br i1 %406, label %407, label %409
407: ; preds = %402
%408 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %405)
br label %409
409: ; preds = %407, %402
%410 = phi i32 [ 1, %407 ], [ %376, %402 ]
%411 = fadd double %56, %338
%412 = sitofp i32 %341 to double
%413 = fadd double %343, %412
%414 = fsub double %413, %411
%415 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %414)
%416 = icmp eq i32 %410, 0
br i1 %416, label %417, label %419
417: ; preds = %409
%418 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %419
419: ; preds = %417, %409
%420 = tail call i32 @free(double* %4)
%421 = tail call i32 @free(double* %49)
ret i32 1
}