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

```asm
<ms_inner>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  sub    %rdx,%r13
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rcx,0x8(%rsp)
  mov    0x90(%rsp),%rdi
  cmp    $0x1,%r13
  ja     L26
L67:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L26:
  mov    %r13,%rax
  sub    $0x8,%rsp
  mov    %rcx,%rbx
  mov    %rsi,%r15
  shr    %rax
  mov    %r9,%r14
  mov    %rax,%rbp
  add    %rdx,%rbp
  mov    %rbp,0x28(%rsp)
  mov    %rbp,%rcx
  mov    %rdi,0x40(%rsp)
  push   %rdi
  mov    %r12,%rdi
  mov    %r8,0x28(%rsp)
  mov    %rdx,0x58(%rsp)
  call   <ms_inner>
  pop    %rax
  push   0x40(%rsp)
  mov    %rbx,%rcx
  mov    0x28(%rsp),%r8
  mov    %r14,%r9
  mov    %rbp,%rdx
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    %rbp,%rbx
  call   <ms_inner>
  mov    %rbp,%rsi
  lea    -0x1(%rbp),%rdi
  mov    %r14,%rdx
  imul   %r15,%rsi
  mov    0x28(%rsp),%r8
  imul   %r15,%rdi
  add    %r12,%rsi
  add    %r12,%rdi
  call   *%r8
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  jle    L67
  mov    0x38(%rsp),%rbp
  mov    %rbx,%rax
  xor    %ecx,%ecx
  mov    %r13,0x28(%rsp)
  mov    %r14,0x40(%rsp)
  mov    0x48(%rsp),%rbx
  mov    %rcx,%r14
  mov    %rbp,%r13
  mov    %rax,%rbp
  cmp    %rbx,0x20(%rsp)
  je     L45
  nopl   (%rax)
L32:
  mov    %r15,%r8
  imul   %rbx,%r8
  add    %r12,%r8
  cmp    %rbp,0x8(%rsp)
  je     L42
  mov    %r15,%rsi
  mov    %r8,0x10(%rsp)
  mov    0x40(%rsp),%rdx
  mov    %r8,%rdi
  imul   %rbp,%rsi
  mov    0x18(%rsp),%rax
  add    %r12,%rsi
  mov    %rsi,0x30(%rsp)
  call   *%rax
  mov    0x10(%rsp),%r8
  mov    %r15,%rdx
  test   %eax,%eax
  jle    L96
  mov    0x30(%rsp),%rsi
  mov    %r13,%rdi
  add    $0x1,%rbp
  call   <memcpy@plt>
L52:
  add    $0x1,%r14
  cmp    %r14,0x28(%rsp)
  je     L78
  add    %r15,%r13
  cmp    %rbx,0x20(%rsp)
  jne    L32
L45:
  mov    %rbp,%rbx
  mov    %r13,%rbp
  mov    0x28(%rsp),%r13
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r14
  add    $0x1,%rbx
  imul   %r15,%rsi
  mov    %r14,%rbp
  add    %r12,%rsi
  call   <memcpy@plt>
  cmp    %r14,%r13
  jne    L54
L53:
  mov    0x48(%rsp),%r10
  mov    %r13,%rdx
  mov    0x38(%rsp),%rsi
  add    $0x58,%rsp
  imul   %r15,%rdx
  pop    %rbx
  pop    %rbp
  imul   %r15,%r10
  lea    (%r12,%r10,1),%rdi
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <memcpy@plt>
  xchg   %ax,%ax
L96:
  mov    %r8,%rsi
  mov    %r13,%rdi
  add    $0x1,%rbx
  call   <memcpy@plt>
  jmp    L52
  nopl   0x0(%rax)
L42:
  mov    %r15,%rdx
  mov    %r8,%rsi
  mov    %r13,%rdi
  add    $0x1,%rbx
  call   <memcpy@plt>
  jmp    L52
  nop
L54:
  imul   %r15,%rbx
  mov    %r15,%r14
  imul   %rbp,%r14
  add    0x38(%rsp),%r14
  add    %r12,%rbx
  nopl   0x0(%rax,%rax,1)
L94:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  mov    %r15,%rdx
  add    $0x1,%rbp
  call   <memcpy@plt>
  add    %r15,%r14
  add    %r15,%rbx
  cmp    %rbp,%r13
  ja     L94
  jmp    L53
L78:
  mov    0x28(%rsp),%r13
  jmp    L53
```

assistant: ```c
void ms_inner(void *base, const size_t size, const size_t start, const size_t end, int (*compar)(const void *v1, const void *v2, const void *private), const void *private, char *workarray) {
  size_t middle;
  if ((end - start) > 1) {
    char *cbase = (char *)base;
    middle = start + (end - start) / 2;
    ms_inner(base, size, start, middle, compar, private, workarray);
    ms_inner(base, size, middle, end, compar, private, workarray);
    if (compar(cbase + (middle - 1) * size, cbase + middle * size, private) > 0) {
      size_t i, n = end - start;
      size_t ileft = start;
      size_t iright = middle;
      for (i = 0; i < n; i++) {
        if (ileft == middle) {
          memcpy(workarray + i * size, cbase + iright * size, size);
          iright++;
        } else if (iright == end) {
          memcpy(workarray + i * size, cbase + ileft * size, size);
          ileft++;
        } else {
          if (compar(cbase + ileft * size, cbase + iright * size, private) > 0) {
            memcpy(workarray + i * size, cbase + iright * size, size);
            iright++;
          } else {
            memcpy(workarray + i * size, cbase + ileft * size, size);
            ileft++;
          }
        }
      }
      memcpy(cbase + start * size, workarray, (end - start) * size);
    }
  }
}
```