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

```asm
<medianOfFour>:
  endbr64
  push   %r15
  mov    %edx,%eax
  movslq %esi,%rdx
  push   %r14
  add    %eax,%esi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  lea    (%rdi,%rdx,8),%rcx
  movslq %esi,%rdx
  lea    (%rdi,%rdx,8),%rdx
  add    %eax,%esi
  add    %esi,%eax
  sub    $0x28,%rsp
  mov    (%rdx),%r13
  mov    (%rcx),%r12
  cltq
  mov    %rdx,0x10(%rsp)
  movslq %esi,%rdx
  lea    (%rdi,%rdx,8),%rbp
  mov    %rcx,0x8(%rsp)
  lea    (%rdi,%rax,8),%rcx
  mov    %r13,%rsi
  mov    0x0(%rbp),%r14
  mov    (%rcx),%r15
  mov    %rcx,0x18(%rsp)
  mov    %r12,%rdi
  call   *%rbx
  mov    %r14,%rsi
  test   %eax,%eax
  jle    L72
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L140
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   *%rbx
  mov    %r15,%rsi
  test   %eax,%eax
  jle    L188
  mov    %r13,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L118
L144:
  mov    0x10(%rsp),%rbx
  mov    0x0(%rbp),%rdx
  mov    (%rbx),%rax
  mov    %rdx,(%rbx)
  mov    %rax,0x0(%rbp)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L140:
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L60
L116:
  mov    0x8(%rsp),%rbx
  mov    0x0(%rbp),%rdx
  mov    (%rbx),%rax
  mov    %rdx,(%rbx)
  mov    %rax,0x0(%rbp)
L74:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L72:
  mov    %r13,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L151
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   *%rbx
  mov    %r15,%rsi
  test   %eax,%eax
  jle    L162
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L116
L64:
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L144
L110:
  mov    0x18(%rsp),%rbx
  mov    0x0(%rbp),%rax
  mov    (%rbx),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%rbx)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L162:
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L74
  jmp    L64
  nopl   0x0(%rax,%rax,1)
L60:
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L110
  jmp    L74
  nopl   0x0(%rax)
L188:
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L74
L118:
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L110
  jmp    L116
  cs nopw 0x0(%rax,%rax,1)
L151:
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L144
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L74
  mov    0x18(%rsp),%rcx
  mov    0x0(%rbp),%rax
  mov    (%rcx),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%rcx)
  jmp    L74
```

assistant: ```c
void medianOfFour(void **ar, int left, int gap, int (*cmp)(const void *, const void *)) {
  int pos1 = left, pos2, pos3, pos4;
  void *a1 = ar[pos1];
  void *a2 = ar[pos2 = pos1 + gap];
  void *a3 = ar[pos3 = pos2 + gap];
  void *a4 = ar[pos4 = pos3 + gap];
  if (cmp(a1, a2) <= 0) {
    if (cmp(a2, a3) <= 0) {
      if (cmp(a2, a4) <= 0) {
        if (cmp(a3, a4) > 0) {
          {
            void *_tmp__ = ar[pos3];
            ar[pos3] = ar[pos4];
            ar[pos4] = _tmp__;
          };
        }
      } else {
        {
          void *_tmp__ = ar[pos2];
          ar[pos2] = ar[pos3];
          ar[pos3] = _tmp__;
        };
      }
    } else {
      if (cmp(a1, a3) <= 0) {
        if (cmp(a3, a4) <= 0) {
          if (cmp(a2, a4) <= 0) {
            {
              void *_tmp__ = ar[pos2];
              ar[pos2] = ar[pos3];
              ar[pos3] = _tmp__;
            };
          } else {
            {
              void *_tmp__ = ar[pos3];
              ar[pos3] = ar[pos4];
              ar[pos4] = _tmp__;
            };
          }
        }
      } else {
        if (cmp(a1, a4) <= 0) {
          if (cmp(a2, a4) <= 0) {
            {
              void *_tmp__ = ar[pos2];
              ar[pos2] = ar[pos3];
              ar[pos3] = _tmp__;
            };
          } else {
            {
              void *_tmp__ = ar[pos3];
              ar[pos3] = ar[pos4];
              ar[pos4] = _tmp__;
            };
          }
        } else {
          {
            void *_tmp__ = ar[pos1];
            ar[pos1] = ar[pos3];
            ar[pos3] = _tmp__;
          };
        }
      }
    }
  } else {
    if (cmp(a1, a3) <= 0) {
      if (cmp(a1, a4) <= 0) {
        if (cmp(a3, a4) > 0) {
          {
            void *_tmp__ = ar[pos3];
            ar[pos3] = ar[pos4];
            ar[pos4] = _tmp__;
          };
        }
      } else {
        {
          void *_tmp__ = ar[pos1];
          ar[pos1] = ar[pos3];
          ar[pos3] = _tmp__;
        };
      }
    } else {
      if (cmp(a2, a3) <= 0) {
        if (cmp(a3, a4) <= 0) {
          if (cmp(a1, a4) <= 0) {
            {
              void *_tmp__ = ar[pos1];
              ar[pos1] = ar[pos3];
              ar[pos3] = _tmp__;
            };
          } else {
            {
              void *_tmp__ = ar[pos3];
              ar[pos3] = ar[pos4];
              ar[pos4] = _tmp__;
            };
          }
        }
      } else {
        if (cmp(a2, a4) <= 0) {
          if (cmp(a1, a4) <= 0) {
            {
              void *_tmp__ = ar[pos1];
              ar[pos1] = ar[pos3];
              ar[pos3] = _tmp__;
            };
          } else {
            {
              void *_tmp__ = ar[pos3];
              ar[pos3] = ar[pos4];
              ar[pos4] = _tmp__;
            };
          }
        } else {
          {
            void *_tmp__ = ar[pos2];
            ar[pos2] = ar[pos3];
            ar[pos3] = _tmp__;
          };
        }
      }
    }
  }
}
```