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

```asm
<gca_median5>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jle    L81
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L81:
  mov    -0x40(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jle    L87
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x40(%rbp)
L87:
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jns    L49
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jle    L91
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L91
L49:
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x40(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jle    L91
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x40(%rbp)
L91:
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jns    L7
  mov    -0x38(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jns    L74
  mov    -0x30(%rbp),%rax
  jmp    L33
L74:
  mov    -0x38(%rbp),%rax
  jmp    L33
L7:
  mov    -0x28(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%r8
  mov    0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  test   %eax,%eax
  jns    L62
  mov    -0x40(%rbp),%rax
  jmp    L33
L62:
  mov    -0x28(%rbp),%rax
L33:
  leave
  ret
```

assistant: ```c
void *gca_median5(void *p0, void *p1, void *p2, void *p3, void *p4, int (*compar)(const void *_a, const void *_b, void *_arg), void *arg) {
  if (compar(p0, p1, arg) > 0)
    do {
      __typeof(p0) _tmp = (p0);
      (p0) = (p1);
      (p1) = _tmp;
    } while (0);
  if (compar(p2, p3, arg) > 0)
    do {
      __typeof(p2) _tmp = (p2);
      (p2) = (p3);
      (p3) = _tmp;
    } while (0);
  if (compar(p0, p2, arg) < 0) {
    p0 = p4;
    if (compar(p0, p1, arg) > 0)
      do {
        __typeof(p0) _tmp = (p0);
        (p0) = (p1);
        (p1) = _tmp;
      } while (0);
  } else {
    p2 = p4;
    if (compar(p2, p3, arg) > 0)
      do {
        __typeof(p2) _tmp = (p2);
        (p2) = (p3);
        (p3) = _tmp;
      } while (0);
  }
  if (compar(p0, p2, arg) < 0) {
    return (compar(p1, p2, arg) < 0 ? p1 : p2);
  } else {
    return (compar(p3, p0, arg) < 0 ? p3 : p0);
  }
}
```