user: Please show me the C implementation that matches the assembly code listed below:

```asm
<medianOfFour>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %esi,-0xac(%rbp)
  mov    %edx,-0xb0(%rbp)
  mov    %rcx,-0xb8(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0xa0(%rbp)
  mov    -0xa0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x90(%rbp)
  mov    -0xa0(%rbp),%edx
  mov    -0xb0(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x9c(%rbp)
  mov    -0x9c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x9c(%rbp),%edx
  mov    -0xb0(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x98(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x80(%rbp)
  mov    -0x98(%rbp),%edx
  mov    -0xb0(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x94(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x88(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L235
  mov    -0x80(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L261
  mov    -0x78(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L23
  mov    -0x78(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jle    L64
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x98(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L23:
  mov    -0x9c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x9c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L261:
  mov    -0x80(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L24
  mov    -0x78(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L64
  mov    -0x78(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L28
  mov    -0x9c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x9c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L28:
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x98(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L24:
  mov    -0x78(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L110
  mov    -0x78(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L220
  mov    -0x9c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x9c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L220:
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x98(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L110:
  mov    -0xa0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0xa0(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L235:
  mov    -0x80(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L43
  mov    -0x78(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L107
  mov    -0x78(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jle    L64
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x98(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L107:
  mov    -0xa0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0xa0(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L43:
  mov    -0x80(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L31
  mov    -0x78(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L64
  mov    -0x78(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L228
  mov    -0xa0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0xa0(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x50(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L228:
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x98(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L31:
  mov    -0x78(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L181
  mov    -0x78(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    -0xb8(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L233
  mov    -0xa0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0xa0(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x60(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L233:
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x98(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x68(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L64
L181:
  mov    -0x9c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x70(%rbp)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x9c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x70(%rbp),%rax
  mov    %rax,(%rdx)
L64:
  nop
  leave
  ret
```

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