#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 sum, known_sum;
  double *input, *temp;
  double rounding_error = 1.E-9;
  struct timeval tim;
  double start, end;
  NK = 1 << 20;
  NJ = 2;
  NI = 32;
  error = 0;
  input = (double *)malloc(NK * NJ * NI * sizeof(double));
  temp = (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++) {
        input[k * NJ * NI + j * NI + i] =
            (double)rand() / (double)RAND_MAX + 0.1;
      }
    }
  }
  sum = 0.0;
  gettimeofday(&tim, NULL);
  start = tim.tv_sec * 1000 + (tim.tv_usec / 1000.0);
#pragma acc parallel copyin(input [0:NK * NJ * NI])                            \
    create(temp [0:NK * NJ * NI]) num_gangs(192) num_workers(8)                \
        vector_length(128)
  {
#pragma acc loop gang reduction(+ : sum)
    for (k = 0; k < NK; k++) {
#pragma acc loop worker
      for (j = 0; j < NJ; j++) {
#pragma acc loop vector
        for (i = 0; i < NI; i++)
          temp[k * NJ * NI + j * NI + i] = input[k * NJ * NI + j * NI + i];
      }
      sum += temp[k * NJ * NI];
    }
  }
  gettimeofday(&tim, NULL);
  end = tim.tv_sec * 1000 + (tim.tv_usec / 1000.0);
  known_sum = 0.0;
  for (k = 0; k < NK; k++) {
    known_sum += input[k * NJ * NI];
  }
  if (fabs(sum - known_sum) > rounding_error) {
    error++;
    printf("gang + FAILED! sum=%f, known_sum=%f\n", sum, known_sum);
  }
  printf("gang + execution time is :%.2lf: ms\n", end - start);
  if (error == 0)
    printf("gang + SUCCESS!\n");
  free(input);
  free(temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x100000,-0x1c(%rbp)
movl   $0x2,-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,-0x38(%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,-0x40(%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    -0x38(%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>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x58(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
imul   $0x3e8,-0x58(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xd17(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13cd <main+0x24d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    139e <main+0x21e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    138b <main+0x20b>
mov    -0x38(%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    -0x40(%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>
jmp    1390 <main+0x210>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1318 <main+0x198>
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1305 <main+0x185>
lea    -0x58(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
imul   $0x3e8,-0x58(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xc16(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1449 <main+0x2c9>
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    140e <main+0x28e>
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movaps 0xbc6(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    148a <main+0x30a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xbad(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
lea    0xbba(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
jne    14ba <main+0x33a>
lea    0xbc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%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,%r12
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),%r15
mov    %r12,%rbx
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
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 (%r15),%xmm1
divsd  %xmm1,%xmm0
movsd  0xddd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    1200 <main+0x70>
mov    $0x20,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10b0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%r15),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd9d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x40,%rbp
jne    1240 <main+0xb0>
add    $0x1,%r13
add    $0x200,%rbx
cmp    $0x100000,%r13
jne    11f0 <main+0x60>
xor    %r15d,%r15d
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%r8d
movsd  0x18(%rsp),%xmm1
divsd  0xd54(%rip),%xmm1
lea    0x18(%r14),%rcx
lea    0x18(%r12),%rdx
lea    0x118(%r14),%rsi
lea    0x118(%r12),%rdi
xorpd  %xmm2,%xmm2
jmp    1456 <main+0x2c6>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r9,%rax
or     $0x20,%rax
movups (%r12,%rax,8),%xmm0
movups %xmm0,(%r14,%rax,8)
lea    0x0(,%r9,8),%rax
mov    %rax,%rbp
or     $0x110,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x120,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x130,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x140,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x150,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x160,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x170,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x180,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x190,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x1a0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x1b0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x1c0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x1d0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rax,%rbp
or     $0x1e0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
or     $0x1f0,%rax
movupd (%r12,%rax,1),%xmm0
movupd %xmm0,(%r14,%rax,1)
addsd  (%r14,%r9,8),%xmm2
add    $0x1,%r15
add    $0x200,%rcx
add    $0x200,%rdx
add    $0x200,%rsi
add    $0x200,%rdi
cmp    $0x100000,%r15
je     165d <main+0x4cd>
mov    %r15,%r9
shl    $0x6,%r9
mov    %r15,%rax
shl    $0x9,%rax
lea    (%r14,%rax,1),%r11
add    $0x100,%r11
lea    (%r12,%rax,1),%r10
add    $0x100,%r10
lea    (%r14,%rax,1),%rbx
cmp    %r10,%rbx
jae    14d0 <main+0x340>
lea    (%r12,%rax,1),%rbx
cmp    %r11,%rbx
jae    14d0 <main+0x340>
xor    %ebx,%ebx
xchg   %ax,%ax
movsd  -0x18(%rdx,%rbx,8),%xmm0
movsd  %xmm0,-0x18(%rcx,%rbx,8)
movsd  -0x10(%rdx,%rbx,8),%xmm0
movsd  %xmm0,-0x10(%rcx,%rbx,8)
movsd  -0x8(%rdx,%rbx,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rbx,8)
movsd  (%rdx,%rbx,8),%xmm0
movsd  %xmm0,(%rcx,%rbx,8)
add    $0x4,%rbx
cmp    $0x20,%rbx
jne    1490 <main+0x300>
jmp    15f8 <main+0x468>
nopl   (%rax)
lea    0x0(,%r9,8),%rbx
movups (%r12,%r9,8),%xmm0
movups %xmm0,(%r14,%r9,8)
mov    %rbx,%rbp
or     $0x10,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x20,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x30,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x40,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x50,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x60,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x70,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x80,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0x90,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0xa0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0xb0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0xc0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0xd0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
mov    %rbx,%rbp
or     $0xe0,%rbp
movups (%r12,%rbp,1),%xmm0
movups %xmm0,(%r14,%rbp,1)
or     $0xf0,%rbx
movupd (%r12,%rbx,1),%xmm0
movupd %xmm0,(%r14,%rbx,1)
lea    (%r12,%rax,1),%rbx
add    $0x200,%rbx
cmp    %rbx,%r11
jae    12e0 <main+0x150>
add    %r14,%rax
add    $0x200,%rax
cmp    %rax,%r10
jae    12e0 <main+0x150>
xor    %eax,%eax
movsd  -0x18(%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x18(%rsi,%rax,8)
movsd  -0x10(%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x10(%rsi,%rax,8)
movsd  -0x8(%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x8(%rsi,%rax,8)
movsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
add    $0x4,%rax
cmp    $0x20,%rax
jne    1620 <main+0x490>
jmp    1423 <main+0x293>
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%eax
movsd  0x18(%rsp),%xmm5
divsd  0x970(%rip),%xmm5
xorpd  %xmm1,%xmm1
mov    $0x600,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  -0x600(%r12,%rcx,1),%xmm1
fa ff ff
addsd  -0x400(%r12,%rcx,1),%xmm1
fc ff ff
addsd  -0x200(%r12,%rcx,1),%xmm1
fe ff ff
addsd  (%r12,%rcx,1),%xmm1
add    $0x800,%rcx
cmp    $0x20000600,%rcx
jne    16b0 <main+0x520>
cvtsi2sd %eax,%xmm4
movsd  0x8(%rsp),%xmm3
addsd  0x20(%rsp),%xmm3
movsd  (%rsp),%xmm0
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
andpd  0x917(%rip),%xmm2
addsd  %xmm4,%xmm5
ucomisd 0x8fb(%rip),%xmm2
jbe    174b <main+0x5bb>
lea    0x912(%rip),%rdi
mov    $0x2,%al
movsd  %xmm3,0x8(%rsp)
movsd  %xmm5,(%rsp)
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
lea    0x913(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    176d <main+0x5dd>
subsd  %xmm3,%xmm5
lea    0x8ff(%rip),%rdi
movapd %xmm5,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x912(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%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 = [37 x i8] c"gang + FAILED! sum=%f, known_sum=%f\0A\00"
@.str.1 = [37 x i8] c"gang + execution time is :%.2lf: ms\0A\00"
@.str.2 = [17 x i8] c"gang + 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 double*
%13 = alloca double
%14 = alloca %struct.timeval
%15 = alloca double
%16 = alloca double
store i32 0, i32* %1
store double 1.000000e-09, double* %13
store i32 1048576, i32* %7
store i32 2, 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** %11
%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** %12
%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** %11
%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
store double 0.000000e+00, double* %9
%89 = call i32 @gettimeofday(%struct.timeval* %14, i32* null)
%90 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, 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* %14, 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* %15
store i32 0, i32* %4
br label %98
98: ; preds = %161, %88
%99 = load i32, i32* %4
%100 = load i32, i32* %7
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %164
102: ; preds = %98
store i32 0, i32* %3
br label %103
103: ; preds = %146, %102
%104 = load i32, i32* %3
%105 = load i32, i32* %6
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %149
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** %11
%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** %12
%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
br label %146
146: ; preds = %145
%147 = load i32, i32* %3
%148 = add nsw i32 %147, 1
store i32 %148, i32* %3
br label %103
149: ; preds = %103
%150 = load double*, double** %12
%151 = load i32, i32* %4
%152 = load i32, i32* %6
%153 = mul nsw i32 %151, %152
%154 = load i32, i32* %5
%155 = mul nsw i32 %153, %154
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %150, i64 %156
%158 = load double, double* %157
%159 = load double, double* %9
%160 = fadd double %159, %158
store double %160, double* %9
br label %161
161: ; preds = %149
%162 = load i32, i32* %4
%163 = add nsw i32 %162, 1
store i32 %163, i32* %4
br label %98
164: ; preds = %98
%165 = call i32 @gettimeofday(%struct.timeval* %14, i32* null)
%166 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%167 = load i32, i32* %166
%168 = mul nsw i32 %167, 1000
%169 = sitofp i32 %168 to double
%170 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%171 = load double, double* %170
%172 = fdiv double %171, 1.000000e+03
%173 = fadd double %169, %172
store double %173, double* %16
store double 0.000000e+00, double* %10
store i32 0, i32* %4
br label %174
174: ; preds = %190, %164
%175 = load i32, i32* %4
%176 = load i32, i32* %7
%177 = icmp slt i32 %175, %176
br i1 %177, label %178, label %193
178: ; preds = %174
%179 = load double*, double** %11
%180 = load i32, i32* %4
%181 = load i32, i32* %6
%182 = mul nsw i32 %180, %181
%183 = load i32, i32* %5
%184 = mul nsw i32 %182, %183
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double, double* %179, i64 %185
%187 = load double, double* %186
%188 = load double, double* %10
%189 = fadd double %188, %187
store double %189, double* %10
br label %190
190: ; preds = %178
%191 = load i32, i32* %4
%192 = add nsw i32 %191, 1
store i32 %192, i32* %4
br label %174
193: ; preds = %174
%194 = load double, double* %9
%195 = load double, double* %10
%196 = fsub double %194, %195
%197 = call double @llvm.fabs.f64(double %196)
%198 = load double, double* %13
%199 = fcmp ogt double %197, %198
br i1 %199, label %200, label %206
200: ; preds = %193
%201 = load i32, i32* %8
%202 = add nsw i32 %201, 1
store i32 %202, i32* %8
%203 = load double, double* %9
%204 = load double, double* %10
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %203, double %204)
br label %206
206: ; preds = %200, %193
%207 = load double, double* %16
%208 = load double, double* %15
%209 = fsub double %207, %208
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), double %209)
%211 = load i32, i32* %8
%212 = icmp eq i32 %211, 0
br i1 %212, label %213, label %215
213: ; preds = %206
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %215
215: ; preds = %213, %206
%216 = load double*, double** %11
%217 = call i32 @free(double* %216)
%218 = load double*, double** %12
%219 = call i32 @free(double* %218)
ret i32 0
}

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