#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*/ ave_dmatrix(double **, long, int, double *);
int /*<<< orphan*/ cov_matrix(double **, double **, long, int, double **);
double **dmatrix(int, int, int, int);
double dot(double *, double *);
int /*<<< orphan*/ free_dmatrix(double **, int, int, int, int);
int /*<<< orphan*/ jacobi(double **, int, double *, double **);
int /*<<< orphan*/ nrerror(char *);
double sqrt(double);
void ls_fitting(double **sxyz, double **exyz, long n, double *rms_value,
                double **fitted_xyz, double **R, double *orgi) {
  double temp;
  double ave_exyz[4], ave_sxyz[4], D[5];
  double **N, **U, **V;
  long i, j;
  if (n < 3)
    nrerror("too few atoms for least-squares fitting");
  U = dmatrix(1, 3, 1, 3);
  cov_matrix(sxyz, exyz, n, 3, U);
  N = dmatrix(1, 4, 1, 4);
  N[1][1] = U[1][1] + U[2][2] + U[3][3];
  N[2][2] = U[1][1] - U[2][2] - U[3][3];
  N[3][3] = -U[1][1] + U[2][2] - U[3][3];
  N[4][4] = -U[1][1] - U[2][2] + U[3][3];
  N[1][2] = U[2][3] - U[3][2];
  N[2][1] = N[1][2];
  N[1][3] = U[3][1] - U[1][3];
  N[3][1] = N[1][3];
  N[1][4] = U[1][2] - U[2][1];
  N[4][1] = N[1][4];
  N[2][3] = U[1][2] + U[2][1];
  N[3][2] = N[2][3];
  N[2][4] = U[3][1] + U[1][3];
  N[4][2] = N[2][4];
  N[3][4] = U[2][3] + U[3][2];
  N[4][3] = N[3][4];
  V = dmatrix(1, 4, 1, 4);
  jacobi(N, 4, D, V);
  for (i = 1; i <= 4; i++)
    for (j = 1; j <= 4; j++)
      N[i][j] = V[i][4] * V[j][4];
  R[1][1] = N[1][1] + N[2][2] - N[3][3] - N[4][4];
  R[1][2] = 2 * (N[2][3] - N[1][4]);
  R[1][3] = 2 * (N[2][4] + N[1][3]);
  R[2][1] = 2 * (N[3][2] + N[1][4]);
  R[2][2] = N[1][1] - N[2][2] + N[3][3] - N[4][4];
  R[2][3] = 2 * (N[3][4] - N[1][2]);
  R[3][1] = 2 * (N[4][2] - N[1][3]);
  R[3][2] = 2 * (N[4][3] + N[1][2]);
  R[3][3] = N[1][1] - N[2][2] - N[3][3] + N[4][4];
  ave_dmatrix(sxyz, n, 3, ave_sxyz);
  ave_dmatrix(exyz, n, 3, ave_exyz);
  for (i = 1; i <= 3; i++)
    orgi[i] = ave_exyz[i] - dot(ave_sxyz, R[i]);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= 3; j++)
      fitted_xyz[i][j] = dot(sxyz[i], R[j]) + orgi[j];
  temp = 0.0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= 3; j++)
      D[j] = exyz[i][j] - fitted_xyz[i][j];
    temp += dot(D, D);
  }
  *rms_value = sqrt(temp / n);
  free_dmatrix(U, 1, 3, 1, 3);
  free_dmatrix(N, 1, 4, 1, 4);
  free_dmatrix(V, 1, 4, 1, 4);
}


