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

```asm
<glmClosestPointOnTriangle3f>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x70(%rbp),%rcx
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  lea    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <glmComputeTriangleNormalf@plt>
  mov    -0x78(%rbp),%rcx
  lea    -0x38(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  lea    -0x44(%rbp),%rax
  mov    %rax,%rdi
  call   <glmClosestPointOnPlane3f@plt>
  mov    -0x70(%rbp),%rcx
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <glmIsPointInTriangle3f@plt>
  test   %rax,%rax
  je     L26
  mov    -0x58(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmCopyVector3f@plt>
  jmp    L66
L26:
  lea    -0x44(%rbp),%rcx
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rdi
  call   <glmClosestPointOnLineSegment3f@plt>
  lea    -0x44(%rbp),%rcx
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rsi
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <glmClosestPointOnLineSegment3f@plt>
  lea    -0x44(%rbp),%rcx
  mov    -0x60(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <glmClosestPointOnLineSegment3f@plt>
  mov    -0x78(%rbp),%rdx
  lea    -0x2c(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmComputeDistance3f@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x78(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmComputeDistance3f@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x78(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmComputeDistance3f@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x48(%rbp)
  movss  -0x48(%rbp),%xmm1
  movss  -0x4c(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  mov    $0x2,%edx
  mov    $0x1,%esi
  mov    $0x0,%edi
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <glmMinIndex3f@plt>
  cmp    $0x2,%eax
  je     L6
  cmp    $0x2,%eax
  jg     L66
  test   %eax,%eax
  je     L25
  cmp    $0x1,%eax
  je     L79
  jmp    L66
L25:
  mov    -0x58(%rbp),%rdx
  lea    -0x2c(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmCopyVector3f@plt>
  jmp    L66
L79:
  mov    -0x58(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmCopyVector3f@plt>
  jmp    L66
L6:
  mov    -0x58(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <glmCopyVector3f@plt>
  nop
L66:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L83
  call   <__stack_chk_fail@plt>
L83:
  leave
  ret
```

assistant: ```c
void glmClosestPointOnTriangle3f(float result[3], const float v1[3], const float v2[3], const float v3[3], const float p[3]) {
  float temp[3];
  float normal[3];
  float d1, d2, d3;
  float t1[3], t2[3], t3[3];
  glmComputeTriangleNormalf(normal, v1, v2, v3);
  glmClosestPointOnPlane3f(temp, v1, normal, p);
  if (glmIsPointInTriangle3f(p, v1, v2, v3)) {
    glmCopyVector3f(p, result);
    return;
  }
  glmClosestPointOnLineSegment3f(t1, v1, v2, temp);
  glmClosestPointOnLineSegment3f(t2, v2, v3, temp);
  glmClosestPointOnLineSegment3f(t3, v3, v1, temp);
  d1 = glmComputeDistance3f(t1, p);
  d2 = glmComputeDistance3f(t2, p);
  d3 = glmComputeDistance3f(t3, p);
  switch (glmMinIndex3f(d1, d2, d3, 0, 1, 2)) {
  case 0:
    glmCopyVector3f(t1, result);
    return;
    break;
  case 1:
    glmCopyVector3f(t2, result);
    return;
    break;
  case 2:
    glmCopyVector3f(t3, result);
    return;
    break;
  }
}
```