user: Translate the below assembly code into C programming language:

```asm
<intersect_triangle>:
  endbr64
  mov    %rsi,%rax
  mov    0x8(%rsp),%rsi
  movsd  (%rdx),%xmm9
  movsd  (%rcx),%xmm7
  subsd  %xmm9,%xmm7
  movsd  0x8(%rdx),%xmm14
  movsd  0x8(%rcx),%xmm3
  subsd  %xmm14,%xmm3
  movsd  0x10(%rdx),%xmm13
  movsd  0x10(%rcx),%xmm8
  subsd  %xmm13,%xmm8
  movsd  (%r8),%xmm2
  subsd  %xmm9,%xmm2
  movsd  0x8(%r8),%xmm6
  subsd  %xmm14,%xmm6
  movsd  0x10(%r8),%xmm5
  subsd  %xmm13,%xmm5
  movsd  0x8(%rax),%xmm4
  movsd  0x10(%rax),%xmm12
  movapd %xmm5,%xmm1
  mulsd  %xmm4,%xmm1
  movapd %xmm6,%xmm10
  mulsd  %xmm12,%xmm10
  subsd  %xmm10,%xmm1
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm12
  movapd %xmm5,%xmm10
  mulsd  %xmm0,%xmm10
  subsd  %xmm10,%xmm12
  mulsd  %xmm6,%xmm0
  mulsd  %xmm2,%xmm4
  subsd  %xmm4,%xmm0
  movapd %xmm7,%xmm4
  mulsd  %xmm1,%xmm4
  movapd %xmm3,%xmm10
  mulsd  %xmm12,%xmm10
  addsd  %xmm10,%xmm4
  movapd %xmm8,%xmm10
  mulsd  %xmm0,%xmm10
  addsd  %xmm10,%xmm4
  comisd D20(%rip),%xmm4
  jbe    L39
  mov    $0x0,%edx
  movsd  D19(%rip),%xmm10
  comisd %xmm4,%xmm10
  ja     L16
L39:
  movsd  D49(%rip),%xmm11
  divsd  %xmm4,%xmm11
  movsd  (%rdi),%xmm10
  subsd  %xmm9,%xmm10
  movsd  0x8(%rdi),%xmm9
  subsd  %xmm14,%xmm9
  movsd  0x10(%rdi),%xmm4
  subsd  %xmm13,%xmm4
  mulsd  %xmm10,%xmm1
  mulsd  %xmm9,%xmm12
  addsd  %xmm12,%xmm1
  mulsd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  mulsd  %xmm11,%xmm1
  movsd  %xmm1,(%rsi)
  mov    $0x0,%edx
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  ja     L16
  comisd D49(%rip),%xmm1
  ja     L16
  movapd %xmm8,%xmm1
  mulsd  %xmm9,%xmm1
  movapd %xmm3,%xmm0
  mulsd  %xmm4,%xmm0
  subsd  %xmm0,%xmm1
  mulsd  %xmm7,%xmm4
  mulsd  %xmm10,%xmm8
  subsd  %xmm8,%xmm4
  mulsd  %xmm10,%xmm3
  mulsd  %xmm9,%xmm7
  subsd  %xmm7,%xmm3
  movapd %xmm1,%xmm0
  mulsd  (%rax),%xmm0
  movapd %xmm4,%xmm7
  mulsd  0x8(%rax),%xmm7
  addsd  %xmm7,%xmm0
  movapd %xmm3,%xmm7
  mulsd  0x10(%rax),%xmm7
  addsd  %xmm7,%xmm0
  mulsd  %xmm11,%xmm0
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rax)
  pxor   %xmm7,%xmm7
  comisd %xmm0,%xmm7
  ja     L16
  addsd  (%rsi),%xmm0
  comisd D49(%rip),%xmm0
  ja     L16
  mulsd  %xmm1,%xmm2
  mulsd  %xmm4,%xmm6
  addsd  %xmm6,%xmm2
  mulsd  %xmm3,%xmm5
  addsd  %xmm5,%xmm2
  mulsd  %xmm11,%xmm2
  movsd  %xmm2,(%r9)
  mov    $0x1,%edx
L16:
  mov    %edx,%eax
  ret
```

tool_calls: name: parse_data
arguments: data_label: D20
type_guessed: byte[16]
name: parse_data
arguments: data_label: D19
type_guessed: f64
name: parse_data
arguments: data_label: D49
type_guessed: f64

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

tool: D19: 1e-06

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