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

```asm
<intersect_triangle>:
  endbr64
  movsd  0x8(%rdx),%xmm15
  movsd  0x10(%rdx),%xmm14
  mov    %rsi,%rax
  movsd  0x8(%r8),%xmm6
  movsd  0x10(%r8),%xmm5
  movsd  0x8(%rax),%xmm4
  movsd  0x10(%rax),%xmm13
  subsd  %xmm15,%xmm6
  subsd  %xmm14,%xmm5
  movsd  (%rdx),%xmm9
  movsd  (%r8),%xmm2
  movsd  (%rax),%xmm0
  movsd  (%rcx),%xmm7
  subsd  %xmm9,%xmm2
  movsd  0x8(%rcx),%xmm3
  movsd  0x10(%rcx),%xmm8
  movapd %xmm5,%xmm1
  movapd %xmm6,%xmm10
  subsd  %xmm9,%xmm7
  mov    0x8(%rsp),%rsi
  mulsd  %xmm13,%xmm10
  subsd  %xmm15,%xmm3
  subsd  %xmm14,%xmm8
  mulsd  %xmm4,%xmm1
  mulsd  %xmm2,%xmm13
  mulsd  %xmm2,%xmm4
  subsd  %xmm10,%xmm1
  movapd %xmm5,%xmm10
  mulsd  %xmm0,%xmm10
  mulsd  %xmm6,%xmm0
  subsd  %xmm10,%xmm13
  movapd %xmm3,%xmm10
  subsd  %xmm4,%xmm0
  movapd %xmm7,%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  %xmm13,%xmm10
  addsd  %xmm10,%xmm4
  movapd %xmm8,%xmm10
  mulsd  %xmm0,%xmm10
  addsd  %xmm10,%xmm4
  comisd D10(%rip),%xmm4
  jbe    L10
  movsd  D13(%rip),%xmm10
  comisd %xmm4,%xmm10
  ja     L41
L10:
  movsd  D23(%rip),%xmm11
  movsd  (%rdi),%xmm10
  movapd %xmm11,%xmm12
  subsd  %xmm9,%xmm10
  movsd  0x8(%rdi),%xmm9
  divsd  %xmm4,%xmm12
  movsd  0x10(%rdi),%xmm4
  subsd  %xmm15,%xmm9
  mulsd  %xmm10,%xmm1
  subsd  %xmm14,%xmm4
  mulsd  %xmm9,%xmm13
  mulsd  %xmm4,%xmm0
  addsd  %xmm13,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  mulsd  %xmm12,%xmm0
  comisd %xmm0,%xmm1
  movsd  %xmm0,(%rsi)
  ja     L41
  comisd %xmm11,%xmm0
  ja     L41
  movapd %xmm8,%xmm13
  movapd %xmm3,%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  %xmm9,%xmm13
  mulsd  %xmm7,%xmm4
  mulsd  %xmm10,%xmm8
  mulsd  %xmm9,%xmm7
  mulsd  %xmm10,%xmm3
  subsd  %xmm0,%xmm13
  movsd  (%rax),%xmm0
  subsd  %xmm8,%xmm4
  mulsd  %xmm13,%xmm0
  subsd  %xmm7,%xmm3
  movsd  0x8(%rax),%xmm7
  mulsd  %xmm4,%xmm7
  addsd  %xmm7,%xmm0
  movsd  0x10(%rax),%xmm7
  mov    0x10(%rsp),%rax
  mulsd  %xmm3,%xmm7
  addsd  %xmm7,%xmm0
  mulsd  %xmm12,%xmm0
  comisd %xmm0,%xmm1
  movsd  %xmm0,(%rax)
  ja     L41
  addsd  (%rsi),%xmm0
  comisd %xmm11,%xmm0
  ja     L41
  mulsd  %xmm13,%xmm2
  mov    $0x1,%eax
  mulsd  %xmm4,%xmm6
  mulsd  %xmm3,%xmm5
  addsd  %xmm6,%xmm2
  addsd  %xmm5,%xmm2
  mulsd  %xmm12,%xmm2
  movsd  %xmm2,(%r9)
  ret
  nopw   0x0(%rax,%rax,1)
L41:
  xor    %eax,%eax
  ret
```

tool_calls: name: unpack_data
arguments: tag: D10
data_type: byte[16]
name: unpack_data
arguments: tag: D13
data_type: f64
name: unpack_data
arguments: tag: D23
data_type: f64

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

tool: D13: 1e-06

tool: D23: 1

assistant: ```c
int intersect_triangle(double orig[3], double dir[3], double vert0[3], double vert1[3], double vert2[3], double *t, double *u, double *v) {
  double edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
  double det, inv_det;
  {
    edge1[0] = vert1[0] - vert0[0];
    edge1[1] = vert1[1] - vert0[1];
    edge1[2] = vert1[2] - vert0[2];
  };
  {
    edge2[0] = vert2[0] - vert0[0];
    edge2[1] = vert2[1] - vert0[1];
    edge2[2] = vert2[2] - vert0[2];
  };
  {
    pvec[0] = dir[1] * edge2[2] - dir[2] * edge2[1];
    pvec[1] = dir[2] * edge2[0] - dir[0] * edge2[2];
    pvec[2] = dir[0] * edge2[1] - dir[1] * edge2[0];
  };
  det = (edge1[0] * pvec[0] + edge1[1] * pvec[1] + edge1[2] * pvec[2]);
  if (det > -0.000001 && det < 0.000001) {
    return 0;
  }
  inv_det = 1.0 / det;
  {
    tvec[0] = orig[0] - vert0[0];
    tvec[1] = orig[1] - vert0[1];
    tvec[2] = orig[2] - vert0[2];
  };
  *u = (tvec[0] * pvec[0] + tvec[1] * pvec[1] + tvec[2] * pvec[2]) * inv_det;
  if (*u < 0.0 || *u > 1.0) {
    return 0;
  }
  {
    qvec[0] = tvec[1] * edge1[2] - tvec[2] * edge1[1];
    qvec[1] = tvec[2] * edge1[0] - tvec[0] * edge1[2];
    qvec[2] = tvec[0] * edge1[1] - tvec[1] * edge1[0];
  };
  *v = (dir[0] * qvec[0] + dir[1] * qvec[1] + dir[2] * qvec[2]) * inv_det;
  if (*v < 0.0 || *u + *v > 1.0) {
    return 0;
  }
  *t = (edge2[0] * qvec[0] + edge2[1] * qvec[1] + edge2[2] * qvec[2]) * inv_det;
  return 1;
}
```