user: 请从给定的汇编指令推导出C源代码:

```asm
<filter_c_3d_median>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x98,%rsp
  mov    0xe0(%rsp),%ebp
  mov    %edx,0x50(%rsp)
  mov    %ebp,%eax
  imul   %ebp,%eax
  mov    %eax,0xc(%rsp)
  imul   %ebp,%eax
  lea    0x0(,%rax,4),%edi
  mov    %eax,0x8(%rsp)
  call   <malloc@plt>
  mov    0x50(%rsp),%r8d
  mov    0x8(%rsp),%ecx
  mov    %rax,%r12
  mov    %ebp,%eax
  shr    $0x1f,%eax
  mov    %r8d,%edx
  add    %ebp,%eax
  imul   %r14d,%edx
  sar    %eax
  mov    %eax,%edi
  mov    %eax,0x18(%rsp)
  mov    %ecx,%eax
  shr    $0x1f,%eax
  sub    %edi,%ebx
  mov    %edx,0x68(%rsp)
  add    %ecx,%eax
  mov    %ebx,0x6c(%rsp)
  sar    %eax
  cmp    %ebx,%edi
  jge    L19
  cltq
  mov    %r8d,%esi
  mov    %edi,%ebx
  movl   $0x0,0x4c(%rsp)
  sub    %edi,%esi
  lea    (%r12,%rax,4),%rax
  mov    %ebp,0xe0(%rsp)
  imul   %r8d,%edi
  mov    %rax,0x58(%rsp)
  movslq %edx,%rax
  shl    $0x2,%rax
  mov    %esi,0x1c(%rsp)
  lea    -0x1(%rbp),%esi
  mov    %rax,(%rsp)
  movslq %edi,%rax
  mov    %ebx,%edi
  mov    %esi,0x80(%rsp)
  imul   %edx,%edi
  movslq %edi,%rdx
  add    %rdx,%rax
  lea    (%r15,%rax,4),%rax
  mov    %rax,0x40(%rsp)
  movslq %ebx,%rax
  movslq %r8d,%rbx
  mov    %rax,%rdi
  mov    %rax,0x30(%rsp)
  neg    %rax
  shl    $0x2,%rax
  sub    %edi,%r14d
  mov    %edi,0x10(%rsp)
  lea    -0x1(%rcx),%edi
  sub    %r12,%rax
  mov    %rbx,0x60(%rsp)
  shl    $0x2,%rbx
  mov    %r14d,0x54(%rsp)
  mov    %rbx,%rbp
  mov    %r13,%rbx
  mov    0xe0(%rsp),%r13d
  mov    %edi,0x84(%rsp)
  mov    %rax,0x88(%rsp)
L2:
  mov    0x1c(%rsp),%edi
  cmp    %edi,0x18(%rsp)
  jge    L88
  mov    0x18(%rsp),%eax
  movl   $0x0,0x48(%rsp)
  movq   $0x0,0x38(%rsp)
  mov    %eax,0x14(%rsp)
  movslq 0x4c(%rsp),%rax
  add    0x30(%rsp),%rax
  mov    %rax,0x78(%rsp)
L48:
  mov    0x54(%rsp),%edi
  cmp    %edi,0x18(%rsp)
  jge    L55
  mov    0x88(%rsp),%rdi
  movslq 0x48(%rsp),%rax
  add    0x78(%rsp),%rax
  mov    0x38(%rsp),%rsi
  lea    (%rdi,%rax,4),%rax
  mov    %rax,0x28(%rsp)
  mov    0x40(%rsp),%rax
  lea    (%rax,%rsi,4),%rax
  mov    %rax,0x70(%rsp)
  mov    0x30(%rsp),%rax
  mov    %rax,0x20(%rsp)
L1:
  test   %r13d,%r13d
  jle    L27
  movl   $0x0,0x8(%rsp)
  mov    0x28(%rsp),%r14
  xor    %r15d,%r15d
  lea    0x4(%r12),%r10
  mov    0x80(%rsp),%r11d
  nopl   0x0(%rax,%rax,1)
L41:
  mov    0x8(%rsp),%esi
  mov    %r14,%rdi
  xor    %r9d,%r9d
  nopw   0x0(%rax,%rax,1)
L45:
  movslq %esi,%rdx
  lea    0x0(,%rdx,4),%r8
  add    %r11,%rdx
  lea    (%r10,%rdx,4),%rcx
  mov    %rdi,%rdx
  lea    (%r8,%r12,1),%rax
  sub    %r8,%rdx
  add    %rbx,%rdx
  nop
L81:
  movss  (%rdx,%rax,1),%xmm0
  add    $0x4,%rax
  movss  %xmm0,-0x4(%rax)
  cmp    %rax,%rcx
  jne    L81
  lea    0x1(%r9),%eax
  add    %r13d,%esi
  add    %rbp,%rdi
  cmp    %eax,%r13d
  je     L66
  mov    %eax,%r9d
  jmp    L45
  nopw   0x0(%rax,%rax,1)
L66:
  mov    0xc(%rsp),%esi
  lea    0x1(%r15),%eax
  add    %esi,0x8(%rsp)
  add    (%rsp),%r14
  cmp    %r15d,%r9d
  je     L27
  mov    %eax,%r15d
  jmp    L41
L27:
  mov    0x84(%rsp),%edx
  mov    %r12,%rdi
  xor    %esi,%esi
  call   <inkernel_quicksort@plt>
  mov    0x58(%rsp),%rax
  mov    0x70(%rsp),%rdi
  addq   $0x4,0x28(%rsp)
  movss  (%rax),%xmm0
  mov    0x20(%rsp),%rax
  movss  %xmm0,(%rdi,%rax,4)
  add    $0x1,%rax
  mov    %rax,0x20(%rsp)
  cmp    %eax,0x54(%rsp)
  jg     L1
L55:
  addl   $0x1,0x14(%rsp)
  mov    0x50(%rsp),%esi
  mov    0x60(%rsp),%rdi
  add    %esi,0x48(%rsp)
  add    %rdi,0x38(%rsp)
  mov    0x14(%rsp),%eax
  cmp    0x1c(%rsp),%eax
  jne    L48
L88:
  mov    (%rsp),%rsi
  addl   $0x1,0x10(%rsp)
  add    %rsi,0x40(%rsp)
  mov    0x10(%rsp),%eax
  mov    0x68(%rsp),%esi
  add    %esi,0x4c(%rsp)
  cmp    0x6c(%rsp),%eax
  jne    L2
L19:
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void filter_c_3d_median(float *im, int nz, int ny, int nx, float *res, int nzr, int nyr, int nxr, int w) {
  int nwin = w * w * w;
  float *win = (float *)malloc(nwin * sizeof(float));
  int edgex = w / 2;
  int edgey = w / 2;
  int edgez = w / 2;
  int mpos = nwin / 2;
  int step = ny * nx;
  int x, y, z, wx, wy, wz, ind, indy, indz, indw;
  int nwa;
  for (z = edgez; z < (nz - edgez); ++z) {
    indz = z * step;
    for (y = edgey; y < (ny - edgey); ++y) {
      ind = indz + y * ny;
      for (x = edgex; x < (nx - edgex); ++x) {
        nwa = 0;
        for (wz = 0; wz < w; ++wz) {
          indw = step * (z + wz - edgez);
          for (wy = 0; wy < w; ++wy) {
            indy = indw + ny * (y + wy - edgey);
            for (wx = 0; wx < w; ++wx) {
              win[nwa] = im[indy + x + wx - edgex];
              ++nwa;
            }
          }
        }
        inkernel_quicksort(win, 0, nwin - 1);
        res[ind + x] = win[mpos];
      }
    }
  }
}
```