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

```asm
<sorter_sqrt_sort_build_blocks>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0x18(%rsp)
  mov    %edx,0x1c(%rsp)
  cmp    $0x1,%esi
  jle    L10
  nopw   0x0(%rax,%rax,1)
L182:
  mov    0x0(%rbp,%rax,8),%rbx
  xor    %ecx,%ecx
  cmp    %rbx,-0x8(%rbp,%rax,8)
  setg   %cl
  lea    -0x1(%rcx,%rax,1),%edx
  movslq %edx,%rdx
  mov    0x0(%rbp,%rdx,8),%rdx
  mov    %rdx,-0x18(%rbp,%rax,8)
  mov    %eax,%edx
  sub    %ecx,%edx
  movslq %edx,%rdx
  mov    0x0(%rbp,%rdx,8),%rdx
  mov    %rdx,-0x10(%rbp,%rax,8)
  add    $0x2,%rax
  cmp    %eax,0x18(%rsp)
  jg     L182
L10:
  testb  $0x1,0x18(%rsp)
  je     L82
  movslq 0x18(%rsp),%rax
  shl    $0x3,%rax
  mov    -0x8(%rbp,%rax,1),%rdx
  mov    %rdx,-0x18(%rbp,%rax,1)
L82:
  lea    -0x10(%rbp),%rax
  cmpl   $0x2,0x1c(%rsp)
  mov    %rax,0x10(%rsp)
  jle    L160
  mov    $0x2,%ebx
  xchg   %ax,%ax
L75:
  mov    0x18(%rsp),%eax
  mov    %ebx,%r13d
  add    %ebx,%ebx
  sub    %ebx,%eax
  mov    %eax,0xc(%rsp)
  js     L158
  mov    %r13d,%r14d
  movslq %ebx,%r12
  mov    0x10(%rsp),%rbp
  xor    %r15d,%r15d
  neg    %r14d
  shl    $0x3,%r12
  nopw   0x0(%rax,%rax,1)
L133:
  mov    %rbp,%rdi
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %r13d,%esi
  call   <sorter_sqrt_sort_merge_left_with_x_buf@plt>
  add    %ebx,%r15d
  add    %r12,%rbp
  cmp    %r15d,0xc(%rsp)
  jge    L133
  mov    0x18(%rsp),%edx
  sub    %r15d,%edx
L25:
  cmp    %edx,%r13d
  jge    L32
  mov    0x10(%rsp),%rax
  mov    %r13d,%ecx
  movslq %r15d,%r8
  sub    %r13d,%edx
  neg    %ecx
  mov    %r13d,%esi
  lea    (%rax,%r8,8),%rdi
  call   <sorter_sqrt_sort_merge_left_with_x_buf@plt>
L207:
  movslq %r13d,%rdx
L91:
  shl    $0x3,%rdx
  sub    %rdx,0x10(%rsp)
  cmp    0x1c(%rsp),%ebx
  jl     L75
L160:
  mov    0x18(%rsp),%eax
  mov    0x1c(%rsp),%ecx
  mov    0x18(%rsp),%ebx
  mov    0x10(%rsp),%rsi
  lea    (%rcx,%rcx,1),%r12d
  cltd
  idiv   %r12d
  sub    %edx,%ebx
  movslq %ebx,%r14
  lea    (%rsi,%r14,8),%rdi
  cmp    %edx,%ecx
  jl     L193
  movslq %ecx,%rax
  shl    $0x3,%edx
  add    %r14,%rax
  lea    (%rsi,%rax,8),%r8
  mov    %rdi,%rsi
  mov    %r8,%rdi
  call   <memcpy@plt>
L106:
  test   %ebx,%ebx
  jle    L108
  movslq %r12d,%rax
  mov    %r12d,%r13d
  sub    %rax,%r14
  neg    %r13d
  mov    0x10(%rsp),%rax
  movslq %r13d,%r13
  shl    $0x3,%r13
  lea    (%rax,%r14,8),%rbp
  nopw   0x0(%rax,%rax,1)
L177:
  mov    0x1c(%rsp),%esi
  mov    %rbp,%rdi
  sub    %r12d,%ebx
  add    %r13,%rbp
  mov    %esi,%ecx
  mov    %esi,%edx
  call   <sorter_sqrt_sort_merge_right@plt>
  test   %ebx,%ebx
  jg     L177
L108:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L32:
  cmp    %r15d,0x18(%rsp)
  jle    L207
  mov    0x18(%rsp),%r9d
  movslq %r15d,%rdi
  movslq %r13d,%rdx
  mov    %rdi,%rcx
  lea    0x8(,%rdi,8),%rax
  sub    %r15d,%r9d
  sub    %rdx,%rcx
  lea    -0x1(%r9),%r10d
  shl    $0x3,%rcx
  cmp    $0x2,%r10d
  jbe    L22
  cmp    %rcx,%rax
  je     L22
  mov    0x10(%rsp),%rdi
  lea    -0x8(%rdi,%rax,1),%r10
  add    %rdi,%rcx
  mov    %r9d,%edi
  xor    %eax,%eax
  shr    %edi
  shl    $0x4,%rdi
  nopw   0x0(%rax,%rax,1)
L137:
  movdqu (%r10,%rax,1),%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdi
  jne    L137
  mov    %r9d,%eax
  and    $0xfffffffe,%eax
  lea    (%rax,%r15,1),%r8d
  cmp    %r9d,%eax
  je     L91
  mov    0x10(%rsp),%rsi
  movslq %r8d,%rax
  sub    %r13d,%r8d
  movslq %r8d,%r8
  mov    (%rsi,%rax,8),%rax
  mov    %rax,(%rsi,%r8,8)
  jmp    L91
  nopl   0x0(%rax)
L158:
  mov    0x18(%rsp),%edx
  xor    %r15d,%r15d
  jmp    L25
L22:
  mov    0x18(%rsp),%ecx
  mov    0x10(%rsp),%rsi
  sub    $0x1,%ecx
  lea    -0x8(%rsi,%rax,1),%rax
  sub    %r15d,%ecx
  add    %rdi,%rcx
  lea    0x8(%rsi,%rcx,8),%rdi
  mov    %rdx,%rsi
  neg    %rsi
  shl    $0x3,%rsi
  nopw   0x0(%rax,%rax,1)
L134:
  mov    (%rax),%rcx
  add    $0x8,%rax
  mov    %rcx,-0x8(%rax,%rsi,1)
  cmp    %rax,%rdi
  jne    L134
  jmp    L91
L193:
  sub    %ecx,%edx
  mov    %ecx,%esi
  call   <sorter_sqrt_sort_merge_right@plt>
  jmp    L106
```

