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

```asm
<getcoms>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %ecx,-0x5c(%rbp)
  mov    %r8d,-0x60(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L27
L10:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L31
L15:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x60(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x60(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %ecx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x60(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %ecx,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x38(%rbp),%xmm0
  addsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x30(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x28(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x20(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  addl   $0x1,-0x3c(%rbp)
L31:
  mov    -0x3c(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L15
  movsd  -0x38(%rbp),%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x30(%rbp),%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x28(%rbp),%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x40(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x40(%rbp)
L27:
  mov    -0x40(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jl     L10
  nop
  pop    %rbp
  ret
```

assistant: ```c
void getcoms(double *pos, double *coms, double *masslist, int beads, int mols) {
  int i, j;
  double x, y, z, X, Y, Z, M;
  for (i = 0; i < mols; i++) {
    X = 0;
    Y = 0;
    Z = 0;
    M = 0;
    for (j = 0; j < beads; j++) {
      x = masslist[j] * pos[mols * i + 3 * j];
      y = masslist[j] * pos[mols * i + 3 * j + 1];
      z = masslist[j] * pos[mols * i + 3 * j + 2];
      X += x;
      Y += y;
      Z += z;
      M += masslist[j];
    }
    X /= M;
    Y /= M;
    Z /= M;
    coms[3 * i] = X;
    coms[3 * i + 1] = Y;
    coms[3 * i + 2] = Z;
  }
  return;
}
```