void calctransform(double xp1[], double yp1[], double res[], int index1[],
                   int index2[], int npoint, double param[]) {
  double s01, s02, s03, s11, s12, s13, s22, s23, s33;
  double d;
  int i;
  if (npoint < 3) {
    return;
  }
  s01 = s02 = s03 = s11 = s12 = s13 = s22 = s23 = s33 = 0;
  for (i = 0; i < npoint; i++) {
    s01 += xp1[index1[i]] * res[index2[i]];
    s02 += yp1[index1[i]] * res[index2[i]];
    s03 += res[index2[i]];
    s11 += xp1[index1[i]] * xp1[index1[i]];
    s12 += xp1[index1[i]] * yp1[index1[i]];
    s13 += xp1[index1[i]];
    s22 += yp1[index1[i]] * yp1[index1[i]];
    s23 += yp1[index1[i]];
    s33++;
  }
  d = (s13 * s13 * s22 - 2 * s12 * s13 * s23 + s11 * s23 * s23 +
       s12 * s12 * s33 - s11 * s22 * s33);
  param[0] = ((s03 * s13 * s22 - s03 * s12 * s23 - s02 * s13 * s23 +
               s01 * s23 * s23 + s02 * s12 * s33 - s01 * s22 * s33) /
              d);
  param[1] = ((-s03 * s12 * s13 + s02 * s13 * s13 + s03 * s11 * s23 -
               s01 * s13 * s23 - s02 * s11 * s33 + s01 * s12 * s33) /
              d);
  param[2] = ((s03 * s12 * s12 - s02 * s12 * s13 - s03 * s11 * s22 +
               s01 * s13 * s22 + s02 * s11 * s23 - s01 * s12 * s23) /
              d);
}