assistant: ```c
void sorter_sqrt_sort_build_blocks(int64_t *arr, int L, int K) {
  int m, u, h, p0, p1, rest, restk, p;
  for (m = 1; m < L; m += 2) {
    u = 0;
    if (((*(arr + (m - 1))) - (*(arr + m))) > 0) {
      u = 1;
    }
    arr[m - 3] = arr[m - 1 + u];
    arr[m - 2] = arr[m - u];
  }
  if (L % 2) {
    arr[L - 3] = arr[L - 1];
  }
  arr -= 2;
  for (h = 2; h < K; h *= 2) {
    p0 = 0;
    p1 = L - 2 * h;
    while (p0 <= p1) {
      sorter_sqrt_sort_merge_left_with_x_buf(arr + p0, h, h, -h);
      p0 += 2 * h;
    }
    rest = L - p0;
    if (rest > h) {
      sorter_sqrt_sort_merge_left_with_x_buf(arr + p0, h, rest - h, -h);
    } else {
      for (; p0 < L; p0++) {
        arr[p0 - h] = arr[p0];
      }
    }
    arr -= h;
  }
  restk = L % (2 * K);
  p = L - restk;
  if (restk <= K) {
    memcpy(arr + p + K, arr + p, restk * sizeof(int64_t));
  } else {
    sorter_sqrt_sort_merge_right(arr + p, K, restk - K, K);
  }
  while (p > 0) {
    p -= 2 * K;
    sorter_sqrt_sort_merge_right(arr + p, K, K, K);
  }
}
```