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

```asm
<medianOfFour>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,%eax
  mov    %rcx,%rbx
  movslq %esi,%rdx
  lea    (%rdi,%rdx,8),%r13
  mov    0x0(%r13),%r12
  add    %eax,%esi
  movslq %esi,%rdx
  lea    (%rdi,%rdx,8),%r14
  mov    (%r14),%rcx
  add    %eax,%esi
  movslq %esi,%rdx
  lea    (%rdi,%rdx,8),%rbp
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x8(%rsp)
  add    %esi,%eax
  cltq
  lea    (%rdi,%rax,8),%r15
  mov    (%r15),%rax
  mov    %rax,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rcx,%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L274
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L220
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L115
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L182
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
  jmp    L154
L274:
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L164
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L168
  mov    0x18(%rsp),%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L81
  mov    0x0(%r13),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%rbp)
  jmp    L154
L164:
  mov    0x18(%rsp),%r13
  mov    %r13,%rsi
  mov    0x10(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L50
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
  jmp    L154
L50:
  mov    %r13,%rsi
  mov    0x8(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L154
  mov    0x0(%rbp),%rax
  mov    (%r15),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L154
L168:
  mov    0x18(%rsp),%r13
  mov    %r13,%rsi
  mov    0x8(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L154
  mov    %r13,%rsi
  mov    0x10(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L18
  mov    0x0(%rbp),%rax
  mov    (%r15),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L154
L18:
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
  jmp    L154
L81:
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L118
  mov    0x0(%rbp),%rax
  mov    (%r15),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L154
L118:
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
  jmp    L154
L220:
  mov    0x18(%rsp),%r14
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L30
  mov    0x0(%r13),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%rbp)
L154:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L30:
  mov    %r14,%rsi
  mov    0x8(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L154
  mov    0x0(%rbp),%rax
  mov    (%r15),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L154
L115:
  mov    0x18(%rsp),%r14
  mov    %r14,%rsi
  mov    0x8(%rsp),%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L154
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L218
  mov    0x0(%rbp),%rax
  mov    (%r15),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L154
L218:
  mov    0x0(%r13),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%rbp)
  jmp    L154
L182:
  mov    0x18(%rsp),%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L126
  mov    0x0(%rbp),%rax
  mov    (%r15),%rdx
  mov    %rdx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L154
L126:
  mov    0x0(%r13),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%rbp)
  jmp    L154
```

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