user: What would the C source look like for the assembly code provided here?

```asm
<kthSmallest>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,-0x48(%rbp)
  mov    %edx,-0x4c(%rbp)
  mov    %ecx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  test   %ecx,%ecx
  jle    L35
  mov    %rdi,%r13
  sub    %esi,%edx
  lea    0x1(%rdx),%edi
  mov    %edi,-0x54(%rbp)
  cmp    %ecx,%edi
  jl     L35
  mov    %rsp,-0x60(%rbp)
  lea    0x5(%rdx),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L8:
  cmp    %rcx,%rsp
  je     L40
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L8
L40:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L37
  orq    $0x0,-0x8(%rsp,%rax,1)
L37:
  lea    0x3(%rsp),%r15
  mov    %r15,%rax
  shr    $0x2,%rax
  mov    %rax,-0x68(%rbp)
  and    $0xfffffffffffffffc,%r15
  mov    -0x54(%rbp),%esi
  mov    %esi,%eax
  movslq %esi,%r14
  imul   $0x66666667,%r14,%r14
  sar    $0x21,%r14
  sar    $0x1f,%eax
  sub    %eax,%r14d
  cmp    $0x4,%esi
  jle    L50
  mov    -0x48(%rbp),%edi
  mov    %edi,%r12d
  mov    $0x0,%ebx
  mov    -0x4c(%rbp),%eax
  sub    %edi,%eax
  add    $0x4,%eax
  sub    %edx,%eax
  mov    %eax,-0x44(%rbp)
L71:
  mov    -0x44(%rbp),%eax
  lea    (%rax,%r12,1),%edx
  mov    $0x5,%ecx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <findMedian@plt>
  mov    %eax,(%r15,%rbx,4)
  add    $0x1,%rbx
  add    $0x5,%r12d
  cmp    %ebx,%r14d
  jg     L71
  test   %r14d,%r14d
  mov    $0x1,%ebx
  cmovg  %r14d,%ebx
  lea    (%rbx,%rbx,4),%eax
  cmp    %eax,-0x54(%rbp)
  jg     L10
L147:
  cmp    $0x1,%ebx
  jne    L1
  mov    -0x68(%rbp),%rax
  mov    0x0(,%rax,4),%ecx
L54:
  mov    -0x4c(%rbp),%edx
  mov    -0x48(%rbp),%ebx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,%edx
  sub    %ebx,%edx
  mov    -0x50(%rbp),%ebx
  lea    -0x1(%rbx),%ecx
  cmp    %ecx,%edx
  je     L121
  mov    -0x50(%rbp),%ecx
  cmp    %ecx,%edx
  jl     L137
  lea    -0x1(%rax),%edx
  mov    -0x48(%rbp),%esi
  mov    %r13,%rdi
  call   <kthSmallest>
L7:
  mov    -0x60(%rbp),%rsp
  jmp    L33
L50:
  mov    $0x0,%ebx
L10:
  add    $0x1,%ebx
  mov    -0x54(%rbp),%edi
  movslq %edi,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  mov    %edi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  sub    %eax,%edi
  mov    %edi,%ecx
  lea    (%rbx,%rbx,4),%esi
  add    -0x48(%rbp),%esi
  mov    -0x4c(%rbp),%edx
  mov    %r13,%rdi
  call   <findMedian@plt>
  mov    %eax,%edx
  movslq %ebx,%rax
  mov    %edx,(%r15,%rax,4)
  jmp    L147
L1:
  mov    %ebx,%ecx
  shr    $0x1f,%ecx
  add    %ebx,%ecx
  sar    %ecx
  lea    -0x1(%rbx),%edx
  mov    $0x0,%esi
  mov    %r15,%rdi
  call   <kthSmallest>
  mov    %eax,%ecx
  jmp    L54
L121:
  cltq
  mov    0x0(%r13,%rax,4),%eax
  jmp    L7
L137:
  mov    -0x50(%rbp),%ecx
  sub    %eax,%ecx
  mov    -0x48(%rbp),%ebx
  lea    -0x1(%rbx,%rcx,1),%ecx
  lea    0x1(%rax),%esi
  mov    -0x4c(%rbp),%edx
  mov    %r13,%rdi
  call   <kthSmallest>
  jmp    L7
L35:
  mov    $0xf,%esi
  mov    $0x2,%edi
  call   <pow@plt>
  sub    $0x1,%eax
L33:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L166
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L166:
  call   <__stack_chk_fail@plt>
```

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;
}
```