#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*/ 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 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 << 20;
  NJ = 2;
  NI = 32;
  input = (double *)malloc(NK * NJ * NI * sizeof(double));
  temp = (double *)malloc(NK * NJ * NI * sizeof(double));
  error = 0;
  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;
      }
    }
  }
  double product = 1;
  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(* : product)
    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];
      }
      product *= temp[k * NJ * NI];
    }
  }
  gettimeofday(&tim, NULL);
  end = tim.tv_sec * 1000 + (tim.tv_usec / 1000.0);
  double known_product = 1;
  for (k = 0; k < NK; k++)
    known_product *= input[k * NJ * NI];
  if (fabs(product - known_product) > rounding_error) {
    error++;
    printf("gang * FAILED! product=%d, known_product=%d\n", product,
           known_product);
  }
  printf("gang * execution time is :%.2lf: ms\n", end - start);
  if (error == 0)
    printf("gang * SUCCESS!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x100000,-0x24(%rbp)
movl   $0x2,-0x20(%rbp)
movl   $0x20,-0x1c(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1080 <acc_init@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12b4 <main+0x144>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12a1 <main+0x131>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    128e <main+0x11e>
mov    $0x0,%al
call   1090 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2da0(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdbf(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x20(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x1c(%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    1229 <main+0xb9>
jmp    1293 <main+0x123>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1216 <main+0xa6>
jmp    12a6 <main+0x136>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1203 <main+0x93>
movsd  0xd54(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
imul   $0x3e8,-0x50(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xd22(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13c2 <main+0x252>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1393 <main+0x223>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1380 <main+0x210>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x20(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x20(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x1c(%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    1320 <main+0x1b0>
jmp    1385 <main+0x215>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130d <main+0x19d>
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x20(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12fa <main+0x18a>
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
imul   $0x3e8,-0x50(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xc21(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc14(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1443 <main+0x2d3>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x20(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1408 <main+0x298>
movsd  -0x68(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movaps 0xbcc(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1484 <main+0x314>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
lea    0xbb3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
lea    0xbc8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x28(%rbp)
jne    14b4 <main+0x344>
lea    0xbd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@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   1080 <malloc@plt>
mov    %rax,%r12
mov    $0x20000000,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1090 <acc_init@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    0x2e1d(%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   10a0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%r15),%xmm1
divsd  %xmm1,%xmm0
movsd  0xded(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    11f0 <main+0x70>
mov    $0x20,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%r15),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdad(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x40,%rbp
jne    1230 <main+0xb0>
add    $0x1,%r13
add    $0x200,%rbx
cmp    $0x100000,%r13
jne    11e0 <main+0x60>
xor    %r15d,%r15d
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%r8d
movsd  0x18(%rsp),%xmm1
divsd  0xd64(%rip),%xmm1
lea    0x18(%r14),%rcx
lea    0x18(%r12),%rdx
lea    0x118(%r14),%rsi
lea    0x118(%r12),%rdi
movsd  0xd4c(%rip),%xmm2
jmp    1446 <main+0x2c6>
nopl   0x0(%rax)
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)
mulsd  (%r14,%r9,8),%xmm2
add    $0x1,%r15
add    $0x200,%rcx
add    $0x200,%rdx
add    $0x200,%rsi
add    $0x200,%rdi
cmp    $0x100000,%r15
je     164d <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    14c0 <main+0x340>
lea    (%r12,%rax,1),%rbx
cmp    %r11,%rbx
jae    14c0 <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    1480 <main+0x300>
jmp    15e8 <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    12d0 <main+0x150>
add    %r14,%rax
add    $0x200,%rax
cmp    %rax,%r10
jae    12d0 <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    1610 <main+0x490>
jmp    1413 <main+0x293>
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
movsd  %xmm0,0x20(%rsp)
xor    %ebx,%ebx
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%eax
movsd  0x18(%rsp),%xmm5
divsd  0x97e(%rip),%xmm5
movsd  0x97e(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  (%r12,%rbx,1),%xmm1
mulsd  0x200(%r12,%rbx,1),%xmm1
mulsd  0x400(%r12,%rbx,1),%xmm1
mulsd  0x600(%r12,%rbx,1),%xmm1
add    $0x800,%rbx
cmp    $0x20000000,%rbx
jne    16a0 <main+0x520>
cvtsi2sd %eax,%xmm4
movsd  0x8(%rsp),%xmm3
addsd  0x20(%rsp),%xmm3
movsd  (%rsp),%xmm0
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
andpd  0x927(%rip),%xmm2
addsd  %xmm4,%xmm5
ucomisd 0x913(%rip),%xmm2
jbe    173b <main+0x5bb>
lea    0x922(%rip),%rdi
mov    $0x2,%al
movsd  %xmm3,0x8(%rsp)
movsd  %xmm5,(%rsp)
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
lea    0x92b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    175d <main+0x5dd>
subsd  %xmm3,%xmm5
lea    0x917(%rip),%rdi
movapd %xmm5,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x92a(%rip),%rdi
call   1030 <puts@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 = [45 x i8] c"gang * FAILED! product=%d, known_product=%d\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 i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca %struct.timeval
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store i32 0, i32* %1
store double 1.000000e-09, double* %13
store i32 1048576, i32* %9
store i32 2, i32* %8
store i32 32, i32* %7
%19 = load i32, i32* %9
%20 = load i32, i32* %8
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = mul nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 8
%26 = trunc i64 %25 to i32
%27 = call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to double*
store double* %28, double** %11
%29 = load i32, i32* %9
%30 = load i32, i32* %8
%31 = mul nsw i32 %29, %30
%32 = load i32, i32* %7
%33 = mul nsw i32 %31, %32
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 8
%36 = trunc i64 %35 to i32
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to double*
store double* %38, double** %12
store i32 0, i32* %10
%39 = load i32, i32* @acc_device_default
%40 = call i32 @acc_init(i32 %39)
%41 = call i64 @time(i32 0)
%42 = trunc i64 %41 to i32
%43 = call i32 @srand(i32 %42)
store i32 0, i32* %4
br label %44
44: ; preds = %87, %0
%45 = load i32, i32* %4
%46 = load i32, i32* %9
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %90
48: ; preds = %44
store i32 0, i32* %3
br label %49
49: ; preds = %83, %48
%50 = load i32, i32* %3
%51 = load i32, i32* %8
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %86
53: ; preds = %49
store i32 0, i32* %2
br label %54
54: ; preds = %79, %53
%55 = load i32, i32* %2
%56 = load i32, i32* %7
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %82
58: ; preds = %54
%59 = call i64 (...) @rand()
%60 = sitofp i64 %59 to double
%61 = load i64, i64* @RAND_MAX
%62 = sitofp i64 %61 to double
%63 = fdiv double %60, %62
%64 = fadd double %63, 1.000000e-01
%65 = load double*, double** %11
%66 = load i32, i32* %4
%67 = load i32, i32* %8
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %7
%70 = mul nsw i32 %68, %69
%71 = load i32, i32* %3
%72 = load i32, i32* %7
%73 = mul nsw i32 %71, %72
%74 = add nsw i32 %70, %73
%75 = load i32, i32* %2
%76 = add nsw i32 %74, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %65, i64 %77
store double %64, double* %78
br label %79
79: ; preds = %58
%80 = load i32, i32* %2
%81 = add nsw i32 %80, 1
store i32 %81, i32* %2
br label %54
82: ; preds = %54
br label %83
83: ; preds = %82
%84 = load i32, i32* %3
%85 = add nsw i32 %84, 1
store i32 %85, i32* %3
br label %49
86: ; preds = %49
br label %87
87: ; preds = %86
%88 = load i32, i32* %4
%89 = add nsw i32 %88, 1
store i32 %89, i32* %4
br label %44
90: ; preds = %44
store double 1.000000e+00, double* %17
%91 = call i32 @gettimeofday(%struct.timeval* %14, i32* null)
%92 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%93 = load i32, i32* %92
%94 = mul nsw i32 %93, 1000
%95 = sitofp i32 %94 to double
%96 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%97 = load double, double* %96
%98 = fdiv double %97, 1.000000e+03
%99 = fadd double %95, %98
store double %99, double* %15
store i32 0, i32* %4
br label %100
100: ; preds = %163, %90
%101 = load i32, i32* %4
%102 = load i32, i32* %9
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %166
104: ; preds = %100
store i32 0, i32* %3
br label %105
105: ; preds = %148, %104
%106 = load i32, i32* %3
%107 = load i32, i32* %8
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %151
109: ; preds = %105
store i32 0, i32* %2
br label %110
110: ; preds = %144, %109
%111 = load i32, i32* %2
%112 = load i32, i32* %7
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %147
114: ; preds = %110
%115 = load double*, double** %11
%116 = load i32, i32* %4
%117 = load i32, i32* %8
%118 = mul nsw i32 %116, %117
%119 = load i32, i32* %7
%120 = mul nsw i32 %118, %119
%121 = load i32, i32* %3
%122 = load i32, i32* %7
%123 = mul nsw i32 %121, %122
%124 = add nsw i32 %120, %123
%125 = load i32, i32* %2
%126 = add nsw i32 %124, %125
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %115, i64 %127
%129 = load double, double* %128
%130 = load double*, double** %12
%131 = load i32, i32* %4
%132 = load i32, i32* %8
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %7
%135 = mul nsw i32 %133, %134
%136 = load i32, i32* %3
%137 = load i32, i32* %7
%138 = mul nsw i32 %136, %137
%139 = add nsw i32 %135, %138
%140 = load i32, i32* %2
%141 = add nsw i32 %139, %140
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %130, i64 %142
store double %129, double* %143
br label %144
144: ; preds = %114
%145 = load i32, i32* %2
%146 = add nsw i32 %145, 1
store i32 %146, i32* %2
br label %110
147: ; preds = %110
br label %148
148: ; preds = %147
%149 = load i32, i32* %3
%150 = add nsw i32 %149, 1
store i32 %150, i32* %3
br label %105
151: ; preds = %105
%152 = load double*, double** %12
%153 = load i32, i32* %4
%154 = load i32, i32* %8
%155 = mul nsw i32 %153, %154
%156 = load i32, i32* %7
%157 = mul nsw i32 %155, %156
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %152, i64 %158
%160 = load double, double* %159
%161 = load double, double* %17
%162 = fmul double %161, %160
store double %162, double* %17
br label %163
163: ; preds = %151
%164 = load i32, i32* %4
%165 = add nsw i32 %164, 1
store i32 %165, i32* %4
br label %100
166: ; preds = %100
%167 = call i32 @gettimeofday(%struct.timeval* %14, i32* null)
%168 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%169 = load i32, i32* %168
%170 = mul nsw i32 %169, 1000
%171 = sitofp i32 %170 to double
%172 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%173 = load double, double* %172
%174 = fdiv double %173, 1.000000e+03
%175 = fadd double %171, %174
store double %175, double* %16
store double 1.000000e+00, double* %18
store i32 0, i32* %4
br label %176
176: ; preds = %192, %166
%177 = load i32, i32* %4
%178 = load i32, i32* %9
%179 = icmp slt i32 %177, %178
br i1 %179, label %180, label %195
180: ; preds = %176
%181 = load double*, double** %11
%182 = load i32, i32* %4
%183 = load i32, i32* %8
%184 = mul nsw i32 %182, %183
%185 = load i32, i32* %7
%186 = mul nsw i32 %184, %185
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %181, i64 %187
%189 = load double, double* %188
%190 = load double, double* %18
%191 = fmul double %190, %189
store double %191, double* %18
br label %192
192: ; preds = %180
%193 = load i32, i32* %4
%194 = add nsw i32 %193, 1
store i32 %194, i32* %4
br label %176
195: ; preds = %176
%196 = load double, double* %17
%197 = load double, double* %18
%198 = fsub double %196, %197
%199 = call double @llvm.fabs.f64(double %198)
%200 = load double, double* %13
%201 = fcmp ogt double %199, %200
br i1 %201, label %202, label %208
202: ; preds = %195
%203 = load i32, i32* %10
%204 = add nsw i32 %203, 1
store i32 %204, i32* %10
%205 = load double, double* %17
%206 = load double, double* %18
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %205, double %206)
br label %208
208: ; preds = %202, %195
%209 = load double, double* %16
%210 = load double, double* %15
%211 = fsub double %209, %210
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), double %211)
%213 = load i32, i32* %10
%214 = icmp eq i32 %213, 0
br i1 %214, label %215, label %217
215: ; preds = %208
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %217
217: ; preds = %215, %208
%218 = load i32, i32* %1
ret i32 %218
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
@acc_device_default = global i32 0
@RAND_MAX = global i64 0
@.str = [45 x i8] c"gang * FAILED! product=%d, known_product=%d\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 [ 1.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 = fmul 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 [ 1.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 = fmul 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 = fmul 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 = fmul 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 = fmul 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 ([45 x i8], [45 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
ret i32 0
}