user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<PolygonD_Clip>:
  endbr64
  mov    %rsi,%r8
  movapd %xmm0,%xmm7
  mov    %edx,%r9d
  mov    %rcx,%rsi
  mov    $0x0,%ecx
  test   %edi,%edi
  jle    L93
  movapd %xmm0,%xmm5
  mulsd  (%r8),%xmm5
  movapd %xmm1,%xmm0
  mulsd  0x8(%r8),%xmm0
  addsd  %xmm0,%xmm5
  movapd %xmm2,%xmm0
  mulsd  0x10(%r8),%xmm0
  addsd  %xmm0,%xmm5
  subsd  %xmm3,%xmm5
  mov    %r8,%r10
  mov    $0x0,%edx
  mov    $0x0,%r11d
  movapd %xmm4,%xmm6
  xorpd  D9(%rip),%xmm6
  jmp    L24
L23:
  cmp    %r9d,%ecx
  jge    L109
  movapd %xmm5,%xmm8
  subsd  %xmm0,%xmm8
  divsd  %xmm8,%xmm5
  movsd  (%r10),%xmm9
  movsd  (%rax),%xmm8
  subsd  %xmm9,%xmm8
  mulsd  %xmm5,%xmm8
  addsd  %xmm9,%xmm8
  movsd  %xmm8,(%rsi)
  movsd  0x8(%r10),%xmm9
  movsd  0x8(%rax),%xmm8
  subsd  %xmm9,%xmm8
  mulsd  %xmm5,%xmm8
  addsd  %xmm9,%xmm8
  movsd  %xmm8,0x8(%rsi)
  movsd  0x10(%r10),%xmm9
  movsd  0x10(%rax),%xmm8
  subsd  %xmm9,%xmm8
  mulsd  %xmm8,%xmm5
  addsd  %xmm9,%xmm5
  movsd  %xmm5,0x10(%rsi)
  lea    0x18(%rsi),%rsi
L109:
  add    $0x1,%ecx
L0:
  cmp    %edi,%edx
  je     L93
  movapd %xmm0,%xmm5
  mov    %rax,%r10
L24:
  add    $0x1,%edx
  mov    %r11,%rax
  cmp    %edi,%edx
  jge    L78
  lea    (%rdx,%rdx,2),%eax
  cltq
  shl    $0x3,%rax
L78:
  add    %r8,%rax
  movapd %xmm7,%xmm0
  mulsd  (%rax),%xmm0
  movapd %xmm1,%xmm8
  mulsd  0x8(%rax),%xmm8
  addsd  %xmm8,%xmm0
  movapd %xmm2,%xmm8
  mulsd  0x10(%rax),%xmm8
  addsd  %xmm8,%xmm0
  subsd  %xmm3,%xmm0
  comisd %xmm6,%xmm5
  jb     L113
  cmp    %ecx,%r9d
  jle    L92
  movsd  (%r10),%xmm8
  movsd  %xmm8,(%rsi)
  movsd  0x8(%r10),%xmm8
  movsd  %xmm8,0x8(%rsi)
  movsd  0x10(%r10),%xmm8
  movsd  %xmm8,0x10(%rsi)
  lea    0x18(%rsi),%rsi
L92:
  add    $0x1,%ecx
L113:
  comisd %xmm4,%xmm5
  jbe    L107
  comisd %xmm0,%xmm6
  ja     L23
L107:
  comisd %xmm5,%xmm6
  jbe    L0
  comisd %xmm4,%xmm0
  jbe    L0
  jmp    L23
L93:
  mov    %ecx,%eax
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D9
datatype: byte[16]

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
int PolygonD_Clip(int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, int outfrontmaxpoints, double *outfrontpoints) {
  int i, frontcount = 0;
  const double *n, *p;
  double frac, pdist, ndist;
  if (innumpoints < 1)
    return 0;
  n = inpoints;
  ndist = n[0] * planenormalx + n[1] * planenormaly + n[2] * planenormalz - planedist;
  for (i = 0; i < innumpoints; i++) {
    p = n;
    pdist = ndist;
    n = inpoints + ((i + 1) < innumpoints ? (i + 1) : 0) * 3;
    ndist = n[0] * planenormalx + n[1] * planenormaly + n[2] * planenormalz - planedist;
    if (pdist >= -epsilon) {
      if (frontcount < outfrontmaxpoints) {
        *outfrontpoints++ = p[0];
        *outfrontpoints++ = p[1];
        *outfrontpoints++ = p[2];
      }
      frontcount++;
    }
    if ((pdist > epsilon && ndist < -epsilon) || (pdist < -epsilon && ndist > epsilon)) {
      frac = pdist / (pdist - ndist);
      if (frontcount < outfrontmaxpoints) {
        *outfrontpoints++ = p[0] + frac * (n[0] - p[0]);
        *outfrontpoints++ = p[1] + frac * (n[1] - p[1]);
        *outfrontpoints++ = p[2] + frac * (n[2] - p[2]);
      }
      frontcount++;
    }
  }
  return frontcount;
}
```