user: Please show me the C implementation that matches the assembly code listed below:

```asm
<u2f>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x538,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x528(%rsp)
  xor    %eax,%eax
  test   %r8,%r8
  je     L76
L114:
  cmp    $0x8,%r13d
  jle    L83
  lea    0x30(%rsp),%r9
  lea    0x10(%rsp),%rcx
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %r9,%r8
  mov    %r13d,%edx
  mov    %r9,0x8(%rsp)
  mov    %rcx,(%rsp)
  call   <normu@plt>
  mov    0x8(%rsp),%r9
  mov    %r15,%rdx
  mov    %r14,%rdi
  mov    (%rsp),%r8
  mov    %r13d,%ecx
  mov    %r12,%rsi
  lea    0x50(%rsp),%r14
  lea    0x2a0(%rsp),%r15
  call   <lin_fmN@plt>
  mov    $0x9,%ecx
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <cov_mat@plt>
  mov    $0x9,%edx
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <lap_eig@plt>
  mov    $0x9,%esi
  mov    %r15,%rdi
  call   <trnm@plt>
  mov    $0x1,%eax
  xor    %edx,%edx
  nop
L60:
  movsd  0x50(%rsp,%rdx,8),%xmm0
  comisd (%r14,%rax,8),%xmm0
  jbe    L46
  movslq %eax,%rdx
L46:
  add    $0x1,%rax
  cmp    $0x9,%rax
  jne    L60
  lea    (%r15,%rdx,8),%rax
L41:
  mov    %rbp,%rdx
  lea    0x288(%rax),%rcx
  nopl   0x0(%rax)
L103:
  movsd  (%rax),%xmm0
  add    $0x48,%rax
  add    $0x8,%rdx
  movsd  %xmm0,-0x8(%rdx)
  cmp    %rax,%rcx
  jne    L103
  mov    %rbp,%rdi
  call   <singulF@plt>
  cmp    $0x8,%r13d
  jg     L107
  test   %rbx,%rbx
  je     L110
L104:
  mov    0x528(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x538,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L83:
  mov    %r13d,%ecx
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <lin_fm@plt>
  lea    0x2a0(%rsp),%rdx
  mov    %r12,%rsi
  lea    0x50(%rsp),%rdi
  mov    $0x8,%r9d
  lea    0xa0(%rsp),%r8
  mov    $0x9,%ecx
  call   <svduv@plt>
  lea    0x2e0(%rsp),%rax
  jmp    L41
  cs nopw 0x0(%rax,%rax,1)
L107:
  lea    0x30(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <denormF@plt>
  test   %rbx,%rbx
  jne    L104
L110:
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L104
  nopl   0x0(%rax,%rax,1)
L76:
  lea    (%rdx,%rdx,8),%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  jmp    L114
L68:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void u2f(const double *u, const int *inl, int len, double *F, double *buffer) {
  double A1[3], A2[3];
  double *Z, V[9 * 9], U[8 * 8], D[9], *p;
  int i, j;
  if (buffer == NULL)
    Z = (double *)malloc(sizeof(double) * 9 * len);
  else
    Z = buffer;
  if (len > 8) {
    normu(u, inl, len, A1, A2);
    lin_fmN(u, Z, inl, len, A1, A2);
    cov_mat(V, Z, len, 9);
    lap_eig(V, D, 9);
    trnm(V, 9);
  } else {
    lin_fm(u, Z, inl, len);
    svduv(D, Z, V, 9, U, 8);
  }
  if (len > 8) {
    j = 0;
    for (i = 1; i < 9; i++)
      if (D[i] < D[j])
        j = i;
    p = V + j;
  } else
    p = V + 8;
  for (i = 0; i < 9; i++) {
    F[i] = *p;
    p += 9;
  }
  singulF(F);
  if (len > 8)
    denormF(F, A1, A2);
  if (buffer == NULL)
    free(Z);
}
```