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

```asm
<intersection_circle_segment>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x40,%rsp
  movsd  0x8(%rdi),%xmm1
  movsd  (%rsi),%xmm3
  movsd  0x8(%rsi),%xmm5
  movsd  %xmm0,(%rsp)
  movsd  (%rdi),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  addsd  %xmm1,%xmm5
  addsd  %xmm0,%xmm3
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm3,0x18(%rsp)
  call   <pythag2@plt>
  movsd  (%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movapd %xmm0,%xmm2
  movsd  0x10(%rsp),%xmm5
  divsd  %xmm4,%xmm2
  movapd %xmm3,%xmm0
  movsd  %xmm4,0x8(%rsp)
  movapd %xmm5,%xmm1
  movsd  %xmm2,(%rsp)
  call   <pythag2@plt>
  movsd  0x8(%rbx),%xmm1
  movq   %xmm0,%r14
  movsd  (%rbx),%xmm0
  call   <pythag2@plt>
  movsd  (%rsp),%xmm2
  movsd  D15(%rip),%xmm3
  movsd  0x8(%rsp),%xmm4
  comisd %xmm2,%xmm3
  divsd  %xmm4,%xmm0
  ja     L31
L39:
  mulsd  %xmm0,%xmm0
  movapd %xmm3,%xmm5
  movsd  0x0(%r13),%xmm1
  xor    %eax,%eax
  mulsd  (%rbx),%xmm1
  mulsd  %xmm4,%xmm4
  mulsd  %xmm2,%xmm2
  subsd  %xmm3,%xmm2
  divsd  %xmm0,%xmm5
  movsd  0x8(%r13),%xmm0
  mulsd  0x8(%rbx),%xmm0
  addsd  %xmm0,%xmm1
  divsd  %xmm4,%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  subsd  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  mulsd  %xmm5,%xmm0
  comisd %xmm0,%xmm2
  jbe    L135
L110:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L34
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L31:
  movq   %r14,%xmm1
  xor    %eax,%eax
  divsd  %xmm4,%xmm1
  comisd %xmm1,%xmm3
  jbe    L39
  jmp    L110
  nop
L135:
  ucomisd %xmm0,%xmm2
  ja     L29
  sqrtsd %xmm0,%xmm0
L71:
  xorpd  D1(%rip),%xmm1
  xor    %eax,%eax
  lea    0x20(%rsp),%rdx
  lea    0x30(%rsp),%rcx
  mulsd  %xmm5,%xmm1
  movapd %xmm1,%xmm4
  addsd  %xmm0,%xmm1
  subsd  %xmm0,%xmm4
  movsd  %xmm1,0x28(%rsp)
  comisd %xmm2,%xmm4
  jbe    L53
  comisd %xmm4,%xmm3
  ja     L67
  nopl   0x0(%rax)
L53:
  add    $0x8,%rdx
  cmp    %rcx,%rdx
  je     L110
  movsd  (%rdx),%xmm4
  comisd %xmm2,%xmm4
  jbe    L53
  comisd %xmm4,%xmm3
  jbe    L53
L67:
  movsd  (%rbx),%xmm0
  lea    (%rax,%rax,1),%esi
  movslq %esi,%rsi
  mulsd  %xmm4,%xmm0
  addsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%rbp,%rsi,8)
  movsd  0x8(%rbx),%xmm0
  mulsd  %xmm4,%xmm0
  addsd  0x8(%r13),%xmm0
  movsd  %xmm0,0x8(%rbp,%rsi,8)
  test   %r12,%r12
  je     L62
  movslq %eax,%rsi
  movsd  %xmm4,(%r12,%rsi,8)
L62:
  add    $0x1,%eax
  jmp    L53
L34:
  call   <__stack_chk_fail@plt>
L29:
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm5,(%rsp)
  call   <sqrt@plt>
  mov    D15(%rip),%rax
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm2,%xmm2
  movsd  (%rsp),%xmm5
  movq   %rax,%xmm3
  jmp    L71
```

tool_calls: name: unpack_data
arguments: label: D15
type_infered: f64
name: unpack_data
arguments: label: D1
type_infered: f32[4]

tool: D15: 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;
  }
}
```