#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*/ mysub(int, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, j, iters;
  double alpha, avg, t1, t2, tnotim;
  double x[1000], y[1000];
  double SuperLU_timer_();
  for (i = 0; i < 1000; ++i) {
    x[i] = 1.0 / (double)(i + 1);
    y[i] = (double)(1000 - i) / (double)1000;
  }
  alpha = 0.315;
  iters = 100000;
  tnotim = 0.0;
  while (tnotim <= 0.0) {
    t1 = SuperLU_timer_();
    for (j = 0; j < iters; ++j) {
      for (i = 0; i < 1000; ++i)
        y[i] += alpha * x[i];
      alpha = -alpha;
    }
    t2 = SuperLU_timer_();
    tnotim = t2 - t1;
    if (tnotim > 0.) {
      float ops = 2.0 * iters * 1000 * 1e-9;
      printf("Time for %d DAXPYs = %10.3g seconds\n", iters, tnotim);
      printf("DAXPY performance rate = %10.3g Gflops\n", ops / tnotim);
    } else {
      if (iters > 100000000) {
        printf("*** Error: Time for operations was zero.\n"
               "\tThe timer may not be working correctly.\n");
      }
      iters *= 10;
    }
  }
  printf("y[0]=%g\n", y[0]);
  t1 = SuperLU_timer_();
  for (j = 0; j < 100000; ++j) {
    for (i = 0; i < 1000; ++i)
      y[i] += alpha * x[i];
    alpha = -alpha;
  }
  t2 = SuperLU_timer_();
  tnotim = t2 - t1;
  t1 = SuperLU_timer_();
  for (j = 0; j < 100000; ++j) {
    for (i = 0; i < 1000; ++i)
      y[i] += alpha * x[i];
    alpha = -alpha;
    t2 = SuperLU_timer_();
  }
  printf("Including DSECND, time        = %10.3g seconds\n", t2 - t1);
  avg = ((t2 - t1) - tnotim) * 1000. / (double)100000;
  printf("Average time for DSECND       = %10.3g milliseconds\n", avg);
  if (tnotim > 0.)
    printf("Equivalent floating point ops = %10.3g ops\n",
           1000. * avg / tnotim);
  mysub(1000, x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3ed0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11ac <main+0x7c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec0(%rip),%xmm0
divsd  %xmm1,%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x1f80(%rbp,%rax,8)
ff ff
mov    $0x3e8,%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x3ec0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x19>
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x186a0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     1339 <main+0x209>
mov    $0x0,%al
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1276 <main+0x146>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1247 <main+0x117>
movsd  -0x18(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movsd  -0x1f80(%rbp,%rax,8),%xmm2
ff ff
movslq -0x8(%rbp),%rax
movsd  -0x3ec0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3ec0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fc <main+0xcc>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e9 <main+0xb9>
mov    $0x0,%al
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1312 <main+0x1e2>
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xd70(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd54(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd50(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x3ec4(%rbp)
ff
mov    -0x10(%rbp),%esi
movsd  -0x38(%rbp),%xmm0
lea    0xd49(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x3ec4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
divsd  -0x38(%rbp),%xmm0
lea    0xd4f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1334 <main+0x204>
cmpl   $0x5f5e100,-0x10(%rbp)
jle    132d <main+0x1fd>
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11c8 <main+0x98>
movsd  -0x3ec0(%rbp),%xmm0
ff
lea    0xd88(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    13f0 <main+0x2c0>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    13c1 <main+0x291>
movsd  -0x18(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movsd  -0x1f80(%rbp,%rax,8),%xmm2
ff ff
movslq -0x8(%rbp),%rax
movsd  -0x3ec0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3ec0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1376 <main+0x246>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1362 <main+0x232>
mov    $0x0,%al
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    14b8 <main+0x388>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    147d <main+0x34d>
movsd  -0x18(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movsd  -0x1f80(%rbp,%rax,8),%xmm2
ff ff
movslq -0x8(%rbp),%rax
movsd  -0x3ec0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3ec0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1432 <main+0x302>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    141e <main+0x2ee>
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
lea    0xc10(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  0xb29(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb15(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xc01(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1541 <main+0x411>
movsd  0xae7(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
lea    0xc04(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x1f80(%rbp),%rsi
lea    -0x3ec0(%rbp),%rdx
mov    $0x3e8,%edi
call   1050 <mysub@plt>
xor    %eax,%eax
add    $0x3ed0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3eb8,%rsp
movdqa 0xeaa(%rip),%xmm0
movdqa 0xeb2(%rip),%xmm1
xor    %eax,%eax
pcmpeqd %xmm8,%xmm8
movapd 0xeb2(%rip),%xmm9
movdqa 0xeba(%rip),%xmm4
movapd 0xec2(%rip),%xmm5
movdqa 0xeca(%rip),%xmm6
movdqa 0xed2(%rip),%xmm7
xchg   %ax,%ax
pshufd $0xe8,%xmm1,%xmm2
psubd  %xmm8,%xmm2
cvtdq2pd %xmm2,%xmm2
movapd %xmm9,%xmm3
divpd  %xmm2,%xmm3
movapd %xmm3,0x1f70(%rsp,%rax,8)
movdqa %xmm4,%xmm2
psubd  %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
divpd  %xmm5,%xmm2
movapd %xmm2,0x30(%rsp,%rax,8)
add    $0x2,%rax
paddq  %xmm6,%xmm1
paddd  %xmm7,%xmm0
cmp    $0x3e8,%rax
jne    1190 <main+0x50>
mov    $0x186a0,%ebx
movsd  0xe99(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
lea    0xeb4(%rip),%r14
lea    0xed2(%rip),%r15
lea    0xf8d(%rip),%r12
jmp    1223 <main+0xe3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1395 <main+0x255>
xor    %eax,%eax
call   1030 <SuperLU_timer_@plt>
test   %ebx,%ebx
movsd  %xmm0,0x8(%rsp)
jle    12e0 <main+0x1a0>
xor    %eax,%eax
movapd 0x10(%rsp),%xmm3
movapd 0xe28(%rip),%xmm4
nopl   0x0(%rax,%rax,1)
movapd %xmm3,%xmm0
unpcklpd %xmm3,%xmm0
mov    $0x6,%ecx
nopl   (%rax)
movapd 0x1f40(%rsp,%rcx,8),%xmm1
mulpd  %xmm0,%xmm1
addpd  (%rsp,%rcx,8),%xmm1
movapd 0x1f50(%rsp,%rcx,8),%xmm2
mulpd  %xmm0,%xmm2
addpd  0x10(%rsp,%rcx,8),%xmm2
movapd %xmm1,(%rsp,%rcx,8)
movapd %xmm2,0x10(%rsp,%rcx,8)
movapd 0x1f60(%rsp,%rcx,8),%xmm1
mulpd  %xmm0,%xmm1
addpd  0x20(%rsp,%rcx,8),%xmm1
movapd 0x1f70(%rsp,%rcx,8),%xmm2
mulpd  %xmm0,%xmm2
addpd  0x30(%rsp,%rcx,8),%xmm2
movapd %xmm1,0x20(%rsp,%rcx,8)
movapd %xmm2,0x30(%rsp,%rcx,8)
add    $0x8,%rcx
cmp    $0x3ee,%rcx
jne    1260 <main+0x120>
xorpd  %xmm4,%xmm3
add    $0x1,%eax
cmp    %ebx,%eax
jne    1250 <main+0x110>
jmp    12e6 <main+0x1a6>
movapd 0x10(%rsp),%xmm3
movapd %xmm3,0x10(%rsp)
xor    %eax,%eax
call   1030 <SuperLU_timer_@plt>
movapd %xmm0,%xmm1
subsd  0x8(%rsp),%xmm1
ucomisd 0xd9b(%rip),%xmm1
jbe    1370 <main+0x230>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  %xmm0,%xmm0
mulsd  0xd6e(%rip),%xmm0
mulsd  0xd6e(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
movapd %xmm1,%xmm0
mov    $0x1,%al
movsd  %xmm1,0x8(%rsp)
call   1050 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0x8(%rsp),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm1
jmp    1215 <main+0xd5>
nopw   0x0(%rax,%rax,1)
cmp    $0x5f5e101,%ebx
jl     1210 <main+0xd0>
mov    %r12,%rdi
movsd  %xmm1,0x8(%rsp)
call   1040 <puts@plt>
movsd  0x8(%rsp),%xmm1
jmp    1210 <main+0xd0>
movsd  0x30(%rsp),%xmm0
lea    0xd53(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0x10(%rsp),%xmm3
movapd 0xcaa(%rip),%xmm4
cs nopw 0x0(%rax,%rax,1)
movapd %xmm3,%xmm0
unpcklpd %xmm3,%xmm0
mov    $0x6,%eax
nopl   (%rax)
movapd 0x1f40(%rsp,%rax,8),%xmm1
mulpd  %xmm0,%xmm1
addpd  (%rsp,%rax,8),%xmm1
movapd 0x1f50(%rsp,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
addpd  0x10(%rsp,%rax,8),%xmm2
movapd %xmm1,(%rsp,%rax,8)
movapd %xmm2,0x10(%rsp,%rax,8)
movapd 0x1f60(%rsp,%rax,8),%xmm1
mulpd  %xmm0,%xmm1
addpd  0x20(%rsp,%rax,8),%xmm1
movapd 0x1f70(%rsp,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
addpd  0x30(%rsp,%rax,8),%xmm2
movapd %xmm1,0x20(%rsp,%rax,8)
movapd %xmm2,0x30(%rsp,%rax,8)
add    $0x8,%rax
cmp    $0x3ee,%rax
jne    13e0 <main+0x2a0>
xorpd  %xmm4,%xmm3
add    $0x1,%ebx
cmp    $0x186a0,%ebx
jne    13d0 <main+0x290>
xor    %eax,%eax
movapd %xmm3,0x10(%rsp)
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <SuperLU_timer_@plt>
movsd  %xmm0,0x28(%rsp)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd 0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
mov    $0x6,%eax
movapd %xmm1,%xmm3
nopw   0x0(%rax,%rax,1)
movapd 0x1f40(%rsp,%rax,8),%xmm1
mulpd  %xmm0,%xmm1
addpd  (%rsp,%rax,8),%xmm1
movapd 0x1f50(%rsp,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
addpd  0x10(%rsp,%rax,8),%xmm2
movapd %xmm1,(%rsp,%rax,8)
movapd %xmm2,0x10(%rsp,%rax,8)
movapd 0x1f60(%rsp,%rax,8),%xmm1
mulpd  %xmm0,%xmm1
addpd  0x20(%rsp,%rax,8),%xmm1
movapd 0x1f70(%rsp,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
addpd  0x30(%rsp,%rax,8),%xmm2
movapd %xmm1,0x20(%rsp,%rax,8)
movapd %xmm2,0x30(%rsp,%rax,8)
add    $0x8,%rax
cmp    $0x3ee,%rax
jne    14b0 <main+0x370>
xorpd  0xb4a(%rip),%xmm3
movapd %xmm3,0x10(%rsp)
xor    %eax,%eax
call   1030 <SuperLU_timer_@plt>
add    $0x1,%ebx
cmp    $0x186a0,%ebx
jne    1490 <main+0x350>
movsd  0x8(%rsp),%xmm1
subsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
subsd  0x28(%rsp),%xmm0
lea    0xb9d(%rip),%rdi
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mulsd  0xb06(%rip),%xmm0
divsd  0xb0e(%rip),%xmm0
lea    0xb9d(%rip),%rdi
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    15ce <main+0x48e>
movsd  0x10(%rsp),%xmm0
mulsd  0xacc(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xb9c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x1f70(%rsp),%rsi
lea    0x30(%rsp),%rdx
mov    $0x3e8,%edi
call   1060 <mysub@plt>
xor    %eax,%eax
add    $0x3eb8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Time for %d DAXPYs = %10.3g seconds\0A\00"
@.str.1 = [40 x i8] c"DAXPY performance rate = %10.3g Gflops\0A\00"
@.str.2 = [83 x i8] c"*** Error: Time for operations was zero.\0A\09The timer may not be working correctly.\0A\00"
@.str.3 = [9 x i8] c"y[0]=%g\0A\00"
@.str.4 = [48 x i8] c"Including DSECND, time = %10.3g seconds\0A\00"
@.str.5 = [53 x i8] c"Average time for DSECND = %10.3g milliseconds\0A\00"
@.str.6 = [44 x i8] c"Equivalent floating point ops = %10.3g ops\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca [1000 x double]
%11 = alloca [1000 x double]
%12 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
br label %13
13: ; preds = %31, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 1000
br i1 %15, label %16, label %34
16: ; preds = %13
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
%19 = sitofp i32 %18 to double
%20 = fdiv double 1.000000e+00, %19
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [1000 x double], [1000 x double]* %10, i64 0, i64 %22
store double %20, double* %23
%24 = load i32, i32* %2
%25 = sub nsw i32 1000, %24
%26 = sitofp i32 %25 to double
%27 = fdiv double %26, 1.000000e+03
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [1000 x double], [1000 x double]* %11, i64 0, i64 %29
store double %27, double* %30
br label %31
31: ; preds = %16
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %13
34: ; preds = %13
store double 3.150000e-01, double* %5
store i32 100000, i32* %4
store double 0.000000e+00, double* %9
br label %35
35: ; preds = %98, %34
%36 = load double, double* %9
%37 = fcmp ole double %36, 0.000000e+00
br i1 %37, label %38, label %99
38: ; preds = %35
%39 = call double (...) @SuperLU_timer_()
store double %39, double* %7
store i32 0, i32* %3
br label %40
40: ; preds = %65, %38
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %68
44: ; preds = %40
store i32 0, i32* %2
br label %45
45: ; preds = %59, %44
%46 = load i32, i32* %2
%47 = icmp slt i32 %46, 1000
br i1 %47, label %48, label %62
48: ; preds = %45
%49 = load double, double* %5
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [1000 x double], [1000 x double]* %10, i64 0, i64 %51
%53 = load double, double* %52
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [1000 x double], [1000 x double]* %11, i64 0, i64 %55
%57 = load double, double* %56
%58 = call double @llvm.fmuladd.f64(double %49, double %53, double %57)
store double %58, double* %56
br label %59
59: ; preds = %48
%60 = load i32, i32* %2
%61 = add nsw i32 %60, 1
store i32 %61, i32* %2
br label %45
62: ; preds = %45
%63 = load double, double* %5
%64 = fneg double %63
store double %64, double* %5
br label %65
65: ; preds = %62
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %40
68: ; preds = %40
%69 = call double (...) @SuperLU_timer_()
store double %69, double* %8
%70 = load double, double* %8
%71 = load double, double* %7
%72 = fsub double %70, %71
store double %72, double* %9
%73 = load double, double* %9
%74 = fcmp ogt double %73, 0.000000e+00
br i1 %74, label %75, label %90
75: ; preds = %68
%76 = load i32, i32* %4
%77 = sitofp i32 %76 to double
%78 = fmul double 2.000000e+00, %77
%79 = fmul double %78, 1.000000e+03
%80 = fmul double %79, 1.000000e-09
%81 = fptrunc double %80 to float
store float %81, float* %12
%82 = load i32, i32* %4
%83 = load double, double* %9
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %82, double %83)
%85 = load float, float* %12
%86 = fpext float %85 to double
%87 = load double, double* %9
%88 = fdiv double %86, %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %88)
br label %98
90: ; preds = %68
%91 = load i32, i32* %4
%92 = icmp sgt i32 %91, 100000000
br i1 %92, label %93, label %95
93: ; preds = %90
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0))
br label %95
95: ; preds = %93, %90
%96 = load i32, i32* %4
%97 = mul nsw i32 %96, 10
store i32 %97, i32* %4
br label %98
98: ; preds = %95, %75
br label %35
99: ; preds = %35
%100 = getelementptr inbounds [1000 x double], [1000 x double]* %11, i64 0, i64 0
%101 = load double, double* %100
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %101)
%103 = call double (...) @SuperLU_timer_()
store double %103, double* %7
store i32 0, i32* %3
br label %104
104: ; preds = %128, %99
%105 = load i32, i32* %3
%106 = icmp slt i32 %105, 100000
br i1 %106, label %107, label %131
107: ; preds = %104
store i32 0, i32* %2
br label %108
108: ; preds = %122, %107
%109 = load i32, i32* %2
%110 = icmp slt i32 %109, 1000
br i1 %110, label %111, label %125
111: ; preds = %108
%112 = load double, double* %5
%113 = load i32, i32* %2
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [1000 x double], [1000 x double]* %10, i64 0, i64 %114
%116 = load double, double* %115
%117 = load i32, i32* %2
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [1000 x double], [1000 x double]* %11, i64 0, i64 %118
%120 = load double, double* %119
%121 = call double @llvm.fmuladd.f64(double %112, double %116, double %120)
store double %121, double* %119
br label %122
122: ; preds = %111
%123 = load i32, i32* %2
%124 = add nsw i32 %123, 1
store i32 %124, i32* %2
br label %108
125: ; preds = %108
%126 = load double, double* %5
%127 = fneg double %126
store double %127, double* %5
br label %128
128: ; preds = %125
%129 = load i32, i32* %3
%130 = add nsw i32 %129, 1
store i32 %130, i32* %3
br label %104
131: ; preds = %104
%132 = call double (...) @SuperLU_timer_()
store double %132, double* %8
%133 = load double, double* %8
%134 = load double, double* %7
%135 = fsub double %133, %134
store double %135, double* %9
%136 = call double (...) @SuperLU_timer_()
store double %136, double* %7
store i32 0, i32* %3
br label %137
137: ; preds = %162, %131
%138 = load i32, i32* %3
%139 = icmp slt i32 %138, 100000
br i1 %139, label %140, label %165
140: ; preds = %137
store i32 0, i32* %2
br label %141
141: ; preds = %155, %140
%142 = load i32, i32* %2
%143 = icmp slt i32 %142, 1000
br i1 %143, label %144, label %158
144: ; preds = %141
%145 = load double, double* %5
%146 = load i32, i32* %2
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [1000 x double], [1000 x double]* %10, i64 0, i64 %147
%149 = load double, double* %148
%150 = load i32, i32* %2
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [1000 x double], [1000 x double]* %11, i64 0, i64 %151
%153 = load double, double* %152
%154 = call double @llvm.fmuladd.f64(double %145, double %149, double %153)
store double %154, double* %152
br label %155
155: ; preds = %144
%156 = load i32, i32* %2
%157 = add nsw i32 %156, 1
store i32 %157, i32* %2
br label %141
158: ; preds = %141
%159 = load double, double* %5
%160 = fneg double %159
store double %160, double* %5
%161 = call double (...) @SuperLU_timer_()
store double %161, double* %8
br label %162
162: ; preds = %158
%163 = load i32, i32* %3
%164 = add nsw i32 %163, 1
store i32 %164, i32* %3
br label %137
165: ; preds = %137
%166 = load double, double* %8
%167 = load double, double* %7
%168 = fsub double %166, %167
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), double %168)
%170 = load double, double* %8
%171 = load double, double* %7
%172 = fsub double %170, %171
%173 = load double, double* %9
%174 = fsub double %172, %173
%175 = fmul double %174, 1.000000e+03
%176 = fdiv double %175, 1.000000e+05
store double %176, double* %6
%177 = load double, double* %6
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), double %177)
%179 = load double, double* %9
%180 = fcmp ogt double %179, 0.000000e+00
br i1 %180, label %181, label %187
181: ; preds = %165
%182 = load double, double* %6
%183 = fmul double 1.000000e+03, %182
%184 = load double, double* %9
%185 = fdiv double %183, %184
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %185)
br label %187
187: ; preds = %181, %165
%188 = getelementptr inbounds [1000 x double], [1000 x double]* %10, i64 0, i64 0
%189 = getelementptr inbounds [1000 x double], [1000 x double]* %11, i64 0, i64 0
%190 = call i32 @mysub(i32 1000, double* %188, double* %189)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Time for %d DAXPYs = %10.3g seconds\0A\00"
@.str.1 = [40 x i8] c"DAXPY performance rate = %10.3g Gflops\0A\00"
@.str.3 = [9 x i8] c"y[0]=%g\0A\00"
@.str.4 = [48 x i8] c"Including DSECND, time = %10.3g seconds\0A\00"
@.str.5 = [53 x i8] c"Average time for DSECND = %10.3g milliseconds\0A\00"
@.str.6 = [44 x i8] c"Equivalent floating point ops = %10.3g ops\0A\00"
@str = [82 x i8] c"*** Error: Time for operations was zero.\0A\09The timer may not be working correctly.\00"
define i32 @main() {
%1 = alloca [1000 x double]
%2 = alloca [1000 x double]
%3 = bitcast [1000 x double]* %1 to i8*
%4 = bitcast [1000 x double]* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = phi i64 [ 0, %0 ], [ %20, %5 ]
%7 = phi <2 x i64> [ <i64 0, i64 1>, %0 ], [ %21, %5 ]
%8 = phi <2 x i32> [ <i32 0, i32 1>, %0 ], [ %22, %5 ]
%9 = trunc <2 x i64> %7 to <2 x i32>
%10 = add <2 x i32> %9, <i32 1, i32 1>
%11 = sitofp <2 x i32> %10 to <2 x double>
%12 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %11
%13 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %6
%14 = bitcast double* %13 to <2 x double>*
store <2 x double> %12, <2 x double>* %14
%15 = sub <2 x i32> <i32 1000, i32 1000>, %8
%16 = sitofp <2 x i32> %15 to <2 x double>
%17 = fdiv <2 x double> %16, <double 1.000000e+03, double 1.000000e+03>
%18 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %6
%19 = bitcast double* %18 to <2 x double>*
store <2 x double> %17, <2 x double>* %19
%20 = add nuw i64 %6, 2
%21 = add <2 x i64> %7, <i64 2, i64 2>
%22 = add <2 x i32> %8, <i32 2, i32 2>
%23 = icmp eq i64 %20, 1000
br i1 %23, label %24, label %5
24: ; preds = %5, %98
%25 = phi double [ %78, %98 ], [ 3.150000e-01, %5 ]
%26 = phi i32 [ %99, %98 ], [ 100000, %5 ]
%27 = tail call double (...) @SuperLU_timer_()
%28 = icmp sgt i32 %26, 0
br i1 %28, label %29, label %77
29: ; preds = %24, %73
%30 = phi i32 [ %75, %73 ], [ 0, %24 ]
%31 = phi double [ %74, %73 ], [ %25, %24 ]
%32 = insertelement <2 x double> poison, double %31, i64 0
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
%34 = insertelement <2 x double> poison, double %31, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
br label %36
36: ; preds = %36, %29
%37 = phi i64 [ 0, %29 ], [ %71, %36 ]
%38 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %37
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = getelementptr inbounds double, double* %38, i64 2
%42 = bitcast double* %41 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %37
%45 = bitcast double* %44 to <2 x double>*
%46 = load <2 x double>, <2 x double>* %45
%47 = getelementptr inbounds double, double* %44, i64 2
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %40, <2 x double> %46)
%51 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %35, <2 x double> %43, <2 x double> %49)
%52 = bitcast double* %44 to <2 x double>*
store <2 x double> %50, <2 x double>* %52
%53 = bitcast double* %47 to <2 x double>*
store <2 x double> %51, <2 x double>* %53
%54 = or i64 %37, 4
%55 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %54
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = getelementptr inbounds double, double* %55, i64 2
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %54
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = getelementptr inbounds double, double* %61, i64 2
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %57, <2 x double> %63)
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %35, <2 x double> %60, <2 x double> %66)
%69 = bitcast double* %61 to <2 x double>*
store <2 x double> %67, <2 x double>* %69
%70 = bitcast double* %64 to <2 x double>*
store <2 x double> %68, <2 x double>* %70
%71 = add nuw nsw i64 %37, 8
%72 = icmp eq i64 %71, 1000
br i1 %72, label %73, label %36
73: ; preds = %36
%74 = fneg double %31
%75 = add nuw nsw i32 %30, 1
%76 = icmp eq i32 %75, %26
br i1 %76, label %77, label %29
77: ; preds = %73, %24
%78 = phi double [ %25, %24 ], [ %74, %73 ]
%79 = tail call double (...) @SuperLU_timer_()
%80 = fsub double %79, %27
%81 = fcmp ogt double %80, 0.000000e+00
br i1 %81, label %82, label %92
82: ; preds = %77
%83 = sitofp i32 %26 to double
%84 = fmul double %83, 2.000000e+00
%85 = fmul double %84, 1.000000e+03
%86 = fmul double %85, 1.000000e-09
%87 = fptrunc double %86 to float
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %26, double %80)
%89 = fpext float %87 to double
%90 = fdiv double %89, %80
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %90)
br label %98
92: ; preds = %77
%93 = icmp sgt i32 %26, 100000000
br i1 %93, label %94, label %96
94: ; preds = %92
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
br label %96
96: ; preds = %94, %92
%97 = mul nsw i32 %26, 10
br label %98
98: ; preds = %96, %82
%99 = phi i32 [ %26, %82 ], [ %97, %96 ]
%100 = fcmp ugt double %80, 0.000000e+00
br i1 %100, label %101, label %24
101: ; preds = %98
%102 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 0
%103 = load double, double* %102
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %103)
%105 = tail call double (...) @SuperLU_timer_()
br label %106
106: ; preds = %150, %101
%107 = phi i32 [ 0, %101 ], [ %152, %150 ]
%108 = phi double [ %78, %101 ], [ %151, %150 ]
%109 = insertelement <2 x double> poison, double %108, i64 0
%110 = shufflevector <2 x double> %109, <2 x double> poison, <2 x i32> zeroinitializer
%111 = insertelement <2 x double> poison, double %108, i64 0
%112 = shufflevector <2 x double> %111, <2 x double> poison, <2 x i32> zeroinitializer
br label %113
113: ; preds = %113, %106
%114 = phi i64 [ 0, %106 ], [ %148, %113 ]
%115 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %114
%116 = bitcast double* %115 to <2 x double>*
%117 = load <2 x double>, <2 x double>* %116
%118 = getelementptr inbounds double, double* %115, i64 2
%119 = bitcast double* %118 to <2 x double>*
%120 = load <2 x double>, <2 x double>* %119
%121 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %114
%122 = bitcast double* %121 to <2 x double>*
%123 = load <2 x double>, <2 x double>* %122
%124 = getelementptr inbounds double, double* %121, i64 2
%125 = bitcast double* %124 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %110, <2 x double> %117, <2 x double> %123)
%128 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %112, <2 x double> %120, <2 x double> %126)
%129 = bitcast double* %121 to <2 x double>*
store <2 x double> %127, <2 x double>* %129
%130 = bitcast double* %124 to <2 x double>*
store <2 x double> %128, <2 x double>* %130
%131 = or i64 %114, 4
%132 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %131
%133 = bitcast double* %132 to <2 x double>*
%134 = load <2 x double>, <2 x double>* %133
%135 = getelementptr inbounds double, double* %132, i64 2
%136 = bitcast double* %135 to <2 x double>*
%137 = load <2 x double>, <2 x double>* %136
%138 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %131
%139 = bitcast double* %138 to <2 x double>*
%140 = load <2 x double>, <2 x double>* %139
%141 = getelementptr inbounds double, double* %138, i64 2
%142 = bitcast double* %141 to <2 x double>*
%143 = load <2 x double>, <2 x double>* %142
%144 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %110, <2 x double> %134, <2 x double> %140)
%145 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %112, <2 x double> %137, <2 x double> %143)
%146 = bitcast double* %138 to <2 x double>*
store <2 x double> %144, <2 x double>* %146
%147 = bitcast double* %141 to <2 x double>*
store <2 x double> %145, <2 x double>* %147
%148 = add nuw nsw i64 %114, 8
%149 = icmp eq i64 %148, 1000
br i1 %149, label %150, label %113
150: ; preds = %113
%151 = fneg double %108
%152 = add nuw nsw i32 %107, 1
%153 = icmp eq i32 %152, 100000
br i1 %153, label %154, label %106
154: ; preds = %150
%155 = tail call double (...) @SuperLU_timer_()
%156 = tail call double (...) @SuperLU_timer_()
br label %157
157: ; preds = %201, %154
%158 = phi i32 [ 0, %154 ], [ %204, %201 ]
%159 = phi double [ %151, %154 ], [ %202, %201 ]
%160 = insertelement <2 x double> poison, double %159, i64 0
%161 = shufflevector <2 x double> %160, <2 x double> poison, <2 x i32> zeroinitializer
%162 = insertelement <2 x double> poison, double %159, i64 0
%163 = shufflevector <2 x double> %162, <2 x double> poison, <2 x i32> zeroinitializer
br label %164
164: ; preds = %164, %157
%165 = phi i64 [ 0, %157 ], [ %199, %164 ]
%166 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %165
%167 = bitcast double* %166 to <2 x double>*
%168 = load <2 x double>, <2 x double>* %167
%169 = getelementptr inbounds double, double* %166, i64 2
%170 = bitcast double* %169 to <2 x double>*
%171 = load <2 x double>, <2 x double>* %170
%172 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %165
%173 = bitcast double* %172 to <2 x double>*
%174 = load <2 x double>, <2 x double>* %173
%175 = getelementptr inbounds double, double* %172, i64 2
%176 = bitcast double* %175 to <2 x double>*
%177 = load <2 x double>, <2 x double>* %176
%178 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %161, <2 x double> %168, <2 x double> %174)
%179 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %163, <2 x double> %171, <2 x double> %177)
%180 = bitcast double* %172 to <2 x double>*
store <2 x double> %178, <2 x double>* %180
%181 = bitcast double* %175 to <2 x double>*
store <2 x double> %179, <2 x double>* %181
%182 = or i64 %165, 4
%183 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 %182
%184 = bitcast double* %183 to <2 x double>*
%185 = load <2 x double>, <2 x double>* %184
%186 = getelementptr inbounds double, double* %183, i64 2
%187 = bitcast double* %186 to <2 x double>*
%188 = load <2 x double>, <2 x double>* %187
%189 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %182
%190 = bitcast double* %189 to <2 x double>*
%191 = load <2 x double>, <2 x double>* %190
%192 = getelementptr inbounds double, double* %189, i64 2
%193 = bitcast double* %192 to <2 x double>*
%194 = load <2 x double>, <2 x double>* %193
%195 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %161, <2 x double> %185, <2 x double> %191)
%196 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %163, <2 x double> %188, <2 x double> %194)
%197 = bitcast double* %189 to <2 x double>*
store <2 x double> %195, <2 x double>* %197
%198 = bitcast double* %192 to <2 x double>*
store <2 x double> %196, <2 x double>* %198
%199 = add nuw nsw i64 %165, 8
%200 = icmp eq i64 %199, 1000
br i1 %200, label %201, label %164
201: ; preds = %164
%202 = fneg double %159
%203 = tail call double (...) @SuperLU_timer_()
%204 = add nuw nsw i32 %158, 1
%205 = icmp eq i32 %204, 100000
br i1 %205, label %206, label %157
206: ; preds = %201
%207 = fsub double %155, %105
%208 = fsub double %203, %156
%209 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), double %208)
%210 = fsub double %208, %207
%211 = fmul double %210, 1.000000e+03
%212 = fdiv double %211, 1.000000e+05
%213 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), double %212)
%214 = fcmp ogt double %207, 0.000000e+00
br i1 %214, label %215, label %219
215: ; preds = %206
%216 = fmul double %212, 1.000000e+03
%217 = fdiv double %216, %207
%218 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %217)
br label %219
219: ; preds = %215, %206
%220 = getelementptr inbounds [1000 x double], [1000 x double]* %1, i64 0, i64 0
%221 = call i32 @mysub(i32 1000, double* %220, double* %102)
ret i32 0
}