user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<diffusionmarine>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x18,%rsp
  movslq 0x68(%rsp),%rax
  mov    0x60(%rsp),%r14d
  mov    %rcx,0x8(%rsp)
  test   %eax,%eax
  jle    L161
  mov    0x58(%rsp),%rdi
  lea    0x0(,%rax,8),%rdx
  xor    %esi,%esi
  call   <memset@plt>
L161:
  test   %r14d,%r14d
  jle    L36
  mov    0x50(%rsp),%rdi
  lea    -0x1(%r14),%eax
  pxor   %xmm1,%xmm1
  lea    0x4(%rdi,%rax,4),%r14
  jmp    L45
  nopl   (%rax)
L21:
  add    $0x4,%rdi
  cmp    %r14,%rdi
  je     L36
L45:
  movslq (%rdi),%rcx
  mov    0x0(%rbp,%rcx,4),%eax
  lea    0x0(,%rcx,4),%r8
  test   %eax,%eax
  jle    L21
  lea    (%r8,%rcx,1),%r10
  shl    $0x3,%rcx
  xor    %edx,%edx
  mov    %r10,%rsi
  shl    $0x5,%r10
  lea    (%r12,%rcx,1),%r9
  add    0x58(%rsp),%rcx
  shl    $0x4,%rsi
  lea    (%r15,%r10,1),%r11
  add    0x8(%rsp),%rsi
  add    %r13,%r10
  jmp    L113
  nopw   0x0(%rax,%rax,1)
L117:
  cmpl   $0x0,(%rbx,%r8,1)
  jle    L159
  movsd  (%r9),%xmm2
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm0,%xmm2
  jbe    L159
  movsd  (%r11,%rdx,8),%xmm3
  comisd %xmm1,%xmm3
  jbe    L159
  subsd  %xmm2,%xmm0
  mulsd  (%r10,%rdx,8),%xmm0
  divsd  %xmm3,%xmm0
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
  nopw   0x0(%rax,%rax,1)
L159:
  cmpl   $0x0,(%rbx,%rax,4)
  jle    L109
  movsd  (%r9),%xmm2
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm2,%xmm0
  jbe    L109
L116:
  movsd  (%r11,%rdx,8),%xmm3
  comisd %xmm1,%xmm3
  jbe    L109
  subsd  %xmm2,%xmm0
  mulsd  (%r10,%rdx,8),%xmm0
  divsd  %xmm3,%xmm0
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
  nopl   0x0(%rax)
L109:
  add    $0x1,%rdx
  cmp    $0x14,%rdx
  je     L21
L113:
  movslq (%rsi,%rdx,4),%rax
  test   %eax,%eax
  js     L21
  cmpl   $0x0,0x0(%rbp,%rax,4)
  jg     L117
  movsd  (%r12,%rax,8),%xmm0
  movsd  (%r9),%xmm2
  comisd %xmm0,%xmm2
  jbe    L109
  mov    (%rbx,%r8,1),%eax
  test   %eax,%eax
  jg     L116
  jmp    L109
L36:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void diffusionmarine(double pyZ[], int pyBord[], int pyDep[], int pyNgbs[][20], double pyEdge[][20], double pyDist[][20], int pyGIDs[], double pyDiff[], int pylocalNb, int pyglobalNb) {
  int i;
  for (i = 0; i < pyglobalNb; i++) {
    pyDiff[i] = 0.;
  }
  int k;
  for (k = 0; k < pylocalNb; k++) {
    int gid = pyGIDs[k];
    int p;
    if (pyBord[gid] > 0.) {
      for (p = 0; p < 20; p++) {
        int ngbid = pyNgbs[gid][p];
        if (ngbid < 0) {
          break;
        }
        if (pyBord[ngbid] > 0) {
          if (pyDep[gid] > 0 && pyZ[gid] > pyZ[ngbid] && pyDist[gid][p] > 0.) {
            pyDiff[gid] += pyEdge[gid][p] * (pyZ[ngbid] - pyZ[gid]) / pyDist[gid][p];
          }
          if (pyDep[ngbid] > 0 && pyZ[gid] < pyZ[ngbid] && pyDist[gid][p] > 0.) {
            pyDiff[gid] += pyEdge[gid][p] * (pyZ[ngbid] - pyZ[gid]) / pyDist[gid][p];
          }
        }
        if (pyBord[ngbid] < 1) {
          if (pyZ[ngbid] < pyZ[gid] && pyDep[gid] > 0 && pyDist[gid][p] > 0.) {
            pyDiff[gid] += pyEdge[gid][p] * (pyZ[ngbid] - pyZ[gid]) / pyDist[gid][p];
          }
        }
      }
    }
  }
}
```