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

```asm
<partition_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x230,%rsp
  mov    %rdi,-0x218(%rbp)
  mov    %rsi,-0x220(%rbp)
  mov    %rdx,-0x228(%rbp)
  mov    %rcx,-0x230(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x204(%rbp)
  mov    -0x218(%rbp),%rax
  mov    %rax,-0x110(%rbp)
  mov    -0x220(%rbp),%rax
  mov    %eax,-0x190(%rbp)
  jmp    L277
L130:
  subl   $0x1,-0x204(%rbp)
  mov    -0x204(%rbp),%eax
  cltq
  mov    -0x110(%rbp,%rax,8),%rax
  mov    %rax,-0x1c0(%rbp)
  mov    -0x204(%rbp),%eax
  cltq
  mov    -0x190(%rbp,%rax,4),%eax
  mov    %eax,-0x200(%rbp)
L299:
  mov    -0x200(%rbp),%eax
  sar    %eax
  cltq
  mov    %eax,%edx
  mov    -0x228(%rbp),%rax
  imul   %edx,%eax
  mov    %eax,-0x1fc(%rbp)
  mov    -0x1fc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x1c0(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1b8(%rbp)
  mov    -0x200(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L363
  mov    -0x1fc(%rbp),%eax
  mov    -0x228(%rbp),%rdx
  sub    %edx,%eax
  mov    %eax,-0x1fc(%rbp)
L363:
  mov    -0x1fc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x1b8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1b0(%rbp)
  mov    -0x1b8(%rbp),%rdx
  mov    -0x1c0(%rbp),%rax
  mov    -0x230(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jle    L380
  mov    -0x228(%rbp),%rax
  mov    %eax,-0x1f8(%rbp)
  mov    -0x1c0(%rbp),%rax
  or     -0x1f8(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L220
L258:
  mov    -0x1c0(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1e0(%rbp)
  mov    -0x1b8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x1c0(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1b8(%rbp),%rax
  mov    -0x1e0(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x1c0(%rbp)
  addq   $0x4,-0x1b8(%rbp)
  subl   $0x4,-0x1f8(%rbp)
  cmpl   $0x0,-0x1f8(%rbp)
  jne    L258
  jmp    L37
L220:
  mov    -0x1c0(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x20a(%rbp)
  mov    -0x1c0(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1c0(%rbp)
  mov    -0x1b8(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x1b8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1b8(%rbp)
  movzbl -0x20a(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x1f8(%rbp)
  cmpl   $0x0,-0x1f8(%rbp)
  jne    L220
L37:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1c0(%rbp)
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1b8(%rbp)
L380:
  mov    -0x1b0(%rbp),%rdx
  mov    -0x1b8(%rbp),%rax
  mov    -0x230(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jle    L222
  mov    -0x1b0(%rbp),%rdx
  mov    -0x1c0(%rbp),%rax
  mov    -0x230(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jle    L146
  mov    -0x228(%rbp),%rax
  mov    %eax,-0x1f4(%rbp)
  mov    -0x1c0(%rbp),%rax
  or     -0x1f4(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L345
L1:
  mov    -0x1c0(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1dc(%rbp)
  mov    -0x1b0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x1c0(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1b0(%rbp),%rax
  mov    -0x1dc(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x1c0(%rbp)
  addq   $0x4,-0x1b0(%rbp)
  subl   $0x4,-0x1f4(%rbp)
  cmpl   $0x0,-0x1f4(%rbp)
  jne    L1
  jmp    L169
L345:
  mov    -0x1c0(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x209(%rbp)
  mov    -0x1c0(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1c0(%rbp)
  mov    -0x1b0(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x1b0(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1b0(%rbp)
  movzbl -0x209(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x1f4(%rbp)
  cmpl   $0x0,-0x1f4(%rbp)
  jne    L345
L169:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1c0(%rbp)
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1b0(%rbp)
L146:
  mov    -0x228(%rbp),%rax
  mov    %eax,-0x1f0(%rbp)
  mov    -0x1b8(%rbp),%rax
  or     -0x1f0(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L260
L140:
  mov    -0x1b8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1d8(%rbp)
  mov    -0x1b0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x1b8(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1b0(%rbp),%rax
  mov    -0x1d8(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x1b8(%rbp)
  addq   $0x4,-0x1b0(%rbp)
  subl   $0x4,-0x1f0(%rbp)
  cmpl   $0x0,-0x1f0(%rbp)
  jne    L140
  jmp    L360
L260:
  mov    -0x1b8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x208(%rbp)
  mov    -0x1b8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1b8(%rbp)
  mov    -0x1b0(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x1b0(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1b0(%rbp)
  movzbl -0x208(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x1f0(%rbp)
  cmpl   $0x0,-0x1f0(%rbp)
  jne    L260
L360:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1b8(%rbp)
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1b0(%rbp)
L222:
  mov    -0x228(%rbp),%rax
  neg    %rax
  mov    %rax,%rdx
  mov    -0x1b0(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x1a0(%rbp)
  mov    -0x228(%rbp),%rax
  mov    %eax,-0x1ec(%rbp)
  mov    -0x1b8(%rbp),%rax
  or     -0x1ec(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L252
L276:
  mov    -0x1b8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1d4(%rbp)
  mov    -0x1a0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x1b8(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1a0(%rbp),%rax
  mov    -0x1d4(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x1b8(%rbp)
  addq   $0x4,-0x1a0(%rbp)
  subl   $0x4,-0x1ec(%rbp)
  cmpl   $0x0,-0x1ec(%rbp)
  jne    L276
  jmp    L362
L252:
  mov    -0x1b8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x207(%rbp)
  mov    -0x1b8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1b8(%rbp)
  mov    -0x1a0(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x1a0(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1a0(%rbp)
  movzbl -0x207(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x1ec(%rbp)
  cmpl   $0x0,-0x1ec(%rbp)
  jne    L252
L362:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1b8(%rbp)
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1a0(%rbp)
  mov    -0x1c0(%rbp),%rax
  mov    %rax,-0x1a8(%rbp)
  mov    -0x1a0(%rbp),%rax
  mov    %rax,-0x198(%rbp)
L144:
  mov    -0x228(%rbp),%rax
  add    %rax,-0x1a8(%rbp)
  mov    -0x198(%rbp),%rdx
  mov    -0x1a8(%rbp),%rax
  mov    -0x230(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  js     L144
L76:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1a0(%rbp)
  mov    -0x198(%rbp),%rdx
  mov    -0x1a0(%rbp),%rax
  mov    -0x230(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jg     L76
  mov    -0x1a0(%rbp),%rax
  cmp    -0x1a8(%rbp),%rax
  jbe    L165
  mov    -0x228(%rbp),%rax
  mov    %eax,-0x1e8(%rbp)
  mov    -0x1a8(%rbp),%rax
  or     -0x1e8(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L160
L396:
  mov    -0x1a8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1d0(%rbp)
  mov    -0x1a0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x1a8(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1a0(%rbp),%rax
  mov    -0x1d0(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x1a8(%rbp)
  addq   $0x4,-0x1a0(%rbp)
  subl   $0x4,-0x1e8(%rbp)
  cmpl   $0x0,-0x1e8(%rbp)
  jne    L396
  jmp    L45
L160:
  mov    -0x1a8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x206(%rbp)
  mov    -0x1a8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1a8(%rbp)
  mov    -0x1a0(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x1a0(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1a0(%rbp)
  movzbl -0x206(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x1e8(%rbp)
  cmpl   $0x0,-0x1e8(%rbp)
  jne    L160
L45:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1a8(%rbp)
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1a0(%rbp)
  jmp    L144
L165:
  nop
  mov    -0x228(%rbp),%rax
  mov    %eax,-0x1e4(%rbp)
  mov    -0x1a8(%rbp),%rax
  or     -0x1e4(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L305
L272:
  mov    -0x1a8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1cc(%rbp)
  mov    -0x198(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x1a8(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x198(%rbp),%rax
  mov    -0x1cc(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x1a8(%rbp)
  addq   $0x4,-0x198(%rbp)
  subl   $0x4,-0x1e4(%rbp)
  cmpl   $0x0,-0x1e4(%rbp)
  jne    L272
  jmp    L296
L305:
  mov    -0x1a8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x205(%rbp)
  mov    -0x1a8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x1a8(%rbp)
  mov    -0x198(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x198(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x198(%rbp)
  movzbl -0x205(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x1e4(%rbp)
  cmpl   $0x0,-0x1e4(%rbp)
  jne    L305
L296:
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x1a8(%rbp)
  mov    -0x228(%rbp),%rax
  neg    %rax
  add    %rax,-0x198(%rbp)
  mov    -0x1a8(%rbp),%rax
  sub    -0x1c0(%rbp),%rax
  mov    $0x0,%edx
  divq   -0x228(%rbp)
  sub    $0x1,%eax
  mov    %eax,-0x1c8(%rbp)
  mov    -0x200(%rbp),%eax
  sub    -0x1c8(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c4(%rbp)
  mov    -0x1c8(%rbp),%eax
  cmp    -0x1c4(%rbp),%eax
  jle    L224
  cmpl   $0xa,-0x1c4(%rbp)
  jle    L67
  mov    -0x204(%rbp),%eax
  cltq
  mov    -0x1c0(%rbp),%rdx
  mov    %rdx,-0x110(%rbp,%rax,8)
  mov    -0x204(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x204(%rbp)
  cltq
  mov    -0x1c8(%rbp),%edx
  mov    %edx,-0x190(%rbp,%rax,4)
  mov    -0x1a8(%rbp),%rax
  mov    %rax,-0x1c0(%rbp)
  mov    -0x1c4(%rbp),%eax
  mov    %eax,-0x200(%rbp)
  jmp    L299
L67:
  cmpl   $0xa,-0x1c8(%rbp)
  jle    L277
  mov    -0x1c8(%rbp),%eax
  mov    %eax,-0x200(%rbp)
  jmp    L299
L224:
  cmpl   $0xa,-0x1c8(%rbp)
  jle    L321
  mov    -0x204(%rbp),%eax
  cltq
  mov    -0x1a8(%rbp),%rdx
  mov    %rdx,-0x110(%rbp,%rax,8)
  mov    -0x204(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x204(%rbp)
  cltq
  mov    -0x1c4(%rbp),%edx
  mov    %edx,-0x190(%rbp,%rax,4)
  mov    -0x1c8(%rbp),%eax
  mov    %eax,-0x200(%rbp)
  jmp    L299
L321:
  cmpl   $0xa,-0x1c4(%rbp)
  jle    L277
  mov    -0x1a8(%rbp),%rax
  mov    %rax,-0x1c0(%rbp)
  mov    -0x1c4(%rbp),%eax
  mov    %eax,-0x200(%rbp)
  jmp    L299
L277:
  cmpl   $0x0,-0x204(%rbp)
  jne    L130
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L80
  call   <__stack_chk_fail@plt>
L80:
  leave
  ret
```

