#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*/ ellipse2param(double *, double *);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ lap_eig(double *, int);
void fit_circle(double *buff, double *vgg, int reg_size, double *param) {
  int i, j, k;
  double A[16];
  if (reg_size <= 0)
    error("fit_circle: invalid size.");
  if (buff == NULL)
    error("fit_circle: invalid buffer.");
  if (vgg == NULL)
    error("fit_circle: invalid normalization matrix.");
  if (param == NULL)
    error("fit_circle: param must be non null.");
  for (i = 0; i < reg_size * 4 * 6; i += 6) {
    buff[i] = buff[i] + buff[i + 3];
    buff[i + 1] = buff[i + 2];
    buff[i + 2] = buff[i + 4];
    buff[i + 3] = buff[i + 5];
  }
  for (i = 0; i < 16; i++)
    A[i] = 0.0;
  for (i = 0; i < 4; i++)
    for (j = 0; j < 4; j++)
      for (k = 0; k < 4 * reg_size; k++)
        A[i * 4 + j] += buff[k * 6 + i] * buff[k * 6 + j];
  lap_eig(A, 4);
  double s[9];
  s[0] = s[4] = A[0];
  s[1] = s[3] = 0;
  s[2] = s[6] = A[1];
  s[5] = s[7] = A[2];
  s[8] = A[3];
  double C[9];
  C[0] = vgg[0] * vgg[0] * s[0] + vgg[3] * vgg[3] * s[4];
  C[1] = vgg[0] * vgg[1] * s[0] + vgg[3] * vgg[4] * s[4];
  C[2] = vgg[0] * vgg[2] * s[0] + vgg[3] * vgg[5] * s[4] + vgg[0] * s[2] +
         vgg[3] * s[5];
  C[3] = vgg[0] * vgg[1] * s[0] + vgg[3] * vgg[4] * s[4];
  C[4] = vgg[1] * vgg[1] * s[0] + vgg[4] * vgg[4] * s[4];
  C[5] = vgg[1] * vgg[2] * s[0] + vgg[4] * vgg[5] * s[4] + vgg[1] * s[2] +
         vgg[4] * s[5];
  C[6] = vgg[0] * vgg[2] * s[0] + vgg[0] * s[6] + vgg[3] * vgg[5] * s[4] +
         vgg[3] * s[7];
  C[7] = vgg[1] * vgg[2] * s[0] + vgg[1] * s[6] + vgg[4] * vgg[5] * s[4] +
         vgg[4] * s[7];
  C[8] = vgg[2] * vgg[2] * s[0] + vgg[2] * s[6] + vgg[5] * vgg[5] * s[4] +
         vgg[5] * s[7] + vgg[2] * s[2] + vgg[5] * s[5] + s[8];
  ellipse2param(C, param);
}


