user: Translate the below assembly code into C programming language:

```asm
<findKth>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L78
  mov    -0x2c(%rbp),%edi
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <findKth>
  movq   %xmm0,%rax
  jmp    L89
L78:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L61
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movq   %xmm1,%rax
  jmp    L89
L61:
  cmpl   $0x1,-0x2c(%rbp)
  jne    L42
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movq   %xmm2,%rax
  jmp    L89
L42:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L51
  mov    -0x2c(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,%esi
  mov    -0x1c(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rdi
  mov    -0x20(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    %esi,%r8d
  mov    %eax,%esi
  call   <findKth>
  movq   %xmm0,%rax
  jmp    L89
L51:
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L69
  mov    -0x2c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x28(%rbp),%rax
  lea    (%rsi,%rax,1),%rdi
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %rdi,%rdx
  mov    %rax,%rdi
  call   <findKth>
  movq   %xmm0,%rax
  jmp    L89
L69:
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movq   %xmm3,%rax
L89:
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double findKth(int *a, int ma, int *b, int mb, int k) {
  if (ma > mb)
    return findKth(b, mb, a, ma, k);
  if (ma == 0)
    return b[k - 1];
  if (k == 1)
    return (a[0] < b[0]) ? a[0] : b[0];
  int pa = (ma < k / 2) ? ma : k / 2;
  int pb = k - pa;
  if (a[pa - 1] < b[pb - 1])
    return findKth(a + pa, ma - pa, b, mb, k - pa);
  else if (a[pa - 1] > b[pb - 1])
    return findKth(a, ma, b + pb, mb - pb, k - pb);
  else
    return a[pa - 1];
}
```