user: 请从给定的汇编指令推导出C源代码：

```asm
<mergeRanges>:
  endbr64
  push   %r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  sub    %esi,%r14d
  mov    %esi,%r13d
  mov    $0x4,%esi
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  mov    %r14d,%edi
  sub    $0x18,%rsp
  call   <calloc@plt>
  mov    %rax,%rdi
  cmp    %ebp,%r13d
  jge    L302
  cmp    %ebp,%r12d
  jle    L302
  mov    %rax,%rsi
  mov    %r13d,%edx
  mov    %ebp,%eax
  xor    %ecx,%ecx
  movslq %r13d,%r11
  movslq %ebp,%r10
  nopl   (%rax)
L165:
  mov    (%rbx,%r11,4),%r9d
  mov    (%rbx,%r10,4),%r8d
  cmp    %r9d,%r8d
  jle    L199
L81:
  mov    %r9d,(%rsi)
  add    $0x1,%edx
  add    $0x1,%ecx
  add    $0x4,%rsi
  cmp    %eax,%r12d
  jle    L301
  cmp    %edx,%ebp
  jle    L88
  movslq %edx,%r11
  mov    (%rbx,%r10,4),%r8d
  mov    (%rbx,%r11,4),%r9d
  cmp    %r9d,%r8d
  jg     L81
L199:
  add    $0x1,%eax
  mov    %r8d,(%rsi)
  add    $0x1,%ecx
  add    $0x4,%rsi
  cmp    %eax,%r12d
  jle    L301
  cmp    %edx,%ebp
  jle    L88
  movslq %eax,%r10
  jmp    L165
  cs nopw 0x0(%rax,%rax,1)
L302:
  mov    %ebp,%eax
  mov    %r13d,%edx
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L301:
  cmp    %edx,%ebp
  jle    L88
  movslq %ecx,%rsi
  movslq %edx,%r9
  mov    %ebp,%r10d
  lea    0x0(,%rsi,4),%r15
  mov    %rsi,(%rsp)
  lea    0x4(,%r9,4),%r9
  sub    %edx,%r10d
  lea    (%r15,%rdi,1),%rsi
  lea    (%rbx,%r9,1),%r11
  mov    %rsi,%r8
  mov    %rsi,0x8(%rsp)
  sub    %r11,%r8
  cmp    $0x8,%r8
  jbe    L276
  lea    -0x1(%r10),%r11d
  cmp    $0x2,%r11d
  jbe    L276
  mov    %r10d,%r8d
  shr    $0x2,%r8d
  sub    $0x1,%r8d
  shl    $0x4,%r8
  lea    0x10(%rsi,%r8,1),%r11
  mov    %rbx,%r8
  sub    %rsi,%r8
  lea    -0x4(%r8,%r9,1),%r8
  nopw   0x0(%rax,%rax,1)
L235:
  movdqu (%rsi,%r8,1),%xmm0
  add    $0x10,%rsi
  movups %xmm0,-0x10(%rsi)
  cmp    %r11,%rsi
  jne    L235
  mov    %r10d,%r8d
  and    $0xfffffffc,%r8d
  add    %r8d,%edx
  lea    (%rcx,%r8,1),%esi
  cmp    %r8d,%r10d
  je     L270
  movslq %edx,%r8
  mov    (%rbx,%r8,4),%r9d
  movslq %esi,%r8
  add    $0x1,%esi
  mov    %r9d,(%rdi,%r8,4)
  lea    0x1(%rdx),%r8d
  cmp    %ebp,%r8d
  jge    L270
  movslq %r8d,%r8
  movslq %esi,%rsi
  add    $0x2,%edx
  lea    0x0(,%r8,4),%r9
  mov    (%rbx,%r8,4),%r8d
  lea    0x0(,%rsi,4),%r11
  mov    %r8d,(%rdi,%rsi,4)
  cmp    %edx,%ebp
  jle    L270
  mov    0x4(%rbx,%r9,1),%edx
  mov    %edx,0x4(%rdi,%r11,1)
L270:
  add    %r10d,%ecx
L88:
  cmp    %eax,%r12d
  jle    L126
  movslq %ecx,%r11
  movslq %eax,%r8
  mov    %r12d,%r9d
  lea    0x0(,%r11,4),%r10
  lea    0x4(,%r8,4),%r8
  sub    %eax,%r9d
  lea    (%r10,%rdi,1),%rsi
  lea    (%rbx,%r8,1),%r15
  mov    %rsi,%rbp
  mov    %rsi,%rdx
  sub    %r15,%rbp
  cmp    $0x8,%rbp
  jbe    L275
  lea    -0x1(%r9),%ebp
  cmp    $0x2,%ebp
  jbe    L275
  mov    %r9d,%esi
  mov    %rbx,%r10
  shr    $0x2,%esi
  sub    %rdx,%r10
  shl    $0x4,%rsi
  lea    -0x4(%r10,%r8,1),%r8
  add    %rdx,%rsi
  nop
L299:
  movdqu (%rdx,%r8,1),%xmm1
  add    $0x10,%rdx
  movups %xmm1,-0x10(%rdx)
  cmp    %rsi,%rdx
  jne    L299
  mov    %r9d,%edx
  and    $0xfffffffc,%edx
  add    %edx,%eax
  add    %edx,%ecx
  cmp    %edx,%r9d
  je     L126
  movslq %eax,%rdx
  mov    (%rbx,%rdx,4),%esi
  movslq %ecx,%rdx
  add    $0x1,%ecx
  mov    %esi,(%rdi,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%r12d
  jle    L126
  movslq %edx,%rdx
  movslq %ecx,%rcx
  add    $0x2,%eax
  lea    0x0(,%rdx,4),%r8
  mov    (%rbx,%rdx,4),%edx
  lea    0x0(,%rcx,4),%rsi
  mov    %edx,(%rdi,%rcx,4)
  cmp    %r12d,%eax
  jge    L126
  mov    0x4(%rbx,%r8,1),%eax
  mov    %eax,0x4(%rdi,%rsi,1)
L126:
  test   %r14d,%r14d
  jle    L358
  movslq %r13d,%rdx
  lea    0x4(%rdi),%r8
  mov    %rdi,%rax
  shl    $0x2,%rdx
  lea    (%rbx,%rdx,1),%rcx
  mov    %rcx,%rsi
  sub    %r8,%rsi
  cmp    $0x8,%rsi
  jbe    L168
  lea    -0x1(%r14),%esi
  cmp    $0x2,%esi
  jbe    L168
  mov    %r14d,%edx
  sub    %rdi,%rcx
  shr    $0x2,%edx
  shl    $0x4,%rdx
  add    %rdi,%rdx
  xchg   %ax,%ax
L280:
  movdqu (%rax),%xmm2
  movups %xmm2,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L280
  mov    %r14d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r14b
  je     L358
  mov    %eax,%edx
  mov    (%rdi,%rdx,4),%esi
  lea    0x0(,%rdx,4),%rcx
  lea    (%rax,%r13,1),%edx
  movslq %edx,%rdx
  mov    %esi,(%rbx,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%r14d
  jle    L358
  mov    0x4(%rdi,%rcx,1),%esi
  add    %r13d,%edx
  add    $0x2,%eax
  movslq %edx,%rdx
  mov    %esi,(%rbx,%rdx,4)
  cmp    %eax,%r14d
  jle    L358
  mov    0x8(%rdi,%rcx,1),%edx
  add    %eax,%r13d
  movslq %r13d,%r13
  mov    %edx,(%rbx,%r13,4)
L358:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <free@plt>
  nopw   0x0(%rax,%rax,1)
L276:
  sub    $0x1,%ebp
  mov    0x8(%rsp),%r8
  sub    %edx,%ebp
  mov    (%rsp),%rdx
  add    %rbp,%rdx
  lea    0x4(%rdi,%rdx,4),%rsi
  lea    -0x4(%r9),%rdx
  sub    %r15,%rdx
  sub    %rdi,%rdx
  add    %rbx,%rdx
  nopl   0x0(%rax,%rax,1)
L284:
  mov    (%rdx,%r8,1),%r9d
  add    $0x4,%r8
  mov    %r9d,-0x4(%r8)
  cmp    %rsi,%r8
  jne    L284
  add    %r10d,%ecx
  jmp    L88
  nopl   0x0(%rax)
L275:
  sub    $0x1,%r12d
  sub    %eax,%r12d
  lea    (%r12,%r11,1),%rax
  lea    0x4(%rdi,%rax,4),%rcx
  lea    -0x4(%r8),%rax
  sub    %rdi,%rax
  sub    %r10,%rax
  add    %rbx,%rax
  nopl   (%rax)
L179:
  mov    (%rax,%rsi,1),%edx
  add    $0x4,%rsi
  mov    %edx,-0x4(%rsi)
  cmp    %rcx,%rsi
  jne    L179
  jmp    L126
  nopl   0x0(%rax)
L168:
  mov    %r14d,%r14d
  sub    %rdi,%rdx
  lea    (%rdi,%r14,4),%rcx
  add    %rdx,%rbx
  nopl   (%rax)
L189:
  mov    (%rax),%edx
  mov    %edx,(%rbx,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L189
  jmp    L358
```

assistant: ```c
void mergeRanges(int values[], int startIndex, int midPoint, int endIndex) {
  int rangeSize = endIndex - startIndex;
  int *destination = (int *)calloc(rangeSize, sizeof(int));
  int firstIndex = startIndex;
  int secondIndex = midPoint;
  int copyIndex = 0;
  int i = 0;
  while (firstIndex < midPoint && secondIndex < endIndex) {
    if (values[firstIndex] < values[secondIndex]) {
      destination[copyIndex] = values[firstIndex];
      ++firstIndex;
    } else {
      destination[copyIndex] = values[secondIndex];
      ++secondIndex;
    }
    ++copyIndex;
  }
  while (firstIndex < midPoint) {
    destination[copyIndex] = values[firstIndex];
    ++copyIndex;
    ++firstIndex;
  }
  while (secondIndex < endIndex) {
    destination[copyIndex] = values[secondIndex];
    ++copyIndex;
    ++secondIndex;
  }
  for (i = 0; i < rangeSize; ++i) {
    values[i + startIndex] = destination[i];
  }
  free(destination);
}
```