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

```asm
<ComputeFirstMoment4D>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    0x8(%r8),%r15d
  mov    %rdx,-0x10(%rsp)
  mov    %rcx,-0x28(%rsp)
  mov    %r8,-0x38(%rsp)
  test   %r15d,%r15d
  jle    L165
  mov    %rdi,%r14
  mov    0x4(%r8),%edi
  mov    %rsi,%r10
  mov    %r9d,%esi
  neg    %esi
  mov    %r9d,%r13d
  lea    (%r15,%r15,1),%r11d
  lea    (%rdi,%rdi,1),%ebx
  mov    %edi,-0x60(%rsp)
  mov    %esi,-0x3c(%rsp)
  mov    %ebx,-0x20(%rsp)
  test   %edi,%edi
  jle    L233
  mov    (%r8),%r12d
  mov    %edi,%ebp
  xor    %ebx,%ebx
  mov    %r14,0x8(%rsp)
  mov    %r11d,%r13d
  mov    %r9d,%r11d
  imul   %r12d,%ebp
  lea    (%r12,%r12,1),%eax
  mov    %r12d,%r14d
  mov    %r15d,%r12d
  mov    %eax,-0x40(%rsp)
  lea    0x2(%r9,%r9,1),%eax
  mov    %ebx,%r15d
  imul   %r9d,%eax
  add    %eax,%eax
  mov    %eax,-0x30(%rsp)
  lea    0x1(%r9),%eax
  mov    %eax,-0x54(%rsp)
  add    %edi,%eax
  mov    %eax,-0x4(%rsp)
  mov    %esi,%eax
  sub    %r9d,%eax
  sub    $0x1,%eax
  mov    %eax,(%rsp)
L29:
  mov    %r15d,%eax
  imul   %ebp,%eax
  mov    %eax,-0x5c(%rsp)
  test   %r14d,%r14d
  jle    L173
  lea    -0x1(%r14),%ebx
  mov    -0x54(%rsp),%eax
  mov    %ebx,-0x1c(%rsp)
  mov    -0x40(%rsp),%ebx
  mov    %eax,-0x70(%rsp)
  sub    $0x1,%ebx
  mov    %ebx,-0x74(%rsp)
  lea    (%r15,%rax,1),%ebx
  mov    -0x30(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rsp)
L192:
  mov    -0x1c(%rsp),%eax
  mov    -0x28(%rsp),%rdi
  movq   $0x0,-0x68(%rsp)
  mov    -0x54(%rsp),%r9d
  mov    %rax,-0x50(%rsp)
  movslq -0x5c(%rsp),%rax
  lea    (%rdi,%rax,4),%rax
  mov    %rax,-0x48(%rsp)
  mov    -0x20(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rsp)
L191:
  mov    (%rsp),%eax
  pxor   %xmm0,%xmm0
  add    -0x70(%rsp),%eax
  movl   $0x0,-0x58(%rsp)
  mov    %eax,-0x6c(%rsp)
  movaps %xmm0,%xmm1
  cmp    -0x3c(%rsp),%r11d
  jl     L9
L104:
  mov    -0x6c(%rsp),%edi
  mov    -0x8(%rsp),%edx
  mov    -0x68(%rsp),%r8d
  mov    %edi,%eax
  neg    %eax
  cmovs  %edi,%eax
  sub    %eax,%edx
  cmp    -0x60(%rsp),%eax
  cmovge %edx,%eax
  sub    %r11d,%r8d
  imul   %r14d,%eax
  mov    %eax,%edi
  nopw   0x0(%rax,%rax,1)
L117:
  mov    %r8d,%eax
  mov    -0x74(%rsp),%esi
  mov    %r15d,%edx
  neg    %eax
  cmovs  %r8d,%eax
  sub    %eax,%esi
  cmp    %eax,%r14d
  cmovg  %eax,%esi
  sub    %r11d,%edx
  nopl   0x0(%rax,%rax,1)
L208:
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  cmp    %eax,%r12d
  jg     L4
  mov    %r13d,%ecx
  add    $0x1,%edx
  sub    %eax,%ecx
  lea    -0x1(%rcx),%eax
  imul   %ebp,%eax
  add    %edi,%eax
  add    %esi,%eax
  cltq
  addss  (%r10,%rax,4),%xmm0
  cmp    %edx,%ebx
  jne    L208
  add    $0x1,%r8d
  cmp    %r9d,%r8d
  jne    L117
L130:
  addl   $0x1,-0x6c(%rsp)
  mov    -0x18(%rsp),%edi
  mov    -0x6c(%rsp),%eax
  add    %edi,-0x58(%rsp)
  cmp    %eax,-0x70(%rsp)
  jne    L104
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x58(%rsp),%xmm1
L9:
  divss  %xmm1,%xmm0
  mov    -0x48(%rsp),%rax
  mov    -0x68(%rsp),%rdi
  add    $0x1,%r9d
  movss  %xmm0,(%rax,%rdi,4)
  lea    0x1(%rdi),%rax
  cmp    %rdi,-0x50(%rsp)
  je     L14
  mov    %rax,-0x68(%rsp)
  jmp    L191
  nopl   0x0(%rax)
L4:
  imul   %ebp,%eax
  add    $0x1,%edx
  add    %edi,%eax
  add    %esi,%eax
  cltq
  addss  (%r10,%rax,4),%xmm0
  cmp    %ebx,%edx
  jne    L208
  add    $0x1,%r8d
  cmp    %r9d,%r8d
  jne    L117
  jmp    L130
L14:
  addl   $0x1,-0x70(%rsp)
  mov    -0x70(%rsp),%eax
  add    %r14d,-0x5c(%rsp)
  cmp    %eax,-0x4(%rsp)
  jne    L192
L173:
  add    $0x1,%r15d
  cmp    %r12d,%r15d
  jne    L29
  mov    0x8(%rsp),%r14
  mov    %r12d,%r15d
  mov    %r11d,%r13d
L233:
  mov    -0x38(%rsp),%rax
  mov    0xc(%rax),%eax
  mov    %eax,-0x28(%rsp)
  test   %eax,%eax
  jle    L165
  mov    %r13d,%eax
  movl   $0x0,-0x48(%rsp)
  lea    (%r15,%r15,1),%r12d
  neg    %eax
  mov    %eax,-0x8(%rsp)
  mov    -0x60(%rsp),%eax
  add    %eax,%eax
  mov    %eax,-0x1c(%rsp)
  lea    0x2(%r13,%r13,1),%eax
  imul   %r13d,%eax
  lea    0x1(%rax,%rax,1),%eax
  mov    %eax,-0x40(%rsp)
  lea    0x1(%r13),%eax
  mov    %eax,-0x20(%rsp)
L248:
  mov    -0x60(%rsp),%eax
  test   %eax,%eax
  jle    L43
  mov    -0x38(%rsp),%rbx
  xor    %r11d,%r11d
  mov    (%rbx),%ebx
  imul   %ebx,%eax
  mov    %eax,%r10d
  imul   %r15d,%eax
  imul   -0x48(%rsp),%eax
  mov    %eax,%ebp
  lea    -0x1(%rbx,%rbx,1),%eax
  mov    %eax,-0x70(%rsp)
  mov    %r13d,%eax
  mov    %ebx,%r13d
  mov    %r11d,%ebx
  mov    %r12d,%r11d
  mov    %r10d,%r12d
  mov    %eax,%r10d
L32:
  mov    %r12d,%eax
  imul   %ebx,%eax
  mov    %eax,-0x3c(%rsp)
  test   %r13d,%r13d
  jle    L76
  lea    -0x1(%r13),%eax
  movl   $0x0,-0x50(%rsp)
  mov    %eax,-0x4(%rsp)
  movslq %ebp,%rax
  mov    %rax,(%rsp)
  mov    -0x20(%rsp),%eax
  lea    (%rax,%rbx,1),%r8d
  mov    -0x1c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x54(%rsp)
L72:
  mov    -0x4(%rsp),%eax
  mov    -0x10(%rsp),%rdi
  movq   $0x0,-0x68(%rsp)
  mov    %rax,-0x30(%rsp)
  movslq -0x3c(%rsp),%rax
  add    (%rsp),%rax
  lea    (%rdi,%rax,4),%rax
  mov    -0x50(%rsp),%edi
  mov    %rax,-0x18(%rsp)
  mov    -0x20(%rsp),%eax
  mov    %eax,-0x74(%rsp)
  add    %edi,%eax
  mov    %eax,-0x58(%rsp)
L13:
  mov    -0x50(%rsp),%eax
  pxor   %xmm0,%xmm0
  movl   $0x0,-0x5c(%rsp)
  movaps %xmm0,%xmm1
  sub    %r10d,%eax
  mov    %eax,-0x6c(%rsp)
  cmp    -0x8(%rsp),%r10d
  jl     L193
  nopl   0x0(%rax,%rax,1)
L92:
  mov    -0x6c(%rsp),%edi
  mov    -0x54(%rsp),%edx
  mov    -0x68(%rsp),%r9d
  mov    %edi,%eax
  neg    %eax
  cmovs  %edi,%eax
  sub    %eax,%edx
  cmp    -0x60(%rsp),%eax
  mov    %edx,%edi
  cmovl  %eax,%edi
  sub    %r10d,%r9d
  imul   %r13d,%edi
  cs nopw 0x0(%rax,%rax,1)
L44:
  mov    %r9d,%eax
  mov    -0x70(%rsp),%esi
  mov    %ebx,%edx
  neg    %eax
  cmovs  %r9d,%eax
  sub    %eax,%esi
  cmp    %eax,%r13d
  cmovg  %eax,%esi
  sub    %r10d,%edx
  nopw   0x0(%rax,%rax,1)
L177:
  mov    %edx,%eax
  mov    %r11d,%ecx
  neg    %eax
  cmovs  %edx,%eax
  sub    %eax,%ecx
  sub    $0x1,%ecx
  cmp    %eax,%r15d
  cmovle %ecx,%eax
  add    $0x1,%edx
  imul   %r12d,%eax
  add    %edi,%eax
  add    %esi,%eax
  add    %ebp,%eax
  cltq
  addss  (%r14,%rax,4),%xmm0
  cmp    %edx,%r8d
  jne    L177
  add    $0x1,%r9d
  cmp    %r9d,-0x74(%rsp)
  jne    L44
  addl   $0x1,-0x6c(%rsp)
  mov    -0x40(%rsp),%edi
  mov    -0x6c(%rsp),%eax
  add    %edi,-0x5c(%rsp)
  cmp    %eax,-0x58(%rsp)
  jne    L92
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x5c(%rsp),%xmm1
L193:
  divss  %xmm1,%xmm0
  mov    -0x18(%rsp),%rax
  mov    -0x68(%rsp),%rdi
  addl   $0x1,-0x74(%rsp)
  movss  %xmm0,(%rax,%rdi,4)
  lea    0x1(%rdi),%rax
  cmp    %rdi,-0x30(%rsp)
  je     L144
  mov    %rax,-0x68(%rsp)
  jmp    L13
L144:
  addl   $0x1,-0x50(%rsp)
  mov    -0x50(%rsp),%eax
  add    %r13d,-0x3c(%rsp)
  cmp    -0x60(%rsp),%eax
  jne    L72
L76:
  add    $0x1,%ebx
  cmp    %r15d,%ebx
  jne    L32
  mov    %r11d,%r12d
  mov    %r10d,%r13d
L43:
  addl   $0x1,-0x48(%rsp)
  mov    -0x48(%rsp),%eax
  cmp    %eax,-0x28(%rsp)
  jne    L248
L165:
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void ComputeFirstMoment4D(float *ima, float *atlas, float *means, float *Ameans, const int *dims, int f) {
  int indice = 0;
  int i, j, k, t;
  int ii, jj, kk;
  int ni, nj, nk;
  float mean = 0.0;
  float Amean = 0.0;
  for (k = 0; k < dims[2]; k++) {
    for (i = 0; i < dims[1]; i++) {
      for (j = 0; j < dims[0]; j++) {
        Amean = 0;
        indice = 0;
        for (ii = -f; ii <= f; ii++) {
          for (jj = -f; jj <= f; jj++) {
            for (kk = -f; kk <= f; kk++) {
              ni = i + ii;
              nj = j + jj;
              nk = k + kk;
              if (ni < 0)
                ni = -ni;
              if (nj < 0)
                nj = -nj;
              if (nk < 0)
                nk = -nk;
              if (ni >= dims[1])
                ni = 2 * dims[1] - ni - 1;
              if (nj >= dims[0])
                nj = 2 * dims[0] - nj - 1;
              if (nk >= dims[2])
                nk = 2 * dims[2] - nk - 1;
              Amean = Amean + atlas[nk * (dims[0] * dims[1]) + (ni * dims[0]) + nj];
              indice = indice + 1;
            }
          }
        }
        Amean = Amean / indice;
        Ameans[k * (dims[0] * dims[1]) + (i * dims[0]) + j] = Amean;
      }
    }
  }
  for (t = 0; t < dims[3]; t++) {
    for (k = 0; k < dims[2]; k++) {
      for (i = 0; i < dims[1]; i++) {
        for (j = 0; j < dims[0]; j++) {
          mean = 0;
          indice = 0;
          for (ii = -f; ii <= f; ii++) {
            for (jj = -f; jj <= f; jj++) {
              for (kk = -f; kk <= f; kk++) {
                ni = i + ii;
                nj = j + jj;
                nk = k + kk;
                if (ni < 0)
                  ni = -ni;
                if (nj < 0)
                  nj = -nj;
                if (nk < 0)
                  nk = -nk;
                if (ni >= dims[1])
                  ni = 2 * dims[1] - ni - 1;
                if (nj >= dims[0])
                  nj = 2 * dims[0] - nj - 1;
                if (nk >= dims[2])
                  nk = 2 * dims[2] - nk - 1;
                mean = mean + ima[t * (dims[0] * dims[1] * dims[2]) + (nk * (dims[0] * dims[1]) + (ni * dims[0]) + nj)];
                indice = indice + 1;
              }
            }
          }
          mean = mean / indice;
          means[t * (dims[0] * dims[1] * dims[2]) + (k * (dims[0] * dims[1]) + (i * dims[0]) + j)] = mean;
        }
      }
    }
  }
}
```