x86 assembly (clang, -O0):
<calctransform>:
push   %rbp
mov    %rsp,%rbp
push   %rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1130 <calctransform+0x30>
jmp    168b <calctransform+0x58b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1367 <calctransform+0x267>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xcbf(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1182 <calctransform+0x82>
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  0xc82(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x80(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x80(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x80(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calctransform>:
cmp    $0x3,%r9d
jl     137b <calctransform+0x27b>
push   %rbx
mov    0x10(%rsp),%r10
mov    %r9d,%r9d
xorpd  %xmm5,%xmm5
xorpd  %xmm13,%xmm13
xor    %eax,%eax
movsd  0xeda(%rip),%xmm1
xorpd  %xmm2,%xmm2
xorpd  %xmm4,%xmm4
xorpd  %xmm14,%xmm14
xorpd  %xmm3,%xmm3
nopw   0x0(%rax,%rax,1)
movapd %xmm5,%xmm7
movslq (%rcx,%rax,4),%r11
movslq (%r8,%rax,4),%rbx
movsd  (%rdx,%rbx,8),%xmm5
movsd  (%rsi,%r11,8),%xmm8
movapd %xmm8,%xmm6
mulsd  %xmm5,%xmm6
addsd  %xmm6,%xmm4
addsd  %xmm5,%xmm2
movsd  (%rdi,%r11,8),%xmm6
unpcklpd %xmm6,%xmm5
movapd %xmm8,%xmm0
unpcklpd %xmm6,%xmm0
unpcklpd %xmm6,%xmm6
mulpd  %xmm6,%xmm5
addpd  %xmm5,%xmm3
unpcklpd %xmm8,%xmm8
mulpd  %xmm0,%xmm8
movapd %xmm8,%xmm5
addpd  %xmm7,%xmm5
addpd  %xmm0,%xmm14
addsd  %xmm1,%xmm13
add    $0x1,%rax
cmp    %rax,%r9
jne    1140 <calctransform+0x40>
addpd  %xmm7,%xmm8
movapd %xmm14,%xmm11
unpckhpd %xmm14,%xmm11
movapd %xmm11,%xmm0
mulsd  %xmm11,%xmm0
movapd %xmm8,%xmm7
unpckhpd %xmm8,%xmm7
movsd  0xe30(%rip),%xmm5
mulsd  %xmm7,%xmm5
mulsd  %xmm11,%xmm5
mulsd  %xmm14,%xmm5
mulsd  %xmm8,%xmm0
addsd  %xmm5,%xmm0
movapd %xmm3,%xmm9
unpckhpd %xmm3,%xmm9
movapd %xmm9,%xmm10
mulsd  %xmm14,%xmm10
mulsd  %xmm14,%xmm10
addsd  %xmm0,%xmm10
movapd %xmm2,%xmm0
mulsd  %xmm7,%xmm0
movapd %xmm0,%xmm12
movapd %xmm4,%xmm15
mulsd  %xmm7,%xmm15
mulsd  %xmm7,%xmm0
movapd %xmm0,-0x10(%rsp)
mulsd  %xmm7,%xmm7
mulsd  %xmm13,%xmm7
addsd  %xmm10,%xmm7
movapd %xmm8,%xmm0
mulsd  %xmm9,%xmm0
mulsd  %xmm13,%xmm0
subsd  %xmm0,%xmm7
movapd 0xdb9(%rip),%xmm0
xorpd  %xmm0,%xmm12
movapd %xmm4,%xmm6
mulsd  %xmm11,%xmm6
movapd %xmm2,%xmm10
xorpd  %xmm0,%xmm10
movapd %xmm14,%xmm5
shufpd $0x1,%xmm10,%xmm5
movapd %xmm8,%xmm1
movsd  %xmm2,%xmm1
mulpd  %xmm1,%xmm5
movapd %xmm14,%xmm1
movsd  %xmm8,%xmm1
mulpd  %xmm5,%xmm1
movapd %xmm14,%xmm5
mulpd  %xmm3,%xmm5
unpcklpd %xmm6,%xmm12
xorpd  %xmm0,%xmm6
mulpd  %xmm14,%xmm12
addpd  %xmm12,%xmm1
mulsd  %xmm9,%xmm2
unpcklpd %xmm2,%xmm6
movapd %xmm14,%xmm10
unpcklpd %xmm14,%xmm10
mulpd  %xmm10,%xmm6
addpd  %xmm1,%xmm6
movapd %xmm11,%xmm12
mulsd  %xmm3,%xmm12
movapd %xmm12,%xmm1
xorpd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm5
mulpd  %xmm10,%xmm5
addpd  %xmm6,%xmm5
mulsd  %xmm4,%xmm9
movapd %xmm3,%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm9,%xmm0
mulsd  %xmm15,%xmm11
unpcklpd %xmm0,%xmm15
unpcklpd %xmm13,%xmm13
mulpd  %xmm13,%xmm15
addpd  %xmm5,%xmm15
unpcklpd %xmm3,%xmm1
mulpd  %xmm8,%xmm1
mulpd  %xmm1,%xmm13
addpd  %xmm15,%xmm13
movapd -0x10(%rsp),%xmm0
subsd  %xmm11,%xmm0
mulsd  %xmm8,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm8,%xmm12
addsd  %xmm0,%xmm12
mulsd  %xmm14,%xmm9
addsd  %xmm12,%xmm9
unpckhpd %xmm1,%xmm1
mulsd  %xmm14,%xmm1
subsd  %xmm1,%xmm9
divsd  %xmm7,%xmm9
unpcklpd %xmm7,%xmm7
divpd  %xmm7,%xmm13
movupd %xmm13,(%r10)
movsd  %xmm9,0x10(%r10)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @calctransform(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32 %5, double* nocapture writeonly %6) {
%8 = icmp slt i32 %5, 3
br i1 %8, label %119, label %9
9: ; preds = %7
%10 = zext i32 %5 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %44, %11 ]
%13 = phi double [ 0.000000e+00, %9 ], [ %43, %11 ]
%14 = phi double [ 0.000000e+00, %9 ], [ %32, %11 ]
%15 = phi double [ 0.000000e+00, %9 ], [ %31, %11 ]
%16 = phi <2 x double> [ zeroinitializer, %9 ], [ %41, %11 ]
%17 = phi <2 x double> [ zeroinitializer, %9 ], [ %42, %11 ]
%18 = phi <2 x double> [ zeroinitializer, %9 ], [ %37, %11 ]
%19 = getelementptr inbounds i32, i32* %3, i64 %12
%20 = load i32, i32* %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %0, i64 %21
%23 = load double, double* %22
%24 = getelementptr inbounds i32, i32* %4, i64 %12
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %2, i64 %26
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %1, i64 %21
%30 = load double, double* %29
%31 = tail call double @llvm.fmuladd.f64(double %30, double %28, double %15)
%32 = fadd double %14, %28
%33 = insertelement <2 x double> poison, double %23, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = insertelement <2 x double> poison, double %28, i64 0
%36 = insertelement <2 x double> %35, double %23, i64 1
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %36, <2 x double> %18)
%38 = insertelement <2 x double> poison, double %30, i64 0
%39 = insertelement <2 x double> %38, double %23, i64 1
%40 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
%41 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %39, <2 x double> %40, <2 x double> %16)
%42 = fadd <2 x double> %17, %39
%43 = fadd double %13, 1.000000e+00
%44 = add nuw nsw i64 %12, 1
%45 = icmp eq i64 %44, %10
br i1 %45, label %46, label %11
46: ; preds = %11
%47 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %39, <2 x double> %40, <2 x double> %16)
%48 = extractelement <2 x double> %42, i64 1
%49 = fmul double %48, %48
%50 = extractelement <2 x double> %47, i64 1
%51 = fmul double %50, -2.000000e+00
%52 = fmul double %51, %48
%53 = extractelement <2 x double> %42, i64 0
%54 = fmul double %52, %53
%55 = extractelement <2 x double> %47, i64 0
%56 = tail call double @llvm.fmuladd.f64(double %49, double %55, double %54)
%57 = extractelement <2 x double> %37, i64 1
%58 = fmul double %57, %53
%59 = tail call double @llvm.fmuladd.f64(double %58, double %53, double %56)
%60 = fmul double %50, %50
%61 = tail call double @llvm.fmuladd.f64(double %60, double %43, double %59)
%62 = fneg double %57
%63 = fmul double %55, %62
%64 = tail call double @llvm.fmuladd.f64(double %63, double %43, double %61)
%65 = fmul double %32, %50
%66 = fneg double %65
%67 = fmul double %31, %48
%68 = fneg double %67
%69 = extractelement <2 x double> %37, i64 0
%70 = fmul <2 x double> %42, %37
%71 = fmul double %31, %50
%72 = fneg double %69
%73 = fneg double %32
%74 = insertelement <2 x double> %47, double %32, i64 0
%75 = insertelement <2 x double> poison, double %48, i64 0
%76 = insertelement <2 x double> %75, double %73, i64 1
%77 = fmul <2 x double> %74, %76
%78 = insertelement <2 x double> poison, double %66, i64 0
%79 = insertelement <2 x double> %78, double %67, i64 1
%80 = fmul <2 x double> %42, %79
%81 = shufflevector <2 x double> %47, <2 x double> %42, <2 x i32> <i32 0, i32 3>
%82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %77, <2 x double> %81, <2 x double> %80)
%83 = fmul double %32, %57
%84 = insertelement <2 x double> poison, double %68, i64 0
%85 = insertelement <2 x double> %84, double %83, i64 1
%86 = shufflevector <2 x double> %42, <2 x double> undef, <2 x i32> zeroinitializer
%87 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %85, <2 x double> %86, <2 x double> %82)
%88 = fmul double %48, %69
%89 = fneg double %88
%90 = insertelement <2 x double> %70, double %89, i64 1
%91 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %90, <2 x double> %86, <2 x double> %87)
%92 = fmul double %31, %57
%93 = fneg double %92
%94 = insertelement <2 x double> poison, double %71, i64 0
%95 = insertelement <2 x double> %94, double %93, i64 1
%96 = insertelement <2 x double> poison, double %43, i64 0
%97 = shufflevector <2 x double> %96, <2 x double> poison, <2 x i32> zeroinitializer
%98 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %95, <2 x double> %97, <2 x double> %91)
%99 = insertelement <2 x double> poison, double %72, i64 0
%100 = shufflevector <2 x double> %99, <2 x double> %37, <2 x i32> <i32 0, i32 2>
%101 = fmul <2 x double> %47, %100
%102 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %101, <2 x double> %97, <2 x double> %98)
%103 = insertelement <2 x double> poison, double %64, i64 0
%104 = shufflevector <2 x double> %103, <2 x double> poison, <2 x i32> zeroinitializer
%105 = fdiv <2 x double> %102, %104
%106 = bitcast double* %6 to <2 x double>*
store <2 x double> %105, <2 x double>* %106
%107 = fneg double %71
%108 = fmul double %48, %107
%109 = tail call double @llvm.fmuladd.f64(double %65, double %50, double %108)
%110 = fneg double %83
%111 = tail call double @llvm.fmuladd.f64(double %110, double %55, double %109)
%112 = tail call double @llvm.fmuladd.f64(double %88, double %55, double %111)
%113 = tail call double @llvm.fmuladd.f64(double %92, double %53, double %112)
%114 = extractelement <2 x double> %101, i64 1
%115 = fneg double %114
%116 = tail call double @llvm.fmuladd.f64(double %115, double %53, double %113)
%117 = fdiv double %116, %64
%118 = getelementptr inbounds double, double* %6, i64 2
store double %117, double* %118
br label %119
119: ; preds = %7, %46
ret void
}