user: Converte this assembly snippet into its equivalent C code:

```asm
<fit_ellipse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x258,%rsp
  mov    %rdi,-0x268(%rbp)
  mov    %rsi,-0x270(%rbp)
  mov    %edx,-0x274(%rbp)
  mov    %rcx,-0x280(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  cmpl   $0x0,-0x274(%rbp)
  jg     L53
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L53:
  cmpq   $0x0,-0x268(%rbp)
  jne    L104
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L104:
  cmpq   $0x0,-0x270(%rbp)
  jne    L128
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L128:
  cmpq   $0x0,-0x280(%rbp)
  jne    L3
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L3:
  movl   $0x0,-0x24c(%rbp)
  jmp    L126
L100:
  mov    -0x24c(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x160(%rbp,%rax,8)
  addl   $0x1,-0x24c(%rbp)
L126:
  cmpl   $0x23,-0x24c(%rbp)
  jle    L100
  movl   $0x0,-0x24c(%rbp)
  jmp    L114
L117:
  movl   $0x0,-0x248(%rbp)
  jmp    L99
L6:
  movl   $0x0,-0x244(%rbp)
  jmp    L152
L49:
  mov    -0x24c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x248(%rbp),%eax
  add    %edx,%eax
  cltq
  movsd  -0x160(%rbp,%rax,8),%xmm1
  mov    -0x244(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x24c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x268(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x244(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x248(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x268(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x24c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x248(%rbp),%eax
  add    %edx,%eax
  addsd  %xmm1,%xmm0
  cltq
  movsd  %xmm0,-0x160(%rbp,%rax,8)
  addl   $0x1,-0x244(%rbp)
L152:
  mov    -0x274(%rbp),%eax
  shl    $0x2,%eax
  cmp    %eax,-0x244(%rbp)
  jl     L49
  addl   $0x1,-0x248(%rbp)
L99:
  cmpl   $0x5,-0x248(%rbp)
  jle    L6
  addl   $0x1,-0x24c(%rbp)
L114:
  cmpl   $0x5,-0x24c(%rbp)
  jle    L117
  movb   $0x56,-0x25e(%rbp)
  movb   $0x55,-0x25d(%rbp)
  movl   $0x6,-0x25c(%rbp)
  mov    -0x25c(%rbp),%eax
  mov    %eax,-0x258(%rbp)
  movl   $0x18,-0x254(%rbp)
  mov    -0x254(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x240(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L42:
  cmp    %rdx,%rsp
  je     L145
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L42
L145:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L98
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L98:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x238(%rbp)
  lea    -0x230(%rbp),%r9
  lea    -0x258(%rbp),%r8
  lea    -0x160(%rbp),%rcx
  lea    -0x25c(%rbp),%rdx
  lea    -0x25d(%rbp),%rsi
  lea    -0x25e(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x250(%rbp),%rdi
  push   %rdi
  lea    -0x254(%rbp),%rdi
  push   %rdi
  push   -0x238(%rbp)
  mov    %rax,%rdi
  call   <dsyev_@plt>
  add    $0x20,%rsp
  movsd  -0x160(%rbp),%xmm0
  movsd  %xmm0,-0x200(%rbp)
  movsd  -0x158(%rbp),%xmm0
  movsd  %xmm0,-0x1e8(%rbp)
  movsd  -0x1e8(%rbp),%xmm0
  movsd  %xmm0,-0x1f8(%rbp)
  movsd  -0x150(%rbp),%xmm0
  movsd  %xmm0,-0x1d0(%rbp)
  movsd  -0x1d0(%rbp),%xmm0
  movsd  %xmm0,-0x1f0(%rbp)
  movsd  -0x148(%rbp),%xmm0
  movsd  %xmm0,-0x1e0(%rbp)
  movsd  -0x140(%rbp),%xmm0
  movsd  %xmm0,-0x1c8(%rbp)
  movsd  -0x1c8(%rbp),%xmm0
  movsd  %xmm0,-0x1d8(%rbp)
  movsd  -0x138(%rbp),%xmm0
  movsd  %xmm0,-0x1c0(%rbp)
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x1b0(%rbp)
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x1a8(%rbp)
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  movsd  -0x1f0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1d8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x1a0(%rbp)
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x198(%rbp)
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x190(%rbp)
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1f0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1d8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x188(%rbp)
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  movsd  (%rax),%xmm2
  movsd  -0x1d0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1c8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x180(%rbp)
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1d0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1c8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x178(%rbp)
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x200(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1d0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1f8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm2
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x1e0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1c8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1f0(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x270(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm2
  movsd  -0x1d8(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x1c0(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x170(%rbp)
  mov    -0x280(%rbp),%rdx
  lea    -0x1b0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <ellipse2param@plt>
  mov    %rbx,%rsp
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L106
  call   <__stack_chk_fail@plt>
L106:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D35
data_type: string
name: unpack_data
arguments: tag: D9
data_type: string
name: unpack_data
arguments: tag: D23
data_type: string
name: unpack_data
arguments: tag: D26
data_type: string

tool: D35: fit_ellipse: invalid size.

tool: D9: fit_ellipse: invalid buffer.

tool: D23: fit_ellipse: invalid normalization matrix.

tool: D26: fit_ellipse: param must be non null.

assistant: ```c
void fit_ellipse(double *eq, double *vgg, int pts_size, double *param) {
  int i, j, k;
  double A[36];
  if (pts_size <= 0)
    error("fit_ellipse: invalid size.");
  if (eq == NULL)
    error("fit_ellipse: invalid buffer.");
  if (vgg == NULL)
    error("fit_ellipse: invalid normalization matrix.");
  if (param == NULL)
    error("fit_ellipse: param must be non null.");
  for (i = 0; i < 36; i++)
    A[i] = 0.0;
  for (i = 0; i < 6; i++)
    for (j = 0; j < 6; j++)
      for (k = 0; k < 4 * pts_size; k++)
        A[i * 6 + j] += eq[k * 6 + i] * eq[k * 6 + j];
  char JOBZ = 'V';
  char UPLO = 'U';
  int M = 6;
  int LDA = M;
  int LWORK = 4 * 6;
  int INFO;
  double W[6];
  double WORK[LWORK];
  dsyev_(&JOBZ, &UPLO, &M, A, &LDA, W, WORK, &LWORK, &INFO);
  double s[9];
  s[0] = A[0];
  s[1] = s[3] = A[1];
  s[2] = s[6] = A[2];
  s[4] = A[3];
  s[5] = s[7] = A[4];
  s[8] = A[5];
  double C[9];
  C[0] = vgg[0] * vgg[0] * s[0] + vgg[0] * vgg[3] * s[3] + vgg[0] * vgg[3] * s[1] + vgg[3] * vgg[3] * s[4];
  C[1] = vgg[0] * vgg[1] * s[0] + vgg[1] * vgg[3] * s[3] + vgg[0] * vgg[4] * s[1] + vgg[3] * vgg[4] * s[4];
  C[2] = vgg[0] * vgg[2] * s[0] + vgg[2] * vgg[3] * s[3] + vgg[0] * vgg[5] * s[1] + vgg[3] * vgg[5] * s[4] + vgg[0] * s[2] + vgg[3] * s[5];
  C[3] = vgg[0] * vgg[1] * s[0] + vgg[0] * vgg[4] * s[3] + vgg[1] * vgg[3] * s[1] + vgg[3] * vgg[4] * s[4];
  C[4] = vgg[1] * vgg[1] * s[0] + vgg[1] * vgg[4] * s[3] + vgg[1] * vgg[4] * s[1] + vgg[4] * vgg[4] * s[4];
  C[5] = vgg[1] * vgg[2] * s[0] + vgg[2] * vgg[4] * s[3] + vgg[1] * vgg[5] * s[1] + vgg[4] * vgg[5] * s[4] + vgg[1] * s[2] + vgg[4] * s[5];
  C[6] = vgg[0] * vgg[2] * s[0] + vgg[0] * vgg[5] * s[3] + vgg[0] * s[6] + vgg[2] * vgg[3] * s[1] + vgg[3] * vgg[5] * s[4] + vgg[3] * s[7];
  C[7] = vgg[1] * vgg[2] * s[0] + vgg[1] * vgg[5] * s[3] + vgg[1] * s[6] + vgg[2] * vgg[4] * s[1] + vgg[4] * vgg[5] * s[4] + vgg[4] * s[7];
  C[8] = vgg[2] * vgg[2] * s[0] + vgg[2] * vgg[5] * s[3] + vgg[2] * s[6] + vgg[2] * vgg[5] * s[1] + vgg[5] * vgg[5] * s[4] + vgg[5] * s[7] + vgg[2] * s[2] + vgg[5] * s[5] + s[8];
  ellipse2param(C, param);
}
```