user: 请从给定的汇编指令推导出C源代码:

```asm
<ctm_fitting>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x200,%rsp
  mov    %rdi,-0x1e8(%rbp)
  mov    %esi,-0x1ec(%rbp)
  mov    %rdx,-0x1f8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x120(%rbp),%rax
  mov    $0x48,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x160(%rbp),%rax
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x140(%rbp),%rax
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x180(%rbp),%rax
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x1a0(%rbp),%rax
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x1ec(%rbp),%edx
  mov    -0x1e8(%rbp),%rax
  mov    $0x4,%ecx
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  movl   $0x0,-0x1dc(%rbp)
  jmp    L24
L51:
  mov    -0x1dc(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1e8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1a8(%rbp)
  movsd  -0x120(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x120(%rbp)
  movsd  -0x118(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x118(%rbp)
  movsd  -0x110(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x110(%rbp)
  movsd  -0x100(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x100(%rbp)
  movsd  -0xf8(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xf8(%rbp)
  movsd  -0x160(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x160(%rbp)
  movsd  -0x158(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x158(%rbp)
  movsd  -0x150(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x150(%rbp)
  movsd  -0x140(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x140(%rbp)
  movsd  -0x138(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x1a8(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x138(%rbp)
  movsd  -0x130(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x130(%rbp)
  addl   $0x1,-0x1dc(%rbp)
L24:
  mov    -0x1dc(%rbp),%eax
  cmp    -0x1ec(%rbp),%eax
  jl     L51
  movsd  -0x118(%rbp),%xmm0
  movsd  %xmm0,-0x108(%rbp)
  movsd  -0x110(%rbp),%xmm0
  movsd  %xmm0,-0xf0(%rbp)
  movsd  -0xf8(%rbp),%xmm0
  movsd  %xmm0,-0xe8(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1ec(%rbp),%xmm0
  movsd  %xmm0,-0xe0(%rbp)
  lea    -0x120(%rbp),%rax
  mov    $0x3,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  lea    -0x160(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  lea    -0x140(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  movl   $0x0,-0x1dc(%rbp)
  jmp    L20
L86:
  mov    -0x1dc(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    -0xd0(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1c0(%rbp)
  mov    -0x1dc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    -0x120(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1b8(%rbp)
  mov    -0x1dc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    -0x160(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1b0(%rbp)
  mov    -0x1b8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x1c0(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x1c0(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x1b8(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x1c0(%rbp),%rax
  lea    0x10(%rax),%rdx
  mov    -0x1b8(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x1c0(%rbp),%rax
  lea    0x18(%rax),%rdx
  mov    -0x1b0(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  addl   $0x1,-0x1dc(%rbp)
L20:
  cmpl   $0x2,-0x1dc(%rbp)
  jle    L86
  movl   $0x0,-0x1dc(%rbp)
  jmp    L22
L57:
  mov    -0x1dc(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1d8(%rbp)
  mov    -0x1dc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    -0x120(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1d0(%rbp)
  mov    -0x1dc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    -0x140(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1c8(%rbp)
  mov    -0x1d0(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x1d8(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x1d8(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x1d0(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x1d8(%rbp),%rax
  lea    0x10(%rax),%rdx
  mov    -0x1d0(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x1d8(%rbp),%rax
  lea    0x18(%rax),%rdx
  mov    -0x1c8(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  addl   $0x1,-0x1dc(%rbp)
L22:
  cmpl   $0x2,-0x1dc(%rbp)
  jle    L57
  lea    -0xd0(%rbp),%rax
  mov    $0x4,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  lea    -0x70(%rbp),%rax
  mov    $0x4,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  lea    -0x1a0(%rbp),%rcx
  lea    -0xd0(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <gauss1@plt>
  lea    -0x180(%rbp),%rcx
  lea    -0x70(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <gauss1@plt>
  lea    -0x1a0(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  lea    -0x180(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    %rax,%rsi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <print_matrix@plt>
  movl   $0x0,-0x1dc(%rbp)
  jmp    L33
L53:
  mov    -0x1dc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1f8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1dc(%rbp),%eax
  cltq
  movsd  -0x1a0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x1dc(%rbp),%eax
  add    $0x3,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1f8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1dc(%rbp),%eax
  cltq
  movsd  -0x180(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  addl   $0x1,-0x1dc(%rbp)
L33:
  cmpl   $0x2,-0x1dc(%rbp)
  jle    L53
  mov    -0x1f8(%rbp),%rax
  add    $0x30,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x1f8(%rbp),%rax
  add    $0x38,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x1f8(%rbp),%rax
  add    $0x40,%rax
  movsd  D29(%rip),%xmm0
  movsd  %xmm0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L52
  call   <__stack_chk_fail@plt>
L52:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D2
datatype: string
name: read_data
arguments: data_label: D25
datatype: string
name: read_data
arguments: data_label: D11
datatype: string
name: read_data
arguments: data_label: D28
datatype: string
name: read_data
arguments: data_label: D33
datatype: string
name: read_data
arguments: data_label: D76
datatype: string
name: read_data
arguments: data_label: D45
datatype: string
name: read_data
arguments: data_label: D1
datatype: string
name: read_data
arguments: data_label: D29
datatype: byte[8]

tool: D2: XY

tool: D25: ata

tool: D11: atx

tool: D28: aty

tool: D33: ata\atx

tool: D76: ata\aty

tool: D45: abc

tool: D1: def

tool: {"D29": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void ctm_fitting(double *xy, int cnt, double *coeff_return) {
  int i;
  double abc[3], def[3];
  double ata[9], atx[3], aty[3];
  memset(ata, 0, sizeof ata);
  ;
  memset(atx, 0, sizeof atx);
  ;
  memset(aty, 0, sizeof aty);
  ;
  memset(def, 0, sizeof def);
  ;
  memset(abc, 0, sizeof abc);
  ;
  print_matrix("XY", xy, cnt, 4);
  for (i = 0; i < cnt; i++) {
    double *xy1 = xy + 4 * i;
    ata[0] += xy1[0] * xy1[0];
    ata[1] += xy1[0] * xy1[1];
    ata[2] += xy1[0];
    ata[4] += xy1[1] * xy1[1];
    ata[5] += xy1[1];
    atx[0] += xy1[0] * xy1[2];
    atx[1] += xy1[1] * xy1[2];
    atx[2] += xy1[2];
    aty[0] += xy1[0] * xy1[3];
    aty[1] += xy1[1] * xy1[3];
    aty[2] += xy1[3];
  }
  ata[3] = ata[1];
  ata[6] = ata[2];
  ata[7] = ata[5];
  ata[8] = cnt;
  print_matrix("ata", ata, 3, 3);
  print_matrix("atx", atx, 3, 1);
  print_matrix("aty", aty, 3, 1);
  double bgauss1[4 * 3], bgauss2[4 * 3];
  for (i = 0; i < 3; i++) {
    double *b = bgauss1 + i * 4;
    double *a = ata + i * 3;
    double *x = atx + i;
    b[0] = a[0];
    b[1] = a[1];
    b[2] = a[2];
    b[3] = x[0];
  }
  for (i = 0; i < 3; i++) {
    double *b = bgauss2 + i * 4;
    double *a = ata + i * 3;
    double *x = aty + i;
    b[0] = a[0];
    b[1] = a[1];
    b[2] = a[2];
    b[3] = x[0];
  }
  print_matrix("ata\\atx", bgauss1, 3, 4);
  print_matrix("ata\\aty", bgauss2, 3, 4);
  gauss1(bgauss1, abc, 3);
  gauss1(bgauss2, def, 3);
  print_matrix("abc", abc, 3, 1);
  print_matrix("def", def, 3, 1);
  for (i = 0; i < 3; i++) {
    coeff_return[3 * 0 + i] = abc[i];
    coeff_return[3 * 1 + i] = def[i];
  }
  coeff_return[3 * 2 + 0] = 0;
  coeff_return[3 * 2 + 1] = 0;
  coeff_return[3 * 2 + 2] = 1;
}
```