assistant: ```c
void partition_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
  int stackpointer = 1;
  void *basestack[32];
  int sizestack[32];
  basestack[0] = base;
  sizestack[0] = nmemb;
  while (stackpointer != 0) {
    char *b = (char *)basestack[--stackpointer];
    int n = sizestack[stackpointer];
    for (;;) {
      int halfn = (n >> 1) * size;
      char *bmid = b + halfn;
      char *btop;
      if ((n & 1) == 0)
        halfn -= size;
      btop = bmid + halfn;
      if ((*compar)(b, bmid) > 0) {
        int xsize = size;
        if (((xsize | (int)b) & 0x3) == 0) {
          do {
            int temp = *(int *)b;
            *(int *)b = *(int *)bmid;
            *(int *)bmid = temp;
            b += 4;
            bmid += 4;
            xsize -= 4;
            ;
          } while (xsize != 0);
        } else {
          do {
            char temp = *b;
            *b++ = *bmid;
            *bmid++ = temp;
            xsize--;
          } while (xsize != 0);
        }
        b -= size;
        bmid -= size;
      };
      if ((*compar)(bmid, btop) > 0) {
        if ((*compar)(b, btop) > 0) {
          int xsize = size;
          if (((xsize | (int)b) & 0x3) == 0) {
            do {
              int temp = *(int *)b;
              *(int *)b = *(int *)btop;
              *(int *)btop = temp;
              b += 4;
              btop += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *b;
              *b++ = *btop;
              *btop++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          b -= size;
          btop -= size;
        };
        {
          int xsize = size;
          if (((xsize | (int)bmid) & 0x3) == 0) {
            do {
              int temp = *(int *)bmid;
              *(int *)bmid = *(int *)btop;
              *(int *)btop = temp;
              bmid += 4;
              btop += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *bmid;
              *bmid++ = *btop;
              *btop++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          bmid -= size;
          btop -= size;
        };
      }
      {
        char *l;
        char *r = btop - size;
        char *pivot;
        int s1, s2;
        {
          int xsize = size;
          if (((xsize | (int)bmid) & 0x3) == 0) {
            do {
              int temp = *(int *)bmid;
              *(int *)bmid = *(int *)r;
              *(int *)r = temp;
              bmid += 4;
              r += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *bmid;
              *bmid++ = *r;
              *r++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          bmid -= size;
          r -= size;
        };
        l = b;
        pivot = r;
        for (;;) {
          do
            l += size;
          while ((*compar)(l, pivot) < 0);
          do
            r -= size;
          while ((*compar)(r, pivot) > 0);
          if (r <= l)
            break;
          {
            int xsize = size;
            if (((xsize | (int)l) & 0x3) == 0) {
              do {
                int temp = *(int *)l;
                *(int *)l = *(int *)r;
                *(int *)r = temp;
                l += 4;
                r += 4;
                xsize -= 4;
                ;
              } while (xsize != 0);
            } else {
              do {
                char temp = *l;
                *l++ = *r;
                *r++ = temp;
                xsize--;
              } while (xsize != 0);
            }
            l -= size;
            r -= size;
          };
        }
        {
          int xsize = size;
          if (((xsize | (int)l) & 0x3) == 0) {
            do {
              int temp = *(int *)l;
              *(int *)l = *(int *)pivot;
              *(int *)pivot = temp;
              l += 4;
              pivot += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *l;
              *l++ = *pivot;
              *pivot++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          l -= size;
          pivot -= size;
        };
        s1 = ((l - b) / size) - 1;
        s2 = n - s1 - 1;
        if (s1 > s2) {
          if (s2 > 10) {
            (basestack[stackpointer] = (void *)(b), sizestack[stackpointer++] = (s1));
            b = l;
            n = s2;
          } else if (s1 > 10)
            n = s1;
          else
            break;
        } else {
          if (s1 > 10) {
            (basestack[stackpointer] = (void *)(l), sizestack[stackpointer++] = (s2));
            n = s1;
          } else if (s2 > 10) {
            b = l;
            n = s2;
          } else
            break;
        }
      }
    }
  }
}
```