user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<kthSmallest>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    %ecx,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x54(%rbp)
  jle    L77
  mov    -0x50(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x54(%rbp)
  jg     L77
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x50(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  add    $0x4,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L128:
  cmp    %rdx,%rsp
  je     L3
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L128
L3:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L54
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L54:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L10
L39:
  mov    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %eax,%edx
  mov    -0x38(%rbp),%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %eax,%ecx
  mov    -0x4c(%rbp),%eax
  lea    (%rcx,%rax,1),%esi
  mov    -0x48(%rbp),%rax
  mov    $0x5,%ecx
  mov    %rax,%rdi
  call   <findMedian@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%ecx
  movslq %ecx,%rcx
  mov    %eax,(%rdx,%rcx,4)
  addl   $0x1,-0x38(%rbp)
L10:
  mov    -0x34(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x38(%rbp)
  jl     L39
  mov    -0x38(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  cmp    %eax,-0x34(%rbp)
  jle    L93
  addl   $0x1,-0x38(%rbp)
  mov    -0x34(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    %eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x2,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    -0x38(%rbp),%ecx
  mov    %ecx,%edx
  shl    $0x2,%edx
  add    %edx,%ecx
  mov    -0x4c(%rbp),%edx
  lea    (%rcx,%rdx,1),%esi
  mov    -0x50(%rbp),%edx
  mov    -0x48(%rbp),%rdi
  mov    %eax,%ecx
  call   <findMedian@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%ecx
  movslq %ecx,%rcx
  mov    %eax,(%rdx,%rcx,4)
L93:
  cmpl   $0x1,-0x38(%rbp)
  jne    L137
  mov    -0x38(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  jmp    L21
L137:
  mov    -0x38(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    -0x38(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <kthSmallest>
L21:
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%ecx
  mov    -0x50(%rbp),%edx
  mov    -0x4c(%rbp),%esi
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <partition@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  mov    -0x54(%rbp),%edx
  sub    $0x1,%edx
  cmp    %edx,%eax
  jne    L61
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L38
L61:
  mov    -0x2c(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  cmp    %eax,-0x54(%rbp)
  jg     L114
  mov    -0x2c(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0x54(%rbp),%edx
  mov    -0x4c(%rbp),%esi
  mov    -0x48(%rbp),%rax
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <kthSmallest>
  jmp    L38
L114:
  mov    -0x54(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  lea    -0x1(%rax),%ecx
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x50(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <kthSmallest>
L38:
  mov    %rbx,%rsp
  jmp    L43
L77:
  mov    $0xf,%esi
  mov    $0x2,%edi
  call   <pow@plt>
  sub    $0x1,%eax
L43:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L66
  call   <__stack_chk_fail@plt>
L66:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int kthSmallest(int arr[], int l, int r, int k) {
  if (k > 0 && k <= r - l + 1) {
    int n = r - l + 1;
    int i, median[(n + 4) / 5];
    for (i = 0; i < n / 5; i++)
      median[i] = findMedian(arr, l + i * 5, 5 * (i + 1) - n + r, 5);
    if (i * 5 < n) {
      i++;
      median[i] = findMedian(arr, l + i * 5, r, n % 5);
    }
    int medOfMed = (i == 1) ? median[i - 1] : kthSmallest(median, 0, i - 1, i / 2);
    int pos = partition(arr, l, r, medOfMed);
    if (pos - l == k - 1)
      return arr[pos];
    if (pos - l > k - 1)
      return kthSmallest(arr, l, pos - 1, k);
    return kthSmallest(arr, pos + 1, r, k - pos + l - 1);
  }
  return pow(2, 15) - 1;
}
```