x86 assembly (clang, -O0):
<ls_fitting>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
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    %r9,-0x30(%rbp)
cmpq   $0x3,-0x18(%rbp)
jge    11be <ls_fitting+0x3e>
lea    0xe4f(%rip),%rdi
call   1050 <nrerror@plt>
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1070 <dmatrix@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0xc0(%rbp),%r8
mov    $0x3,%ecx
call   1060 <cov_matrix@plt>
mov    $0x1,%edx
mov    $0x4,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1070 <dmatrix@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
addsd  0x10(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
addsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
subsd  0x10(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
subsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
addsd  0x10(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
subsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
subsd  0x10(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
addsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x18(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
subsd  0x10(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
subsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
subsd  0x8(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x20(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
addsd  0x8(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
addsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x20(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x18(%rax),%xmm0
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
addsd  0x10(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  0x20(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    $0x1,%edx
mov    $0x4,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1070 <dmatrix@plt>
mov    %rax,-0xc8(%rbp)
mov    -0xb8(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
mov    -0xc8(%rbp),%rcx
mov    $0x4,%esi
call   1040 <jacobi@plt>
movq   $0x1,-0xd0(%rbp)
cmpq   $0x4,-0xd0(%rbp)
04
jg     1607 <ls_fitting+0x487>
movq   $0x1,-0xd8(%rbp)
cmpq   $0x4,-0xd8(%rbp)
04
jg     15eb <ls_fitting+0x46b>
mov    -0xc8(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x20(%rax),%xmm0
mov    -0xc8(%rbp),%rax
mov    -0xd8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mulsd  0x20(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd8(%rbp)
jmp    157a <ls_fitting+0x3fa>
jmp    15f0 <ls_fitting+0x470>
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    1561 <ls_fitting+0x3e1>
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
addsd  0x10(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
subsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
subsd  0x20(%rax),%xmm0
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x18(%rax),%xmm1
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
subsd  0x20(%rax),%xmm1
movsd  0x984(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x20(%rax),%xmm1
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
addsd  0x18(%rax),%xmm1
movsd  0x94b(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  0x10(%rax),%xmm1
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
addsd  0x20(%rax),%xmm1
movsd  0x912(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
subsd  0x10(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
addsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
subsd  0x20(%rax),%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  0x20(%rax),%xmm1
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
subsd  0x10(%rax),%xmm1
movsd  0x88c(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  0x10(%rax),%xmm1
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
subsd  0x18(%rax),%xmm1
movsd  0x853(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  0x18(%rax),%xmm1
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
addsd  0x10(%rax),%xmm1
movsd  0x81a(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0xb8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x10(%rax),%rax
subsd  0x10(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x18(%rax),%rax
subsd  0x18(%rax),%xmm0
mov    -0xb8(%rbp),%rax
mov    0x20(%rax),%rax
addsd  0x20(%rax),%xmm0
mov    -0x30(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x80(%rbp),%rcx
mov    $0x3,%edx
call   10a0 <ave_dmatrix@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x60(%rbp),%rcx
mov    $0x3,%edx
call   10a0 <ave_dmatrix@plt>
movq   $0x1,-0xd0(%rbp)
cmpq   $0x3,-0xd0(%rbp)
03
jg     18ec <ls_fitting+0x76c>
mov    -0xd0(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
lea    -0x80(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <dot@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
mov    -0xd0(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    187b <ls_fitting+0x6fb>
movq   $0x1,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     19a2 <ls_fitting+0x822>
movq   $0x1,-0xd8(%rbp)
cmpq   $0x3,-0xd8(%rbp)
03
jg     1986 <ls_fitting+0x806>
mov    -0x8(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x30(%rbp),%rax
mov    -0xd8(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <dot@plt>
mov    0x10(%rbp),%rax
mov    -0xd8(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd8(%rbp)
jmp    1913 <ls_fitting+0x793>
jmp    198b <ls_fitting+0x80b>
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    18f7 <ls_fitting+0x777>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movq   $0x1,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1a70 <ls_fitting+0x8f0>
movq   $0x1,-0xd8(%rbp)
cmpq   $0x3,-0xd8(%rbp)
03
jg     1a3c <ls_fitting+0x8bc>
mov    -0x10(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd8(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0xd8(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0xd8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd8(%rbp)
jmp    19d1 <ls_fitting+0x851>
lea    -0xb0(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1030 <dot@plt>
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    19b5 <ls_fitting+0x835>
movsd  -0x38(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1080 <free_dmatrix@plt>
mov    -0xb8(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x4,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1080 <free_dmatrix@plt>
mov    -0xc8(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x4,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1080 <free_dmatrix@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_fitting>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r9,%r14
mov    %r8,%r13
mov    %rcx,0x28(%rsp)
mov    %rdx,%r12
mov    %rsi,0x8(%rsp)
mov    %rdi,%r15
cmp    $0x2,%rdx
jg     11b9 <ls_fitting+0x39>
lea    0xe64(%rip),%rdi
call   1050 <nrerror@plt>
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1070 <dmatrix@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    0x8(%rsp),%rsi
mov    %r12,%rdx
mov    $0x3,%ecx
mov    %rax,%r8
call   1060 <cov_matrix@plt>
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1070 <dmatrix@plt>
mov    0x8(%rbp),%rdx
mov    0x10(%rbp),%rcx
movsd  0x8(%rdx),%xmm0
addsd  0x10(%rcx),%xmm0
mov    %rbp,0x20(%rsp)
mov    0x18(%rbp),%rsi
addsd  0x18(%rsi),%xmm0
mov    0x8(%rax),%rbp
movsd  %xmm0,0x8(%rbp)
movsd  0x8(%rdx),%xmm0
subsd  0x10(%rcx),%xmm0
subsd  0x18(%rsi),%xmm0
mov    0x10(%rax),%r8
movsd  %xmm0,0x10(%r8)
movsd  0x10(%rcx),%xmm0
subsd  0x8(%rdx),%xmm0
subsd  0x18(%rsi),%xmm0
mov    0x18(%rax),%rdi
mov    %rax,0x10(%rsp)
movsd  %xmm0,0x18(%rdi)
movsd  0x8(%rdx),%xmm0
xorpd  0xd8e(%rip),%xmm0
subsd  0x10(%rcx),%xmm0
addsd  0x18(%rsi),%xmm0
mov    0x20(%rax),%rax
movsd  %xmm0,0x20(%rax)
movsd  0x18(%rcx),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rbp)
movsd  %xmm0,0x8(%r8)
movsd  0x8(%rsi),%xmm0
subsd  0x18(%rdx),%xmm0
movsd  %xmm0,0x18(%rbp)
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rdx),%xmm0
subsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x20(%rbp)
movsd  %xmm0,0x8(%rax)
movsd  0x10(%rdx),%xmm0
addsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x18(%r8)
movsd  %xmm0,0x10(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x18(%rdx),%xmm0
movsd  %xmm0,0x20(%r8)
movsd  %xmm0,0x10(%rax)
movsd  0x18(%rcx),%xmm0
addsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x20(%rdi)
movsd  %xmm0,0x18(%rax)
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1070 <dmatrix@plt>
mov    %rax,%rbx
lea    0x50(%rsp),%rdx
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x4,%esi
mov    %rax,%rcx
call   1040 <jacobi@plt>
mov    0x8(%rbx),%rdi
mov    0x8(%rbp),%rax
mov    %rbp,%rsi
movsd  0x20(%rdi),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  0x20(%rdi),%xmm0
mov    0x10(%rbx),%rbp
mulsd  0x20(%rbp),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  0x20(%rdi),%xmm0
mov    0x18(%rbx),%rcx
mulsd  0x20(%rcx),%xmm0
movsd  %xmm0,0x18(%rax)
movsd  0x20(%rdi),%xmm0
mov    %rbx,0x18(%rsp)
mov    0x20(%rbx),%rdx
mulsd  0x20(%rdx),%xmm0
movsd  %xmm0,0x20(%rax)
mov    0x10(%rsi),%r8
movsd  0x20(%rbp),%xmm0
mulsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x8(%r8)
movsd  0x20(%rbp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%r8)
movsd  0x20(%rbp),%xmm0
mulsd  0x20(%rcx),%xmm0
movsd  %xmm0,0x18(%r8)
movsd  0x20(%rbp),%xmm0
mulsd  0x20(%rdx),%xmm0
movsd  %xmm0,0x20(%r8)
mov    0x18(%rsi),%r9
movsd  0x20(%rcx),%xmm0
mulsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x8(%r9)
movsd  0x20(%rcx),%xmm0
mulsd  0x20(%rbp),%xmm0
movsd  %xmm0,0x10(%r9)
movsd  0x20(%rcx),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%r9)
movsd  0x20(%rcx),%xmm0
mulsd  0x20(%rdx),%xmm0
movsd  %xmm0,0x20(%r9)
mov    0x20(%rsi),%rsi
movsd  0x20(%rdx),%xmm0
mulsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x20(%rdx),%xmm0
mulsd  0x20(%rbp),%xmm0
movsd  %xmm0,0x10(%rsi)
movsd  0x20(%rdx),%xmm0
mulsd  0x20(%rcx),%xmm0
movsd  %xmm0,0x18(%rsi)
movsd  0x20(%rdx),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x20(%rsi)
movsd  0x8(%rax),%xmm1
addsd  0x10(%r8),%xmm1
subsd  0x18(%r9),%xmm1
subsd  %xmm0,%xmm1
mov    0x8(%r14),%rcx
movsd  %xmm1,0x8(%rcx)
movsd  0x18(%r8),%xmm0
subsd  0x20(%rax),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x20(%r8),%xmm0
addsd  0x18(%rax),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rcx)
movsd  0x10(%r9),%xmm0
addsd  0x20(%rax),%xmm0
addsd  %xmm0,%xmm0
mov    0x10(%r14),%rcx
movsd  %xmm0,0x8(%rcx)
movsd  0x8(%rax),%xmm0
subsd  0x10(%r8),%xmm0
addsd  0x18(%r9),%xmm0
subsd  0x20(%rsi),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x20(%r9),%xmm0
subsd  0x10(%rax),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rcx)
movsd  0x10(%rsi),%xmm0
subsd  0x18(%rax),%xmm0
addsd  %xmm0,%xmm0
mov    0x18(%r14),%rcx
movsd  %xmm0,0x8(%rcx)
movsd  0x18(%rsi),%xmm0
addsd  0x10(%rax),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x8(%rax),%xmm0
subsd  0x10(%r8),%xmm0
subsd  0x18(%r9),%xmm0
addsd  0x20(%rsi),%xmm0
movsd  %xmm0,0x18(%rcx)
lea    0x80(%rsp),%rbp
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x3,%edx
mov    %rbp,%rcx
call   10a0 <ave_dmatrix@plt>
lea    0x30(%rsp),%rcx
mov    0x8(%rsp),%rdi
mov    %r12,%rsi
mov    $0x3,%edx
call   10a0 <ave_dmatrix@plt>
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x8(%r14),%rsi
mov    %rbp,%rdi
call   1030 <dot@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    0xe0(%rsp),%rbx
movsd  %xmm1,0x8(%rbx)
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x10(%r14),%rsi
mov    %rbp,%rdi
call   1030 <dot@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx)
movsd  0x48(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x18(%r14),%rsi
mov    %rbp,%rdi
call   1030 <dot@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rbx)
xorpd  %xmm1,%xmm1
test   %r12,%r12
jle    16b0 <ls_fitting+0x530>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x8(%r15,%rbp,8),%rdi
mov    0x8(%r14),%rsi
call   1030 <dot@plt>
addsd  0x8(%rbx),%xmm0
mov    0x8(%r13,%rbp,8),%rax
movsd  %xmm0,0x8(%rax)
mov    0x8(%r15,%rbp,8),%rdi
mov    0x10(%r14),%rsi
call   1030 <dot@plt>
addsd  0x10(%rbx),%xmm0
mov    0x8(%r13,%rbp,8),%rax
movsd  %xmm0,0x10(%rax)
mov    0x8(%r15,%rbp,8),%rdi
mov    0x18(%r14),%rsi
call   1030 <dot@plt>
addsd  0x18(%rbx),%xmm0
mov    0x8(%r13,%rbp,8),%rax
movsd  %xmm0,0x18(%rax)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    15e0 <ls_fitting+0x460>
xorpd  %xmm1,%xmm1
test   %r12,%r12
mov    0x8(%rsp),%r14
jle    16b0 <ls_fitting+0x530>
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
lea    0x50(%rsp),%rbp
nopl   0x0(%rax)
movsd  %xmm1,(%rsp)
mov    0x8(%r14,%rbx,8),%rax
mov    0x8(%r13,%rbx,8),%rcx
movupd 0x8(%rax),%xmm0
movupd 0x8(%rcx),%xmm1
subpd  %xmm1,%xmm0
movupd %xmm0,0x58(%rsp)
movsd  0x18(%rax),%xmm0
subsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x68(%rsp)
mov    %rbp,%rdi
mov    %rbp,%rsi
call   1030 <dot@plt>
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1660 <ls_fitting+0x4e0>
xorps  %xmm0,%xmm0
cvtsi2sd %r12,%xmm0
divsd  %xmm0,%xmm1
ucomisd 0x94c(%rip),%xmm1
jb     16cf <ls_fitting+0x54f>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    16d8 <ls_fitting+0x558>
movapd %xmm1,%xmm0
call   1090 <sqrt@plt>
mov    0x28(%rsp),%rax
movsd  %xmm0,(%rax)
mov    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1080 <free_dmatrix@plt>
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1080 <free_dmatrix@plt>
mov    0x18(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1080 <free_dmatrix@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"too few atoms for least-squares fitting\00"
define void @ls_fitting(double** %0, double** %1, i64 %2, double* %3, double** %4, double** %5, double* %6) {
%8 = alloca double**
%9 = alloca double**
%10 = alloca i64
%11 = alloca double*
%12 = alloca double**
%13 = alloca double**
%14 = alloca double*
%15 = alloca double
%16 = alloca [4 x double]
%17 = alloca [4 x double]
%18 = alloca [5 x double]
%19 = alloca double**
%20 = alloca double**
%21 = alloca double**
%22 = alloca i64
%23 = alloca i64
store double** %0, double*** %8
store double** %1, double*** %9
store i64 %2, i64* %10
store double* %3, double** %11
store double** %4, double*** %12
store double** %5, double*** %13
store double* %6, double** %14
%24 = load i64, i64* %10
%25 = icmp slt i64 %24, 3
br i1 %25, label %26, label %28
26: ; preds = %7
%27 = call i32 @nrerror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %7
%29 = call double** @dmatrix(i32 1, i32 3, i32 1, i32 3)
store double** %29, double*** %20
%30 = load double**, double*** %8
%31 = load double**, double*** %9
%32 = load i64, i64* %10
%33 = load double**, double*** %20
%34 = call i32 @cov_matrix(double** %30, double** %31, i64 %32, i32 3, double** %33)
%35 = call double** @dmatrix(i32 1, i32 4, i32 1, i32 4)
store double** %35, double*** %19
%36 = load double**, double*** %20
%37 = getelementptr inbounds double*, double** %36, i64 1
%38 = load double*, double** %37
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
%41 = load double**, double*** %20
%42 = getelementptr inbounds double*, double** %41, i64 2
%43 = load double*, double** %42
%44 = getelementptr inbounds double, double* %43, i64 2
%45 = load double, double* %44
%46 = fadd double %40, %45
%47 = load double**, double*** %20
%48 = getelementptr inbounds double*, double** %47, i64 3
%49 = load double*, double** %48
%50 = getelementptr inbounds double, double* %49, i64 3
%51 = load double, double* %50
%52 = fadd double %46, %51
%53 = load double**, double*** %19
%54 = getelementptr inbounds double*, double** %53, i64 1
%55 = load double*, double** %54
%56 = getelementptr inbounds double, double* %55, i64 1
store double %52, double* %56
%57 = load double**, double*** %20
%58 = getelementptr inbounds double*, double** %57, i64 1
%59 = load double*, double** %58
%60 = getelementptr inbounds double, double* %59, i64 1
%61 = load double, double* %60
%62 = load double**, double*** %20
%63 = getelementptr inbounds double*, double** %62, i64 2
%64 = load double*, double** %63
%65 = getelementptr inbounds double, double* %64, i64 2
%66 = load double, double* %65
%67 = fsub double %61, %66
%68 = load double**, double*** %20
%69 = getelementptr inbounds double*, double** %68, i64 3
%70 = load double*, double** %69
%71 = getelementptr inbounds double, double* %70, i64 3
%72 = load double, double* %71
%73 = fsub double %67, %72
%74 = load double**, double*** %19
%75 = getelementptr inbounds double*, double** %74, i64 2
%76 = load double*, double** %75
%77 = getelementptr inbounds double, double* %76, i64 2
store double %73, double* %77
%78 = load double**, double*** %20
%79 = getelementptr inbounds double*, double** %78, i64 1
%80 = load double*, double** %79
%81 = getelementptr inbounds double, double* %80, i64 1
%82 = load double, double* %81
%83 = fneg double %82
%84 = load double**, double*** %20
%85 = getelementptr inbounds double*, double** %84, i64 2
%86 = load double*, double** %85
%87 = getelementptr inbounds double, double* %86, i64 2
%88 = load double, double* %87
%89 = fadd double %83, %88
%90 = load double**, double*** %20
%91 = getelementptr inbounds double*, double** %90, i64 3
%92 = load double*, double** %91
%93 = getelementptr inbounds double, double* %92, i64 3
%94 = load double, double* %93
%95 = fsub double %89, %94
%96 = load double**, double*** %19
%97 = getelementptr inbounds double*, double** %96, i64 3
%98 = load double*, double** %97
%99 = getelementptr inbounds double, double* %98, i64 3
store double %95, double* %99
%100 = load double**, double*** %20
%101 = getelementptr inbounds double*, double** %100, i64 1
%102 = load double*, double** %101
%103 = getelementptr inbounds double, double* %102, i64 1
%104 = load double, double* %103
%105 = fneg double %104
%106 = load double**, double*** %20
%107 = getelementptr inbounds double*, double** %106, i64 2
%108 = load double*, double** %107
%109 = getelementptr inbounds double, double* %108, i64 2
%110 = load double, double* %109
%111 = fsub double %105, %110
%112 = load double**, double*** %20
%113 = getelementptr inbounds double*, double** %112, i64 3
%114 = load double*, double** %113
%115 = getelementptr inbounds double, double* %114, i64 3
%116 = load double, double* %115
%117 = fadd double %111, %116
%118 = load double**, double*** %19
%119 = getelementptr inbounds double*, double** %118, i64 4
%120 = load double*, double** %119
%121 = getelementptr inbounds double, double* %120, i64 4
store double %117, double* %121
%122 = load double**, double*** %20
%123 = getelementptr inbounds double*, double** %122, i64 2
%124 = load double*, double** %123
%125 = getelementptr inbounds double, double* %124, i64 3
%126 = load double, double* %125
%127 = load double**, double*** %20
%128 = getelementptr inbounds double*, double** %127, i64 3
%129 = load double*, double** %128
%130 = getelementptr inbounds double, double* %129, i64 2
%131 = load double, double* %130
%132 = fsub double %126, %131
%133 = load double**, double*** %19
%134 = getelementptr inbounds double*, double** %133, i64 1
%135 = load double*, double** %134
%136 = getelementptr inbounds double, double* %135, i64 2
store double %132, double* %136
%137 = load double**, double*** %19
%138 = getelementptr inbounds double*, double** %137, i64 1
%139 = load double*, double** %138
%140 = getelementptr inbounds double, double* %139, i64 2
%141 = load double, double* %140
%142 = load double**, double*** %19
%143 = getelementptr inbounds double*, double** %142, i64 2
%144 = load double*, double** %143
%145 = getelementptr inbounds double, double* %144, i64 1
store double %141, double* %145
%146 = load double**, double*** %20
%147 = getelementptr inbounds double*, double** %146, i64 3
%148 = load double*, double** %147
%149 = getelementptr inbounds double, double* %148, i64 1
%150 = load double, double* %149
%151 = load double**, double*** %20
%152 = getelementptr inbounds double*, double** %151, i64 1
%153 = load double*, double** %152
%154 = getelementptr inbounds double, double* %153, i64 3
%155 = load double, double* %154
%156 = fsub double %150, %155
%157 = load double**, double*** %19
%158 = getelementptr inbounds double*, double** %157, i64 1
%159 = load double*, double** %158
%160 = getelementptr inbounds double, double* %159, i64 3
store double %156, double* %160
%161 = load double**, double*** %19
%162 = getelementptr inbounds double*, double** %161, i64 1
%163 = load double*, double** %162
%164 = getelementptr inbounds double, double* %163, i64 3
%165 = load double, double* %164
%166 = load double**, double*** %19
%167 = getelementptr inbounds double*, double** %166, i64 3
%168 = load double*, double** %167
%169 = getelementptr inbounds double, double* %168, i64 1
store double %165, double* %169
%170 = load double**, double*** %20
%171 = getelementptr inbounds double*, double** %170, i64 1
%172 = load double*, double** %171
%173 = getelementptr inbounds double, double* %172, i64 2
%174 = load double, double* %173
%175 = load double**, double*** %20
%176 = getelementptr inbounds double*, double** %175, i64 2
%177 = load double*, double** %176
%178 = getelementptr inbounds double, double* %177, i64 1
%179 = load double, double* %178
%180 = fsub double %174, %179
%181 = load double**, double*** %19
%182 = getelementptr inbounds double*, double** %181, i64 1
%183 = load double*, double** %182
%184 = getelementptr inbounds double, double* %183, i64 4
store double %180, double* %184
%185 = load double**, double*** %19
%186 = getelementptr inbounds double*, double** %185, i64 1
%187 = load double*, double** %186
%188 = getelementptr inbounds double, double* %187, i64 4
%189 = load double, double* %188
%190 = load double**, double*** %19
%191 = getelementptr inbounds double*, double** %190, i64 4
%192 = load double*, double** %191
%193 = getelementptr inbounds double, double* %192, i64 1
store double %189, double* %193
%194 = load double**, double*** %20
%195 = getelementptr inbounds double*, double** %194, i64 1
%196 = load double*, double** %195
%197 = getelementptr inbounds double, double* %196, i64 2
%198 = load double, double* %197
%199 = load double**, double*** %20
%200 = getelementptr inbounds double*, double** %199, i64 2
%201 = load double*, double** %200
%202 = getelementptr inbounds double, double* %201, i64 1
%203 = load double, double* %202
%204 = fadd double %198, %203
%205 = load double**, double*** %19
%206 = getelementptr inbounds double*, double** %205, i64 2
%207 = load double*, double** %206
%208 = getelementptr inbounds double, double* %207, i64 3
store double %204, double* %208
%209 = load double**, double*** %19
%210 = getelementptr inbounds double*, double** %209, i64 2
%211 = load double*, double** %210
%212 = getelementptr inbounds double, double* %211, i64 3
%213 = load double, double* %212
%214 = load double**, double*** %19
%215 = getelementptr inbounds double*, double** %214, i64 3
%216 = load double*, double** %215
%217 = getelementptr inbounds double, double* %216, i64 2
store double %213, double* %217
%218 = load double**, double*** %20
%219 = getelementptr inbounds double*, double** %218, i64 3
%220 = load double*, double** %219
%221 = getelementptr inbounds double, double* %220, i64 1
%222 = load double, double* %221
%223 = load double**, double*** %20
%224 = getelementptr inbounds double*, double** %223, i64 1
%225 = load double*, double** %224
%226 = getelementptr inbounds double, double* %225, i64 3
%227 = load double, double* %226
%228 = fadd double %222, %227
%229 = load double**, double*** %19
%230 = getelementptr inbounds double*, double** %229, i64 2
%231 = load double*, double** %230
%232 = getelementptr inbounds double, double* %231, i64 4
store double %228, double* %232
%233 = load double**, double*** %19
%234 = getelementptr inbounds double*, double** %233, i64 2
%235 = load double*, double** %234
%236 = getelementptr inbounds double, double* %235, i64 4
%237 = load double, double* %236
%238 = load double**, double*** %19
%239 = getelementptr inbounds double*, double** %238, i64 4
%240 = load double*, double** %239
%241 = getelementptr inbounds double, double* %240, i64 2
store double %237, double* %241
%242 = load double**, double*** %20
%243 = getelementptr inbounds double*, double** %242, i64 2
%244 = load double*, double** %243
%245 = getelementptr inbounds double, double* %244, i64 3
%246 = load double, double* %245
%247 = load double**, double*** %20
%248 = getelementptr inbounds double*, double** %247, i64 3
%249 = load double*, double** %248
%250 = getelementptr inbounds double, double* %249, i64 2
%251 = load double, double* %250
%252 = fadd double %246, %251
%253 = load double**, double*** %19
%254 = getelementptr inbounds double*, double** %253, i64 3
%255 = load double*, double** %254
%256 = getelementptr inbounds double, double* %255, i64 4
store double %252, double* %256
%257 = load double**, double*** %19
%258 = getelementptr inbounds double*, double** %257, i64 3
%259 = load double*, double** %258
%260 = getelementptr inbounds double, double* %259, i64 4
%261 = load double, double* %260
%262 = load double**, double*** %19
%263 = getelementptr inbounds double*, double** %262, i64 4
%264 = load double*, double** %263
%265 = getelementptr inbounds double, double* %264, i64 3
store double %261, double* %265
%266 = call double** @dmatrix(i32 1, i32 4, i32 1, i32 4)
store double** %266, double*** %21
%267 = load double**, double*** %19
%268 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 0
%269 = load double**, double*** %21
%270 = call i32 @jacobi(double** %267, i32 4, double* %268, double** %269)
store i64 1, i64* %22
br label %271
271: ; preds = %302, %28
%272 = load i64, i64* %22
%273 = icmp sle i64 %272, 4
br i1 %273, label %274, label %305
274: ; preds = %271
store i64 1, i64* %23
br label %275
275: ; preds = %298, %274
%276 = load i64, i64* %23
%277 = icmp sle i64 %276, 4
br i1 %277, label %278, label %301
278: ; preds = %275
%279 = load double**, double*** %21
%280 = load i64, i64* %22
%281 = getelementptr inbounds double*, double** %279, i64 %280
%282 = load double*, double** %281
%283 = getelementptr inbounds double, double* %282, i64 4
%284 = load double, double* %283
%285 = load double**, double*** %21
%286 = load i64, i64* %23
%287 = getelementptr inbounds double*, double** %285, i64 %286
%288 = load double*, double** %287
%289 = getelementptr inbounds double, double* %288, i64 4
%290 = load double, double* %289
%291 = fmul double %284, %290
%292 = load double**, double*** %19
%293 = load i64, i64* %22
%294 = getelementptr inbounds double*, double** %292, i64 %293
%295 = load double*, double** %294
%296 = load i64, i64* %23
%297 = getelementptr inbounds double, double* %295, i64 %296
store double %291, double* %297
br label %298
298: ; preds = %278
%299 = load i64, i64* %23
%300 = add nsw i64 %299, 1
store i64 %300, i64* %23
br label %275
301: ; preds = %275
br label %302
302: ; preds = %301
%303 = load i64, i64* %22
%304 = add nsw i64 %303, 1
store i64 %304, i64* %22
br label %271
305: ; preds = %271
%306 = load double**, double*** %19
%307 = getelementptr inbounds double*, double** %306, i64 1
%308 = load double*, double** %307
%309 = getelementptr inbounds double, double* %308, i64 1
%310 = load double, double* %309
%311 = load double**, double*** %19
%312 = getelementptr inbounds double*, double** %311, i64 2
%313 = load double*, double** %312
%314 = getelementptr inbounds double, double* %313, i64 2
%315 = load double, double* %314
%316 = fadd double %310, %315
%317 = load double**, double*** %19
%318 = getelementptr inbounds double*, double** %317, i64 3
%319 = load double*, double** %318
%320 = getelementptr inbounds double, double* %319, i64 3
%321 = load double, double* %320
%322 = fsub double %316, %321
%323 = load double**, double*** %19
%324 = getelementptr inbounds double*, double** %323, i64 4
%325 = load double*, double** %324
%326 = getelementptr inbounds double, double* %325, i64 4
%327 = load double, double* %326
%328 = fsub double %322, %327
%329 = load double**, double*** %13
%330 = getelementptr inbounds double*, double** %329, i64 1
%331 = load double*, double** %330
%332 = getelementptr inbounds double, double* %331, i64 1
store double %328, double* %332
%333 = load double**, double*** %19
%334 = getelementptr inbounds double*, double** %333, i64 2
%335 = load double*, double** %334
%336 = getelementptr inbounds double, double* %335, i64 3
%337 = load double, double* %336
%338 = load double**, double*** %19
%339 = getelementptr inbounds double*, double** %338, i64 1
%340 = load double*, double** %339
%341 = getelementptr inbounds double, double* %340, i64 4
%342 = load double, double* %341
%343 = fsub double %337, %342
%344 = fmul double 2.000000e+00, %343
%345 = load double**, double*** %13
%346 = getelementptr inbounds double*, double** %345, i64 1
%347 = load double*, double** %346
%348 = getelementptr inbounds double, double* %347, i64 2
store double %344, double* %348
%349 = load double**, double*** %19
%350 = getelementptr inbounds double*, double** %349, i64 2
%351 = load double*, double** %350
%352 = getelementptr inbounds double, double* %351, i64 4
%353 = load double, double* %352
%354 = load double**, double*** %19
%355 = getelementptr inbounds double*, double** %354, i64 1
%356 = load double*, double** %355
%357 = getelementptr inbounds double, double* %356, i64 3
%358 = load double, double* %357
%359 = fadd double %353, %358
%360 = fmul double 2.000000e+00, %359
%361 = load double**, double*** %13
%362 = getelementptr inbounds double*, double** %361, i64 1
%363 = load double*, double** %362
%364 = getelementptr inbounds double, double* %363, i64 3
store double %360, double* %364
%365 = load double**, double*** %19
%366 = getelementptr inbounds double*, double** %365, i64 3
%367 = load double*, double** %366
%368 = getelementptr inbounds double, double* %367, i64 2
%369 = load double, double* %368
%370 = load double**, double*** %19
%371 = getelementptr inbounds double*, double** %370, i64 1
%372 = load double*, double** %371
%373 = getelementptr inbounds double, double* %372, i64 4
%374 = load double, double* %373
%375 = fadd double %369, %374
%376 = fmul double 2.000000e+00, %375
%377 = load double**, double*** %13
%378 = getelementptr inbounds double*, double** %377, i64 2
%379 = load double*, double** %378
%380 = getelementptr inbounds double, double* %379, i64 1
store double %376, double* %380
%381 = load double**, double*** %19
%382 = getelementptr inbounds double*, double** %381, i64 1
%383 = load double*, double** %382
%384 = getelementptr inbounds double, double* %383, i64 1
%385 = load double, double* %384
%386 = load double**, double*** %19
%387 = getelementptr inbounds double*, double** %386, i64 2
%388 = load double*, double** %387
%389 = getelementptr inbounds double, double* %388, i64 2
%390 = load double, double* %389
%391 = fsub double %385, %390
%392 = load double**, double*** %19
%393 = getelementptr inbounds double*, double** %392, i64 3
%394 = load double*, double** %393
%395 = getelementptr inbounds double, double* %394, i64 3
%396 = load double, double* %395
%397 = fadd double %391, %396
%398 = load double**, double*** %19
%399 = getelementptr inbounds double*, double** %398, i64 4
%400 = load double*, double** %399
%401 = getelementptr inbounds double, double* %400, i64 4
%402 = load double, double* %401
%403 = fsub double %397, %402
%404 = load double**, double*** %13
%405 = getelementptr inbounds double*, double** %404, i64 2
%406 = load double*, double** %405
%407 = getelementptr inbounds double, double* %406, i64 2
store double %403, double* %407
%408 = load double**, double*** %19
%409 = getelementptr inbounds double*, double** %408, i64 3
%410 = load double*, double** %409
%411 = getelementptr inbounds double, double* %410, i64 4
%412 = load double, double* %411
%413 = load double**, double*** %19
%414 = getelementptr inbounds double*, double** %413, i64 1
%415 = load double*, double** %414
%416 = getelementptr inbounds double, double* %415, i64 2
%417 = load double, double* %416
%418 = fsub double %412, %417
%419 = fmul double 2.000000e+00, %418
%420 = load double**, double*** %13
%421 = getelementptr inbounds double*, double** %420, i64 2
%422 = load double*, double** %421
%423 = getelementptr inbounds double, double* %422, i64 3
store double %419, double* %423
%424 = load double**, double*** %19
%425 = getelementptr inbounds double*, double** %424, i64 4
%426 = load double*, double** %425
%427 = getelementptr inbounds double, double* %426, i64 2
%428 = load double, double* %427
%429 = load double**, double*** %19
%430 = getelementptr inbounds double*, double** %429, i64 1
%431 = load double*, double** %430
%432 = getelementptr inbounds double, double* %431, i64 3
%433 = load double, double* %432
%434 = fsub double %428, %433
%435 = fmul double 2.000000e+00, %434
%436 = load double**, double*** %13
%437 = getelementptr inbounds double*, double** %436, i64 3
%438 = load double*, double** %437
%439 = getelementptr inbounds double, double* %438, i64 1
store double %435, double* %439
%440 = load double**, double*** %19
%441 = getelementptr inbounds double*, double** %440, i64 4
%442 = load double*, double** %441
%443 = getelementptr inbounds double, double* %442, i64 3
%444 = load double, double* %443
%445 = load double**, double*** %19
%446 = getelementptr inbounds double*, double** %445, i64 1
%447 = load double*, double** %446
%448 = getelementptr inbounds double, double* %447, i64 2
%449 = load double, double* %448
%450 = fadd double %444, %449
%451 = fmul double 2.000000e+00, %450
%452 = load double**, double*** %13
%453 = getelementptr inbounds double*, double** %452, i64 3
%454 = load double*, double** %453
%455 = getelementptr inbounds double, double* %454, i64 2
store double %451, double* %455
%456 = load double**, double*** %19
%457 = getelementptr inbounds double*, double** %456, i64 1
%458 = load double*, double** %457
%459 = getelementptr inbounds double, double* %458, i64 1
%460 = load double, double* %459
%461 = load double**, double*** %19
%462 = getelementptr inbounds double*, double** %461, i64 2
%463 = load double*, double** %462
%464 = getelementptr inbounds double, double* %463, i64 2
%465 = load double, double* %464
%466 = fsub double %460, %465
%467 = load double**, double*** %19
%468 = getelementptr inbounds double*, double** %467, i64 3
%469 = load double*, double** %468
%470 = getelementptr inbounds double, double* %469, i64 3
%471 = load double, double* %470
%472 = fsub double %466, %471
%473 = load double**, double*** %19
%474 = getelementptr inbounds double*, double** %473, i64 4
%475 = load double*, double** %474
%476 = getelementptr inbounds double, double* %475, i64 4
%477 = load double, double* %476
%478 = fadd double %472, %477
%479 = load double**, double*** %13
%480 = getelementptr inbounds double*, double** %479, i64 3
%481 = load double*, double** %480
%482 = getelementptr inbounds double, double* %481, i64 3
store double %478, double* %482
%483 = load double**, double*** %8
%484 = load i64, i64* %10
%485 = getelementptr inbounds [4 x double], [4 x double]* %17, i64 0, i64 0
%486 = call i32 @ave_dmatrix(double** %483, i64 %484, i32 3, double* %485)
%487 = load double**, double*** %9
%488 = load i64, i64* %10
%489 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 0
%490 = call i32 @ave_dmatrix(double** %487, i64 %488, i32 3, double* %489)
store i64 1, i64* %22
br label %491
491: ; preds = %508, %305
%492 = load i64, i64* %22
%493 = icmp sle i64 %492, 3
br i1 %493, label %494, label %511
494: ; preds = %491
%495 = load i64, i64* %22
%496 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 %495
%497 = load double, double* %496
%498 = getelementptr inbounds [4 x double], [4 x double]* %17, i64 0, i64 0
%499 = load double**, double*** %13
%500 = load i64, i64* %22
%501 = getelementptr inbounds double*, double** %499, i64 %500
%502 = load double*, double** %501
%503 = call double @dot(double* %498, double* %502)
%504 = fsub double %497, %503
%505 = load double*, double** %14
%506 = load i64, i64* %22
%507 = getelementptr inbounds double, double* %505, i64 %506
store double %504, double* %507
br label %508
508: ; preds = %494
%509 = load i64, i64* %22
%510 = add nsw i64 %509, 1
store i64 %510, i64* %22
br label %491
511: ; preds = %491
store i64 1, i64* %22
br label %512
512: ; preds = %545, %511
%513 = load i64, i64* %22
%514 = load i64, i64* %10
%515 = icmp sle i64 %513, %514
br i1 %515, label %516, label %548
516: ; preds = %512
store i64 1, i64* %23
br label %517
517: ; preds = %541, %516
%518 = load i64, i64* %23
%519 = icmp sle i64 %518, 3
br i1 %519, label %520, label %544
520: ; preds = %517
%521 = load double**, double*** %8
%522 = load i64, i64* %22
%523 = getelementptr inbounds double*, double** %521, i64 %522
%524 = load double*, double** %523
%525 = load double**, double*** %13
%526 = load i64, i64* %23
%527 = getelementptr inbounds double*, double** %525, i64 %526
%528 = load double*, double** %527
%529 = call double @dot(double* %524, double* %528)
%530 = load double*, double** %14
%531 = load i64, i64* %23
%532 = getelementptr inbounds double, double* %530, i64 %531
%533 = load double, double* %532
%534 = fadd double %529, %533
%535 = load double**, double*** %12
%536 = load i64, i64* %22
%537 = getelementptr inbounds double*, double** %535, i64 %536
%538 = load double*, double** %537
%539 = load i64, i64* %23
%540 = getelementptr inbounds double, double* %538, i64 %539
store double %534, double* %540
br label %541
541: ; preds = %520
%542 = load i64, i64* %23
%543 = add nsw i64 %542, 1
store i64 %543, i64* %23
br label %517
544: ; preds = %517
br label %545
545: ; preds = %544
%546 = load i64, i64* %22
%547 = add nsw i64 %546, 1
store i64 %547, i64* %22
br label %512
548: ; preds = %512
store double 0.000000e+00, double* %15
store i64 1, i64* %22
br label %549
549: ; preds = %584, %548
%550 = load i64, i64* %22
%551 = load i64, i64* %10
%552 = icmp sle i64 %550, %551
br i1 %552, label %553, label %587
553: ; preds = %549
store i64 1, i64* %23
br label %554
554: ; preds = %575, %553
%555 = load i64, i64* %23
%556 = icmp sle i64 %555, 3
br i1 %556, label %557, label %578
557: ; preds = %554
%558 = load double**, double*** %9
%559 = load i64, i64* %22
%560 = getelementptr inbounds double*, double** %558, i64 %559
%561 = load double*, double** %560
%562 = load i64, i64* %23
%563 = getelementptr inbounds double, double* %561, i64 %562
%564 = load double, double* %563
%565 = load double**, double*** %12
%566 = load i64, i64* %22
%567 = getelementptr inbounds double*, double** %565, i64 %566
%568 = load double*, double** %567
%569 = load i64, i64* %23
%570 = getelementptr inbounds double, double* %568, i64 %569
%571 = load double, double* %570
%572 = fsub double %564, %571
%573 = load i64, i64* %23
%574 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 %573
store double %572, double* %574
br label %575
575: ; preds = %557
%576 = load i64, i64* %23
%577 = add nsw i64 %576, 1
store i64 %577, i64* %23
br label %554
578: ; preds = %554
%579 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 0
%580 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 0
%581 = call double @dot(double* %579, double* %580)
%582 = load double, double* %15
%583 = fadd double %582, %581
store double %583, double* %15
br label %584
584: ; preds = %578
%585 = load i64, i64* %22
%586 = add nsw i64 %585, 1
store i64 %586, i64* %22
br label %549
587: ; preds = %549
%588 = load double, double* %15
%589 = load i64, i64* %10
%590 = sitofp i64 %589 to double
%591 = fdiv double %588, %590
%592 = call double @sqrt(double %591)
%593 = load double*, double** %11
store double %592, double* %593
%594 = load double**, double*** %20
%595 = call i32 @free_dmatrix(double** %594, i32 1, i32 3, i32 1, i32 3)
%596 = load double**, double*** %19
%597 = call i32 @free_dmatrix(double** %596, i32 1, i32 4, i32 1, i32 4)
%598 = load double**, double*** %21
%599 = call i32 @free_dmatrix(double** %598, i32 1, i32 4, i32 1, i32 4)
ret void
}

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