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

```asm
<boothroyd>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  lea    -0x2(%rsi),%r8d
  push   %r14
  push   %r13
  mov    %rcx,%r13
  lea    -0x1(%rsi),%ecx
  push   %r12
  mov    %edx,%r12d
  mov    %esi,%edx
  push   %rbp
  mov    %edx,%eax
  lea    -0x8(%rdx),%r11d
  lea    -0x7(%rdx),%edi
  push   %rbx
  and    $0x1,%eax
  lea    -0x6(%rdx),%r10d
  lea    -0x5(%rdx),%ebx
  lea    -0x4(%rdx),%r9d
  sub    $0xf8,%rsp
  mov    %eax,0xbc(%rsp)
  movslq %r11d,%rax
  lea    -0x4(%r15,%rax,4),%r14
  mov    %edi,%eax
  mov    %esi,0xd8(%rsp)
  sub    $0x3,%esi
  and    $0x1,%eax
  mov    %ecx,0xa4(%rsp)
  mov    %eax,0x58(%rsp)
  movslq %edi,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %r8d,0xa0(%rsp)
  mov    %rax,0x20(%rsp)
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %esi,0x7c(%rsp)
  mov    %eax,0x78(%rsp)
  movslq %r10d,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %r9d,0x5c(%rsp)
  mov    %rax,0x40(%rsp)
  mov    %ebx,%eax
  and    $0x1,%eax
  mov    %ebx,0x50(%rsp)
  mov    %eax,0x90(%rsp)
  movslq %ebx,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %r10d,0x1c(%rsp)
  mov    %rax,0x60(%rsp)
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %edi,0xc(%rsp)
  mov    %eax,0xb8(%rsp)
  movslq %r9d,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %r11d,0x30(%rsp)
  mov    %rax,0x80(%rsp)
  mov    %esi,%eax
  and    $0x1,%eax
  mov    %eax,0xd0(%rsp)
  movslq %esi,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %rax,0x98(%rsp)
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,0xdc(%rsp)
  movslq %r8d,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %rax,0xc0(%rsp)
  mov    %ecx,%eax
  and    $0x1,%eax
  mov    %eax,0xe8(%rsp)
  movslq %ecx,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %rax,0xc8(%rsp)
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,0xec(%rsp)
  movslq %edx,%rax
  lea    -0x4(%r15,%rax,4),%rax
  mov    %rax,0xe0(%rsp)
  lea    -0x9(%rdx),%eax
  cmpl   $0x2,0xd8(%rsp)
  mov    %eax,0x70(%rsp)
  lea    -0xa(%rdx),%eax
  lea    0x4(%r15,%rax,4),%rax
  movq   $0x0,0xb0(%rsp)
  mov    %rax,0x38(%rsp)
  mov    %r13,%rax
  mov    %r15,%r13
  mov    %r12d,%r15d
  mov    %rax,%r12
  jg     L517
L59:
  mov    0xb0(%rsp),%rax
  cmp    %eax,0xa4(%rsp)
  jle    L592
  mov    0xec(%rsp),%r9d
  lea    0x0(%r13,%rax,4),%rax
  test   %r9d,%r9d
  cmovne %r13,%rax
L172:
  mov    0xe0(%rsp),%rsi
  mov    (%rax),%ecx
  mov    (%rsi),%edx
  mov    %ecx,(%rsi)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L278
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   *%r12
L278:
  addq   $0x1,0xb0(%rsp)
  cmpl   $0x2,0xd8(%rsp)
  jle    L59
L517:
  mov    %r15d,%eax
  mov    %r14,%r15
  cmpl   $0x2,0xa4(%rsp)
  mov    %r13,0xa8(%rsp)
  movl   $0x0,0x94(%rsp)
  mov    %r13,%r14
  mov    %eax,%r13d
  jne    L412
L339:
  mov    0x94(%rsp),%r8d
  test   %r8d,%r8d
  jne    L231
  mov    0xa8(%rsp),%rax
L548:
  mov    0xc8(%rsp),%rbx
  mov    (%rax),%ecx
  addl   $0x1,0x94(%rsp)
  mov    (%rbx),%edx
  mov    %ecx,(%rbx)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L465
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   *%r12
L465:
  addq   $0x4,0xa8(%rsp)
  cmpl   $0x2,0xa4(%rsp)
  je     L339
L412:
  mov    %r13d,%eax
  cmpl   $0x2,0xa0(%rsp)
  mov    %r14,%r13
  mov    %r14,0x88(%rsp)
  movl   $0x0,0x74(%rsp)
  mov    %eax,%r14d
  jne    L29
L562:
  mov    0x74(%rsp),%edi
  test   %edi,%edi
  jne    L448
  mov    0x88(%rsp),%rax
L609:
  mov    0xc0(%rsp),%rbx
  mov    (%rax),%ecx
  addl   $0x1,0x74(%rsp)
  mov    (%rbx),%edx
  mov    %ecx,(%rbx)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L391
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   *%r12
L391:
  addq   $0x4,0x88(%rsp)
  cmpl   $0x2,0xa0(%rsp)
  je     L562
L29:
  mov    %r14d,%eax
  cmpl   $0x2,0x7c(%rsp)
  mov    %r13,0x68(%rsp)
  mov    %r13,%r14
  movl   $0x0,0x54(%rsp)
  mov    %eax,%r13d
  jne    L434
L111:
  mov    0x54(%rsp),%esi
  test   %esi,%esi
  jne    L659
  mov    0x68(%rsp),%rax
L11:
  mov    0x98(%rsp),%rsi
  mov    (%rax),%ecx
  addl   $0x1,0x54(%rsp)
  mov    (%rsi),%edx
  mov    %ecx,(%rsi)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L191
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   *%r12
L191:
  addq   $0x4,0x68(%rsp)
  cmpl   $0x2,0x7c(%rsp)
  je     L111
L434:
  cmpl   $0x2,0x5c(%rsp)
  mov    %r13d,%ebp
  mov    %r14,0x48(%rsp)
  mov    %r14,%r13
  movl   $0x0,0x34(%rsp)
  jne    L522
L2:
  mov    0x34(%rsp),%ecx
  test   %ecx,%ecx
  jne    L419
  mov    0x48(%rsp),%rax
L234:
  mov    0x80(%rsp),%rdi
  mov    (%rax),%ecx
  addl   $0x1,0x34(%rsp)
  mov    (%rdi),%edx
  mov    %ecx,(%rdi)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L267
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   *%r12
L267:
  addq   $0x4,0x48(%rsp)
  cmpl   $0x2,0x5c(%rsp)
  je     L2
L522:
  cmpl   $0x2,0x50(%rsp)
  mov    %r13,0x28(%rsp)
  mov    %r13,%r14
  movl   $0x0,0x18(%rsp)
  jne    L166
L578:
  mov    0x18(%rsp),%edx
  test   %edx,%edx
  jne    L325
  mov    0x28(%rsp),%rax
L651:
  mov    0x60(%rsp),%rbx
  mov    (%rax),%ecx
  addl   $0x1,0x18(%rsp)
  mov    (%rbx),%edx
  mov    %ecx,(%rbx)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L171
  mov    %ebp,%esi
  mov    %r14,%rdi
  call   *%r12
L171:
  addq   $0x4,0x28(%rsp)
  cmpl   $0x2,0x50(%rsp)
  je     L578
L166:
  cmpl   $0x2,0x1c(%rsp)
  mov    %r14,0x10(%rsp)
  mov    %r14,%r13
  movl   $0x0,0x8(%rsp)
  jne    L568
L97:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L305
  mov    0x10(%rsp),%rax
L436:
  mov    0x40(%rsp),%rsi
  mov    (%rax),%ecx
  addl   $0x1,0x8(%rsp)
  mov    (%rsi),%edx
  mov    %ecx,(%rsi)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L225
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   *%r12
L225:
  addq   $0x4,0x10(%rsp)
  cmpl   $0x2,0x1c(%rsp)
  je     L97
L568:
  xor    %ebx,%ebx
  cmpl   $0x2,0xc(%rsp)
  mov    %r13,(%rsp)
  mov    %r13,%r14
  jne    L622
L443:
  test   %ebx,%ebx
  jne    L569
  mov    (%rsp),%rax
L70:
  mov    0x20(%rsp),%rdi
  mov    (%rax),%ecx
  add    $0x1,%ebx
  mov    (%rdi),%edx
  mov    %ecx,(%rdi)
  mov    %edx,(%rax)
  test   %r12,%r12
  je     L487
  mov    %ebp,%esi
  mov    %r14,%rdi
  call   *%r12
L487:
  addq   $0x4,(%rsp)
  cmpl   $0x2,0xc(%rsp)
  je     L443
L622:
  cmpl   $0x2,0x30(%rsp)
  jne    L8
  test   %r12,%r12
  je     L542
  mov    0x70(%rsp),%eax
  test   %eax,%eax
  jle    L88
  mov    %ebp,%eax
  mov    %r14,%r13
  mov    %ebx,%ebp
  mov    %eax,%ebx
L403:
  mov    0x0(%r13),%edx
  mov    (%r15),%eax
  mov    %ebx,%esi
  mov    %r14,%rdi
  add    $0x4,%r13
  mov    %edx,(%r15)
  mov    %eax,-0x4(%r13)
  call   *%r12
  cmp    %r13,0x38(%rsp)
  jne    L403
  mov    %ebx,%eax
  mov    %ebp,%ebx
  mov    %eax,%ebp
L88:
  cmp    0x30(%rsp),%ebx
  jge    L569
  mov    0x58(%rsp),%eax
  test   %eax,%eax
  mov    (%rsp),%rax
  cmovne %r14,%rax
  jmp    L70
  nopl   0x0(%rax)
L569:
  mov    0xc(%rsp),%ecx
  mov    %r14,%r13
  cmp    %ecx,0x8(%rsp)
  jge    L305
  mov    0x78(%rsp),%eax
  test   %eax,%eax
  mov    0x10(%rsp),%rax
  cmovne %r14,%rax
  jmp    L436
  nopl   0x0(%rax)
L305:
  mov    0x1c(%rsp),%edx
  mov    %r13,%r14
  cmp    %edx,0x18(%rsp)
  jge    L325
  mov    0x90(%rsp),%eax
  test   %eax,%eax
  mov    0x28(%rsp),%rax
  cmovne %r13,%rax
  jmp    L651
  nopl   0x0(%rax)
L325:
  mov    0x50(%rsp),%ecx
  mov    %r14,%r13
  cmp    %ecx,0x34(%rsp)
  jge    L419
  mov    0xb8(%rsp),%r14d
  mov    0x48(%rsp),%rax
  test   %r14d,%r14d
  cmovne %r13,%rax
  jmp    L234
  xchg   %ax,%ax
L8:
  test   %r12,%r12
  je     L406
  mov    0xbc(%rsp),%ecx
  test   %ecx,%ecx
  je     L245
  mov    %ebx,0xd4(%rsp)
  mov    0x70(%rsp),%ebx
  xor    %r13d,%r13d
L600:
  mov    %r12,%rcx
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <boothroyd>
  cmp    %ebx,%r13d
  jge    L405
  mov    (%r15),%eax
  mov    (%r14),%edx
  add    $0x1,%r13d
  mov    %ebp,%esi
  mov    %r14,%rdi
  mov    %edx,(%r15)
  mov    %eax,(%r14)
  call   *%r12
  jmp    L600
  nopl   0x0(%rax,%rax,1)
L419:
  mov    %r13,%r14
  mov    0x5c(%rsp),%ecx
  mov    %ebp,%r13d
  cmp    %ecx,0x54(%rsp)
  jge    L659
  mov    0xd0(%rsp),%ebx
  mov    0x68(%rsp),%rax
  test   %ebx,%ebx
  cmovne %r14,%rax
  jmp    L11
  nopw   0x0(%rax,%rax,1)
L542:
  mov    0x70(%rsp),%eax
  test   %eax,%eax
  jle    L88
  mov    0x38(%rsp),%rsi
  mov    %r14,%rax
L289:
  mov    (%rax),%ecx
  mov    (%r15),%edx
  add    $0x4,%rax
  mov    %ecx,(%r15)
  mov    %edx,-0x4(%rax)
  cmp    %rsi,%rax
  jne    L289
  jmp    L88
  nopl   (%rax)
L659:
  mov    %r13d,%eax
  mov    0x7c(%rsp),%ecx
  mov    %r14,%r13
  mov    %eax,%r14d
  cmp    %ecx,0x74(%rsp)
  jge    L448
  mov    0xdc(%rsp),%r11d
  mov    0x88(%rsp),%rax
  test   %r11d,%r11d
  cmovne %r13,%rax
  jmp    L609
  nop
L448:
  mov    %r14d,%eax
  mov    0xa0(%rsp),%ecx
  mov    %r13,%r14
  mov    %eax,%r13d
  cmp    %ecx,0x94(%rsp)
  jge    L394
  mov    0xe8(%rsp),%r10d
  mov    0xa8(%rsp),%rax
  test   %r10d,%r10d
  cmovne %r14,%rax
  jmp    L548
  nopl   0x0(%rax)
L406:
  mov    0xbc(%rsp),%edx
  test   %edx,%edx
  je     L365
  mov    %ebx,0xd4(%rsp)
  mov    0x70(%rsp),%ebx
  xor    %r13d,%r13d
L323:
  xor    %ecx,%ecx
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <boothroyd>
  cmp    %ebx,%r13d
  jge    L405
  mov    (%r15),%edx
  mov    (%r14),%ecx
  add    $0x1,%r13d
  mov    %ecx,(%r15)
  mov    %edx,(%r14)
  jmp    L323
  cs nopw 0x0(%rax,%rax,1)
L231:
  mov    %r13d,%eax
  mov    0xb0(%rsp),%edx
  mov    %r14,%r13
  mov    %r15,%r14
  mov    %eax,%r15d
  cmp    %edx,0xa4(%rsp)
  jle    L592
  mov    %r13,%rax
  jmp    L172
L592:
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L245:
  xor    %r13d,%r13d
L199:
  mov    0x70(%rsp),%esi
  mov    %r12,%rcx
  mov    %ebp,%edx
  mov    %r14,%rdi
  call   <boothroyd>
  cmp    %r13d,0x70(%rsp)
  jle    L88
  mov    (%r14,%r13,4),%edx
  mov    (%r15),%eax
  mov    %ebp,%esi
  mov    %r14,%rdi
  mov    %edx,(%r15)
  mov    %eax,(%r14,%r13,4)
  add    $0x1,%r13
  call   *%r12
  jmp    L199
L365:
  xor    %r13d,%r13d
L628:
  mov    0x70(%rsp),%esi
  xor    %ecx,%ecx
  mov    %ebp,%edx
  mov    %r14,%rdi
  call   <boothroyd>
  cmp    %r13d,0x70(%rsp)
  jle    L88
  mov    (%r14,%r13,4),%edx
  mov    (%r15),%eax
  mov    %edx,(%r15)
  mov    %eax,(%r14,%r13,4)
  add    $0x1,%r13
  jmp    L628
L394:
  mov    %r14,%r13
  mov    %r15,%r14
  mov    %eax,%r15d
  jmp    L59
L405:
  mov    0xd4(%rsp),%ebx
  jmp    L88
```

assistant: ```c
void boothroyd(int *x, int n, int nn, int callback(int *, int)) {
  int c = 0, i, t;
  while (1) {
    if (n > 2)
      boothroyd(x, n - 1, nn, callback);
    if (c >= n - 1)
      return;
    i = (n & 1) ? 0 : c;
    c++;
    t = x[n - 1], x[n - 1] = x[i], x[i] = t;
    if (callback)
      callback(x, nn);
  }
}
```