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

```asm
<filter_c_2d_median>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x50(%rsp)
  mov    %esi,%r14d
  mov    %esi,0x5c(%rsp)
  mov    %edx,0x60(%rsp)
  mov    %rcx,%rbp
  mov    0xb0(%rsp),%ebx
  mov    %ebx,%r15d
  imul   %ebx,%r15d
  mov    %r15d,0x3c(%rsp)
  lea    0x0(,%r15,4),%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    %rax,0x10(%rsp)
  mov    %ebx,%eax
  shr    $0x1f,%eax
  add    %ebx,%eax
  mov    %eax,%edi
  sar    %edi
  mov    %edi,0x64(%rsp)
  mov    %r15d,%ecx
  shr    $0x1f,%r15d
  mov    %r15d,%eax
  add    %ecx,%eax
  sar    %eax
  mov    %r14d,%esi
  sub    %edi,%r14d
  mov    %r14d,0x58(%rsp)
  cmp    %r14d,%edi
  jge    L25
  cltq
  mov    %rdx,%rcx
  lea    (%rdx,%rax,4),%r15
  movslq %esi,%rax
  lea    0x0(,%rax,4),%r8
  mov    %r8,0x48(%rsp)
  mov    %edi,%eax
  imul   %esi,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  movslq %edi,%rax
  mov    %rax,0x40(%rsp)
  neg    %rax
  shl    $0x2,%rax
  mov    %rax,0x68(%rsp)
  movslq %ebx,%rax
  mov    %rax,%rdx
  neg    %rdx
  lea    (%r8,%rdx,4),%r14
  shl    $0x2,%rax
  mov    %rax,0x8(%rsp)
  lea    -0x1(%rbx),%eax
  lea    0x4(%rcx,%rax,4),%rsi
  mov    %rsi,0x28(%rsp)
  mov    %edi,0x34(%rsp)
  movl   $0x0,0x38(%rsp)
  not    %rax
  lea    0x0(,%rax,4),%rbp
  jmp    L12
L74:
  lea    0x0(%rbp,%rdx,1),%rax
L17:
  movss  (%rcx,%rax,1),%xmm0
  movss  %xmm0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L17
  add    $0x1,%esi
  add    %r14,%rcx
  add    0x8(%rsp),%rdx
  cmp    %esi,%ebx
  jne    L74
L37:
  mov    0x30(%rsp),%edx
  mov    $0x0,%esi
  mov    0x10(%rsp),%rdi
  call   <inkernel_quicksort@plt>
  movss  (%r15),%xmm0
  mov    0x18(%rsp),%rax
  movss  %xmm0,(%rax,%r12,4)
  add    $0x1,%r12
  add    $0x4,%r13
  cmp    %r12d,0x24(%rsp)
  jle    L79
L89:
  mov    0x28(%rsp),%rdx
  mov    %r13,%rcx
  mov    $0x0,%esi
  test   %ebx,%ebx
  jg     L74
  jmp    L37
L79:
  addl   $0x1,0x34(%rsp)
  mov    0x34(%rsp),%eax
  mov    0x48(%rsp),%rsi
  add    %rsi,0x18(%rsp)
  mov    0x5c(%rsp),%esi
  add    %esi,0x38(%rsp)
  cmp    0x58(%rsp),%eax
  je     L25
L12:
  mov    0x60(%rsp),%eax
  mov    0x64(%rsp),%edi
  sub    %edi,%eax
  mov    %eax,0x24(%rsp)
  cmp    %eax,%edi
  jge    L79
  movslq 0x38(%rsp),%rax
  mov    0x40(%rsp),%r12
  add    %r12,%rax
  mov    0x68(%rsp),%rdx
  sub    0x10(%rsp),%rdx
  lea    (%rdx,%rax,4),%r13
  add    0x50(%rsp),%r13
  mov    0x3c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x30(%rsp)
  jmp    L89
L25:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

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