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

```asm
<merge_sort>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  lea    0x0(,%rsi,4),%edi
  call   <malloc@plt>
  movl   $0x1,0x8(%rsp)
  mov    %rax,%rbp
  cmp    $0x1,%r14d
  jle    L253
  mov    %r14d,%r13d
  mov    %rax,%r14
  nopl   0x0(%rax)
L102:
  mov    0x8(%rsp),%eax
  xor    %r12d,%r12d
  add    %eax,%eax
  mov    %eax,0xc(%rsp)
  nopl   (%rax)
L312:
  mov    0x8(%rsp),%eax
  mov    %r13d,%esi
  lea    (%rax,%r12,1),%edi
  call   <min@plt>
  mov    %r13d,%esi
  mov    %eax,%ebx
  mov    0xc(%rsp),%eax
  add    %r12d,%eax
  mov    %eax,%edi
  mov    %eax,0x4(%rsp)
  call   <min@plt>
  mov    %eax,%ecx
  cmp    %eax,%ebx
  jge    L79
  cmp    %r12d,%ebx
  jle    L79
  lea    0x1(%r12),%edi
  movslq %r12d,%r11
  mov    %ebx,%edx
  movslq %ebx,%r10
  movslq %edi,%rdi
  mov    %r11,%rax
  nopl   (%rax)
L314:
  mov    (%r15,%r11,4),%r9d
  mov    (%r15,%r10,4),%r8d
  cmp    %r9d,%r8d
  jle    L175
L365:
  mov    %r9d,-0x4(%r14,%rdi,4)
  mov    %edi,%esi
  add    $0x1,%eax
  add    $0x1,%rdi
  cmp    %edx,%ecx
  jle    L153
  cmp    %eax,%ebx
  jle    L159
  movslq %eax,%r11
  mov    (%r15,%r10,4),%r8d
  mov    (%r15,%r11,4),%r9d
  cmp    %r9d,%r8d
  jg     L365
L175:
  add    $0x1,%edx
  mov    %r8d,-0x4(%r14,%rdi,4)
  mov    %edi,%esi
  add    $0x1,%rdi
  cmp    %edx,%ecx
  jle    L153
  cmp    %eax,%ebx
  jle    L159
  movslq %edx,%r10
  jmp    L314
  cs nopw 0x0(%rax,%rax,1)
L79:
  mov    %ebx,%edx
  mov    %r12d,%eax
  mov    %r12d,%esi
  nopl   0x0(%rax,%rax,1)
L153:
  cmp    %eax,%ebx
  jle    L159
  movslq %esi,%r11
  movslq %eax,%r8
  mov    %ebx,%r10d
  lea    0x1(%r8),%rdi
  shl    $0x2,%r11
  sub    %eax,%r10d
  lea    0x0(,%rdi,4),%rbp
  lea    (%r14,%r11,1),%r9
  mov    %rdi,0x10(%rsp)
  lea    (%r15,%rbp,1),%r12
  mov    %r9,%rdi
  sub    %r12,%rdi
  cmp    $0x8,%rdi
  jbe    L369
  lea    -0x1(%r10),%r12d
  cmp    $0x2,%r12d
  jbe    L369
  mov    %r10d,%r8d
  lea    -0x4(%r15,%rbp,1),%r11
  xor    %edi,%edi
  shr    $0x2,%r8d
  shl    $0x4,%r8
  nopl   0x0(%rax)
L149:
  movdqu (%r11,%rdi,1),%xmm0
  movups %xmm0,(%r9,%rdi,1)
  add    $0x10,%rdi
  cmp    %r8,%rdi
  jne    L149
  mov    %r10d,%edi
  and    $0xfffffffc,%edi
  lea    (%rsi,%rdi,1),%r8d
  add    %edi,%eax
  cmp    %edi,%r10d
  je     L390
  movslq %eax,%r11
  lea    0x1(%r8),%r9d
  lea    0x1(%rax),%edi
  movslq %r8d,%r8
  mov    (%r15,%r11,4),%r11d
  mov    %r11d,(%r14,%r8,4)
  cmp    %ebx,%edi
  jge    L390
  movslq %edi,%rdi
  movslq %r9d,%r9
  add    $0x2,%eax
  lea    0x0(,%rdi,4),%r8
  mov    (%r15,%rdi,4),%edi
  lea    0x0(,%r9,4),%r11
  mov    %edi,(%r14,%r9,4)
  cmp    %ebx,%eax
  jge    L390
  mov    0x4(%r15,%r8,1),%eax
  mov    %eax,0x4(%r14,%r11,1)
L390:
  add    %r10d,%esi
L159:
  cmp    %edx,%ecx
  jle    L275
  movslq %esi,%r10
  movslq %edx,%rdi
  mov    %ecx,%r9d
  shl    $0x2,%r10
  lea    0x1(%rdi),%rax
  sub    %edx,%r9d
  lea    (%r14,%r10,1),%r8
  lea    0x0(,%rax,4),%r11
  lea    (%r15,%r11,1),%rbp
  mov    %r8,%rbx
  sub    %rbp,%rbx
  cmp    $0x8,%rbx
  jbe    L69
  lea    -0x1(%r9),%ebx
  cmp    $0x2,%ebx
  jbe    L69
  mov    %r9d,%edi
  lea    -0x4(%r15,%r11,1),%r10
  xor    %eax,%eax
  shr    $0x2,%edi
  shl    $0x4,%rdi
  nopw   0x0(%rax,%rax,1)
L31:
  movdqu (%r10,%rax,1),%xmm1
  movups %xmm1,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L31
  mov    %r9d,%eax
  and    $0xfffffffc,%eax
  add    %eax,%esi
  add    %eax,%edx
  cmp    %eax,%r9d
  je     L275
  movslq %edx,%r8
  lea    0x1(%rsi),%edi
  lea    0x1(%rdx),%eax
  movslq %esi,%rsi
  mov    (%r15,%r8,4),%r8d
  mov    %r8d,(%r14,%rsi,4)
  cmp    %ecx,%eax
  jge    L275
  cltq
  movslq %edi,%rsi
  add    $0x2,%edx
  lea    0x0(,%rax,4),%r8
  mov    (%r15,%rax,4),%eax
  lea    0x0(,%rsi,4),%rdi
  mov    %eax,(%r14,%rsi,4)
  cmp    %edx,%ecx
  jle    L275
  mov    0x4(%r15,%r8,1),%eax
  mov    %eax,0x4(%r14,%rdi,1)
L275:
  mov    0x4(%rsp),%r12d
  cmp    %r12d,%r13d
  jg     L312
  shll   0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,%r13d
  jle    L63
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %rax,%r14
  jmp    L102
  nopw   0x0(%rax,%rax,1)
L369:
  mov    %r8,%rax
  mov    0x10(%rsp),%rdi
  neg    %rax
  lea    (%r11,%rax,4),%r9
  add    %r14,%r9
  jmp    L90
  nopl   0x0(%rax)
L404:
  add    $0x1,%rdi
L90:
  mov    (%r15,%r8,4),%eax
  mov    %eax,(%r9,%r8,4)
  mov    %rdi,%r8
  cmp    %edi,%ebx
  jg     L404
  jmp    L390
L69:
  mov    %rdi,%rdx
  neg    %rdx
  lea    (%r10,%rdx,4),%rsi
  add    %r14,%rsi
  jmp    L101
  nop
L352:
  add    $0x1,%rax
L101:
  mov    (%r15,%rdi,4),%edx
  mov    %edx,(%rsi,%rdi,4)
  mov    %rax,%rdi
  cmp    %eax,%ecx
  jg     L352
  jmp    L275
L63:
  mov    %r14,%rbp
  mov    %r13d,%r14d
  cmp    %rbp,0x18(%rsp)
  je     L148
  lea    0x4(%rbp),%rdx
  mov    %r15,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L409
  lea    -0x1(%r14),%eax
  cmp    $0x2,%eax
  jbe    L409
  mov    %r14d,%edx
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
L85:
  movdqu 0x0(%rbp,%rax,1),%xmm2
  movups %xmm2,(%r15,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L85
  mov    %r14d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r14b
  je     L253
  mov    %eax,%ecx
  mov    0x0(%rbp,%rcx,4),%esi
  lea    0x0(,%rcx,4),%rdx
  mov    %esi,(%r15,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %r14d,%ecx
  jge    L253
  mov    0x4(%rbp,%rdx,1),%ecx
  add    $0x2,%eax
  mov    %ecx,0x4(%r15,%rdx,1)
  cmp    %r14d,%eax
  jge    L253
  mov    0x8(%rbp,%rdx,1),%eax
  mov    %eax,0x8(%r15,%rdx,1)
L253:
  add    $0x28,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
L148:
  mov    %r15,%rbp
  jmp    L253
L409:
  mov    %r14d,%edx
  xor    %eax,%eax
L384:
  mov    0x0(%rbp,%rax,4),%ecx
  mov    %ecx,(%r15,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L384
  jmp    L253
```

assistant: ```c
void merge_sort(int arr[], int len) {
  int *a = arr;
  int *b = (int *)malloc(len * sizeof(int));
  int seg, start;
  for (seg = 1; seg < len; seg += seg) {
    for (start = 0; start < len; start += (seg + seg)) {
      int low = start, mid = min(start + seg, len), high = min(start + seg + seg, len);
      int k = low;
      int start1 = low, end1 = mid;
      int start2 = mid, end2 = high;
      while (start1 < end1 && start2 < end2)
        b[k++] = a[start1] < a[start2] ? a[start1++] : a[start2++];
      while (start1 < end1)
        b[k++] = a[start1++];
      while (start2 < end2)
        b[k++] = a[start2++];
    }
    int *temp = a;
    a = b;
    b = temp;
  }
  if (a != arr) {
    int i;
    for (i = 0; i < len; i++)
      b[i] = a[i];
    b = a;
  }
  free(b);
}
```