user: What would the C source look like for the assembly code provided here:

```asm
<partition>:
  endbr64
  cmp    %rdx,%rsi
  jae    L29
  push   %r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  sub    %rsi,%rdx
  push   %rbp
  mov    %rdx,%r15
  mov    %rsi,%rbp
  push   %rbx
  shr    %r15
  add    %rsi,%r15
  sub    $0x28,%rsp
  mov    D110(%rip),%rcx
  lea    0x1(%rcx),%rax
  mov    %rax,D228(%rip)
  cmp    $0x3e8,%rax
  je     L141
  cmp    %r15,%rsi
  jae    L142
  mov    %rdx,%r9
  lea    0x2(%rcx),%rax
  shr    $0x2,%r9
  mov    %rax,D228(%rip)
  add    %rsi,%r9
  cmp    $0x3e8,%rax
  je     L52
  cmp    %r9,%rsi
  jae    L185
  shr    $0x3,%rdx
  add    $0x3,%rcx
  mov    %rcx,D228(%rip)
  lea    (%rdx,%rsi,1),%rbx
  cmp    $0x3e8,%rcx
  je     L165
  mov    %r14,%rcx
  mov    %rbx,%rdx
  mov    %r9,0x8(%rsp)
  call   <partition>
  mov    0x8(%rsp),%rdx
  mov    %r14,%rcx
  mov    %r13,%rdi
  lea    0x1(%rbx),%rsi
  call   <partition>
  mov    0x8(%rsp),%rcx
  mov    %r14,%r8
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  subq   $0x1,D228(%rip)
  call   <merge_sort@plt>
  mov    D228(%rip),%rax
  mov    0x8(%rsp),%r9
L185:
  lea    0x1(%r9),%rbx
  cmp    %rbx,%r15
  jbe    L150
  mov    %r15,%r10
  add    $0x1,%rax
  sub    %rbx,%r10
  mov    %rax,D228(%rip)
  shr    %r10
  add    %rbx,%r10
  cmp    $0x3e8,%rax
  je     L156
  mov    %r10,%rdx
  mov    %r14,%rcx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  mov    %r9,0x10(%rsp)
  mov    %r10,0x8(%rsp)
  call   <partition>
  mov    0x8(%rsp),%r10
  mov    %r14,%rcx
  mov    %r15,%rdx
  mov    %r13,%rdi
  lea    0x1(%r10),%rsi
  call   <partition>
  mov    0x8(%rsp),%rdx
  mov    %r14,%r8
  mov    %r15,%rcx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  subq   $0x1,D228(%rip)
  call   <merge_sort@plt>
  mov    D228(%rip),%rax
  mov    0x10(%rsp),%r9
L150:
  sub    $0x1,%rax
  mov    %r14,%r8
  mov    %r15,%rcx
  mov    %r9,%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  mov    %rax,D228(%rip)
  call   <merge_sort@plt>
  mov    D228(%rip),%rax
L142:
  lea    0x1(%r15),%rbx
  cmp    %r12,%rbx
  jae    L182
  mov    %r12,%rcx
  lea    0x1(%rax),%rdx
  sub    %rbx,%rcx
  mov    %rdx,D228(%rip)
  mov    %rcx,%r9
  shr    %r9
  add    %rbx,%r9
  cmp    $0x3e8,%rdx
  je     L106
  cmp    %r9,%rbx
  jae    L81
  shr    $0x2,%rcx
  add    $0x2,%rax
  mov    %rax,D228(%rip)
  lea    (%rcx,%rbx,1),%r10
  cmp    $0x3e8,%rax
  je     L20
  mov    %r10,%rdx
  mov    %r14,%rcx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  mov    %r9,0x18(%rsp)
  mov    %r10,0x8(%rsp)
  call   <partition>
  mov    0x8(%rsp),%r10
  mov    %r14,%rcx
  mov    %r13,%rdi
  mov    0x18(%rsp),%r9
  lea    0x1(%r10),%rsi
  mov    %r10,0x10(%rsp)
  mov    %r9,%rdx
  mov    %r9,0x8(%rsp)
  call   <partition>
  mov    0x10(%rsp),%rdx
  mov    %r14,%r8
  mov    %rbx,%rsi
  mov    0x8(%rsp),%rcx
  mov    %r13,%rdi
  subq   $0x1,D228(%rip)
  call   <merge_sort@plt>
  mov    D228(%rip),%rdx
  mov    0x8(%rsp),%r9
L81:
  lea    0x1(%r9),%r10
  cmp    %r10,%r12
  jbe    L19
  mov    %r12,%r11
  add    $0x1,%rdx
  sub    %r10,%r11
  mov    %rdx,D228(%rip)
  shr    %r11
  add    %r10,%r11
  cmp    $0x3e8,%rdx
  je     L192
  mov    %r10,%rsi
  mov    %r11,%rdx
  mov    %r14,%rcx
  mov    %r13,%rdi
  mov    %r9,0x18(%rsp)
  mov    %r10,0x10(%rsp)
  mov    %r11,0x8(%rsp)
  call   <partition>
  mov    0x8(%rsp),%r11
  mov    %r14,%rcx
  mov    %r12,%rdx
  mov    %r13,%rdi
  lea    0x1(%r11),%rsi
  call   <partition>
  mov    0x8(%rsp),%rdx
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    0x10(%rsp),%rsi
  mov    %r13,%rdi
  subq   $0x1,D228(%rip)
  call   <merge_sort@plt>
  mov    D228(%rip),%rdx
  mov    0x18(%rsp),%r9
L19:
  sub    $0x1,%rdx
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    %rbx,%rsi
  mov    %rdx,D228(%rip)
  mov    %r13,%rdi
  mov    %r9,%rdx
  call   <merge_sort@plt>
  mov    D228(%rip),%rax
L182:
  sub    $0x1,%rax
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    %r15,%rdx
  mov    %rax,D228(%rip)
  add    $0x28,%rsp
  mov    %rbp,%rsi
  mov    %r13,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <merge_sort@plt>
  nopl   0x0(%rax)
L29:
  ret
  nopl   0x0(%rax)
L141:
  mov    %r12,%rdx
  call   <error_sort@plt>
  add    $0x28,%rsp
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
  cs nopw 0x0(%rax,%rax,1)
L106:
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <error_sort@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    D228(%rip),%rax
  jmp    L182
  nop
L52:
  mov    %r15,%rdx
  call   <error_sort@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    D228(%rip),%rax
  jmp    L142
  nopl   0x0(%rax)
L156:
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  mov    %r9,0x8(%rsp)
  call   <error_sort@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    D228(%rip),%rax
  mov    0x8(%rsp),%r9
  jmp    L150
  nopl   0x0(%rax)
L165:
  mov    %r9,%rdx
  mov    %r9,0x8(%rsp)
  call   <error_sort@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    D228(%rip),%rax
  mov    0x8(%rsp),%r9
  jmp    L185
  cs nopw 0x0(%rax,%rax,1)
L192:
  mov    %r12,%rdx
  mov    %r10,%rsi
  mov    %r13,%rdi
  mov    %r9,0x8(%rsp)
  call   <error_sort@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    D228(%rip),%rdx
  mov    0x8(%rsp),%r9
  jmp    L19
  nopl   0x0(%rax)
L20:
  mov    %r9,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  mov    %r9,0x8(%rsp)
  call   <error_sort@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    D228(%rip),%rdx
  mov    0x8(%rsp),%r9
  jmp    L81
```

assistant: ```c
void partition(int arr[], size_t low, size_t high, int buffer[]) {
  size_t mid;
  static size_t rec = 0;
  if (low < high) {
    mid = low + (high - low) / 2;
    ++rec;
    if (rec == 1000) {
      error_sort(arr, low, high);
      free(buffer);
      return;
    }
    partition(arr, low, mid, buffer);
    partition(arr, mid + 1, high, buffer);
    --rec;
    merge_sort(arr, low, mid, high, buffer);
  }
}
```