user: 下面的汇编指令对应的C源代码是什么:

```asm
<sorter_grail_build_blocks>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbp
  mov    %esi,0x10(%rsp)
  mov    %edx,0x14(%rsp)
  mov    %rcx,0x20(%rsp)
  cmp    %edx,%r8d
  cmovg  %edx,%r8d
  mov    %r8d,%eax
L70:
  mov    %eax,%ecx
  lea    -0x1(%rax),%edx
  and    %edx,%eax
  jne    L70
  mov    %eax,0x18(%rsp)
  mov    %ecx,0x1c(%rsp)
  test   %ecx,%ecx
  jne    L175
  cmpl   $0x1,0x10(%rsp)
  jle    L136
  lea    -0x10(%rbp),%rbx
  mov    0x10(%rsp),%eax
  lea    -0x2(%rax),%r14d
  and    $0xfffffffe,%r14d
  add    $0x3,%r14d
  mov    $0x1,%r12d
L120:
  mov    0x18(%rbx),%rax
  cmp    %rax,0x10(%rbx)
  setg   %r13b
  movzbl %r13b,%r13d
  lea    -0x1(%r12,%r13,1),%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rsi
  mov    %rbx,%rdi
  call   <sorter_grail_swap1@plt>
  mov    %r12d,%eax
  sub    %r13d,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rsi
  lea    0x8(%rbx),%rdi
  call   <sorter_grail_swap1@plt>
  add    $0x2,%r12d
  add    $0x10,%rbx
  cmp    %r14d,%r12d
  jne    L120
L136:
  testb  $0x1,0x10(%rsp)
  jne    L207
L92:
  lea    -0x10(%rbp),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x2,%r13d
L76:
  cmp    %r13d,0x14(%rsp)
  jg     L295
L30:
  mov    0x14(%rsp),%edi
  lea    (%rdi,%rdi,1),%r12d
  mov    0x10(%rsp),%eax
  cltd
  idiv   %r12d
  mov    %edx,%esi
  mov    0x10(%rsp),%eax
  sub    %edx,%eax
  mov    %eax,%ebx
  mov    %edi,%edx
  cmp    %esi,%edi
  jl     L115
  cltq
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdi
  call   <sorter_grail_rotate@plt>
L215:
  test   %ebx,%ebx
  jle    L270
  mov    %r12d,%r13d
  neg    %r13d
  movslq %r13d,%r13
  shl    $0x3,%r13
  movslq %ebx,%rax
  movslq %r12d,%rdx
  sub    %rdx,%rax
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rax,8),%rbp
  mov    0x14(%rsp),%r14d
L178:
  sub    %r12d,%ebx
  mov    %r14d,%ecx
  mov    %r14d,%edx
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <sorter_grail_merge_right@plt>
  add    %r13,%rbp
  test   %ebx,%ebx
  jg     L178
L270:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L175:
  mov    0x1c(%rsp),%edi
  movslq %edi,%rax
  lea    0x0(,%rdi,8),%edx
  mov    %edx,0x2c(%rsp)
  shl    $0x3,%rax
  mov    %rbp,%rsi
  sub    %rax,%rsi
  mov    0x20(%rsp),%rdi
  call   <memcpy@plt>
  mov    0x10(%rsp),%esi
  cmp    $0x1,%esi
  jle    L189
  mov    $0x1,%eax
L151:
  mov    0x0(%rbp,%rax,8),%rdi
  cmp    %rdi,-0x8(%rbp,%rax,8)
  setg   %cl
  movzbl %cl,%ecx
  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,%esi
  jg     L151
L189:
  mov    0x10(%rsp),%eax
  test   $0x1,%al
  je     L301
  cltq
  shl    $0x3,%rax
  mov    -0x8(%rbp,%rax,1),%rdx
  mov    %rdx,-0x18(%rbp,%rax,1)
L301:
  lea    -0x10(%rbp),%rax
  mov    %rax,0x8(%rsp)
  cmpl   $0x2,0x1c(%rsp)
  jle    L101
  mov    $0x2,%r13d
  mov    0x10(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x28(%rsp)
  jmp    L291
L37:
  mov    0x18(%rsp),%ebx
  jmp    L259
L165:
  cmp    %ebx,%eax
  jle    L223
  movslq %ebx,%rcx
  mov    0x8(%rsp),%rsi
  lea    (%rsi,%rcx,8),%rax
  mov    0x28(%rsp),%edx
  sub    %ebx,%edx
  add    %rcx,%rdx
  lea    0x8(%rsi,%rdx,8),%rsi
  movslq %ebp,%rcx
  neg    %rcx
  shl    $0x3,%rcx
L158:
  mov    (%rax),%rdx
  mov    %rdx,(%rax,%rcx,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L158
L223:
  movslq %ebp,%rbp
  shl    $0x3,%rbp
  sub    %rbp,0x8(%rsp)
  cmp    0x1c(%rsp),%r13d
  jge    L183
L291:
  mov    %r13d,%ebp
  add    %r13d,%r13d
  mov    0x10(%rsp),%r14d
  sub    %r13d,%r14d
  js     L37
  movslq %r13d,%rax
  shl    $0x3,%rax
  mov    %rax,(%rsp)
  mov    0x8(%rsp),%r12
  mov    0x18(%rsp),%ebx
  mov    %ebp,%r15d
  neg    %r15d
L264:
  mov    %r15d,%ecx
  mov    %ebp,%edx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <sorter_grail_merge_left_with_x_buf@plt>
  add    %r13d,%ebx
  add    (%rsp),%r12
  cmp    %ebx,%r14d
  jge    L264
L259:
  mov    0x10(%rsp),%eax
  mov    %eax,%edx
  sub    %ebx,%edx
  cmp    %ebp,%edx
  jle    L165
  mov    %ebp,%ecx
  neg    %ecx
  sub    %ebp,%edx
  movslq %ebx,%rbx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rbx,8),%rdi
  mov    %ebp,%esi
  call   <sorter_grail_merge_left_with_x_buf@plt>
  jmp    L223
L101:
  mov    $0x2,%r13d
L183:
  movslq 0x10(%rsp),%rax
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdi
  mov    0x2c(%rsp),%edx
  mov    0x20(%rsp),%rsi
  call   <memcpy@plt>
  jmp    L76
L207:
  movslq 0x10(%rsp),%rax
  shl    $0x3,%rax
  lea    -0x18(%rbp,%rax,1),%rsi
  lea    -0x8(%rbp,%rax,1),%rdi
  call   <sorter_grail_swap1@plt>
  jmp    L92
L212:
  mov    0x18(%rsp),%ebx
  jmp    L12
L224:
  movslq %ebx,%rbx
  movslq %ebp,%rax
  sub    %rax,%rbx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rbx,8),%rdi
  mov    %ebp,%esi
  call   <sorter_grail_rotate@plt>
L107:
  movslq %ebp,%rbp
  shl    $0x3,%rbp
  sub    %rbp,0x8(%rsp)
  cmp    0x14(%rsp),%r13d
  jge    L30
L295:
  mov    %r13d,%ebp
  add    %r13d,%r13d
  mov    0x10(%rsp),%r14d
  sub    %r13d,%r14d
  js     L212
  movslq %r13d,%rax
  shl    $0x3,%rax
  mov    %rax,(%rsp)
  mov    0x8(%rsp),%r12
  mov    0x18(%rsp),%ebx
  mov    %ebp,%r15d
  neg    %r15d
L257:
  mov    %r15d,%ecx
  mov    %ebp,%edx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <sorter_grail_merge_left@plt>
  add    %r13d,%ebx
  add    (%rsp),%r12
  cmp    %ebx,%r14d
  jge    L257
L12:
  mov    0x10(%rsp),%edx
  sub    %ebx,%edx
  cmp    %ebp,%edx
  jle    L224
  mov    %ebp,%ecx
  neg    %ecx
  sub    %ebp,%edx
  movslq %ebx,%rbx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rbx,8),%rdi
  mov    %ebp,%esi
  call   <sorter_grail_merge_left@plt>
  jmp    L107
L115:
  mov    0x14(%rsp),%ecx
  sub    %ecx,%esi
  mov    %esi,%edx
  cltq
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdi
  mov    %ecx,%esi
  call   <sorter_grail_merge_right@plt>
  jmp    L215
```

