user: 请将以下的汇编代码转换成C语言代码:

```asm
<intersection_circle_segment>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x20,%rsp
  movsd  0x8(%rdi),%xmm1
  movsd  (%rsi),%xmm3
  movsd  0x8(%rsi),%xmm4
  movsd  %xmm0,(%rsp)
  movsd  (%rdi),%xmm0
  addsd  %xmm1,%xmm4
  addsd  %xmm0,%xmm3
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm3,0x18(%rsp)
  call   <pythag2@plt>
  movsd  (%rsp),%xmm7
  movsd  0x18(%rsp),%xmm3
  movapd %xmm0,%xmm2
  movsd  0x10(%rsp),%xmm4
  divsd  %xmm7,%xmm2
  movapd %xmm3,%xmm0
  movsd  %xmm7,0x8(%rsp)
  movapd %xmm4,%xmm1
  movsd  %xmm2,(%rsp)
  call   <pythag2@plt>
  movsd  0x8(%r12),%xmm1
  movq   %xmm0,%r14
  movsd  (%r12),%xmm0
  call   <pythag2@plt>
  movsd  (%rsp),%xmm2
  movsd  D19(%rip),%xmm3
  movsd  0x8(%rsp),%xmm7
  movapd %xmm0,%xmm1
  comisd %xmm2,%xmm3
  divsd  %xmm7,%xmm1
  ja     L106
L74:
  mulsd  %xmm1,%xmm1
  movsd  0x0(%r13),%xmm5
  movapd %xmm3,%xmm6
  xor    %eax,%eax
  movsd  (%r12),%xmm4
  mulsd  %xmm7,%xmm7
  mulsd  %xmm2,%xmm2
  movapd %xmm5,%xmm0
  mulsd  %xmm4,%xmm0
  subsd  %xmm3,%xmm2
  divsd  %xmm1,%xmm6
  movsd  0x8(%r13),%xmm1
  mulsd  0x8(%r12),%xmm1
  addsd  %xmm0,%xmm1
  divsd  %xmm7,%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm6,%xmm0
  subsd  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  mulsd  %xmm6,%xmm0
  comisd %xmm0,%xmm2
  jbe    L39
L83:
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L106:
  movq   %r14,%xmm0
  xor    %eax,%eax
  divsd  %xmm7,%xmm0
  comisd %xmm0,%xmm3
  jbe    L74
  jmp    L83
  nop
L39:
  ucomisd %xmm0,%xmm2
  ja     L123
  sqrtsd %xmm0,%xmm0
L99:
  xorpd  D1(%rip),%xmm1
  mulsd  %xmm6,%xmm1
  movapd %xmm1,%xmm6
  addsd  %xmm0,%xmm1
  subsd  %xmm0,%xmm6
  comisd %xmm2,%xmm6
  jbe    L73
  comisd %xmm6,%xmm3
  ja     L71
L73:
  xor    %eax,%eax
L66:
  comisd %xmm2,%xmm1
  jbe    L83
  comisd %xmm1,%xmm3
  jbe    L83
  movsd  (%r12),%xmm0
  lea    (%rax,%rax,1),%edx
  movslq %edx,%rdx
  mulsd  %xmm1,%xmm0
  addsd  0x0(%r13),%xmm0
  movsd  %xmm0,(%rbx,%rdx,8)
  movsd  0x8(%r12),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%r13),%xmm0
  movsd  %xmm0,0x8(%rbx,%rdx,8)
  test   %rbp,%rbp
  je     L46
  movslq %eax,%rdx
  movsd  %xmm1,0x0(%rbp,%rdx,8)
L46:
  add    $0x1,%eax
  jmp    L83
  nopl   0x0(%rax,%rax,1)
L71:
  mulsd  %xmm6,%xmm4
  addsd  %xmm5,%xmm4
  movsd  %xmm4,(%rbx)
  movsd  0x8(%r12),%xmm0
  mulsd  %xmm6,%xmm0
  addsd  0x8(%r13),%xmm0
  movsd  %xmm0,0x8(%rbx)
  test   %rbp,%rbp
  je     L111
  movsd  %xmm6,0x0(%rbp)
L111:
  mov    $0x1,%eax
  jmp    L66
L123:
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  movsd  %xmm5,(%rsp)
  call   <sqrt@plt>
  mov    D19(%rip),%rax
  movsd  (%rsp),%xmm5
  pxor   %xmm2,%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm6
  movsd  0x8(%rsp),%xmm4
  movq   %rax,%xmm3
  jmp    L99
```

tool_calls: name: extract_symbolic_data
arguments: label: D19
data_type: f64
name: extract_symbolic_data
arguments: label: D1
data_type: f32[4]

tool: D19: 1

tool: {"D1": [0.0,-0.0,0.0,0.0]}

assistant: ```c
int intersection_circle_segment(double radius, const double seg0[2], const double segd[2], double isect[4], double t_[2]) {
  int i;
  double seg1[2] = {seg0[0] + segd[0], seg0[1] + segd[1]};
  double r[2] = {pythag2(seg0[0], seg0[1]) / radius, pythag2(seg1[0], seg1[1]) / radius};
  double s = pythag2(segd[0], segd[1]) / radius;
  if (r[0] < 1 && r[1] < 1) {
    return 0;
  }
  double isl2 = 1. / (s * s);
  double seg_dot = (seg0[0] * segd[0] + seg0[1] * segd[1]) / (radius * radius);
  double disc = (seg_dot * seg_dot * isl2 - (r[0] * r[0] - 1)) * isl2;
  double t0 = -seg_dot * isl2;
  double t[2];
  if (disc < 0) {
    return 0;
  } else {
    int c = 0;
    disc = sqrt(disc);
    t[0] = t0 - disc;
    t[1] = t0 + disc;
    for (i = 0; i < 2; ++i) {
      if (0 < t[i] && t[i] < 1) {
        isect[2 * c + 0] = seg0[0] + t[i] * segd[0];
        isect[2 * c + 1] = seg0[1] + t[i] * segd[1];
        if (NULL != t_) {
          t_[c] = t[i];
          t_[c] = t[i];
        }
        ++c;
      }
    }
    return c;
  }
}
```