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

```asm
<quickSortGlobalEdgeTablefromto>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  add    $0x1,%eax
  sub    -0x3c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x1,-0x10(%rbp)
  jg     L133
  mov    $0x0,%eax
  jmp    L86
L133:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <getSortsbefore@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jne    L50
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L50:
  cmpl   $0x2,-0x10(%rbp)
  jg     L112
  mov    $0x0,%eax
  jmp    L86
L112:
  mov    -0x3c(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <getSortsbefore@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  je     L55
  mov    -0x1c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <getSortsbefore@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jne    L144
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x40(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L144
L55:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L144:
  cmpl   $0x3,-0x10(%rbp)
  jg     L191
  mov    $0x0,%eax
  jmp    L86
L191:
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  movl   $0x1,-0x28(%rbp)
  jmp    L71
L148:
  movl   $0x1,-0x18(%rbp)
  jmp    L199
L156:
  subl   $0x1,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L134
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <getSortsbefore@plt>
  mov    %eax,-0x18(%rbp)
  jmp    L199
L134:
  movl   $0x0,-0x18(%rbp)
L199:
  cmpl   $0x0,-0x18(%rbp)
  jne    L156
  movl   $0x1,-0x18(%rbp)
  jmp    L20
L19:
  addl   $0x1,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jg     L29
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <getSortsbefore@plt>
  mov    %eax,-0x18(%rbp)
  jmp    L20
L29:
  movl   $0x0,-0x18(%rbp)
L20:
  cmpl   $0x0,-0x18(%rbp)
  jne    L19
  mov    -0x2c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  setle  %al
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L71
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
L71:
  cmpl   $0x0,-0x28(%rbp)
  jne    L148
  mov    -0x20(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <quickSortGlobalEdgeTablefromto>
  mov    -0x40(%rbp),%edx
  mov    -0x2c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <quickSortGlobalEdgeTablefromto>
L86:
  leave
  ret
```

assistant: ```c
int quickSortGlobalEdgeTablefromto(int *array, int i, int j) {
  int k;
  int again;
  int tt;
  int di;
  int n;
  int l;
  int dj;
  int before;
  int dij;
  int ij;
  int tmp;
  if ((n = (j + 1) - i) <= 1) {
    return 0;
  }
  di = array[i];
  dj = array[j];
  before = getSortsbefore(di, dj);
  if (!(before)) {
    tmp = array[i];
    array[i] = (array[j]);
    array[j] = tmp;
    tt = di;
    di = dj;
    dj = tt;
  }
  if (n <= 2) {
    return 0;
  }
  ij = ((int)(i + j) >> 1);
  dij = array[ij];
  before = getSortsbefore(di, dij);
  if (before) {
    before = getSortsbefore(dij, dj);
    if (!(before)) {
      tmp = array[j];
      array[j] = (array[ij]);
      array[ij] = tmp;
      dij = dj;
    }
  } else {
    tmp = array[i];
    array[i] = (array[ij]);
    array[ij] = tmp;
    dij = di;
  }
  if (n <= 3) {
    return 0;
  }
  k = i;
  l = j;
  again = 1;
  while (again) {
    before = 1;
    while (before) {
      if (k <= (l -= 1)) {
        tmp = array[l];
        before = getSortsbefore(dij, tmp);
      } else {
        before = 0;
      }
    }
    before = 1;
    while (before) {
      if ((k += 1) <= l) {
        tmp = array[k];
        before = getSortsbefore(tmp, dij);
      } else {
        before = 0;
      }
    }
    again = k <= l;
    if (again) {
      tmp = array[k];
      array[k] = (array[l]);
      array[l] = tmp;
    }
  }
  quickSortGlobalEdgeTablefromto(array, i, l);
  quickSortGlobalEdgeTablefromto(array, k, j);
}
```