assistant: ```c
void sorter_grail_build_blocks(int64_t *arr, int L, int K, int64_t *extbuf, int LExtBuf) {
  int m, u, h, p0, p1, rest, restk, p, kbuf;
  kbuf = K < LExtBuf ? K : LExtBuf;
  while (kbuf & (kbuf - 1)) {
    kbuf &= kbuf - 1;
  }
  if (kbuf) {
    memcpy(extbuf, arr - kbuf, kbuf * sizeof(int64_t));
    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 < kbuf; h *= 2) {
      p0 = 0;
      p1 = L - 2 * h;
      while (p0 <= p1) {
        sorter_grail_merge_left_with_x_buf(arr + p0, h, h, -h);
        p0 += 2 * h;
      }
      rest = L - p0;
      if (rest > h) {
        sorter_grail_merge_left_with_x_buf(arr + p0, h, rest - h, -h);
      } else {
        for (; p0 < L; p0++) {
          arr[p0 - h] = arr[p0];
        }
      }
      arr -= h;
    }
    memcpy(arr + L, extbuf, kbuf * sizeof(int64_t));
  } else {
    for (m = 1; m < L; m += 2) {
      u = 0;
      if (((*(arr + (m - 1))) - (*(arr + m))) > 0) {
        u = 1;
      }
      sorter_grail_swap1(arr + (m - 3), arr + (m - 1 + u));
      sorter_grail_swap1(arr + (m - 2), arr + (m - u));
    }
    if (L % 2) {
      sorter_grail_swap1(arr + (L - 1), arr + (L - 3));
    }
    arr -= 2;
    h = 2;
  }
  for (; h < K; h *= 2) {
    p0 = 0;
    p1 = L - 2 * h;
    while (p0 <= p1) {
      sorter_grail_merge_left(arr + p0, h, h, -h);
      p0 += 2 * h;
    }
    rest = L - p0;
    if (rest > h) {
      sorter_grail_merge_left(arr + p0, h, rest - h, -h);
    } else {
      sorter_grail_rotate(arr + p0 - h, h, rest);
    }
    arr -= h;
  }
  restk = L % (2 * K);
  p = L - restk;
  if (restk <= K) {
    sorter_grail_rotate(arr + p, restk, K);
  } else {
    sorter_grail_merge_right(arr + p, K, restk - K, K);
  }
  while (p > 0) {
    p -= 2 * K;
    sorter_grail_merge_right(arr + p, K, K, K);
  }
}
```