user: 请将以下的汇编代码转换成C语言代码：

```asm
<qselect_median_lng>:
  endbr64
  push   %r14
  mov    %rdi,%r11
  push   %r13
  push   %r12
  push   %rbp
  lea    -0x1(%rsi),%ebp
  mov    %ebp,%r13d
  push   %rbx
  shr    $0x1f,%r13d
  add    %ebp,%r13d
  sar    %r13d
  test   %ebp,%ebp
  jle    L135
  cmp    $0x1,%ebp
  je     L61
  xor    %r12d,%r12d
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L78:
  lea    (%r12,%rbp,1),%ecx
  movslq %ebp,%rsi
  mov    %ecx,%edx
  lea    (%r11,%rsi,8),%r8
  shr    $0x1f,%edx
  mov    (%r8),%rdi
  add    %ecx,%edx
  sar    %edx
  movslq %edx,%rdx
  lea    (%r11,%rdx,8),%rdx
  mov    (%rdx),%rcx
  cmp    %rdi,%rcx
  jle    L109
  mov    %rdi,(%rdx)
  mov    %rcx,%rdi
  mov    %rcx,(%r8)
L109:
  movslq %r12d,%rcx
  shl    $0x3,%rcx
  lea    (%r11,%rcx,1),%rbx
  mov    (%rbx),%rsi
  cmp    %rdi,%rsi
  jle    L33
  mov    %rdi,(%rbx)
  mov    %rsi,(%r8)
  mov    (%rbx),%rsi
L33:
  mov    (%rdx),%rdi
  cmp    %rsi,%rdi
  jle    L39
  mov    %rsi,(%rdx)
  mov    %rdi,(%rbx)
  mov    (%rdx),%rdi
L39:
  lea    0x8(%r11,%rcx,1),%rcx
  add    $0x1,%eax
  mov    (%rcx),%rsi
  movslq %eax,%r8
  mov    %rsi,(%rdx)
  mov    %ebp,%edx
  mov    %rdi,(%rcx)
  mov    (%rbx),%rsi
  nopl   (%rax)
L8:
  mov    (%r11,%r8,8),%r10
  mov    %r8d,%r14d
  cmp    %rsi,%r10
  jl     L83
  movslq %edx,%rax
  lea    -0x8(%r11,%rax,8),%rax
  nopl   0x0(%rax)
L98:
  mov    %rax,%rdi
  mov    (%rax),%rcx
  mov    %edx,%r9d
  sub    $0x8,%rax
  sub    $0x1,%edx
  cmp    %rsi,%rcx
  jg     L98
  cmp    %r8d,%edx
  jl     L124
  mov    %rcx,(%r11,%r8,8)
  mov    %r10,(%rdi)
  mov    (%rbx),%rsi
L83:
  add    $0x1,%r8
  jmp    L8
  nopw   0x0(%rax,%rax,1)
L124:
  mov    %rcx,(%rbx)
  mov    %rsi,(%rdi)
  cmp    %edx,%r13d
  jl     L66
  movslq %r14d,%r12
  je     L66
L107:
  cmp    %r12d,%ebp
  jle    L135
  lea    0x1(%r12),%eax
  cmp    %ebp,%eax
  jne    L78
  movslq %ebp,%rax
  lea    (%r11,%r12,8),%rdx
  shl    $0x3,%rax
L99:
  add    %r11,%rax
  mov    (%rdx),%rcx
  mov    (%rax),%rsi
  cmp    %rsi,%rcx
  jle    L135
  mov    %rsi,(%rdx)
  mov    %rcx,(%rax)
L135:
  movslq %r13d,%r13
  pop    %rbx
  pop    %rbp
  mov    (%r11,%r13,8),%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L66:
  lea    -0x2(%r9),%ebp
  jmp    L107
L61:
  mov    %rdi,%rdx
  mov    $0x8,%eax
  jmp    L99
```

assistant: ```c
long qselect_median_lng(long arr[], int n) {
  int low, high;
  int median;
  int middle, ll, hh;
  low = 0;
  high = n - 1;
  median = (low + high) / 2;
  for (;;) {
    if (high <= low) {
      return arr[median];
    }
    if (high == low + 1) {
      if (arr[low] > arr[high]) {
        register long t = (arr[low]);
        (arr[low]) = (arr[high]);
        (arr[high]) = t;
      };
      return arr[median];
    }
    middle = (low + high) / 2;
    if (arr[middle] > arr[high]) {
      register long t = (arr[middle]);
      (arr[middle]) = (arr[high]);
      (arr[high]) = t;
    };
    if (arr[low] > arr[high]) {
      register long t = (arr[low]);
      (arr[low]) = (arr[high]);
      (arr[high]) = t;
    };
    if (arr[middle] > arr[low]) {
      register long t = (arr[middle]);
      (arr[middle]) = (arr[low]);
      (arr[low]) = t;
    };
    {
      register long 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 long t = (arr[ll]);
        (arr[ll]) = (arr[hh]);
        (arr[hh]) = t;
      };
    }
    {
      register long t = (arr[low]);
      (arr[low]) = (arr[hh]);
      (arr[hh]) = t;
    };
    if (hh <= median)
      low = ll;
    if (hh >= median)
      high = hh - 1;
  }
}
```