#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;
  double sum, known_sum;
  int NI, NJ, NK;
  int error;
  double *input, *temp;
  double rounding_error = 1.E-9;
  struct timeval tim;
  double start, end;
  NK = 1 << 10;
  NJ = 1 << 10;
  NI = 64;
  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;
  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 + j * NI];
      }
    }
  }
  gettimeofday(&tim, NULL);
  end = tim.tv_sec * 1000 + (tim.tv_usec / 1000.0);
  known_sum = 0;
  for (k = 0; k < NK; k++) {
    for (j = 0; j < NJ; j++) {
      known_sum += input[k * NJ * NI + j * NI];
    }
  }
  if (fabs(sum - known_sum) > rounding_error) {
    error++;
    printf("gang_worker + FAILED! sum=%d, known_sum=%d\n", sum, known_sum);
  }
  printf("gang_worker + execution time is :%.2lf: ms\n", end - start);
  if (error == 0)
    printf("gang_worker + SUCCESS!\n");
  free(input);
  free(temp);
}


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   $0x400,-0x2c(%rbp)
movl   $0x400,-0x28(%rbp)
movl   $0x40,-0x24(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x28(%rbp),%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x28(%rbp),%eax
imul   -0x24(%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    -0x2c(%rbp),%eax
jge    12c4 <main+0x144>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12b1 <main+0x131>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x24(%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   -0x28(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x24(%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,-0x18(%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    -0x2c(%rbp),%eax
jge    13d6 <main+0x256>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13c3 <main+0x243>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    138b <main+0x20b>
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x28(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x24(%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   -0x28(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x24(%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    -0x40(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x28(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1318 <main+0x198>
jmp    13c8 <main+0x248>
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  0xc0d(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1481 <main+0x301>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    146e <main+0x2ee>
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x28(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    142a <main+0x2aa>
jmp    1473 <main+0x2f3>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1417 <main+0x297>
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movaps 0xb8e(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    14c2 <main+0x342>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xb75(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
lea    0xb89(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x30(%rbp)
jne    14f2 <main+0x372>
lea    0xb9d(%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>
mov    -0x4(%rbp),%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,%r14
mov    $0x20000000,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
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),%rbx
mov    %r14,%rbp
xor    %eax,%eax
mov    %rax,(%rsp)
mov    %rbp,0x8(%rsp)
xor    %r15d,%r15d
nopl   0x0(%rax)
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   10b0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
divsd  %xmm1,%xmm0
movsd  0xddd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%r12,8)
add    $0x1,%r12
cmp    $0x40,%r12
jne    1200 <main+0x70>
add    $0x1,%r15
add    $0x200,%rbp
cmp    $0x400,%r15
jne    11f0 <main+0x60>
mov    (%rsp),%rax
add    $0x1,%rax
mov    0x8(%rsp),%rbp
add    $0x80000,%rbp
cmp    $0x400,%rax
jne    11e0 <main+0x50>
xor    %r15d,%r15d
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%r8d
movsd  0x18(%rsp),%xmm1
divsd  0xd76(%rip),%xmm1
lea    0x18(%r13),%r9
lea    0x18(%r14),%r10
xorpd  %xmm2,%xmm2
jmp    12bf <main+0x12f>
add    $0x1,%r15
add    $0x80000,%r9
add    $0x80000,%r10
cmp    $0x400,%r15
je     160d <main+0x47d>
mov    %r15,%r12
shl    $0x10,%r12
lea    0x40(%r12),%r11
mov    %r10,%rdx
mov    %r9,%rcx
xor    %eax,%eax
jmp    158d <main+0x3fd>
nopl   0x0(%rax,%rax,1)
lea    0x0(,%rdi,8),%rsi
movups (%r14,%rdi,8),%xmm0
movups %xmm0,0x0(%r13,%rdi,8)
mov    %rsi,%rbx
or     $0x10,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x20,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x30,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x40,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x50,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x60,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x70,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x80,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x90,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0xa0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0xb0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0xc0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0xd0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0xe0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0xf0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x100,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x110,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x120,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x130,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x140,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x150,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x160,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x170,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x180,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x190,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x1a0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x1b0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x1c0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x1d0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
mov    %rsi,%rbx
or     $0x1e0,%rbx
movups (%r14,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
or     $0x1f0,%rsi
movupd (%r14,%rsi,1),%xmm0
movupd %xmm0,0x0(%r13,%rsi,1)
addsd  0x0(%r13,%rdi,8),%xmm2
add    $0x1,%rax
add    $0x200,%rcx
add    $0x200,%rdx
cmp    $0x400,%rax
je     12a0 <main+0x110>
mov    %rax,%rsi
shl    $0x6,%rsi
lea    (%r12,%rsi,1),%rdi
add    %r11,%rsi
lea    (%r14,%rsi,8),%rbx
lea    0x0(,%rdi,8),%rbp
add    %r13,%rbp
cmp    %rbx,%rbp
jae    12e0 <main+0x150>
lea    (%r14,%rdi,8),%rbx
lea    0x0(,%rsi,8),%rsi
add    %r13,%rsi
cmp    %rsi,%rbx
jae    12e0 <main+0x150>
xor    %esi,%esi
nopl   (%rax)
movsd  -0x18(%rdx,%rsi,8),%xmm0
movsd  %xmm0,-0x18(%rcx,%rsi,8)
movsd  -0x10(%rdx,%rsi,8),%xmm0
movsd  %xmm0,-0x10(%rcx,%rsi,8)
movsd  -0x8(%rdx,%rsi,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rsi,8)
movsd  (%rdx,%rsi,8),%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
add    $0x4,%rsi
cmp    $0x40,%rsi
jne    15d0 <main+0x440>
jmp    1568 <main+0x3d8>
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
movsd  %xmm0,0x20(%rsp)
xor    %ebx,%ebx
lea    0x10(%rsp),%rdi
xor    %esi,%esi
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,(%rsp)
call   1060 <gettimeofday@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm3
imul   $0x3e8,0x10(%rsp),%eax
movsd  0x18(%rsp),%xmm5
divsd  0x9b3(%rip),%xmm5
mov    %r14,%rcx
add    $0x600,%rcx
xorpd  %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  -0x600(%rcx,%rdx,1),%xmm1
ff ff
addsd  -0x400(%rcx,%rdx,1),%xmm1
ff ff
addsd  -0x200(%rcx,%rdx,1),%xmm1
ff ff
addsd  (%rcx,%rdx,1),%xmm1
add    $0x800,%rdx
cmp    $0x80000,%rdx
jne    1680 <main+0x4f0>
add    $0x1,%rbx
add    $0x80000,%rcx
cmp    $0x400,%rbx
jne    1670 <main+0x4e0>
cvtsi2sd %eax,%xmm4
addsd  0x20(%rsp),%xmm3
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
andpd  0x942(%rip),%xmm2
addsd  %xmm4,%xmm5
ucomisd 0x926(%rip),%xmm2
jbe    1720 <main+0x590>
lea    0x93d(%rip),%rdi
mov    $0x2,%al
movsd  %xmm3,0x8(%rsp)
movsd  %xmm5,(%rsp)
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
lea    0x945(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1742 <main+0x5b2>
subsd  %xmm3,%xmm5
lea    0x931(%rip),%rdi
movapd %xmm5,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x94b(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13,%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 = [44 x i8] c"gang_worker + FAILED! sum=%d, known_sum=%d\0A\00"
@.str.1 = [44 x i8] c"gang_worker + execution time is :%.2lf: ms\0A\00"
@.str.2 = [24 x i8] c"gang_worker + SUCCESS!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%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 1024, i32* %9
store i32 1024, i32* %8
store i32 64, i32* %7
store i32 0, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %7
%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* %9
%28 = load i32, i32* %8
%29 = mul nsw i32 %27, %28
%30 = load i32, i32* %7
%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* %9
%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* %8
%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* %7
%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* %8
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %7
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %3
%70 = load i32, i32* %7
%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* %5
%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 = %165, %88
%99 = load i32, i32* %4
%100 = load i32, i32* %9
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %168
102: ; preds = %98
store i32 0, i32* %3
br label %103
103: ; preds = %161, %102
%104 = load i32, i32* %3
%105 = load i32, i32* %8
%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* %7
%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* %8
%116 = mul nsw i32 %114, %115
%117 = load i32, i32* %7
%118 = mul nsw i32 %116, %117
%119 = load i32, i32* %3
%120 = load i32, i32* %7
%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* %8
%131 = mul nsw i32 %129, %130
%132 = load i32, i32* %7
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %3
%135 = load i32, i32* %7
%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** %12
%147 = load i32, i32* %4
%148 = load i32, i32* %8
%149 = mul nsw i32 %147, %148
%150 = load i32, i32* %7
%151 = mul nsw i32 %149, %150
%152 = load i32, i32* %3
%153 = load i32, i32* %7
%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* %5
%160 = fadd double %159, %158
store double %160, double* %5
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
br label %165
165: ; preds = %164
%166 = load i32, i32* %4
%167 = add nsw i32 %166, 1
store i32 %167, i32* %4
br label %98
168: ; preds = %98
%169 = call i32 @gettimeofday(%struct.timeval* %14, i32* null)
%170 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%171 = load i32, i32* %170
%172 = mul nsw i32 %171, 1000
%173 = sitofp i32 %172 to double
%174 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%175 = load double, double* %174
%176 = fdiv double %175, 1.000000e+03
%177 = fadd double %173, %176
store double %177, double* %16
store double 0.000000e+00, double* %6
store i32 0, i32* %4
br label %178
178: ; preds = %207, %168
%179 = load i32, i32* %4
%180 = load i32, i32* %9
%181 = icmp slt i32 %179, %180
br i1 %181, label %182, label %210
182: ; preds = %178
store i32 0, i32* %3
br label %183
183: ; preds = %203, %182
%184 = load i32, i32* %3
%185 = load i32, i32* %8
%186 = icmp slt i32 %184, %185
br i1 %186, label %187, label %206
187: ; preds = %183
%188 = load double*, double** %11
%189 = load i32, i32* %4
%190 = load i32, i32* %8
%191 = mul nsw i32 %189, %190
%192 = load i32, i32* %7
%193 = mul nsw i32 %191, %192
%194 = load i32, i32* %3
%195 = load i32, i32* %7
%196 = mul nsw i32 %194, %195
%197 = add nsw i32 %193, %196
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %188, i64 %198
%200 = load double, double* %199
%201 = load double, double* %6
%202 = fadd double %201, %200
store double %202, double* %6
br label %203
203: ; preds = %187
%204 = load i32, i32* %3
%205 = add nsw i32 %204, 1
store i32 %205, i32* %3
br label %183
206: ; preds = %183
br label %207
207: ; preds = %206
%208 = load i32, i32* %4
%209 = add nsw i32 %208, 1
store i32 %209, i32* %4
br label %178
210: ; preds = %178
%211 = load double, double* %5
%212 = load double, double* %6
%213 = fsub double %211, %212
%214 = call double @llvm.fabs.f64(double %213)
%215 = load double, double* %13
%216 = fcmp ogt double %214, %215
br i1 %216, label %217, label %223
217: ; preds = %210
%218 = load i32, i32* %10
%219 = add nsw i32 %218, 1
store i32 %219, i32* %10
%220 = load double, double* %5
%221 = load double, double* %6
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double %220, double %221)
br label %223
223: ; preds = %217, %210
%224 = load double, double* %16
%225 = load double, double* %15
%226 = fsub double %224, %225
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double %226)
%228 = load i32, i32* %10
%229 = icmp eq i32 %228, 0
br i1 %229, label %230, label %232
230: ; preds = %223
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %232
232: ; preds = %230, %223
%233 = load double*, double** %11
%234 = call i32 @free(double* %233)
%235 = load double*, double** %12
%236 = call i32 @free(double* %235)
%237 = load i32, i32* %1
ret i32 %237
}

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