#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 */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int atoi(char *);
float *calloc(int, int);
int /*<<< orphan*/ free(float *);
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ vadd0(int, float *, float *, float *);
int /*<<< orphan*/ vadd1(int, float *, float *, float *);
int /*<<< orphan*/ vadd2(int, float *, float *, float *);
int /*<<< orphan*/ vdiff(int, float *, float *);
int main(int argc, char *argv[]) {
  int n = (argc > 1) ? atoi(argv[1]) : 1000;
  float *x = calloc(n, sizeof(float));
  assert(x != NULL);
  float *y = calloc(n, sizeof(float));
  assert(y != NULL);
  float *z0 = calloc(n, sizeof(float));
  assert(z0 != NULL);
  float *z1 = calloc(n, sizeof(float));
  assert(z1 != NULL);
  float *z2 = calloc(n, sizeof(float));
  assert(z2 != NULL);
  for (int i = 0; i < n; i++) {
    x[i] = (float)i;
  }
  for (int i = 0; i < n; i++) {
    y[i] = (float)i;
  }
  for (int iter = 0; iter < 10; iter++) {
    double t0 = omp_get_wtime();
    vadd0(n, x, y, z0);
    double t1 = omp_get_wtime();
    vadd1(n, x, y, z1);
    double t2 = omp_get_wtime();
    vadd2(n, x, y, z2);
    double t3 = omp_get_wtime();
    printf("%20s time = %lf             \n", "for", t1 - t0);
    printf("%20s time = %lf (error=%lf) \n", "OpenMP for", t2 - t1,
           vdiff(n, z0, z1));
    printf("%20s time = %lf (error=%lf) \n", "OpenMP offload for", t3 - t2,
           vdiff(n, z0, z2));
    double junk = t0 + t1 + t2 + t3;
    for (int i = 0; i < n; i++) {
      junk += z0[i] + z1[i] + z2[i];
    }
    printf("junk=%lf\n", junk);
  }
  free(z2);
  free(z1);
  free(z0);
  free(y);
  free(x);
  printf("Success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11d8 <main+0x38>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x80(%rbp)
jmp    11e5 <main+0x45>
mov    $0x3e8,%eax
mov    %eax,-0x80(%rbp)
jmp    11e5 <main+0x45>
mov    -0x80(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12cd <main+0x12d>
cvtsi2ssl -0x44(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12a1 <main+0x101>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1300 <main+0x160>
cvtsi2ssl -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x48(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12d4 <main+0x134>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xa,-0x4c(%rbp)
jge    14ae <main+0x30e>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1070 <vadd0@plt>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   10c0 <vadd1@plt>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x40(%rbp),%rcx
call   1060 <vadd2@plt>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
lea    0xc72(%rip),%rdi
lea    0xcae(%rip),%rsi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   10a0 <vdiff@plt>
movsd  -0x90(%rbp),%xmm0
ff
mov    %eax,%edx
lea    0xc4f(%rip),%rdi
lea    0xc66(%rip),%rsi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x70(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x40(%rbp),%rdx
call   10a0 <vdiff@plt>
movsd  -0x88(%rbp),%xmm0
ff
mov    %eax,%edx
lea    0xc0e(%rip),%rdi
lea    0xc30(%rip),%rsi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    148d <main+0x2ed>
mov    -0x30(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x7c(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x7c(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    143e <main+0x29e>
movsd  -0x78(%rbp),%xmm0
lea    0xbc1(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1307 <main+0x167>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    $0x3e8,%r12d
cmp    $0x2,%edi
jl     11d5 <main+0x25>
mov    0x8(%rsi),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r12d
mov    %r12d,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r12d,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
mov    %rax,%r15
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r12d,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
xor    %edi,%edi
mov    %rax,0x30(%rsp)
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r12d,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
xor    %edi,%edi
mov    %rax,0x38(%rsp)
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r12d,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
mov    %rax,%r13
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r12d,%edi
test   %r12d,%r12d
jle    1456 <main+0x2a6>
cmp    $0x8,%r12d
jae    1288 <main+0xd8>
xor    %eax,%eax
jmp    1350 <main+0x1a0>
mov    %edi,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     16b6 <main+0x506>
mov    %rcx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xd4c(%rip),%xmm0
xor    %edx,%edx
movdqa 0xd52(%rip),%xmm1
movdqa 0xd5a(%rip),%xmm2
movdqa 0xd62(%rip),%xmm3
movdqa 0xd6a(%rip),%xmm4
cs nopw 0x0(%rax,%rax,1)
movdqa %xmm0,%xmm5
paddd  %xmm1,%xmm5
cvtdq2ps %xmm0,%xmm6
cvtdq2ps %xmm5,%xmm5
movups %xmm6,(%r14,%rdx,4)
movups %xmm5,0x10(%r14,%rdx,4)
movdqa %xmm0,%xmm5
paddd  %xmm2,%xmm5
movdqa %xmm0,%xmm6
paddd  %xmm3,%xmm6
cvtdq2ps %xmm5,%xmm5
cvtdq2ps %xmm6,%xmm6
movups %xmm5,0x20(%r14,%rdx,4)
movups %xmm6,0x30(%r14,%rdx,4)
add    $0x10,%rdx
paddd  %xmm4,%xmm0
add    $0xfffffffffffffffe,%rsi
jne    12e0 <main+0x130>
test   $0x1,%cl
je     1347 <main+0x197>
cvtdq2ps %xmm0,%xmm1
paddd  0xcd7(%rip),%xmm0
cvtdq2ps %xmm0,%xmm0
movups %xmm1,(%r14,%rdx,4)
movups %xmm0,0x10(%r14,%rdx,4)
cmp    %rdi,%rax
je     1366 <main+0x1b6>
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%r14,%rax,4)
add    $0x1,%rax
cmp    %rax,%rdi
jne    1350 <main+0x1a0>
test   %r12d,%r12d
jle    1456 <main+0x2a6>
cmp    $0x8,%r12d
jae    137c <main+0x1cc>
xor    %eax,%eax
jmp    1440 <main+0x290>
mov    %edi,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     16ce <main+0x51e>
mov    %rcx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xc58(%rip),%xmm0
xor    %edx,%edx
movdqa 0xc5e(%rip),%xmm1
movdqa 0xc66(%rip),%xmm2
movdqa 0xc6e(%rip),%xmm3
movdqa 0xc76(%rip),%xmm4
nopw   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm5
paddd  %xmm1,%xmm5
cvtdq2ps %xmm0,%xmm6
cvtdq2ps %xmm5,%xmm5
movups %xmm6,(%r15,%rdx,4)
movups %xmm5,0x10(%r15,%rdx,4)
movdqa %xmm0,%xmm5
paddd  %xmm2,%xmm5
movdqa %xmm0,%xmm6
paddd  %xmm3,%xmm6
cvtdq2ps %xmm5,%xmm5
cvtdq2ps %xmm6,%xmm6
movups %xmm5,0x20(%r15,%rdx,4)
movups %xmm6,0x30(%r15,%rdx,4)
add    $0x10,%rdx
paddd  %xmm4,%xmm0
add    $0xfffffffffffffffe,%rsi
jne    13d0 <main+0x220>
test   $0x1,%cl
je     1437 <main+0x287>
cvtdq2ps %xmm0,%xmm1
paddd  0xbe7(%rip),%xmm0
cvtdq2ps %xmm0,%xmm0
movups %xmm1,(%r15,%rdx,4)
movups %xmm0,0x10(%r15,%rdx,4)
cmp    %rdi,%rax
je     1456 <main+0x2a6>
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%r15,%rax,4)
add    $0x1,%rax
cmp    %rax,%rdi
jne    1440 <main+0x290>
mov    %r15,0x40(%rsp)
mov    %r14,0x48(%rsp)
mov    %rdi,0x28(%rsp)
and    $0xfffffffe,%edi
mov    %rdi,0x60(%rsp)
xor    %r14d,%r14d
mov    0x30(%rsp),%rbx
mov    0x38(%rsp),%rbp
jmp    14a1 <main+0x2f1>
nopl   0x0(%rax)
mov    0xc(%rsp),%r14d
lea    0xc1e(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%r14d
cmp    $0xa,%r14d
je     1669 <main+0x4b9>
mov    %r14d,0xc(%rsp)
xor    %eax,%eax
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,0x58(%rsp)
mov    %r12d,%edi
mov    %r12d,%r15d
mov    0x48(%rsp),%r12
mov    %r12,%rsi
mov    0x40(%rsp),%r14
mov    %r14,%rdx
mov    %rbx,%rcx
call   1080 <vadd0@plt>
xor    %eax,%eax
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,0x20(%rsp)
mov    %r15d,%edi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   10d0 <vadd1@plt>
xor    %eax,%eax
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,0x18(%rsp)
mov    %r15d,%edi
mov    %r12,%rsi
mov    %r15d,%r12d
mov    %r14,%rdx
mov    %r13,%rcx
call   1070 <vadd2@plt>
xor    %eax,%eax
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x58(%rsp),%xmm0
lea    0xb20(%rip),%rdi
lea    0xb5c(%rip),%rsi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x18(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   10b0 <vdiff@plt>
lea    0xb09(%rip),%r14
mov    %r14,%rdi
lea    0xb1d(%rip),%rsi
movsd  0x10(%rsp),%xmm0
mov    %eax,%edx
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x50(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   10b0 <vdiff@plt>
mov    %r14,%rdi
lea    0xaef(%rip),%rsi
movsd  0x10(%rsp),%xmm0
mov    %eax,%edx
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x58(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
addsd  0x50(%rsp),%xmm0
test   %r15d,%r15d
jle    1480 <main+0x2d0>
xor    %eax,%eax
cmp    $0x1,%r12d
jne    15f0 <main+0x440>
mov    0x28(%rsp),%rcx
mov    0xc(%rsp),%r14d
jmp    1641 <main+0x491>
nopl   0x0(%rax)
mov    0x28(%rsp),%rcx
mov    0x60(%rsp),%rdx
mov    0xc(%rsp),%r14d
nop
movss  (%rbx,%rax,4),%xmm2
movss  0x4(%rbx,%rax,4),%xmm1
addss  0x0(%rbp,%rax,4),%xmm2
addss  0x0(%r13,%rax,4),%xmm2
cvtss2sd %xmm2,%xmm2
addsd  %xmm0,%xmm2
addss  0x4(%rbp,%rax,4),%xmm1
addss  0x4(%r13,%rax,4),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rax
cmp    %rax,%rdx
jne    1600 <main+0x450>
test   $0x1,%cl
je     1485 <main+0x2d5>
movss  (%rbx,%rax,4),%xmm1
addss  0x0(%rbp,%rax,4),%xmm1
addss  0x0(%r13,%rax,4),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
jmp    1485 <main+0x2d5>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
lea    0xa14(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movdqa 0x942(%rip),%xmm0
xor    %edx,%edx
test   $0x1,%cl
jne    132e <main+0x17e>
jmp    1347 <main+0x197>
movdqa 0x92a(%rip),%xmm0
xor    %edx,%edx
test   $0x1,%cl
jne    141e <main+0x26e>
jmp    1437 <main+0x287>

LLVM IR (-O0):
@.str = [30 x i8] c"%20s time = %lf \0A\00"
@.str.1 = [4 x i8] c"for\00"
@.str.2 = [30 x i8] c"%20s time = %lf (error=%lf) \0A\00"
@.str.3 = [11 x i8] c"OpenMP for\00"
@.str.4 = [19 x i8] c"OpenMP offload for\00"
@.str.5 = [10 x i8] c"junk=%lf\0A\00"
@.str.6 = [9 x i8] c"Success\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %28
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
br label %29
28: ; preds = %2
br label %29
29: ; preds = %28, %23
%30 = phi i32 [ %27, %23 ], [ 1000, %28 ]
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = call float* @calloc(i32 %31, i32 4)
store float* %32, float** %7
%33 = load float*, float** %7
%34 = icmp ne float* %33, null
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = load i32, i32* %6
%38 = call float* @calloc(i32 %37, i32 4)
store float* %38, float** %8
%39 = load float*, float** %8
%40 = icmp ne float* %39, null
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = load i32, i32* %6
%44 = call float* @calloc(i32 %43, i32 4)
store float* %44, float** %9
%45 = load float*, float** %9
%46 = icmp ne float* %45, null
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = load i32, i32* %6
%50 = call float* @calloc(i32 %49, i32 4)
store float* %50, float** %10
%51 = load float*, float** %10
%52 = icmp ne float* %51, null
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = load i32, i32* %6
%56 = call float* @calloc(i32 %55, i32 4)
store float* %56, float** %11
%57 = load float*, float** %11
%58 = icmp ne float* %57, null
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
store i32 0, i32* %12
br label %61
61: ; preds = %72, %29
%62 = load i32, i32* %12
%63 = load i32, i32* %6
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %75
65: ; preds = %61
%66 = load i32, i32* %12
%67 = sitofp i32 %66 to float
%68 = load float*, float** %7
%69 = load i32, i32* %12
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds float, float* %68, i64 %70
store float %67, float* %71
br label %72
72: ; preds = %65
%73 = load i32, i32* %12
%74 = add nsw i32 %73, 1
store i32 %74, i32* %12
br label %61
75: ; preds = %61
store i32 0, i32* %13
br label %76
76: ; preds = %87, %75
%77 = load i32, i32* %13
%78 = load i32, i32* %6
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %90
80: ; preds = %76
%81 = load i32, i32* %13
%82 = sitofp i32 %81 to float
%83 = load float*, float** %8
%84 = load i32, i32* %13
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds float, float* %83, i64 %85
store float %82, float* %86
br label %87
87: ; preds = %80
%88 = load i32, i32* %13
%89 = add nsw i32 %88, 1
store i32 %89, i32* %13
br label %76
90: ; preds = %76
store i32 0, i32* %14
br label %91
91: ; preds = %172, %90
%92 = load i32, i32* %14
%93 = icmp slt i32 %92, 10
br i1 %93, label %94, label %175
94: ; preds = %91
%95 = call double (...) @omp_get_wtime()
store double %95, double* %15
%96 = load i32, i32* %6
%97 = load float*, float** %7
%98 = load float*, float** %8
%99 = load float*, float** %9
%100 = call i32 @vadd0(i32 %96, float* %97, float* %98, float* %99)
%101 = call double (...) @omp_get_wtime()
store double %101, double* %16
%102 = load i32, i32* %6
%103 = load float*, float** %7
%104 = load float*, float** %8
%105 = load float*, float** %10
%106 = call i32 @vadd1(i32 %102, float* %103, float* %104, float* %105)
%107 = call double (...) @omp_get_wtime()
store double %107, double* %17
%108 = load i32, i32* %6
%109 = load float*, float** %7
%110 = load float*, float** %8
%111 = load float*, float** %11
%112 = call i32 @vadd2(i32 %108, float* %109, float* %110, float* %111)
%113 = call double (...) @omp_get_wtime()
store double %113, double* %18
%114 = load double, double* %16
%115 = load double, double* %15
%116 = fsub double %114, %115
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %116)
%118 = load double, double* %17
%119 = load double, double* %16
%120 = fsub double %118, %119
%121 = load i32, i32* %6
%122 = load float*, float** %9
%123 = load float*, float** %10
%124 = call i32 @vdiff(i32 %121, float* %122, float* %123)
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %120, i32 %124)
%126 = load double, double* %18
%127 = load double, double* %17
%128 = fsub double %126, %127
%129 = load i32, i32* %6
%130 = load float*, float** %9
%131 = load float*, float** %11
%132 = call i32 @vdiff(i32 %129, float* %130, float* %131)
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), double %128, i32 %132)
%134 = load double, double* %15
%135 = load double, double* %16
%136 = fadd double %134, %135
%137 = load double, double* %17
%138 = fadd double %136, %137
%139 = load double, double* %18
%140 = fadd double %138, %139
store double %140, double* %19
store i32 0, i32* %20
br label %141
141: ; preds = %166, %94
%142 = load i32, i32* %20
%143 = load i32, i32* %6
%144 = icmp slt i32 %142, %143
br i1 %144, label %145, label %169
145: ; preds = %141
%146 = load float*, float** %9
%147 = load i32, i32* %20
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds float, float* %146, i64 %148
%150 = load float, float* %149
%151 = load float*, float** %10
%152 = load i32, i32* %20
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds float, float* %151, i64 %153
%155 = load float, float* %154
%156 = fadd float %150, %155
%157 = load float*, float** %11
%158 = load i32, i32* %20
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds float, float* %157, i64 %159
%161 = load float, float* %160
%162 = fadd float %156, %161
%163 = fpext float %162 to double
%164 = load double, double* %19
%165 = fadd double %164, %163
store double %165, double* %19
br label %166
166: ; preds = %145
%167 = load i32, i32* %20
%168 = add nsw i32 %167, 1
store i32 %168, i32* %20
br label %141
169: ; preds = %141
%170 = load double, double* %19
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), double %170)
br label %172
172: ; preds = %169
%173 = load i32, i32* %14
%174 = add nsw i32 %173, 1
store i32 %174, i32* %14
br label %91
175: ; preds = %91
%176 = load float*, float** %11
%177 = call i32 @free(float* %176)
%178 = load float*, float** %10
%179 = call i32 @free(float* %178)
%180 = load float*, float** %9
%181 = call i32 @free(float* %180)
%182 = load float*, float** %8
%183 = call i32 @free(float* %182)
%184 = load float*, float** %7
%185 = call i32 @free(float* %184)
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"%20s time = %lf \0A\00"
@.str.1 = [4 x i8] c"for\00"
@.str.2 = [30 x i8] c"%20s time = %lf (error=%lf) \0A\00"
@.str.3 = [11 x i8] c"OpenMP for\00"
@.str.4 = [19 x i8] c"OpenMP offload for\00"
@.str.5 = [10 x i8] c"junk=%lf\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1000, %2 ]
%10 = tail call float* @calloc(i32 %9, i32 4)
%11 = icmp ne float* %10, null
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call float* @calloc(i32 %9, i32 4)
%15 = icmp ne float* %14, null
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call float* @calloc(i32 %9, i32 4)
%19 = icmp ne float* %18, null
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call float* @calloc(i32 %9, i32 4)
%23 = icmp ne float* %22, null
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call float* @calloc(i32 %9, i32 4)
%27 = icmp ne float* %26, null
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = icmp sgt i32 %9, 0
br i1 %30, label %31, label %143
31: ; preds = %8
%32 = zext i32 %9 to i64
%33 = icmp ult i32 %9, 8
br i1 %33, label %81, label %34
34: ; preds = %31
%35 = and i64 %32, 4294967288
%36 = add nsw i64 %35, -8
%37 = lshr exact i64 %36, 3
%38 = add nuw nsw i64 %37, 1
%39 = and i64 %38, 1
%40 = icmp eq i64 %36, 0
br i1 %40, label %67, label %41
41: ; preds = %34
%42 = and i64 %38, 4611686018427387902
br label %43
43: ; preds = %43, %41
%44 = phi i64 [ 0, %41 ], [ %63, %43 ]
%45 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %41 ], [ %64, %43 ]
%46 = phi i64 [ 0, %41 ], [ %65, %43 ]
%47 = add <4 x i32> %45, <i32 4, i32 4, i32 4, i32 4>
%48 = sitofp <4 x i32> %45 to <4 x float>
%49 = sitofp <4 x i32> %47 to <4 x float>
%50 = getelementptr inbounds float, float* %10, i64 %44
%51 = bitcast float* %50 to <4 x float>*
store <4 x float> %48, <4 x float>* %51
%52 = getelementptr inbounds float, float* %50, i64 4
%53 = bitcast float* %52 to <4 x float>*
store <4 x float> %49, <4 x float>* %53
%54 = or i64 %44, 8
%55 = add <4 x i32> %45, <i32 8, i32 8, i32 8, i32 8>
%56 = add <4 x i32> %45, <i32 12, i32 12, i32 12, i32 12>
%57 = sitofp <4 x i32> %55 to <4 x float>
%58 = sitofp <4 x i32> %56 to <4 x float>
%59 = getelementptr inbounds float, float* %10, i64 %54
%60 = bitcast float* %59 to <4 x float>*
store <4 x float> %57, <4 x float>* %60
%61 = getelementptr inbounds float, float* %59, i64 4
%62 = bitcast float* %61 to <4 x float>*
store <4 x float> %58, <4 x float>* %62
%63 = add nuw i64 %44, 16
%64 = add <4 x i32> %45, <i32 16, i32 16, i32 16, i32 16>
%65 = add i64 %46, 2
%66 = icmp eq i64 %65, %42
br i1 %66, label %67, label %43
67: ; preds = %43, %34
%68 = phi i64 [ 0, %34 ], [ %63, %43 ]
%69 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %34 ], [ %64, %43 ]
%70 = icmp eq i64 %39, 0
br i1 %70, label %79, label %71
71: ; preds = %67
%72 = add <4 x i32> %69, <i32 4, i32 4, i32 4, i32 4>
%73 = sitofp <4 x i32> %69 to <4 x float>
%74 = sitofp <4 x i32> %72 to <4 x float>
%75 = getelementptr inbounds float, float* %10, i64 %68
%76 = bitcast float* %75 to <4 x float>*
store <4 x float> %73, <4 x float>* %76
%77 = getelementptr inbounds float, float* %75, i64 4
%78 = bitcast float* %77 to <4 x float>*
store <4 x float> %74, <4 x float>* %78
br label %79
79: ; preds = %67, %71
%80 = icmp eq i64 %35, %32
br i1 %80, label %83, label %81
81: ; preds = %31, %79
%82 = phi i64 [ 0, %31 ], [ %35, %79 ]
br label %136
83: ; preds = %136, %79
br i1 %30, label %84, label %143
84: ; preds = %83
%85 = zext i32 %9 to i64
%86 = icmp ult i32 %9, 8
br i1 %86, label %134, label %87
87: ; preds = %84
%88 = and i64 %32, 4294967288
%89 = add nsw i64 %88, -8
%90 = lshr exact i64 %89, 3
%91 = add nuw nsw i64 %90, 1
%92 = and i64 %91, 1
%93 = icmp eq i64 %89, 0
br i1 %93, label %120, label %94
94: ; preds = %87
%95 = and i64 %91, 4611686018427387902
br label %96
96: ; preds = %96, %94
%97 = phi i64 [ 0, %94 ], [ %116, %96 ]
%98 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %94 ], [ %117, %96 ]
%99 = phi i64 [ 0, %94 ], [ %118, %96 ]
%100 = add <4 x i32> %98, <i32 4, i32 4, i32 4, i32 4>
%101 = sitofp <4 x i32> %98 to <4 x float>
%102 = sitofp <4 x i32> %100 to <4 x float>
%103 = getelementptr inbounds float, float* %14, i64 %97
%104 = bitcast float* %103 to <4 x float>*
store <4 x float> %101, <4 x float>* %104
%105 = getelementptr inbounds float, float* %103, i64 4
%106 = bitcast float* %105 to <4 x float>*
store <4 x float> %102, <4 x float>* %106
%107 = or i64 %97, 8
%108 = add <4 x i32> %98, <i32 8, i32 8, i32 8, i32 8>
%109 = add <4 x i32> %98, <i32 12, i32 12, i32 12, i32 12>
%110 = sitofp <4 x i32> %108 to <4 x float>
%111 = sitofp <4 x i32> %109 to <4 x float>
%112 = getelementptr inbounds float, float* %14, i64 %107
%113 = bitcast float* %112 to <4 x float>*
store <4 x float> %110, <4 x float>* %113
%114 = getelementptr inbounds float, float* %112, i64 4
%115 = bitcast float* %114 to <4 x float>*
store <4 x float> %111, <4 x float>* %115
%116 = add nuw i64 %97, 16
%117 = add <4 x i32> %98, <i32 16, i32 16, i32 16, i32 16>
%118 = add i64 %99, 2
%119 = icmp eq i64 %118, %95
br i1 %119, label %120, label %96
120: ; preds = %96, %87
%121 = phi i64 [ 0, %87 ], [ %116, %96 ]
%122 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %87 ], [ %117, %96 ]
%123 = icmp eq i64 %92, 0
br i1 %123, label %132, label %124
124: ; preds = %120
%125 = add <4 x i32> %122, <i32 4, i32 4, i32 4, i32 4>
%126 = sitofp <4 x i32> %122 to <4 x float>
%127 = sitofp <4 x i32> %125 to <4 x float>
%128 = getelementptr inbounds float, float* %14, i64 %121
%129 = bitcast float* %128 to <4 x float>*
store <4 x float> %126, <4 x float>* %129
%130 = getelementptr inbounds float, float* %128, i64 4
%131 = bitcast float* %130 to <4 x float>*
store <4 x float> %127, <4 x float>* %131
br label %132
132: ; preds = %120, %124
%133 = icmp eq i64 %88, %32
br i1 %133, label %143, label %134
134: ; preds = %84, %132
%135 = phi i64 [ 0, %84 ], [ %88, %132 ]
br label %149
136: ; preds = %81, %136
%137 = phi i64 [ %141, %136 ], [ %82, %81 ]
%138 = trunc i64 %137 to i32
%139 = sitofp i32 %138 to float
%140 = getelementptr inbounds float, float* %10, i64 %137
store float %139, float* %140
%141 = add nuw nsw i64 %137, 1
%142 = icmp eq i64 %141, %32
br i1 %142, label %83, label %136
143: ; preds = %149, %132, %8, %83
%144 = zext i32 %9 to i64
%145 = and i64 %144, 1
%146 = icmp eq i32 %9, 1
%147 = and i64 %144, 4294967294
%148 = icmp eq i64 %145, 0
br label %163
149: ; preds = %134, %149
%150 = phi i64 [ %154, %149 ], [ %135, %134 ]
%151 = trunc i64 %150 to i32
%152 = sitofp i32 %151 to float
%153 = getelementptr inbounds float, float* %14, i64 %150
store float %152, float* %153
%154 = add nuw nsw i64 %150, 1
%155 = icmp eq i64 %154, %85
br i1 %155, label %143, label %149
156: ; preds = %199
%157 = tail call i32 @free(float* %26)
%158 = tail call i32 @free(float* %22)
%159 = tail call i32 @free(float* %18)
%160 = tail call i32 @free(float* %14)
%161 = tail call i32 @free(float* %10)
%162 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
163: ; preds = %143, %199
%164 = phi i32 [ 0, %143 ], [ %202, %199 ]
%165 = tail call double (...) @omp_get_wtime()
%166 = tail call i32 @vadd0(i32 %9, float* %10, float* %14, float* %18)
%167 = tail call double (...) @omp_get_wtime()
%168 = tail call i32 @vadd1(i32 %9, float* %10, float* %14, float* %22)
%169 = tail call double (...) @omp_get_wtime()
%170 = tail call i32 @vadd2(i32 %9, float* %10, float* %14, float* %26)
%171 = tail call double (...) @omp_get_wtime()
%172 = fsub double %167, %165
%173 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %172)
%174 = fsub double %169, %167
%175 = tail call i32 @vdiff(i32 %9, float* %18, float* %22)
%176 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %174, i32 %175)
%177 = fsub double %171, %169
%178 = tail call i32 @vdiff(i32 %9, float* %18, float* %26)
%179 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), double %177, i32 %178)
%180 = fadd double %165, %167
%181 = fadd double %180, %169
%182 = fadd double %181, %171
br i1 %30, label %183, label %199
183: ; preds = %163
br i1 %146, label %184, label %204
184: ; preds = %204, %183
%185 = phi double [ undef, %183 ], [ %228, %204 ]
%186 = phi i64 [ 0, %183 ], [ %229, %204 ]
%187 = phi double [ %182, %183 ], [ %228, %204 ]
br i1 %148, label %199, label %188
188: ; preds = %184
%189 = getelementptr inbounds float, float* %18, i64 %186
%190 = load float, float* %189
%191 = getelementptr inbounds float, float* %22, i64 %186
%192 = load float, float* %191
%193 = fadd float %190, %192
%194 = getelementptr inbounds float, float* %26, i64 %186
%195 = load float, float* %194
%196 = fadd float %193, %195
%197 = fpext float %196 to double
%198 = fadd double %187, %197
br label %199
199: ; preds = %188, %184, %163
%200 = phi double [ %182, %163 ], [ %185, %184 ], [ %198, %188 ]
%201 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), double %200)
%202 = add nuw nsw i32 %164, 1
%203 = icmp eq i32 %202, 10
br i1 %203, label %156, label %163
204: ; preds = %183, %204
%205 = phi i64 [ %229, %204 ], [ 0, %183 ]
%206 = phi double [ %228, %204 ], [ %182, %183 ]
%207 = phi i64 [ %230, %204 ], [ 0, %183 ]
%208 = getelementptr inbounds float, float* %18, i64 %205
%209 = load float, float* %208
%210 = getelementptr inbounds float, float* %22, i64 %205
%211 = load float, float* %210
%212 = fadd float %209, %211
%213 = getelementptr inbounds float, float* %26, i64 %205
%214 = load float, float* %213
%215 = fadd float %212, %214
%216 = fpext float %215 to double
%217 = fadd double %206, %216
%218 = or i64 %205, 1
%219 = getelementptr inbounds float, float* %18, i64 %218
%220 = load float, float* %219
%221 = getelementptr inbounds float, float* %22, i64 %218
%222 = load float, float* %221
%223 = fadd float %220, %222
%224 = getelementptr inbounds float, float* %26, i64 %218
%225 = load float, float* %224
%226 = fadd float %223, %225
%227 = fpext float %226 to double
%228 = fadd double %217, %227
%229 = add nuw nsw i64 %205, 2
%230 = add i64 %207, 2
%231 = icmp eq i64 %230, %147
br i1 %231, label %184, label %204
}