user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fit_cornu_half>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  movsd  %xmm0,-0x88(%rbp)
  movsd  %xmm1,-0x90(%rbp)
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %rdx,-0xa8(%rbp)
  mov    %rcx,-0xb0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x15,-0x74(%rbp)
  movsd  -0x88(%rbp),%xmm0
  addsd  -0x90(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jg     L85
  movsd  -0x88(%rbp),%xmm1
  movsd  D6(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x90(%rbp),%xmm1
  movsd  D6(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
L85:
  movsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x88(%rbp),%xmm1
  movsd  D13(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0xb8(%rbp)
  movsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm3
  subsd  -0x88(%rbp),%xmm3
  movq   %xmm3,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  -0xb8(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x30(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x78(%rbp)
  jmp    L64
L33:
  movsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x38(%rbp),%xmm1
  movsd  D10(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x88(%rbp),%xmm0
  addsd  -0x90(%rbp),%xmm0
  movsd  -0x20(%rbp),%xmm2
  movsd  D45(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x20(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x20(%rbp),%xmm0
  addsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  lea    -0x68(%rbp),%rcx
  lea    -0x70(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <eval_cornu@plt>
  lea    -0x58(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <eval_cornu@plt>
  movsd  -0x58(%rbp),%xmm0
  movsd  -0x68(%rbp),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  -0x60(%rbp),%xmm0
  movsd  -0x70(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movapd %xmm2,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x50(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  subsd  -0x88(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <mod_2pi@plt>
  test   %rax,%rax
  jns    L54
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L90
L54:
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L90:
  addl   $0x1,-0x78(%rbp)
L64:
  mov    -0x78(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L33
  mov    -0x98(%rbp),%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xa0(%rbp),%rax
  movsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  cmpq   $0x0,-0xa8(%rbp)
  jne    L68
  cmpq   $0x0,-0xb0(%rbp)
  je     L96
L68:
  movsd  -0x58(%rbp),%xmm0
  movsd  -0x68(%rbp),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  -0x60(%rbp),%xmm0
  movsd  -0x70(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movapd %xmm2,%xmm1
  movq   %rax,%xmm0
  call   <hypot@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0xa8(%rbp)
  je     L92
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  mov    -0xa8(%rbp),%rax
  movsd  %xmm0,(%rax)
L92:
  cmpq   $0x0,-0xb0(%rbp)
  je     L96
  movsd  -0x48(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  mov    -0xb0(%rbp),%rax
  movsd  %xmm0,(%rax)
L96:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L13
  call   <__stack_chk_fail@plt>
L13:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D6
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D13
data_type: f64
name: extract_symbolic_data
arguments: tag: D16
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D10
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D45
data_type: byte[8]

tool: {"D6": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

tool: D13: 0.29112

tool: {"D16": [0xcd,0xcc,0xcc,0xcc,0xcc,0xcc,0xec,0x3f]}

tool: {"D10": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D45": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

assistant: ```c
void fit_cornu_half(double th0, double th1, double *pt0, double *pt1, double *pk0, double *pk1) {
  int i;
  const int max_iter = 21;
  double t0, t1, t_m;
  double tl, tr, t_est;
  double s0, c0, s1, c1;
  if (fabs(th0 + th1) < 1e-6) {
    th0 += 1e-6;
    th1 += 1e-6;
  }
  t_est = 0.29112 * (th1 + th0) / sqrt(th1 - th0);
  tl = t_est * .9;
  tr = t_est * 2;
  for (i = 0; i < max_iter; i++) {
    double dt;
    double chord_th;
    t_m = .5 * (tl + tr);
    dt = (th0 + th1) / (4 * t_m);
    t0 = t_m - dt;
    t1 = t_m + dt;
    eval_cornu(t0, &s0, &c0);
    eval_cornu(t1, &s1, &c1);
    chord_th = atan2(s1 - s0, c1 - c0);
    if (mod_2pi(chord_th - t0 * t0 - th0) < 0)
      tl = t_m;
    else
      tr = t_m;
  }
  *pt0 = t0;
  *pt1 = t1;
  if (pk0 || pk1) {
    double chordlen = hypot(s1 - s0, c1 - c0);
    if (pk0)
      *pk0 = t0 * chordlen;
    if (pk1)
      *pk1 = t1 * chordlen;
  }
}
```