#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 */
float *calloc(int const, int);
int /*<<< orphan*/ data_gen(float *, float *, int const);
int /*<<< orphan*/ free(float *);
double getTime();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  const int dataPoints = 16;
  int i;
  double startTime, timeDuration;
  float *x = calloc(dataPoints, sizeof(float));
  float *y = calloc(dataPoints, sizeof(float));
  float *a = calloc(dataPoints, sizeof(float));
  float *b = calloc(dataPoints, sizeof(float));
  printf("Generating input data...\n");
  data_gen(x, y, dataPoints);
  printf("Computing on regression...\n");
  float sumX = 0;
  float sumX2 = 0;
  float sumXY = 0;
  float sumY = 0;
  float meanX = 0;
  float meanY = 0;
  startTime = getTime();
  for (i = 0; i < dataPoints; i++) {
    sumX += x[i];
    sumX2 += x[i] * x[i];
    sumXY += x[i] * y[i];
    sumY += y[i];
    meanX = sumX / (i + 1);
    meanY = sumY / (i + 1);
    if (i == 0) {
      b[i] = 0;
    } else {
      b[i] = (sumXY - sumX * meanY) / (sumX2 - sumX * meanX);
    }
    a[i] = meanY - b[i] * meanX;
  }
  timeDuration = getTime() - startTime;
  for (i = 0; i < dataPoints; i++) {
    printf("regression[%d]: y = %f + %f x\n", i, a[i], b[i]);
  }
  printf("compute time: %g s\n", timeDuration);
  free(x);
  free(y);
  free(a);
  free(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x10,-0x8(%rbp)
mov    $0x10,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x10,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x10,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x10,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x40(%rbp)
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1070 <data_gen@plt>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    $0x0,%al
call   1040 <getTime@plt>
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    13a2 <main+0x252>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x48(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x4c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x44(%rbp),%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x50(%rbp),%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1302 <main+0x1b2>
mov    -0x40(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    135b <main+0x20b>
movss  -0x4c(%rbp),%xmm1
movss  -0x44(%rbp),%xmm0
movss  -0x58(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x44(%rbp),%xmm1
movss  -0x54(%rbp),%xmm3
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x58(%rbp),%xmm1
mov    -0x40(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  -0x54(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1223 <main+0xd3>
mov    $0x0,%al
call   1040 <getTime@plt>
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1405 <main+0x2b5>
mov    -0xc(%rbp),%esi
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc46(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13ba <main+0x26a>
movsd  -0x20(%rbp),%xmm0
lea    0xc44(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x10,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%r14
mov    $0x10,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%r15
mov    $0x10,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%r12
mov    $0x10,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%rbp
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1080 <data_gen@plt>
lea    0xe77(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getTime@plt>
movsd  %xmm0,0x10(%rsp)
movss  (%r14),%xmm3
xorps  %xmm4,%xmm4
movaps %xmm3,%xmm0
addss  %xmm4,%xmm0
movss  (%r15),%xmm1
movaps %xmm1,%xmm2
unpcklps %xmm3,%xmm2
shufps $0x0,%xmm3,%xmm3
mulps  %xmm2,%xmm3
xorps  %xmm2,%xmm2
addps  %xmm3,%xmm2
addss  %xmm4,%xmm1
movl   $0x0,0x0(%rbp)
movss  0xdd9(%rip),%xmm3
mulss  %xmm0,%xmm3
addss  %xmm1,%xmm3
movss  %xmm3,0x4(%rsp)
movss  %xmm3,(%r12)
nopl   0x0(%rax,%rax,1)
movss  0x4(%r14,%rbx,4),%xmm3
addss  %xmm3,%xmm0
movss  0x4(%r15,%rbx,4),%xmm4
addss  %xmm4,%xmm1
unpcklps %xmm3,%xmm4
shufps $0x0,%xmm3,%xmm3
mulps  %xmm4,%xmm3
addps  %xmm3,%xmm2
movaps %xmm2,%xmm3
shufps $0x55,%xmm2,%xmm3
lea    0x2(%rbx),%eax
xorps  %xmm4,%xmm4
cvtsi2ss %eax,%xmm4
movaps %xmm0,%xmm5
divss  %xmm4,%xmm5
movaps %xmm1,%xmm6
divss  %xmm4,%xmm6
movaps %xmm0,%xmm4
mulss  %xmm6,%xmm4
movaps %xmm2,%xmm7
subss  %xmm4,%xmm7
movaps %xmm0,%xmm4
mulss  %xmm5,%xmm4
subss  %xmm4,%xmm3
divss  %xmm3,%xmm7
movss  %xmm7,0x4(%rbp,%rbx,4)
mulss  %xmm5,%xmm7
subss  %xmm7,%xmm6
movss  %xmm6,0x4(%r12,%rbx,4)
add    $0x1,%rbx
cmp    $0xf,%rbx
jne    1240 <main+0xe0>
xor    %eax,%eax
call   1050 <getTime@plt>
movsd  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd28(%rip),%r13
xorps  %xmm1,%xmm1
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x4(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x8(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x2,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0xc(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x3,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x10(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x4,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x14(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x5,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x18(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x6,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x1c(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x7,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x20(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x8,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x24(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x9,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x28(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0xa,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x2c(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0xb,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x30(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x30(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0xc,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x34(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0xd,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x38(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x38(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0xe,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x3c(%r12),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x3c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0xf,%esi
mov    $0x2,%al
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
lea    0xb18(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Generating input data...\0A\00"
@.str.1 = [28 x i8] c"Computing on regression...\0A\00"
@.str.2 = [31 x i8] c"regression[%d]: y = %f + %f x\0A\00"
@.str.3 = [20 x i8] c"compute time: %g s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
store i32 0, i32* %1
store i32 16, i32* %2
%16 = call float* @calloc(i32 16, i32 4)
store float* %16, float** %6
%17 = call float* @calloc(i32 16, i32 4)
store float* %17, float** %7
%18 = call float* @calloc(i32 16, i32 4)
store float* %18, float** %8
%19 = call float* @calloc(i32 16, i32 4)
store float* %19, float** %9
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%21 = load float*, float** %6
%22 = load float*, float** %7
%23 = call i32 @data_gen(float* %21, float* %22, i32 16)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store float 0.000000e+00, float* %10
store float 0.000000e+00, float* %11
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
%25 = call double (...) @getTime()
store double %25, double* %4
store i32 0, i32* %3
br label %26
26: ; preds = %115, %0
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, 16
br i1 %28, label %29, label %118
29: ; preds = %26
%30 = load float*, float** %6
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds float, float* %30, i64 %32
%34 = load float, float* %33
%35 = load float, float* %10
%36 = fadd float %35, %34
store float %36, float* %10
%37 = load float*, float** %6
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds float, float* %37, i64 %39
%41 = load float, float* %40
%42 = load float*, float** %6
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds float, float* %42, i64 %44
%46 = load float, float* %45
%47 = load float, float* %11
%48 = call float @llvm.fmuladd.f32(float %41, float %46, float %47)
store float %48, float* %11
%49 = load float*, float** %6
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds float, float* %49, i64 %51
%53 = load float, float* %52
%54 = load float*, float** %7
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds float, float* %54, i64 %56
%58 = load float, float* %57
%59 = load float, float* %12
%60 = call float @llvm.fmuladd.f32(float %53, float %58, float %59)
store float %60, float* %12
%61 = load float*, float** %7
%62 = load i32, i32* %3
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds float, float* %61, i64 %63
%65 = load float, float* %64
%66 = load float, float* %13
%67 = fadd float %66, %65
store float %67, float* %13
%68 = load float, float* %10
%69 = load i32, i32* %3
%70 = add nsw i32 %69, 1
%71 = sitofp i32 %70 to float
%72 = fdiv float %68, %71
store float %72, float* %14
%73 = load float, float* %13
%74 = load i32, i32* %3
%75 = add nsw i32 %74, 1
%76 = sitofp i32 %75 to float
%77 = fdiv float %73, %76
store float %77, float* %15
%78 = load i32, i32* %3
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %85
80: ; preds = %29
%81 = load float*, float** %9
%82 = load i32, i32* %3
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds float, float* %81, i64 %83
store float 0.000000e+00, float* %84
br label %101
85: ; preds = %29
%86 = load float, float* %12
%87 = load float, float* %10
%88 = load float, float* %15
%89 = fneg float %87
%90 = call float @llvm.fmuladd.f32(float %89, float %88, float %86)
%91 = load float, float* %11
%92 = load float, float* %10
%93 = load float, float* %14
%94 = fneg float %92
%95 = call float @llvm.fmuladd.f32(float %94, float %93, float %91)
%96 = fdiv float %90, %95
%97 = load float*, float** %9
%98 = load i32, i32* %3
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds float, float* %97, i64 %99
store float %96, float* %100
br label %101
101: ; preds = %85, %80
%102 = load float, float* %15
%103 = load float*, float** %9
%104 = load i32, i32* %3
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds float, float* %103, i64 %105
%107 = load float, float* %106
%108 = load float, float* %14
%109 = fneg float %107
%110 = call float @llvm.fmuladd.f32(float %109, float %108, float %102)
%111 = load float*, float** %8
%112 = load i32, i32* %3
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds float, float* %111, i64 %113
store float %110, float* %114
br label %115
115: ; preds = %101
%116 = load i32, i32* %3
%117 = add nsw i32 %116, 1
store i32 %117, i32* %3
br label %26
118: ; preds = %26
%119 = call double (...) @getTime()
%120 = load double, double* %4
%121 = fsub double %119, %120
store double %121, double* %5
store i32 0, i32* %3
br label %122
122: ; preds = %140, %118
%123 = load i32, i32* %3
%124 = icmp slt i32 %123, 16
br i1 %124, label %125, label %143
125: ; preds = %122
%126 = load i32, i32* %3
%127 = load float*, float** %8
%128 = load i32, i32* %3
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds float, float* %127, i64 %129
%131 = load float, float* %130
%132 = fpext float %131 to double
%133 = load float*, float** %9
%134 = load i32, i32* %3
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds float, float* %133, i64 %135
%137 = load float, float* %136
%138 = fpext float %137 to double
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %126, double %132, double %138)
br label %140
140: ; preds = %125
%141 = load i32, i32* %3
%142 = add nsw i32 %141, 1
store i32 %142, i32* %3
br label %122
143: ; preds = %122
%144 = load double, double* %5
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %144)
%146 = load float*, float** %6
%147 = call i32 @free(float* %146)
%148 = load float*, float** %7
%149 = call i32 @free(float* %148)
%150 = load float*, float** %8
%151 = call i32 @free(float* %150)
%152 = load float*, float** %9
%153 = call i32 @free(float* %152)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [31 x i8] c"regression[%d]: y = %f + %f x\0A\00"
@.str.3 = [20 x i8] c"compute time: %g s\0A\00"
@str = [25 x i8] c"Generating input data...\00"
@str.4 = [27 x i8] c"Computing on regression...\00"
define i32 @main() {
%1 = tail call float* @calloc(i32 16, i32 4)
%2 = tail call float* @calloc(i32 16, i32 4)
%3 = tail call float* @calloc(i32 16, i32 4)
%4 = tail call float* @calloc(i32 16, i32 4)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @data_gen(float* %1, float* %2, i32 16)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%8 = tail call double (...) @getTime()
%9 = load float, float* %1
%10 = fadd float %9, 0.000000e+00
%11 = load float, float* %2
%12 = insertelement <2 x float> poison, float %9, i64 0
%13 = shufflevector <2 x float> %12, <2 x float> poison, <2 x i32> zeroinitializer
%14 = insertelement <2 x float> poison, float %11, i64 0
%15 = insertelement <2 x float> %14, float %9, i64 1
%16 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %13, <2 x float> %15, <2 x float> zeroinitializer)
%17 = fadd float %11, 0.000000e+00
store float 0.000000e+00, float* %4
%18 = tail call float @llvm.fmuladd.f32(float %10, float -0.000000e+00, float %17)
store float %18, float* %3
br label %19
19: ; preds = %0, %19
%20 = phi i64 [ 1, %0 ], [ %35, %19 ]
%21 = phi float [ %17, %0 ], [ %34, %19 ]
%22 = phi float [ %10, %0 ], [ %26, %19 ]
%23 = phi <2 x float> [ %16, %0 ], [ %33, %19 ]
%24 = getelementptr inbounds float, float* %1, i64 %20
%25 = load float, float* %24
%26 = fadd float %22, %25
%27 = getelementptr inbounds float, float* %2, i64 %20
%28 = load float, float* %27
%29 = insertelement <2 x float> poison, float %25, i64 0
%30 = shufflevector <2 x float> %29, <2 x float> poison, <2 x i32> zeroinitializer
%31 = insertelement <2 x float> poison, float %28, i64 0
%32 = insertelement <2 x float> %31, float %25, i64 1
%33 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %30, <2 x float> %32, <2 x float> %23)
%34 = fadd float %21, %28
%35 = add nuw nsw i64 %20, 1
%36 = trunc i64 %35 to i32
%37 = sitofp i32 %36 to float
%38 = fdiv float %26, %37
%39 = fdiv float %34, %37
%40 = fneg float %26
%41 = extractelement <2 x float> %33, i64 0
%42 = tail call float @llvm.fmuladd.f32(float %40, float %39, float %41)
%43 = extractelement <2 x float> %33, i64 1
%44 = tail call float @llvm.fmuladd.f32(float %40, float %38, float %43)
%45 = fdiv float %42, %44
%46 = getelementptr inbounds float, float* %4, i64 %20
store float %45, float* %46
%47 = fneg float %45
%48 = tail call float @llvm.fmuladd.f32(float %47, float %38, float %39)
%49 = getelementptr inbounds float, float* %3, i64 %20
store float %48, float* %49
%50 = icmp eq i64 %35, 16
br i1 %50, label %51, label %19
51: ; preds = %19
%52 = tail call double (...) @getTime()
%53 = fpext float %18 to double
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 0, double %53, double 0.000000e+00)
%55 = getelementptr inbounds float, float* %3, i64 1
%56 = load float, float* %55
%57 = fpext float %56 to double
%58 = getelementptr inbounds float, float* %4, i64 1
%59 = load float, float* %58
%60 = fpext float %59 to double
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 1, double %57, double %60)
%62 = getelementptr inbounds float, float* %3, i64 2
%63 = load float, float* %62
%64 = fpext float %63 to double
%65 = getelementptr inbounds float, float* %4, i64 2
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 2, double %64, double %67)
%69 = getelementptr inbounds float, float* %3, i64 3
%70 = load float, float* %69
%71 = fpext float %70 to double
%72 = getelementptr inbounds float, float* %4, i64 3
%73 = load float, float* %72
%74 = fpext float %73 to double
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 3, double %71, double %74)
%76 = getelementptr inbounds float, float* %3, i64 4
%77 = load float, float* %76
%78 = fpext float %77 to double
%79 = getelementptr inbounds float, float* %4, i64 4
%80 = load float, float* %79
%81 = fpext float %80 to double
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 4, double %78, double %81)
%83 = getelementptr inbounds float, float* %3, i64 5
%84 = load float, float* %83
%85 = fpext float %84 to double
%86 = getelementptr inbounds float, float* %4, i64 5
%87 = load float, float* %86
%88 = fpext float %87 to double
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 5, double %85, double %88)
%90 = getelementptr inbounds float, float* %3, i64 6
%91 = load float, float* %90
%92 = fpext float %91 to double
%93 = getelementptr inbounds float, float* %4, i64 6
%94 = load float, float* %93
%95 = fpext float %94 to double
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 6, double %92, double %95)
%97 = getelementptr inbounds float, float* %3, i64 7
%98 = load float, float* %97
%99 = fpext float %98 to double
%100 = getelementptr inbounds float, float* %4, i64 7
%101 = load float, float* %100
%102 = fpext float %101 to double
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 7, double %99, double %102)
%104 = getelementptr inbounds float, float* %3, i64 8
%105 = load float, float* %104
%106 = fpext float %105 to double
%107 = getelementptr inbounds float, float* %4, i64 8
%108 = load float, float* %107
%109 = fpext float %108 to double
%110 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 8, double %106, double %109)
%111 = getelementptr inbounds float, float* %3, i64 9
%112 = load float, float* %111
%113 = fpext float %112 to double
%114 = getelementptr inbounds float, float* %4, i64 9
%115 = load float, float* %114
%116 = fpext float %115 to double
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 9, double %113, double %116)
%118 = getelementptr inbounds float, float* %3, i64 10
%119 = load float, float* %118
%120 = fpext float %119 to double
%121 = getelementptr inbounds float, float* %4, i64 10
%122 = load float, float* %121
%123 = fpext float %122 to double
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 10, double %120, double %123)
%125 = getelementptr inbounds float, float* %3, i64 11
%126 = load float, float* %125
%127 = fpext float %126 to double
%128 = getelementptr inbounds float, float* %4, i64 11
%129 = load float, float* %128
%130 = fpext float %129 to double
%131 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 11, double %127, double %130)
%132 = getelementptr inbounds float, float* %3, i64 12
%133 = load float, float* %132
%134 = fpext float %133 to double
%135 = getelementptr inbounds float, float* %4, i64 12
%136 = load float, float* %135
%137 = fpext float %136 to double
%138 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 12, double %134, double %137)
%139 = getelementptr inbounds float, float* %3, i64 13
%140 = load float, float* %139
%141 = fpext float %140 to double
%142 = getelementptr inbounds float, float* %4, i64 13
%143 = load float, float* %142
%144 = fpext float %143 to double
%145 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 13, double %141, double %144)
%146 = getelementptr inbounds float, float* %3, i64 14
%147 = load float, float* %146
%148 = fpext float %147 to double
%149 = getelementptr inbounds float, float* %4, i64 14
%150 = load float, float* %149
%151 = fpext float %150 to double
%152 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 14, double %148, double %151)
%153 = getelementptr inbounds float, float* %3, i64 15
%154 = load float, float* %153
%155 = fpext float %154 to double
%156 = getelementptr inbounds float, float* %4, i64 15
%157 = load float, float* %156
%158 = fpext float %157 to double
%159 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 15, double %155, double %158)
%160 = fsub double %52, %8
%161 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %160)
%162 = tail call i32 @free(float* %1)
%163 = tail call i32 @free(float* %2)
%164 = tail call i32 @free(float* %3)
%165 = tail call i32 @free(float* %4)
ret i32 0
}