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

```asm
<_ccv_median>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r11
  lea    (%rsi,%rdx,1),%eax
  mov    %eax,%r13d
  shr    $0x1f,%r13d
  add    %eax,%r13d
  sar    %r13d
  cmp    %edx,%esi
  jge    L114
  mov    %esi,%r12d
  mov    %edx,%ebp
  lea    0x1(%rsi),%eax
  cmp    %eax,%edx
  jne    L68
  mov    %eax,%ebp
L149:
  movslq %r12d,%r12
  lea    (%r11,%r12,4),%rcx
  mov    (%rcx),%edx
  movslq %ebp,%rbp
  lea    (%r11,%rbp,4),%rax
  mov    (%rax),%esi
  cmp    %esi,%edx
  jle    L157
  mov    %esi,(%rcx)
  mov    %edx,(%rax)
L157:
  movslq %r13d,%r13
  mov    (%r11,%r13,4),%eax
  jmp    L99
L129:
  mov    %r14d,%r12d
L122:
  cmp    %ebp,%r12d
  jge    L114
  lea    0x1(%r12),%eax
  cmp    %ebp,%eax
  je     L149
L68:
  lea    (%r12,%rbp,1),%ecx
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  movslq %edx,%rdx
  lea    (%r11,%rdx,4),%rdx
  mov    (%rdx),%ecx
  movslq %ebp,%rsi
  lea    (%r11,%rsi,4),%rsi
  mov    (%rsi),%edi
  cmp    %edi,%ecx
  jle    L27
  mov    %edi,(%rdx)
  mov    %ecx,(%rsi)
L27:
  movslq %r12d,%rcx
  shl    $0x2,%rcx
  lea    (%r11,%rcx,1),%rbx
  mov    (%rbx),%edi
  mov    (%rsi),%r8d
  cmp    %r8d,%edi
  jle    L87
  mov    %r8d,(%rbx)
  mov    %edi,(%rsi)
L87:
  mov    (%rdx),%esi
  mov    (%rbx),%edi
  cmp    %edi,%esi
  jle    L135
  mov    %edi,(%rdx)
  mov    %esi,(%rbx)
L135:
  mov    (%rdx),%esi
  lea    0x4(%r11,%rcx,1),%rcx
  mov    (%rcx),%edi
  mov    %edi,(%rdx)
  mov    %esi,(%rcx)
  add    $0x1,%eax
  movslq %eax,%r8
  mov    %ebp,%edx
  jmp    L126
L114:
  movslq %r13d,%r13
  mov    (%r11,%r13,4),%eax
L99:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L155:
  add    $0x1,%r8
L126:
  mov    %r8d,%r14d
  mov    (%rbx),%esi
  mov    (%r11,%r8,4),%r10d
  cmp    %r10d,%esi
  jg     L155
  movslq %edx,%rax
  lea    -0x4(%r11,%rax,4),%rax
L4:
  mov    %edx,%r9d
  sub    $0x1,%edx
  mov    %rax,%rdi
  sub    $0x4,%rax
  mov    0x4(%rax),%ecx
  cmp    %ecx,%esi
  jl     L4
  cmp    %r8d,%edx
  jl     L6
  mov    %ecx,(%r11,%r8,4)
  mov    %r10d,(%rdi)
  jmp    L155
L6:
  mov    %ecx,(%rbx)
  mov    %esi,(%rdi)
  cmp    %edx,%r13d
  jge    L129
  lea    -0x2(%r9),%ebp
  jmp    L122
```

assistant: ```c
int _ccv_median(int *buf, int low, int high) {
  int middle, ll, hh, w;
  int median = (low + high) / 2;
  for (;;) {
    if (high <= low)
      return buf[median];
    if (high == low + 1) {
      if (buf[low] > buf[high])
        ((w) = (buf[low]), (buf[low]) = (buf[high]), (buf[high]) = (w));
      return buf[median];
    }
    middle = (low + high) / 2;
    if (buf[middle] > buf[high])
      ((w) = (buf[middle]), (buf[middle]) = (buf[high]), (buf[high]) = (w));
    if (buf[low] > buf[high])
      ((w) = (buf[low]), (buf[low]) = (buf[high]), (buf[high]) = (w));
    if (buf[middle] > buf[low])
      ((w) = (buf[middle]), (buf[middle]) = (buf[low]), (buf[low]) = (w));
    ((w) = (buf[middle]), (buf[middle]) = (buf[low + 1]), (buf[low + 1]) = (w));
    ll = low + 1;
    hh = high;
    for (;;) {
      do
        ll++;
      while (buf[low] > buf[ll]);
      do
        hh--;
      while (buf[hh] > buf[low]);
      if (hh < ll)
        break;
      ((w) = (buf[ll]), (buf[ll]) = (buf[hh]), (buf[hh]) = (w));
    }
    ((w) = (buf[low]), (buf[low]) = (buf[hh]), (buf[hh]) = (w));
    if (hh <= median)
      low = ll;
    else if (hh >= median)
      high = hh - 1;
  }
}
```