x86 assembly (clang, -O0):
<fit_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1160 <fit_circle+0x30>
lea    0xea5(%rip),%rdi
call   1050 <error@plt>
cmpq   $0x0,-0x8(%rbp)
jne    1177 <fit_circle+0x47>
lea    0xea8(%rip),%rdi
call   1050 <error@plt>
cmpq   $0x0,-0x10(%rbp)
jne    118e <fit_circle+0x5e>
lea    0xead(%rip),%rdi
call   1050 <error@plt>
cmpq   $0x0,-0x20(%rbp)
jne    11a5 <fit_circle+0x75>
lea    0xec0(%rip),%rdi
call   1050 <error@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
imul   $0x6,%ecx,%ecx
cmp    %ecx,%eax
jge    1266 <fit_circle+0x136>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x24(%rbp)
jmp    11ac <fit_circle+0x7c>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    1295 <fit_circle+0x165>
movslq -0x24(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    126d <fit_circle+0x13d>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    134e <fit_circle+0x21e>
movl   $0x0,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jge    133b <fit_circle+0x20b>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
jge    1328 <fit_circle+0x1f8>
mov    -0x8(%rbp),%rax
imul   $0x6,-0x2c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
imul   $0x6,-0x2c(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x24(%rbp),%eax
shl    $0x2,%eax
add    -0x28(%rbp),%eax
cltq
movsd  -0xb0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12be <fit_circle+0x18e>
jmp    132d <fit_circle+0x1fd>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12ad <fit_circle+0x17d>
jmp    1340 <fit_circle+0x210>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    129c <fit_circle+0x16c>
lea    -0xb0(%rbp),%rdi
mov    $0x4,%esi
call   1040 <lap_eig@plt>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  %xmm0,-0x100(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0xf0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0xd8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0xf0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0xd8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movsd  -0xe0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movsd  -0xe0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  -0x100(%rbp),%xmm2
ff
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movsd  -0xe0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
movsd  -0xf0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0xd8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
lea    -0x150(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <ellipse2param@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fit_circle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rcx,%rbp
mov    %edx,%r12d
mov    %rsi,%r15
mov    %rdi,%rbx
test   %edx,%edx
jle    16a8 <fit_circle+0x578>
test   %rbx,%rbx
je     16bd <fit_circle+0x58d>
test   %r15,%r15
je     16d2 <fit_circle+0x5a2>
test   %rbp,%rbp
je     16e7 <fit_circle+0x5b7>
mov    %rbp,(%rsp)
test   %r12d,%r12d
jle    11c1 <fit_circle+0x91>
lea    0x0(,%r12,8),%eax
lea    (%rax,%rax,2),%eax
cltq
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
movsd  0x10(%rbx,%rcx,8),%xmm1
addsd  0x18(%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
movsd  %xmm1,0x8(%rbx,%rcx,8)
movupd 0x20(%rbx,%rcx,8),%xmm0
movupd %xmm0,0x10(%rbx,%rcx,8)
add    $0x6,%rcx
cmp    %rax,%rcx
jl     1190 <fit_circle+0x60>
xorpd  %xmm0,%xmm0
movapd %xmm0,0x80(%rsp)
movapd %xmm0,0x70(%rsp)
movapd %xmm0,0x60(%rsp)
movapd %xmm0,0x50(%rsp)
movapd %xmm0,0x40(%rsp)
movapd %xmm0,0x30(%rsp)
movapd %xmm0,0x20(%rsp)
lea    0x0(,%r12,4),%eax
cmp    $0x2,%eax
mov    $0x1,%r13d
cmovge %eax,%r13d
movapd %xmm0,0x10(%rsp)
lea    -0x1(%r13),%r11
mov    %r13d,%edx
and    $0x7ffffffc,%edx
lea    0x38(%rbx),%r14
lea    0x40(%rbx),%r9
lea    0x30(%rbx),%rax
mov    %rax,0x8(%rsp)
xor    %edi,%edi
xor    %esi,%esi
jmp    1252 <fit_circle+0x122>
movsd  %xmm0,0x10(%rsp,%r8,8)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rsi
add    $0x8,%rdi
cmp    $0x4,%rsi
je     14ae <fit_circle+0x37e>
test   %r12d,%r12d
jle    1240 <fit_circle+0x110>
lea    0x0(,%rsi,4),%r8
movsd  0x10(%rsp,%r8,8),%xmm0
test   %r11,%r11
je     1450 <fit_circle+0x320>
mov    %rbx,%rbp
xor    %ecx,%ecx
movapd %xmm0,%xmm1
nopl   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rdi,1),%xmm2
mulsd  0x0(%rbp),%xmm2
movsd  0x30(%rbp,%rdi,1),%xmm0
addsd  %xmm1,%xmm2
mulsd  0x30(%rbp),%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rcx
add    $0x60,%rbp
movapd %xmm0,%xmm1
cmp    %rcx,%rdx
jne    1280 <fit_circle+0x150>
test   $0x1,%r13b
je     12ce <fit_circle+0x19e>
add    %rcx,%rcx
lea    (%rcx,%rcx,2),%rax
lea    (%rax,%rsi,1),%rcx
movsd  (%rbx,%rcx,8),%xmm1
mulsd  (%rbx,%rax,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp,%r8,8)
test   %r12d,%r12d
jle    1240 <fit_circle+0x110>
mov    %r8,%rcx
or     $0x1,%rcx
movsd  0x10(%rsp,%rcx,8),%xmm0
test   %r11,%r11
je     1461 <fit_circle+0x331>
mov    %r14,%r10
xor    %ebp,%ebp
movapd %xmm0,%xmm1
nopl   (%rax)
movsd  -0x38(%r10,%rdi,1),%xmm2
mulsd  -0x30(%r10),%xmm2
movsd  -0x8(%r10,%rdi,1),%xmm0
addsd  %xmm1,%xmm2
mulsd  (%r10),%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rbp
add    $0x60,%r10
movapd %xmm0,%xmm1
cmp    %rbp,%rdx
jne    1300 <fit_circle+0x1d0>
test   $0x1,%r13b
je     1359 <fit_circle+0x229>
add    %rbp,%rbp
lea    0x0(,%rbp,2),%rax
add    %rbp,%rax
lea    (%rax,%rsi,1),%rbp
movsd  (%rbx,%rbp,8),%xmm1
mulsd  0x8(%rbx,%rax,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp,%rcx,8)
test   %r12d,%r12d
jle    1240 <fit_circle+0x110>
mov    %r8,%rcx
or     $0x2,%rcx
movsd  0x10(%rsp,%rcx,8),%xmm0
test   %r11,%r11
je     1472 <fit_circle+0x342>
mov    %r9,%rax
xor    %ebp,%ebp
movapd %xmm0,%xmm1
nopw   0x0(%rax,%rax,1)
movsd  -0x40(%rax,%rdi,1),%xmm2
mulsd  -0x30(%rax),%xmm2
movsd  -0x10(%rax,%rdi,1),%xmm0
addsd  %xmm1,%xmm2
mulsd  (%rax),%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rbp
add    $0x60,%rax
movapd %xmm0,%xmm1
cmp    %rbp,%rdx
jne    1390 <fit_circle+0x260>
test   $0x1,%r13b
je     13e5 <fit_circle+0x2b5>
add    %rbp,%rbp
lea    0x0(,%rbp,2),%rax
add    %rbp,%rax
lea    (%rax,%rsi,1),%rbp
movsd  (%rbx,%rbp,8),%xmm1
mulsd  0x10(%rbx,%rax,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp,%rcx,8)
test   %r12d,%r12d
jle    1240 <fit_circle+0x110>
or     $0x3,%r8
movsd  0x10(%rsp,%r8,8),%xmm0
test   %r11,%r11
je     1483 <fit_circle+0x353>
mov    0x8(%rsp),%rax
xor    %ecx,%ecx
movapd %xmm0,%xmm1
nop
movsd  -0x30(%rax,%rdi,1),%xmm2
mulsd  -0x18(%rax),%xmm2
movsd  (%rax,%rdi,1),%xmm0
addsd  %xmm1,%xmm2
mulsd  0x18(%rax),%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rcx
add    $0x60,%rax
movapd %xmm0,%xmm1
cmp    %rcx,%rdx
jne    1410 <fit_circle+0x2e0>
test   $0x1,%r13b
je     1231 <fit_circle+0x101>
jmp    148f <fit_circle+0x35f>
nopw   0x0(%rax,%rax,1)
xor    %ecx,%ecx
test   $0x1,%r13b
jne    12b5 <fit_circle+0x185>
jmp    12ce <fit_circle+0x19e>
xor    %ebp,%ebp
test   $0x1,%r13b
jne    1338 <fit_circle+0x208>
jmp    1359 <fit_circle+0x229>
xor    %ebp,%ebp
test   $0x1,%r13b
jne    13c4 <fit_circle+0x294>
jmp    13e5 <fit_circle+0x2b5>
xor    %ecx,%ecx
test   $0x1,%r13b
je     1231 <fit_circle+0x101>
add    %rcx,%rcx
lea    (%rcx,%rcx,2),%rax
lea    (%rax,%rsi,1),%rcx
movsd  (%rbx,%rcx,8),%xmm1
mulsd  0x18(%rbx,%rax,8),%xmm1
addsd  %xmm1,%xmm0
jmp    1231 <fit_circle+0x101>
lea    0x10(%rsp),%rdi
mov    $0x4,%esi
call   1040 <lap_eig@plt>
movsd  0x10(%rsp),%xmm14
movsd  0x18(%rsp),%xmm9
movsd  0x20(%rsp),%xmm8
movupd (%r15),%xmm12
movupd 0x18(%r15),%xmm13
movapd %xmm12,%xmm4
unpcklpd %xmm12,%xmm4
mulpd  %xmm12,%xmm4
movapd %xmm13,%xmm0
unpcklpd %xmm13,%xmm0
mulpd  %xmm13,%xmm0
movapd %xmm14,%xmm10
unpcklpd %xmm14,%xmm10
mulpd  %xmm10,%xmm0
mulpd  %xmm10,%xmm4
addpd  %xmm0,%xmm4
movapd %xmm4,0x90(%rsp)
movsd  0x10(%r15),%xmm15
movsd  0x28(%r15),%xmm11
movapd %xmm11,%xmm7
unpcklpd %xmm11,%xmm7
mulpd  %xmm13,%xmm7
movapd %xmm15,%xmm6
unpcklpd %xmm15,%xmm6
mulpd  %xmm12,%xmm6
movapd %xmm6,%xmm5
mulsd  %xmm14,%xmm5
movapd %xmm13,%xmm1
unpckhpd %xmm13,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm14,%xmm1
movapd %xmm14,%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm2,%xmm5
movapd %xmm12,%xmm3
movapd %xmm9,%xmm2
unpcklpd %xmm9,%xmm2
mulpd  %xmm12,%xmm2
mulsd  %xmm9,%xmm12
addsd  %xmm5,%xmm12
unpckhpd %xmm3,%xmm3
movapd %xmm3,%xmm5
mulsd  %xmm3,%xmm5
shufpd $0x2,%xmm13,%xmm5
movapd %xmm8,%xmm0
unpcklpd %xmm8,%xmm0
mulpd  %xmm13,%xmm0
mulsd  %xmm8,%xmm13
addsd  %xmm12,%xmm13
movapd %xmm7,%xmm12
unpckhpd %xmm7,%xmm12
mulsd  %xmm14,%xmm12
movsd  %xmm13,0xa0(%rsp)
movapd %xmm6,%xmm13
unpckhpd %xmm6,%xmm13
mulsd  %xmm14,%xmm13
mulsd  %xmm9,%xmm3
mulsd  %xmm15,%xmm9
mulsd  %xmm15,%xmm15
mulsd  %xmm14,%xmm15
movhpd %xmm4,0xa8(%rsp)
movapd %xmm11,%xmm4
mulsd  %xmm11,%xmm4
mulsd  %xmm14,%xmm4
addsd  %xmm12,%xmm13
movsd  0x28(%rsp),%xmm12
addsd  %xmm13,%xmm3
unpcklpd %xmm3,%xmm1
unpcklpd %xmm8,%xmm14
mulpd  %xmm5,%xmm14
addpd  %xmm1,%xmm14
movapd %xmm14,0xb0(%rsp)
mulpd  %xmm10,%xmm6
addpd  %xmm2,%xmm6
mulpd  %xmm10,%xmm7
addpd  %xmm6,%xmm7
addpd  %xmm7,%xmm0
movapd %xmm0,0xc0(%rsp)
addsd  %xmm9,%xmm15
addsd  %xmm15,%xmm4
mulsd  %xmm8,%xmm11
addsd  %xmm11,%xmm4
addsd  %xmm9,%xmm4
addsd  %xmm11,%xmm4
addsd  %xmm12,%xmm4
movsd  %xmm4,0xd0(%rsp)
lea    0x90(%rsp),%rdi
mov    (%rsp),%rsi
call   1030 <ellipse2param@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x951(%rip),%rdi
call   1050 <error@plt>
test   %rbx,%rbx
jne    115e <fit_circle+0x2e>
lea    0x956(%rip),%rdi
call   1050 <error@plt>
test   %r15,%r15
jne    1167 <fit_circle+0x37>
lea    0x95d(%rip),%rdi
call   1050 <error@plt>
test   %rbp,%rbp
jne    1170 <fit_circle+0x40>
lea    0x972(%rip),%rdi
call   1050 <error@plt>
jmp    1170 <fit_circle+0x40>

LLVM IR (-O0):
@.str = [26 x i8] c"fit_circle: invalid size.\00"
@.str.1 = [28 x i8] c"fit_circle: invalid buffer.\00"
@.str.2 = [42 x i8] c"fit_circle: invalid normalization matrix.\00"
@.str.3 = [36 x i8] c"fit_circle: param must be non null.\00"
define void @fit_circle(double* %0, double* %1, i32 %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [16 x double]
%13 = alloca [9 x double]
%14 = alloca [9 x double]
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double* %3, double** %8
%15 = load i32, i32* %7
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %4
%20 = load double*, double** %5
%21 = icmp eq double* %20, null
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %19
%25 = load double*, double** %6
%26 = icmp eq double* %25, null
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27, %24
%30 = load double*, double** %8
%31 = icmp eq double* %30, null
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
store i32 0, i32* %9
br label %35
35: ; preds = %91, %34
%36 = load i32, i32* %9
%37 = load i32, i32* %7
%38 = mul nsw i32 %37, 4
%39 = mul nsw i32 %38, 6
%40 = icmp slt i32 %36, %39
br i1 %40, label %41, label %94
41: ; preds = %35
%42 = load double*, double** %5
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = load double*, double** %5
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %47, i64 %50
%52 = load double, double* %51
%53 = fadd double %46, %52
%54 = load double*, double** %5
%55 = load i32, i32* %9
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
store double %53, double* %57
%58 = load double*, double** %5
%59 = load i32, i32* %9
%60 = add nsw i32 %59, 2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %58, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %5
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %64, i64 %67
store double %63, double* %68
%69 = load double*, double** %5
%70 = load i32, i32* %9
%71 = add nsw i32 %70, 4
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %69, i64 %72
%74 = load double, double* %73
%75 = load double*, double** %5
%76 = load i32, i32* %9
%77 = add nsw i32 %76, 2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %75, i64 %78
store double %74, double* %79
%80 = load double*, double** %5
%81 = load i32, i32* %9
%82 = add nsw i32 %81, 5
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %80, i64 %83
%85 = load double, double* %84
%86 = load double*, double** %5
%87 = load i32, i32* %9
%88 = add nsw i32 %87, 3
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %86, i64 %89
store double %85, double* %90
br label %91
91: ; preds = %41
%92 = load i32, i32* %9
%93 = add nsw i32 %92, 6
store i32 %93, i32* %9
br label %35
94: ; preds = %35
store i32 0, i32* %9
br label %95
95: ; preds = %102, %94
%96 = load i32, i32* %9
%97 = icmp slt i32 %96, 16
br i1 %97, label %98, label %105
98: ; preds = %95
%99 = load i32, i32* %9
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 %100
store double 0.000000e+00, double* %101
br label %102
102: ; preds = %98
%103 = load i32, i32* %9
%104 = add nsw i32 %103, 1
store i32 %104, i32* %9
br label %95
105: ; preds = %95
store i32 0, i32* %9
br label %106
106: ; preds = %152, %105
%107 = load i32, i32* %9
%108 = icmp slt i32 %107, 4
br i1 %108, label %109, label %155
109: ; preds = %106
store i32 0, i32* %10
br label %110
110: ; preds = %148, %109
%111 = load i32, i32* %10
%112 = icmp slt i32 %111, 4
br i1 %112, label %113, label %151
113: ; preds = %110
store i32 0, i32* %11
br label %114
114: ; preds = %144, %113
%115 = load i32, i32* %11
%116 = load i32, i32* %7
%117 = mul nsw i32 4, %116
%118 = icmp slt i32 %115, %117
br i1 %118, label %119, label %147
119: ; preds = %114
%120 = load double*, double** %5
%121 = load i32, i32* %11
%122 = mul nsw i32 %121, 6
%123 = load i32, i32* %9
%124 = add nsw i32 %122, %123
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %120, i64 %125
%127 = load double, double* %126
%128 = load double*, double** %5
%129 = load i32, i32* %11
%130 = mul nsw i32 %129, 6
%131 = load i32, i32* %10
%132 = add nsw i32 %130, %131
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %128, i64 %133
%135 = load double, double* %134
%136 = load i32, i32* %9
%137 = mul nsw i32 %136, 4
%138 = load i32, i32* %10
%139 = add nsw i32 %137, %138
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 %140
%142 = load double, double* %141
%143 = call double @llvm.fmuladd.f64(double %127, double %135, double %142)
store double %143, double* %141
br label %144
144: ; preds = %119
%145 = load i32, i32* %11
%146 = add nsw i32 %145, 1
store i32 %146, i32* %11
br label %114
147: ; preds = %114
br label %148
148: ; preds = %147
%149 = load i32, i32* %10
%150 = add nsw i32 %149, 1
store i32 %150, i32* %10
br label %110
151: ; preds = %110
br label %152
152: ; preds = %151
%153 = load i32, i32* %9
%154 = add nsw i32 %153, 1
store i32 %154, i32* %9
br label %106
155: ; preds = %106
%156 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 0
%157 = call i32 @lap_eig(double* %156, i32 4)
%158 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 0
%159 = load double, double* %158
%160 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
store double %159, double* %160
%161 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
store double %159, double* %161
%162 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 3
store double 0.000000e+00, double* %162
%163 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 1
store double 0.000000e+00, double* %163
%164 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 1
%165 = load double, double* %164
%166 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 6
store double %165, double* %166
%167 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 2
store double %165, double* %167
%168 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 2
%169 = load double, double* %168
%170 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 7
store double %169, double* %170
%171 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 5
store double %169, double* %171
%172 = getelementptr inbounds [16 x double], [16 x double]* %12, i64 0, i64 3
%173 = load double, double* %172
%174 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 8
store double %173, double* %174
%175 = load double*, double** %6
%176 = getelementptr inbounds double, double* %175, i64 0
%177 = load double, double* %176
%178 = load double*, double** %6
%179 = getelementptr inbounds double, double* %178, i64 0
%180 = load double, double* %179
%181 = fmul double %177, %180
%182 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%183 = load double, double* %182
%184 = load double*, double** %6
%185 = getelementptr inbounds double, double* %184, i64 3
%186 = load double, double* %185
%187 = load double*, double** %6
%188 = getelementptr inbounds double, double* %187, i64 3
%189 = load double, double* %188
%190 = fmul double %186, %189
%191 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%192 = load double, double* %191
%193 = fmul double %190, %192
%194 = call double @llvm.fmuladd.f64(double %181, double %183, double %193)
%195 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 0
store double %194, double* %195
%196 = load double*, double** %6
%197 = getelementptr inbounds double, double* %196, i64 0
%198 = load double, double* %197
%199 = load double*, double** %6
%200 = getelementptr inbounds double, double* %199, i64 1
%201 = load double, double* %200
%202 = fmul double %198, %201
%203 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%204 = load double, double* %203
%205 = load double*, double** %6
%206 = getelementptr inbounds double, double* %205, i64 3
%207 = load double, double* %206
%208 = load double*, double** %6
%209 = getelementptr inbounds double, double* %208, i64 4
%210 = load double, double* %209
%211 = fmul double %207, %210
%212 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%213 = load double, double* %212
%214 = fmul double %211, %213
%215 = call double @llvm.fmuladd.f64(double %202, double %204, double %214)
%216 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 1
store double %215, double* %216
%217 = load double*, double** %6
%218 = getelementptr inbounds double, double* %217, i64 0
%219 = load double, double* %218
%220 = load double*, double** %6
%221 = getelementptr inbounds double, double* %220, i64 2
%222 = load double, double* %221
%223 = fmul double %219, %222
%224 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%225 = load double, double* %224
%226 = load double*, double** %6
%227 = getelementptr inbounds double, double* %226, i64 3
%228 = load double, double* %227
%229 = load double*, double** %6
%230 = getelementptr inbounds double, double* %229, i64 5
%231 = load double, double* %230
%232 = fmul double %228, %231
%233 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%234 = load double, double* %233
%235 = fmul double %232, %234
%236 = call double @llvm.fmuladd.f64(double %223, double %225, double %235)
%237 = load double*, double** %6
%238 = getelementptr inbounds double, double* %237, i64 0
%239 = load double, double* %238
%240 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 2
%241 = load double, double* %240
%242 = call double @llvm.fmuladd.f64(double %239, double %241, double %236)
%243 = load double*, double** %6
%244 = getelementptr inbounds double, double* %243, i64 3
%245 = load double, double* %244
%246 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 5
%247 = load double, double* %246
%248 = call double @llvm.fmuladd.f64(double %245, double %247, double %242)
%249 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 2
store double %248, double* %249
%250 = load double*, double** %6
%251 = getelementptr inbounds double, double* %250, i64 0
%252 = load double, double* %251
%253 = load double*, double** %6
%254 = getelementptr inbounds double, double* %253, i64 1
%255 = load double, double* %254
%256 = fmul double %252, %255
%257 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%258 = load double, double* %257
%259 = load double*, double** %6
%260 = getelementptr inbounds double, double* %259, i64 3
%261 = load double, double* %260
%262 = load double*, double** %6
%263 = getelementptr inbounds double, double* %262, i64 4
%264 = load double, double* %263
%265 = fmul double %261, %264
%266 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%267 = load double, double* %266
%268 = fmul double %265, %267
%269 = call double @llvm.fmuladd.f64(double %256, double %258, double %268)
%270 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 3
store double %269, double* %270
%271 = load double*, double** %6
%272 = getelementptr inbounds double, double* %271, i64 1
%273 = load double, double* %272
%274 = load double*, double** %6
%275 = getelementptr inbounds double, double* %274, i64 1
%276 = load double, double* %275
%277 = fmul double %273, %276
%278 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%279 = load double, double* %278
%280 = load double*, double** %6
%281 = getelementptr inbounds double, double* %280, i64 4
%282 = load double, double* %281
%283 = load double*, double** %6
%284 = getelementptr inbounds double, double* %283, i64 4
%285 = load double, double* %284
%286 = fmul double %282, %285
%287 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%288 = load double, double* %287
%289 = fmul double %286, %288
%290 = call double @llvm.fmuladd.f64(double %277, double %279, double %289)
%291 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 4
store double %290, double* %291
%292 = load double*, double** %6
%293 = getelementptr inbounds double, double* %292, i64 1
%294 = load double, double* %293
%295 = load double*, double** %6
%296 = getelementptr inbounds double, double* %295, i64 2
%297 = load double, double* %296
%298 = fmul double %294, %297
%299 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%300 = load double, double* %299
%301 = load double*, double** %6
%302 = getelementptr inbounds double, double* %301, i64 4
%303 = load double, double* %302
%304 = load double*, double** %6
%305 = getelementptr inbounds double, double* %304, i64 5
%306 = load double, double* %305
%307 = fmul double %303, %306
%308 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%309 = load double, double* %308
%310 = fmul double %307, %309
%311 = call double @llvm.fmuladd.f64(double %298, double %300, double %310)
%312 = load double*, double** %6
%313 = getelementptr inbounds double, double* %312, i64 1
%314 = load double, double* %313
%315 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 2
%316 = load double, double* %315
%317 = call double @llvm.fmuladd.f64(double %314, double %316, double %311)
%318 = load double*, double** %6
%319 = getelementptr inbounds double, double* %318, i64 4
%320 = load double, double* %319
%321 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 5
%322 = load double, double* %321
%323 = call double @llvm.fmuladd.f64(double %320, double %322, double %317)
%324 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 5
store double %323, double* %324
%325 = load double*, double** %6
%326 = getelementptr inbounds double, double* %325, i64 0
%327 = load double, double* %326
%328 = load double*, double** %6
%329 = getelementptr inbounds double, double* %328, i64 2
%330 = load double, double* %329
%331 = fmul double %327, %330
%332 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%333 = load double, double* %332
%334 = load double*, double** %6
%335 = getelementptr inbounds double, double* %334, i64 0
%336 = load double, double* %335
%337 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 6
%338 = load double, double* %337
%339 = fmul double %336, %338
%340 = call double @llvm.fmuladd.f64(double %331, double %333, double %339)
%341 = load double*, double** %6
%342 = getelementptr inbounds double, double* %341, i64 3
%343 = load double, double* %342
%344 = load double*, double** %6
%345 = getelementptr inbounds double, double* %344, i64 5
%346 = load double, double* %345
%347 = fmul double %343, %346
%348 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%349 = load double, double* %348
%350 = call double @llvm.fmuladd.f64(double %347, double %349, double %340)
%351 = load double*, double** %6
%352 = getelementptr inbounds double, double* %351, i64 3
%353 = load double, double* %352
%354 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 7
%355 = load double, double* %354
%356 = call double @llvm.fmuladd.f64(double %353, double %355, double %350)
%357 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 6
store double %356, double* %357
%358 = load double*, double** %6
%359 = getelementptr inbounds double, double* %358, i64 1
%360 = load double, double* %359
%361 = load double*, double** %6
%362 = getelementptr inbounds double, double* %361, i64 2
%363 = load double, double* %362
%364 = fmul double %360, %363
%365 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%366 = load double, double* %365
%367 = load double*, double** %6
%368 = getelementptr inbounds double, double* %367, i64 1
%369 = load double, double* %368
%370 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 6
%371 = load double, double* %370
%372 = fmul double %369, %371
%373 = call double @llvm.fmuladd.f64(double %364, double %366, double %372)
%374 = load double*, double** %6
%375 = getelementptr inbounds double, double* %374, i64 4
%376 = load double, double* %375
%377 = load double*, double** %6
%378 = getelementptr inbounds double, double* %377, i64 5
%379 = load double, double* %378
%380 = fmul double %376, %379
%381 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%382 = load double, double* %381
%383 = call double @llvm.fmuladd.f64(double %380, double %382, double %373)
%384 = load double*, double** %6
%385 = getelementptr inbounds double, double* %384, i64 4
%386 = load double, double* %385
%387 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 7
%388 = load double, double* %387
%389 = call double @llvm.fmuladd.f64(double %386, double %388, double %383)
%390 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 7
store double %389, double* %390
%391 = load double*, double** %6
%392 = getelementptr inbounds double, double* %391, i64 2
%393 = load double, double* %392
%394 = load double*, double** %6
%395 = getelementptr inbounds double, double* %394, i64 2
%396 = load double, double* %395
%397 = fmul double %393, %396
%398 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%399 = load double, double* %398
%400 = load double*, double** %6
%401 = getelementptr inbounds double, double* %400, i64 2
%402 = load double, double* %401
%403 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 6
%404 = load double, double* %403
%405 = fmul double %402, %404
%406 = call double @llvm.fmuladd.f64(double %397, double %399, double %405)
%407 = load double*, double** %6
%408 = getelementptr inbounds double, double* %407, i64 5
%409 = load double, double* %408
%410 = load double*, double** %6
%411 = getelementptr inbounds double, double* %410, i64 5
%412 = load double, double* %411
%413 = fmul double %409, %412
%414 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%415 = load double, double* %414
%416 = call double @llvm.fmuladd.f64(double %413, double %415, double %406)
%417 = load double*, double** %6
%418 = getelementptr inbounds double, double* %417, i64 5
%419 = load double, double* %418
%420 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 7
%421 = load double, double* %420
%422 = call double @llvm.fmuladd.f64(double %419, double %421, double %416)
%423 = load double*, double** %6
%424 = getelementptr inbounds double, double* %423, i64 2
%425 = load double, double* %424
%426 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 2
%427 = load double, double* %426
%428 = call double @llvm.fmuladd.f64(double %425, double %427, double %422)
%429 = load double*, double** %6
%430 = getelementptr inbounds double, double* %429, i64 5
%431 = load double, double* %430
%432 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 5
%433 = load double, double* %432
%434 = call double @llvm.fmuladd.f64(double %431, double %433, double %428)
%435 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 8
%436 = load double, double* %435
%437 = fadd double %434, %436
%438 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 8
store double %437, double* %438
%439 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 0
%440 = load double*, double** %8
%441 = call i32 @ellipse2param(double* %439, double* %440)
ret void
}

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