#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ acc_malloc(int);
int /*<<< orphan*/ acc_memcpy_from_device(float *, float *, int);
int /*<<< orphan*/ acc_memcpy_to_device(float *, float *, int);
int /*<<< orphan*/ acc_wait_all();
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(float *);
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, char **argv) {
  int N = 32 * 30000 * 256;
  float sumv1[256];
  float *v = (float *)calloc(N, sizeof(float));
  float *redv = (float *)calloc(30000, sizeof(float));
  for (int n = 0; n < N; ++n) {
    v[n] = 1;
  }
  float *d_v = (float *)acc_malloc(N * sizeof(float));
  float *d_redv = (float *)acc_malloc(30000 * sizeof(float));
  acc_memcpy_to_device(d_v, v, N * sizeof(float));
  acc_memcpy_to_device(d_redv, redv, 30000 * sizeof(float));
  double c1 = omp_get_wtime();
#pragma acc data deviceptr(d_v, d_redv)
#pragma acc parallel num_gangs(B), vector_length(T), private(sumv1)
  {
#pragma acc loop gang
    for (int b = 0; b < 30000; ++b) {
#pragma acc loop vector
      for (int t = 0; t < 256; ++t) {
        int id = t + b * 256;
        float tmp = 0.f;
        while (id < N) {
          tmp = d_v[id];
          id += 30000 * 256;
        }
        sumv1[t] = tmp;
      }
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (256 >= 256 && t < 128)
          sumv1[t] += sumv1[t + 128];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (256 >= 128 && t < 64)
          sumv1[t] += sumv1[t + 64];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (256 >= 64 && t < 32)
          sumv1[t] += sumv1[t + 32];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (t < 16)
          sumv1[t] += sumv1[t + 16];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (t < 8)
          sumv1[t] += sumv1[t + 8];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (t < 4)
          sumv1[t] += sumv1[t + 4];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (t < 2)
          sumv1[t] += sumv1[t + 2];
#pragma acc loop vector
      for (int t = 0; t < 256; ++t)
        if (t < 1) {
          sumv1[t] += sumv1[t + 1];
          d_redv[b] = sumv1[0];
        }
    }
  }
  acc_wait_all();
  double c2 = omp_get_wtime();
  double elapsed_time = (c2 - c1);
  printf("elapsed time for cpu: %g\n", elapsed_time);
  printf("BW: %g GB/s\n",
         (N + 1. * 30000) * sizeof(float) / (1.e9 * elapsed_time));
  printf("N=%d (%g GB)\n", N, N * sizeof(float) / 1.e9);
  acc_memcpy_from_device(redv, d_redv, 30000 * sizeof(float));
  for (int b = 0; b < 30000; ++b) {
    if (b < 10 || b > 30000 - 10)
      printf("redv[%03d]=%g\n", b, redv[b]);
  }
  free(v);
  free(redv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xea60000,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x428(%rbp)
mov    $0x7530,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x430(%rbp)
movl   $0x0,-0x434(%rbp)
mov    -0x434(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1212 <main+0x92>
mov    -0x428(%rbp),%rax
movslq -0x434(%rbp),%rcx
movss  0xe47(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x434(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x434(%rbp)
jmp    11d4 <main+0x54>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <acc_malloc@plt>
mov    %rax,-0x440(%rbp)
mov    $0x1d4c0,%edi
call   1040 <acc_malloc@plt>
mov    %rax,-0x448(%rbp)
mov    -0x440(%rbp),%rdi
mov    -0x428(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1090 <acc_memcpy_to_device@plt>
mov    -0x448(%rbp),%rdi
mov    -0x430(%rbp),%rsi
mov    $0x1d4c0,%edx
call   1090 <acc_memcpy_to_device@plt>
mov    $0x0,%al
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x450(%rbp)
ff
movl   $0x0,-0x454(%rbp)
cmpl   $0x7530,-0x454(%rbp)
jge    16e0 <main+0x560>
movl   $0x0,-0x458(%rbp)
cmpl   $0x100,-0x458(%rbp)
jge    133f <main+0x1bf>
mov    -0x458(%rbp),%eax
mov    -0x454(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x45c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x460(%rbp)
ff
mov    -0x45c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1313 <main+0x193>
mov    -0x440(%rbp),%rax
movslq -0x45c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x460(%rbp)
ff
mov    -0x45c(%rbp),%eax
add    $0x753000,%eax
mov    %eax,-0x45c(%rbp)
jmp    12d3 <main+0x153>
movss  -0x460(%rbp),%xmm0
ff
movslq -0x458(%rbp),%rax
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
mov    -0x458(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x458(%rbp)
jmp    12a1 <main+0x121>
movl   $0x0,-0x464(%rbp)
cmpl   $0x100,-0x464(%rbp)
jge    13b1 <main+0x231>
cmpl   $0x80,-0x464(%rbp)
jge    1398 <main+0x218>
mov    -0x464(%rbp),%eax
add    $0x80,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x464(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    139d <main+0x21d>
mov    -0x464(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x464(%rbp)
jmp    1349 <main+0x1c9>
movl   $0x0,-0x468(%rbp)
cmpl   $0x100,-0x468(%rbp)
jge    141e <main+0x29e>
cmpl   $0x40,-0x468(%rbp)
jge    1405 <main+0x285>
mov    -0x468(%rbp),%eax
add    $0x40,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x468(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    140a <main+0x28a>
mov    -0x468(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x468(%rbp)
jmp    13bb <main+0x23b>
movl   $0x0,-0x46c(%rbp)
cmpl   $0x100,-0x46c(%rbp)
jge    148b <main+0x30b>
cmpl   $0x20,-0x46c(%rbp)
jge    1472 <main+0x2f2>
mov    -0x46c(%rbp),%eax
add    $0x20,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x46c(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    1477 <main+0x2f7>
mov    -0x46c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x46c(%rbp)
jmp    1428 <main+0x2a8>
movl   $0x0,-0x470(%rbp)
cmpl   $0x100,-0x470(%rbp)
jge    14f8 <main+0x378>
cmpl   $0x10,-0x470(%rbp)
jge    14df <main+0x35f>
mov    -0x470(%rbp),%eax
add    $0x10,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x470(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    14e4 <main+0x364>
mov    -0x470(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x470(%rbp)
jmp    1495 <main+0x315>
movl   $0x0,-0x474(%rbp)
cmpl   $0x100,-0x474(%rbp)
jge    1565 <main+0x3e5>
cmpl   $0x8,-0x474(%rbp)
jge    154c <main+0x3cc>
mov    -0x474(%rbp),%eax
add    $0x8,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x474(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    1551 <main+0x3d1>
mov    -0x474(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x474(%rbp)
jmp    1502 <main+0x382>
movl   $0x0,-0x478(%rbp)
cmpl   $0x100,-0x478(%rbp)
jge    15d2 <main+0x452>
cmpl   $0x4,-0x478(%rbp)
jge    15b9 <main+0x439>
mov    -0x478(%rbp),%eax
add    $0x4,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x478(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    15be <main+0x43e>
mov    -0x478(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x478(%rbp)
jmp    156f <main+0x3ef>
movl   $0x0,-0x47c(%rbp)
cmpl   $0x100,-0x47c(%rbp)
jge    163f <main+0x4bf>
cmpl   $0x2,-0x47c(%rbp)
jge    1626 <main+0x4a6>
mov    -0x47c(%rbp),%eax
add    $0x2,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x47c(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
jmp    162b <main+0x4ab>
mov    -0x47c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x47c(%rbp)
jmp    15dc <main+0x45c>
movl   $0x0,-0x480(%rbp)
cmpl   $0x100,-0x480(%rbp)
jge    16c7 <main+0x547>
cmpl   $0x1,-0x480(%rbp)
jge    16ae <main+0x52e>
mov    -0x480(%rbp),%eax
add    $0x1,%eax
cltq
movss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movslq -0x480(%rbp),%rax
addss  -0x420(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x420(%rbp,%rax,4)
ff ff
movss  -0x420(%rbp),%xmm0
ff
mov    -0x448(%rbp),%rax
movslq -0x454(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    16b3 <main+0x533>
mov    -0x480(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x480(%rbp)
jmp    1649 <main+0x4c9>
jmp    16cc <main+0x54c>
mov    -0x454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x454(%rbp)
jmp    1287 <main+0x107>
xor    %eax,%eax
mov    %al,-0x495(%rbp)
call   1050 <acc_wait_all@plt>
mov    -0x495(%rbp),%al
call   1060 <omp_get_wtime@plt>
mov    -0x495(%rbp),%al
movsd  %xmm0,-0x488(%rbp)
ff
movsd  -0x488(%rbp),%xmm0
ff
movsd  -0x450(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x490(%rbp)
ff
cvttsd2si -0x490(%rbp),%esi
ff
lea    0x913(%rip),%rdi
call   1070 <printf@plt>
mov    -0x495(%rbp),%al
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0x8bf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x8bb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x490(%rbp),%xmm1
ff
movsd  0x897(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0x8e2(%rip),%rdi
call   1070 <printf@plt>
movslq -0x14(%rbp),%rax
mov    %eax,%esi
shl    $0x2,%rax
movq   %rax,%xmm0
movaps 0x889(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0x88d(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x846(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0x8a6(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x430(%rbp),%rdi
mov    -0x448(%rbp),%rsi
mov    $0x1d4c0,%edx
call   10a0 <acc_memcpy_from_device@plt>
movl   $0x0,-0x494(%rbp)
cmpl   $0x7530,-0x494(%rbp)
jge    185f <main+0x6df>
cmpl   $0xa,-0x494(%rbp)
jl     181b <main+0x69b>
cmpl   $0x7526,-0x494(%rbp)
jle    1846 <main+0x6c6>
mov    -0x494(%rbp),%esi
mov    -0x430(%rbp),%rax
movslq -0x494(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0x83a(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
jmp    184b <main+0x6cb>
mov    -0x494(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x494(%rbp)
jmp    17ee <main+0x66e>
mov    -0x428(%rbp),%rdi
call   1030 <free@plt>
mov    -0x430(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x4a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    $0xea60000,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,%r12
mov    $0x7530,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,%rbx
mov    $0x3c,%eax
movaps 0xe3f(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0xf0(%r12,%rax,4)
ff ff
movups %xmm0,-0xe0(%r12,%rax,4)
ff ff
movups %xmm0,-0xd0(%r12,%rax,4)
ff ff
movups %xmm0,-0xc0(%r12,%rax,4)
ff ff
movups %xmm0,-0xb0(%r12,%rax,4)
ff ff
movups %xmm0,-0xa0(%r12,%rax,4)
ff ff
movups %xmm0,-0x90(%r12,%rax,4)
ff ff
movups %xmm0,-0x80(%r12,%rax,4)
movups %xmm0,-0x70(%r12,%rax,4)
movups %xmm0,-0x60(%r12,%rax,4)
movups %xmm0,-0x50(%r12,%rax,4)
movups %xmm0,-0x40(%r12,%rax,4)
movups %xmm0,-0x30(%r12,%rax,4)
movups %xmm0,-0x20(%r12,%rax,4)
movups %xmm0,-0x10(%r12,%rax,4)
movups %xmm0,(%r12,%rax,4)
add    $0x40,%rax
cmp    $0xea6003c,%rax
jne    11d0 <main+0x50>
mov    $0x3a980000,%edi
call   1040 <acc_malloc@plt>
mov    %rax,%r14
mov    $0x1d4c0,%edi
call   1040 <acc_malloc@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x3a980000,%edx
call   1090 <acc_memcpy_to_device@plt>
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
mov    %rbx,0x18(%rsp)
mov    %rbx,%rsi
mov    $0x1d4c0,%edx
call   1090 <acc_memcpy_to_device@plt>
xor    %r13d,%r13d
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x753000,%r9d
mov    $0xe30cfff,%r10d
mov    $0xe30cffe,%r11d
mov    $0x753001,%r15d
jmp    132f <main+0x1af>
xchg   %ax,%ax
movaps 0x30(%rsp),%xmm0
addps  0x20(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movss  0x28(%rsp),%xmm0
movss  0x2c(%rsp),%xmm1
addss  0x20(%rsp),%xmm0
addss  0x24(%rsp),%xmm1
movss  %xmm1,0x24(%rsp)
addss  %xmm0,%xmm1
movss  %xmm1,0x20(%rsp)
mov    0x8(%rsp),%rax
movss  %xmm1,(%rax,%r13,4)
add    $0x1,%r13
add    $0x100,%r9d
add    $0xffffff00,%r10d
add    $0xffffff00,%r11d
add    $0x100,%r15d
cmp    $0x7530,%r13
je     1572 <main+0x3f2>
mov    %r15d,%esi
mov    %r11d,%edx
xor    %ecx,%ecx
lea    0x24(%rsp),%rax
mov    %r10d,%ebp
mov    %r9d,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%r8d
imul   $0x45e7b273,%r8,%rdi
shr    $0x35,%rdi
imul   $0x753000,%edi,%edi
mov    %edx,%ebx
imul   $0x45e7b273,%rbx,%rbx
shr    $0x35,%rbx
imul   $0x753000,%ebx,%ebx
add    %esi,%ebx
add    %r9d,%edi
movss  (%r14,%rdi,4),%xmm0
movss  %xmm0,-0x4(%rax)
movss  (%r14,%rbx,4),%xmm0
movss  %xmm0,(%rax)
add    $0x2,%r9d
add    $0xfffffffe,%ebp
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
add    $0xfffffffe,%edx
add    $0x2,%esi
cmp    $0xffffffffffffff00,%rcx
jne    1350 <main+0x1d0>
xor    %eax,%eax
mov    (%rsp),%r9d
jmp    13cc <main+0x24c>
nopw   0x0(%rax,%rax,1)
add    $0x2,%rax
cmp    $0x100,%rax
je     1410 <main+0x290>
cmp    $0x7f,%rax
ja     13e7 <main+0x267>
movss  0x220(%rsp,%rax,4),%xmm0
addss  0x20(%rsp,%rax,4),%xmm0
movss  %xmm0,0x20(%rsp,%rax,4)
cmp    $0x7e,%rax
ja     13c0 <main+0x240>
movss  0x224(%rsp,%rax,4),%xmm0
addss  0x24(%rsp,%rax,4),%xmm0
movss  %xmm0,0x24(%rsp,%rax,4)
jmp    13c0 <main+0x240>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
jmp    142c <main+0x2ac>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmp    $0x100,%rax
je     1470 <main+0x2f0>
cmp    $0x3f,%rax
ja     1447 <main+0x2c7>
movss  0x120(%rsp,%rax,4),%xmm0
addss  0x20(%rsp,%rax,4),%xmm0
movss  %xmm0,0x20(%rsp,%rax,4)
cmp    $0x3e,%rax
ja     1420 <main+0x2a0>
movss  0x124(%rsp,%rax,4),%xmm0
addss  0x24(%rsp,%rax,4),%xmm0
movss  %xmm0,0x24(%rsp,%rax,4)
jmp    1420 <main+0x2a0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
jmp    148c <main+0x30c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmp    $0x100,%rax
je     14d0 <main+0x350>
cmp    $0x1f,%rax
ja     14a7 <main+0x327>
movss  0xa0(%rsp,%rax,4),%xmm0
addss  0x20(%rsp,%rax,4),%xmm0
movss  %xmm0,0x20(%rsp,%rax,4)
cmp    $0x1e,%rax
ja     1480 <main+0x300>
movss  0xa4(%rsp,%rax,4),%xmm0
addss  0x24(%rsp,%rax,4),%xmm0
movss  %xmm0,0x24(%rsp,%rax,4)
jmp    1480 <main+0x300>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
jmp    14ec <main+0x36c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmp    $0x100,%rax
je     1520 <main+0x3a0>
cmp    $0xf,%rax
ja     1504 <main+0x384>
movss  0x60(%rsp,%rax,4),%xmm0
addss  0x20(%rsp,%rax,4),%xmm0
movss  %xmm0,0x20(%rsp,%rax,4)
cmp    $0xe,%rax
ja     14e0 <main+0x360>
movss  0x64(%rsp,%rax,4),%xmm0
addss  0x24(%rsp,%rax,4),%xmm0
movss  %xmm0,0x24(%rsp,%rax,4)
jmp    14e0 <main+0x360>
xchg   %ax,%ax
xor    %eax,%eax
jmp    1540 <main+0x3c0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmp    $0x100,%rax
je     12c0 <main+0x140>
cmp    $0x7,%rax
ja     1558 <main+0x3d8>
movss  0x40(%rsp,%rax,4),%xmm0
addss  0x20(%rsp,%rax,4),%xmm0
movss  %xmm0,0x20(%rsp,%rax,4)
cmp    $0x6,%rax
ja     1530 <main+0x3b0>
movss  0x44(%rsp,%rax,4),%xmm0
addss  0x24(%rsp,%rax,4),%xmm0
movss  %xmm0,0x24(%rsp,%rax,4)
jmp    1530 <main+0x3b0>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <acc_wait_all@plt>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
cvttsd2si %xmm0,%esi
lea    0xa90(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movsd  (%rsp),%xmm1
mulsd  0xa64(%rip),%xmm1
movsd  0xa64(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xa7f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa7e(%rip),%rdi
movsd  0xa47(%rip),%xmm0
mov    $0xea60000,%esi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
mov    $0x1d4c0,%edx
call   10a0 <acc_memcpy_from_device@plt>
lea    0xa5a(%rip),%r15
jmp    161d <main+0x49d>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    $0x7530,%rbx
je     1642 <main+0x4c2>
lea    -0x7527(%rbx),%eax
cmp    $0xffff8ae2,%eax
ja     1610 <main+0x490>
movss  0x0(%rbp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1070 <printf@plt>
jmp    1610 <main+0x490>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"elapsed time for cpu: %g\0A\00"
@.str.1 = [13 x i8] c"BW: %g GB/s\0A\00"
@.str.2 = [14 x i8] c"N=%d (%g GB)\0A\00"
@.str.3 = [15 x i8] c"redv[%03d]=%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [256 x float]
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
%11 = alloca float*
%12 = alloca float*
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca float
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca double
%28 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 245760000, i32* %6
%29 = load i32, i32* %6
%30 = call i64 @calloc(i32 %29, i32 4)
%31 = inttoptr i64 %30 to float*
store float* %31, float** %8
%32 = call i64 @calloc(i32 30000, i32 4)
%33 = inttoptr i64 %32 to float*
store float* %33, float** %9
store i32 0, i32* %10
br label %34
34: ; preds = %43, %2
%35 = load i32, i32* %10
%36 = load i32, i32* %6
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %46
38: ; preds = %34
%39 = load float*, float** %8
%40 = load i32, i32* %10
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %39, i64 %41
store float 1.000000e+00, float* %42
br label %43
43: ; preds = %38
%44 = load i32, i32* %10
%45 = add nsw i32 %44, 1
store i32 %45, i32* %10
br label %34
46: ; preds = %34
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = mul i64 %48, 4
%50 = trunc i64 %49 to i32
%51 = call i64 @acc_malloc(i32 %50)
%52 = inttoptr i64 %51 to float*
store float* %52, float** %11
%53 = call i64 @acc_malloc(i32 120000)
%54 = inttoptr i64 %53 to float*
store float* %54, float** %12
%55 = load float*, float** %11
%56 = load float*, float** %8
%57 = load i32, i32* %6
%58 = sext i32 %57 to i64
%59 = mul i64 %58, 4
%60 = trunc i64 %59 to i32
%61 = call i32 @acc_memcpy_to_device(float* %55, float* %56, i32 %60)
%62 = load float*, float** %12
%63 = load float*, float** %9
%64 = call i32 @acc_memcpy_to_device(float* %62, float* %63, i32 120000)
%65 = call double (...) @omp_get_wtime()
store double %65, double* %13
store i32 0, i32* %14
br label %66
66: ; preds = %281, %46
%67 = load i32, i32* %14
%68 = icmp slt i32 %67, 30000
br i1 %68, label %69, label %284
69: ; preds = %66
store i32 0, i32* %15
br label %70
70: ; preds = %95, %69
%71 = load i32, i32* %15
%72 = icmp slt i32 %71, 256
br i1 %72, label %73, label %98
73: ; preds = %70
%74 = load i32, i32* %15
%75 = load i32, i32* %14
%76 = mul nsw i32 %75, 256
%77 = add nsw i32 %74, %76
store i32 %77, i32* %16
store float 0.000000e+00, float* %17
br label %78
78: ; preds = %82, %73
%79 = load i32, i32* %16
%80 = load i32, i32* %6
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %90
82: ; preds = %78
%83 = load float*, float** %11
%84 = load i32, i32* %16
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds float, float* %83, i64 %85
%87 = load float, float* %86
store float %87, float* %17
%88 = load i32, i32* %16
%89 = add nsw i32 %88, 7680000
store i32 %89, i32* %16
br label %78
90: ; preds = %78
%91 = load float, float* %17
%92 = load i32, i32* %15
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %93
store float %91, float* %94
br label %95
95: ; preds = %90
%96 = load i32, i32* %15
%97 = add nsw i32 %96, 1
store i32 %97, i32* %15
br label %70
98: ; preds = %70
store i32 0, i32* %18
br label %99
99: ; preds = %117, %98
%100 = load i32, i32* %18
%101 = icmp slt i32 %100, 256
br i1 %101, label %102, label %120
102: ; preds = %99
%103 = load i32, i32* %18
%104 = icmp slt i32 %103, 128
br i1 %104, label %105, label %116
105: ; preds = %102
%106 = load i32, i32* %18
%107 = add nsw i32 %106, 128
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %108
%110 = load float, float* %109
%111 = load i32, i32* %18
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %112
%114 = load float, float* %113
%115 = fadd float %114, %110
store float %115, float* %113
br label %116
116: ; preds = %105, %102
br label %117
117: ; preds = %116
%118 = load i32, i32* %18
%119 = add nsw i32 %118, 1
store i32 %119, i32* %18
br label %99
120: ; preds = %99
store i32 0, i32* %19
br label %121
121: ; preds = %139, %120
%122 = load i32, i32* %19
%123 = icmp slt i32 %122, 256
br i1 %123, label %124, label %142
124: ; preds = %121
%125 = load i32, i32* %19
%126 = icmp slt i32 %125, 64
br i1 %126, label %127, label %138
127: ; preds = %124
%128 = load i32, i32* %19
%129 = add nsw i32 %128, 64
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %130
%132 = load float, float* %131
%133 = load i32, i32* %19
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %134
%136 = load float, float* %135
%137 = fadd float %136, %132
store float %137, float* %135
br label %138
138: ; preds = %127, %124
br label %139
139: ; preds = %138
%140 = load i32, i32* %19
%141 = add nsw i32 %140, 1
store i32 %141, i32* %19
br label %121
142: ; preds = %121
store i32 0, i32* %20
br label %143
143: ; preds = %161, %142
%144 = load i32, i32* %20
%145 = icmp slt i32 %144, 256
br i1 %145, label %146, label %164
146: ; preds = %143
%147 = load i32, i32* %20
%148 = icmp slt i32 %147, 32
br i1 %148, label %149, label %160
149: ; preds = %146
%150 = load i32, i32* %20
%151 = add nsw i32 %150, 32
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %152
%154 = load float, float* %153
%155 = load i32, i32* %20
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %156
%158 = load float, float* %157
%159 = fadd float %158, %154
store float %159, float* %157
br label %160
160: ; preds = %149, %146
br label %161
161: ; preds = %160
%162 = load i32, i32* %20
%163 = add nsw i32 %162, 1
store i32 %163, i32* %20
br label %143
164: ; preds = %143
store i32 0, i32* %21
br label %165
165: ; preds = %183, %164
%166 = load i32, i32* %21
%167 = icmp slt i32 %166, 256
br i1 %167, label %168, label %186
168: ; preds = %165
%169 = load i32, i32* %21
%170 = icmp slt i32 %169, 16
br i1 %170, label %171, label %182
171: ; preds = %168
%172 = load i32, i32* %21
%173 = add nsw i32 %172, 16
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %174
%176 = load float, float* %175
%177 = load i32, i32* %21
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %178
%180 = load float, float* %179
%181 = fadd float %180, %176
store float %181, float* %179
br label %182
182: ; preds = %171, %168
br label %183
183: ; preds = %182
%184 = load i32, i32* %21
%185 = add nsw i32 %184, 1
store i32 %185, i32* %21
br label %165
186: ; preds = %165
store i32 0, i32* %22
br label %187
187: ; preds = %205, %186
%188 = load i32, i32* %22
%189 = icmp slt i32 %188, 256
br i1 %189, label %190, label %208
190: ; preds = %187
%191 = load i32, i32* %22
%192 = icmp slt i32 %191, 8
br i1 %192, label %193, label %204
193: ; preds = %190
%194 = load i32, i32* %22
%195 = add nsw i32 %194, 8
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %196
%198 = load float, float* %197
%199 = load i32, i32* %22
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %200
%202 = load float, float* %201
%203 = fadd float %202, %198
store float %203, float* %201
br label %204
204: ; preds = %193, %190
br label %205
205: ; preds = %204
%206 = load i32, i32* %22
%207 = add nsw i32 %206, 1
store i32 %207, i32* %22
br label %187
208: ; preds = %187
store i32 0, i32* %23
br label %209
209: ; preds = %227, %208
%210 = load i32, i32* %23
%211 = icmp slt i32 %210, 256
br i1 %211, label %212, label %230
212: ; preds = %209
%213 = load i32, i32* %23
%214 = icmp slt i32 %213, 4
br i1 %214, label %215, label %226
215: ; preds = %212
%216 = load i32, i32* %23
%217 = add nsw i32 %216, 4
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %218
%220 = load float, float* %219
%221 = load i32, i32* %23
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %222
%224 = load float, float* %223
%225 = fadd float %224, %220
store float %225, float* %223
br label %226
226: ; preds = %215, %212
br label %227
227: ; preds = %226
%228 = load i32, i32* %23
%229 = add nsw i32 %228, 1
store i32 %229, i32* %23
br label %209
230: ; preds = %209
store i32 0, i32* %24
br label %231
231: ; preds = %249, %230
%232 = load i32, i32* %24
%233 = icmp slt i32 %232, 256
br i1 %233, label %234, label %252
234: ; preds = %231
%235 = load i32, i32* %24
%236 = icmp slt i32 %235, 2
br i1 %236, label %237, label %248
237: ; preds = %234
%238 = load i32, i32* %24
%239 = add nsw i32 %238, 2
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %240
%242 = load float, float* %241
%243 = load i32, i32* %24
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %244
%246 = load float, float* %245
%247 = fadd float %246, %242
store float %247, float* %245
br label %248
248: ; preds = %237, %234
br label %249
249: ; preds = %248
%250 = load i32, i32* %24
%251 = add nsw i32 %250, 1
store i32 %251, i32* %24
br label %231
252: ; preds = %231
store i32 0, i32* %25
br label %253
253: ; preds = %277, %252
%254 = load i32, i32* %25
%255 = icmp slt i32 %254, 256
br i1 %255, label %256, label %280
256: ; preds = %253
%257 = load i32, i32* %25
%258 = icmp slt i32 %257, 1
br i1 %258, label %259, label %276
259: ; preds = %256
%260 = load i32, i32* %25
%261 = add nsw i32 %260, 1
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %262
%264 = load float, float* %263
%265 = load i32, i32* %25
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 %266
%268 = load float, float* %267
%269 = fadd float %268, %264
store float %269, float* %267
%270 = getelementptr inbounds [256 x float], [256 x float]* %7, i64 0, i64 0
%271 = load float, float* %270
%272 = load float*, float** %12
%273 = load i32, i32* %14
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds float, float* %272, i64 %274
store float %271, float* %275
br label %276
276: ; preds = %259, %256
br label %277
277: ; preds = %276
%278 = load i32, i32* %25
%279 = add nsw i32 %278, 1
store i32 %279, i32* %25
br label %253
280: ; preds = %253
br label %281
281: ; preds = %280
%282 = load i32, i32* %14
%283 = add nsw i32 %282, 1
store i32 %283, i32* %14
br label %66
284: ; preds = %66
%285 = call i32 (...) @acc_wait_all()
%286 = call double (...) @omp_get_wtime()
store double %286, double* %26
%287 = load double, double* %26
%288 = load double, double* %13
%289 = fsub double %287, %288
store double %289, double* %27
%290 = load double, double* %27
%291 = fptosi double %290 to i32
%292 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %291)
%293 = load i32, i32* %6
%294 = sitofp i32 %293 to double
%295 = fadd double %294, 3.000000e+04
%296 = fmul double %295, 4.000000e+00
%297 = load double, double* %27
%298 = fmul double 1.000000e+09, %297
%299 = fdiv double %296, %298
%300 = fptosi double %299 to i32
%301 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %300)
%302 = load i32, i32* %6
%303 = load i32, i32* %6
%304 = sext i32 %303 to i64
%305 = mul i64 %304, 4
%306 = uitofp i64 %305 to double
%307 = fdiv double %306, 1.000000e+09
%308 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %302, double %307)
%309 = load float*, float** %9
%310 = load float*, float** %12
%311 = call i32 @acc_memcpy_from_device(float* %309, float* %310, i32 120000)
store i32 0, i32* %28
br label %312
312: ; preds = %331, %284
%313 = load i32, i32* %28
%314 = icmp slt i32 %313, 30000
br i1 %314, label %315, label %334
315: ; preds = %312
%316 = load i32, i32* %28
%317 = icmp slt i32 %316, 10
br i1 %317, label %321, label %318
318: ; preds = %315
%319 = load i32, i32* %28
%320 = icmp sgt i32 %319, 29990
br i1 %320, label %321, label %330
321: ; preds = %318, %315
%322 = load i32, i32* %28
%323 = load float*, float** %9
%324 = load i32, i32* %28
%325 = sext i32 %324 to i64
%326 = getelementptr inbounds float, float* %323, i64 %325
%327 = load float, float* %326
%328 = fpext float %327 to double
%329 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %322, double %328)
br label %330
330: ; preds = %321, %318
br label %331
331: ; preds = %330
%332 = load i32, i32* %28
%333 = add nsw i32 %332, 1
store i32 %333, i32* %28
br label %312
334: ; preds = %312
%335 = load float*, float** %8
%336 = call i32 @free(float* %335)
%337 = load float*, float** %9
%338 = call i32 @free(float* %337)
%339 = load i32, i32* %3
ret i32 %339
}

LLVM IR (-O2):
@.str = [26 x i8] c"elapsed time for cpu: %g\0A\00"
@.str.1 = [13 x i8] c"BW: %g GB/s\0A\00"
@.str.2 = [14 x i8] c"N=%d (%g GB)\0A\00"
@.str.3 = [15 x i8] c"redv[%03d]=%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x float]
%4 = bitcast [256 x float]* %3 to i8*
%5 = tail call i64 @calloc(i32 245760000, i32 4)
%6 = inttoptr i64 %5 to float*
%7 = tail call i64 @calloc(i32 30000, i32 4)
br label %8
8: ; preds = %8, %2
%9 = phi i64 [ 0, %2 ], [ %49, %8 ]
%10 = getelementptr inbounds float, float* %6, i64 %9
%11 = bitcast float* %10 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %11
%12 = getelementptr inbounds float, float* %10, i64 4
%13 = bitcast float* %12 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %13
%14 = or i64 %9, 8
%15 = getelementptr inbounds float, float* %6, i64 %14
%16 = bitcast float* %15 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %16
%17 = getelementptr inbounds float, float* %15, i64 4
%18 = bitcast float* %17 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %18
%19 = or i64 %9, 16
%20 = getelementptr inbounds float, float* %6, i64 %19
%21 = bitcast float* %20 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %21
%22 = getelementptr inbounds float, float* %20, i64 4
%23 = bitcast float* %22 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %23
%24 = or i64 %9, 24
%25 = getelementptr inbounds float, float* %6, i64 %24
%26 = bitcast float* %25 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %26
%27 = getelementptr inbounds float, float* %25, i64 4
%28 = bitcast float* %27 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %28
%29 = or i64 %9, 32
%30 = getelementptr inbounds float, float* %6, i64 %29
%31 = bitcast float* %30 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %31
%32 = getelementptr inbounds float, float* %30, i64 4
%33 = bitcast float* %32 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %33
%34 = or i64 %9, 40
%35 = getelementptr inbounds float, float* %6, i64 %34
%36 = bitcast float* %35 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %36
%37 = getelementptr inbounds float, float* %35, i64 4
%38 = bitcast float* %37 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %38
%39 = or i64 %9, 48
%40 = getelementptr inbounds float, float* %6, i64 %39
%41 = bitcast float* %40 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %41
%42 = getelementptr inbounds float, float* %40, i64 4
%43 = bitcast float* %42 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %43
%44 = or i64 %9, 56
%45 = getelementptr inbounds float, float* %6, i64 %44
%46 = bitcast float* %45 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %46
%47 = getelementptr inbounds float, float* %45, i64 4
%48 = bitcast float* %47 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %48
%49 = add nuw nsw i64 %9, 64
%50 = icmp eq i64 %49, 245760000
br i1 %50, label %51, label %8
51: ; preds = %8
%52 = inttoptr i64 %7 to float*
%53 = tail call i64 @acc_malloc(i32 983040000)
%54 = inttoptr i64 %53 to float*
%55 = tail call i64 @acc_malloc(i32 120000)
%56 = inttoptr i64 %55 to float*
%57 = tail call i32 @acc_memcpy_to_device(float* %54, float* %6, i32 983040000)
%58 = tail call i32 @acc_memcpy_to_device(float* %56, float* %52, i32 120000)
%59 = tail call double (...) @omp_get_wtime()
%60 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 0
%61 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 4
%62 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 2
%63 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 3
%64 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 1
%65 = bitcast float* %61 to <4 x float>*
%66 = bitcast [256 x float]* %3 to <4 x float>*
%67 = bitcast [256 x float]* %3 to <4 x float>*
br label %68
68: ; preds = %51, %224
%69 = phi i64 [ 0, %51 ], [ %236, %224 ]
%70 = phi i32 [ 238079999, %51 ], [ %238, %224 ]
%71 = phi i32 [ 7680000, %51 ], [ %237, %224 ]
br label %84
72: ; preds = %224
%73 = tail call i32 (...) @acc_wait_all()
%74 = tail call double (...) @omp_get_wtime()
%75 = fsub double %74, %59
%76 = fptosi double %75 to i32
%77 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %76)
%78 = fmul double %75, 1.000000e+09
%79 = fdiv double 9.831600e+08, %78
%80 = fptosi double %79 to i32
%81 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 245760000, double 9.830400e-01)
%83 = tail call i32 @acc_memcpy_from_device(float* %52, float* %56, i32 120000)
br label %243
84: ; preds = %84, %68
%85 = phi i64 [ 0, %68 ], [ %105, %84 ]
%86 = phi i32 [ %70, %68 ], [ %107, %84 ]
%87 = phi i32 [ %71, %68 ], [ %106, %84 ]
%88 = urem i32 %86, 7680000
%89 = sub nuw i32 %86, %88
%90 = add i32 %87, %89
%91 = zext i32 %90 to i64
%92 = getelementptr inbounds float, float* %54, i64 %91
%93 = load float, float* %92
%94 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %85
store float %93, float* %94
%95 = or i64 %85, 1
%96 = or i32 %87, 1
%97 = add nsw i32 %86, -1
%98 = urem i32 %97, 7680000
%99 = sub nuw i32 %97, %98
%100 = add i32 %96, %99
%101 = zext i32 %100 to i64
%102 = getelementptr inbounds float, float* %54, i64 %101
%103 = load float, float* %102
%104 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %95
store float %103, float* %104
%105 = add nuw nsw i64 %85, 2
%106 = add nuw nsw i32 %87, 2
%107 = add nsw i32 %86, -2
%108 = icmp eq i64 %105, 256
br i1 %108, label %109, label %84
109: ; preds = %84, %129
%110 = phi i64 [ %130, %129 ], [ 0, %84 ]
%111 = icmp ult i64 %110, 128
br i1 %111, label %112, label %119
112: ; preds = %109
%113 = add nuw nsw i64 %110, 128
%114 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %113
%115 = load float, float* %114
%116 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %110
%117 = load float, float* %116
%118 = fadd float %115, %117
store float %118, float* %116
br label %119
119: ; preds = %109, %112
%120 = icmp ult i64 %110, 127
br i1 %120, label %121, label %129
121: ; preds = %119
%122 = or i64 %110, 1
%123 = add nuw i64 %110, 129
%124 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %123
%125 = load float, float* %124
%126 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %122
%127 = load float, float* %126
%128 = fadd float %125, %127
store float %128, float* %126
br label %129
129: ; preds = %121, %119
%130 = add nuw nsw i64 %110, 2
%131 = icmp eq i64 %130, 256
br i1 %131, label %132, label %109
132: ; preds = %129, %152
%133 = phi i64 [ %153, %152 ], [ 0, %129 ]
%134 = icmp ult i64 %133, 64
br i1 %134, label %135, label %142
135: ; preds = %132
%136 = add nuw nsw i64 %133, 64
%137 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %136
%138 = load float, float* %137
%139 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %133
%140 = load float, float* %139
%141 = fadd float %138, %140
store float %141, float* %139
br label %142
142: ; preds = %132, %135
%143 = icmp ult i64 %133, 63
br i1 %143, label %144, label %152
144: ; preds = %142
%145 = or i64 %133, 1
%146 = add nuw i64 %133, 65
%147 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %146
%148 = load float, float* %147
%149 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %145
%150 = load float, float* %149
%151 = fadd float %148, %150
store float %151, float* %149
br label %152
152: ; preds = %144, %142
%153 = add nuw nsw i64 %133, 2
%154 = icmp eq i64 %153, 256
br i1 %154, label %155, label %132
155: ; preds = %152, %175
%156 = phi i64 [ %176, %175 ], [ 0, %152 ]
%157 = icmp ult i64 %156, 32
br i1 %157, label %158, label %165
158: ; preds = %155
%159 = add nuw nsw i64 %156, 32
%160 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %159
%161 = load float, float* %160
%162 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %156
%163 = load float, float* %162
%164 = fadd float %161, %163
store float %164, float* %162
br label %165
165: ; preds = %155, %158
%166 = icmp ult i64 %156, 31
br i1 %166, label %167, label %175
167: ; preds = %165
%168 = or i64 %156, 1
%169 = add nuw i64 %156, 33
%170 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %169
%171 = load float, float* %170
%172 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %168
%173 = load float, float* %172
%174 = fadd float %171, %173
store float %174, float* %172
br label %175
175: ; preds = %167, %165
%176 = add nuw nsw i64 %156, 2
%177 = icmp eq i64 %176, 256
br i1 %177, label %178, label %155
178: ; preds = %175, %198
%179 = phi i64 [ %199, %198 ], [ 0, %175 ]
%180 = icmp ult i64 %179, 16
br i1 %180, label %181, label %188
181: ; preds = %178
%182 = add nuw nsw i64 %179, 16
%183 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %182
%184 = load float, float* %183
%185 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %179
%186 = load float, float* %185
%187 = fadd float %184, %186
store float %187, float* %185
br label %188
188: ; preds = %178, %181
%189 = icmp ult i64 %179, 15
br i1 %189, label %190, label %198
190: ; preds = %188
%191 = or i64 %179, 1
%192 = add nuw i64 %179, 17
%193 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %192
%194 = load float, float* %193
%195 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %191
%196 = load float, float* %195
%197 = fadd float %194, %196
store float %197, float* %195
br label %198
198: ; preds = %190, %188
%199 = add nuw nsw i64 %179, 2
%200 = icmp eq i64 %199, 256
br i1 %200, label %201, label %178
201: ; preds = %198, %221
%202 = phi i64 [ %222, %221 ], [ 0, %198 ]
%203 = icmp ult i64 %202, 8
br i1 %203, label %204, label %211
204: ; preds = %201
%205 = add nuw nsw i64 %202, 8
%206 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %205
%207 = load float, float* %206
%208 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %202
%209 = load float, float* %208
%210 = fadd float %207, %209
store float %210, float* %208
br label %211
211: ; preds = %201, %204
%212 = icmp ult i64 %202, 7
br i1 %212, label %213, label %221
213: ; preds = %211
%214 = or i64 %202, 1
%215 = add nuw i64 %202, 9
%216 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %215
%217 = load float, float* %216
%218 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %214
%219 = load float, float* %218
%220 = fadd float %217, %219
store float %220, float* %218
br label %221
221: ; preds = %213, %211
%222 = add nuw nsw i64 %202, 2
%223 = icmp eq i64 %222, 256
br i1 %223, label %224, label %201
224: ; preds = %221
%225 = load <4 x float>, <4 x float>* %65
%226 = load <4 x float>, <4 x float>* %66
%227 = fadd <4 x float> %225, %226
store <4 x float> %227, <4 x float>* %67
%228 = load float, float* %62
%229 = load float, float* %60
%230 = fadd float %228, %229
store float %230, float* %60
%231 = load float, float* %63
%232 = load float, float* %64
%233 = fadd float %231, %232
store float %233, float* %64
%234 = getelementptr inbounds float, float* %56, i64 %69
%235 = fadd float %233, %230
store float %235, float* %60
store float %235, float* %234
%236 = add nuw nsw i64 %69, 1
%237 = add nuw nsw i32 %71, 256
%238 = add nsw i32 %70, -256
%239 = icmp eq i64 %236, 30000
br i1 %239, label %72, label %68
240: ; preds = %254
%241 = tail call i32 @free(float* %6)
%242 = tail call i32 @free(float* %52)
ret i32 0
243: ; preds = %72, %254
%244 = phi i64 [ 0, %72 ], [ %255, %254 ]
%245 = trunc i64 %244 to i32
%246 = add i32 %245, -29991
%247 = icmp ult i32 %246, -29981
br i1 %247, label %248, label %254
248: ; preds = %243
%249 = getelementptr inbounds float, float* %52, i64 %244
%250 = load float, float* %249
%251 = fpext float %250 to double
%252 = trunc i64 %244 to i32
%253 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %252, double %251)
br label %254
254: ; preds = %248, %243
%255 = add nuw nsw i64 %244, 1
%256 = icmp eq i64 %255, 30000
br i1 %256, label %240, label %243
}