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

```asm
<getMedian>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r11
  lea    -0x1(%rsi),%ebp
  mov    %ebp,%r13d
  sar    %r13d
  test   %ebp,%ebp
  jle    L143
  cmp    $0x1,%ebp
  je     L43
  mov    $0x0,%r12d
  mov    $0x1,%eax
  jmp    L97
L143:
  movslq %r13d,%r13
  mov    (%r11,%r13,4),%eax
L173:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L43:
  mov    $0x0,%r12d
L154:
  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    L110
  mov    %esi,(%rcx)
  mov    %edx,(%rax)
L110:
  movslq %r13d,%r13
  mov    (%r11,%r13,4),%eax
  jmp    L173
L107:
  add    $0x1,%r8
L114:
  mov    %r8d,%r14d
  mov    (%rbx),%esi
  mov    (%r11,%r8,4),%r10d
  cmp    %r10d,%esi
  jg     L107
  movslq %edx,%rax
  lea    -0x4(%r11,%rax,4),%rax
L24:
  mov    %edx,%r9d
  sub    $0x1,%edx
  mov    %rax,%rdi
  sub    $0x4,%rax
  mov    0x4(%rax),%ecx
  cmp    %ecx,%esi
  jl     L24
  cmp    %r8d,%edx
  jl     L126
  mov    %ecx,(%r11,%r8,4)
  mov    %r10d,(%rdi)
  jmp    L107
L126:
  mov    %ecx,(%rbx)
  mov    %esi,(%rdi)
  cmp    %edx,%r13d
  jl     L163
  je     L64
  mov    %r14d,%r12d
L100:
  cmp    %r12d,%ebp
  jle    L143
  lea    0x1(%r12),%eax
  cmp    %ebp,%eax
  je     L154
L97:
  lea    (%r12,%rbp,1),%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    L61
  mov    %edi,(%rdx)
  mov    %ecx,(%rsi)
L61:
  movslq %r12d,%rcx
  shl    $0x2,%rcx
  lea    (%r11,%rcx,1),%rbx
  mov    (%rbx),%edi
  mov    (%rsi),%r8d
  cmp    %r8d,%edi
  jle    L38
  mov    %r8d,(%rbx)
  mov    %edi,(%rsi)
L38:
  mov    (%rdx),%esi
  mov    (%rbx),%edi
  cmp    %edi,%esi
  jle    L21
  mov    %edi,(%rdx)
  mov    %esi,(%rbx)
L21:
  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    L114
L64:
  mov    %r14d,%r12d
L163:
  lea    -0x2(%r9),%ebp
  jmp    L100
```

assistant: ```c
int getMedian(int *arr, unsigned int n) {
  int low, high;
  int median;
  int middle, ll, hh;
  low = 0;
  high = n - 1;
  median = (low + high) >> 1;
  for (;;) {
    if (high <= low)
      return arr[median];
    if (high == low + 1) {
      if (arr[low] > arr[high]) {
        register int t = (arr[low]);
        (arr[low]) = (arr[high]);
        (arr[high]) = t;
      };
      return arr[median];
    }
    middle = (low + high) >> 1;
    if (arr[middle] > arr[high]) {
      register int t = (arr[middle]);
      (arr[middle]) = (arr[high]);
      (arr[high]) = t;
    };
    if (arr[low] > arr[high]) {
      register int t = (arr[low]);
      (arr[low]) = (arr[high]);
      (arr[high]) = t;
    };
    if (arr[middle] > arr[low]) {
      register int t = (arr[middle]);
      (arr[middle]) = (arr[low]);
      (arr[low]) = t;
    };
    {
      register int t = (arr[middle]);
      (arr[middle]) = (arr[low + 1]);
      (arr[low + 1]) = t;
    };
    ll = low + 1;
    hh = high;
    for (;;) {
      do
        ll++;
      while (arr[low] > arr[ll]);
      do
        hh--;
      while (arr[hh] > arr[low]);
      if (hh < ll)
        break;
      {
        register int t = (arr[ll]);
        (arr[ll]) = (arr[hh]);
        (arr[hh]) = t;
      };
    }
    {
      register int t = (arr[low]);
      (arr[low]) = (arr[hh]);
      (arr[hh]) = t;
    };
    if (hh <= median)
      low = ll;
    if (hh >= median)
      high = hh - 1;
  }
}
```