user: Converte this assembly snippet into its equivalent C code:

```asm
<sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    -0x68(%rbp),%rax
  sub    -0x60(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  cmpq   $0x3,-0x38(%rbp)
  jbe    L101
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <partition@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x60(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sort>
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x68(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sort>
  jmp    L73
L101:
  cmpq   $0x3,-0x38(%rbp)
  jne    L119
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x44(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L116
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L123
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x44(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L73
L123:
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L74
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x40(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x44(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L73
L74:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x40(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x44(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L73
L116:
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L73
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L14
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x44(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x40(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L73
L14:
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x40(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L73
L119:
  cmpq   $0x2,-0x38(%rbp)
  jne    L73
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x58(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L73
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <swap@plt>
L73:
  nop
  leave
  ret
```

assistant: ```c
void sort(int a[], const size_t startIndex, const size_t endIndex) {
  const size_t len = endIndex - startIndex;
  if (len > 3) {
    const size_t pivot = partition(a, startIndex, endIndex);
    sort(a, startIndex, pivot);
    sort(a, pivot + 1, endIndex);
  } else if (len == 3) {
    const size_t x = startIndex, y = x + 1, z = y + 1;
    const int ax = a[x], ay = a[y], az = a[z];
    if (ax > ay) {
      if (ay > az) {
        a[x] = az;
        a[z] = ax;
      } else {
        if (ax > az) {
          a[x] = ay;
          a[y] = az;
          a[z] = ax;
        } else {
          a[x] = ay;
          a[y] = ax;
        }
      }
    } else {
      if (ay > az) {
        if (ax > az) {
          a[x] = az;
          a[y] = ax;
          a[z] = ay;
        } else {
          a[y] = az;
          a[z] = ay;
        }
      } else {
      }
    }
  } else if (len == 2) {
    const size_t x = startIndex;
    const size_t y = x + 1;
    if (a[x] > a[y]) {
      swap(a, x, y);
    }
  }
}
```