user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<perm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbx
  sub    $0x168,%rsp
  mov    %rdi,-0x120(%rbp)
  mov    %esi,-0xc0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    %edx,%esi
  je     L638
  jg     L129
L456:
  movslq -0xc0(%rbp),%rdx
  mov    %r14,%r12
  movq   $0x0,-0xf0(%rbp)
  lea    0x1(%rdx),%eax
  mov    %rdx,-0x188(%rbp)
  mov    %eax,-0x108(%rbp)
  lea    0x2(%rdx),%eax
  mov    %eax,-0x104(%rbp)
  lea    0x3(%rdx),%eax
  mov    %eax,-0xd0(%rbp)
  lea    0x4(%rdx),%eax
  mov    %eax,-0xa8(%rbp)
  lea    0x5(%rdx),%eax
  mov    %eax,-0xa4(%rbp)
  lea    0x6(%rdx),%eax
  mov    %eax,-0xbc(%rbp)
  lea    0x7(%rdx),%eax
  mov    %eax,-0x5c(%rbp)
  lea    0x8(%rdx),%eax
  mov    %eax,-0x60(%rbp)
  movslq %r13d,%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xff0,%eax
  and    $0xfffffffffffffff0,%rdx
  lea    -0x8(%rax),%r15
  mov    %rax,%r14
  mov    %rdx,-0x48(%rbp)
L120:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0x138(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L257
L161:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L161
L257:
  sub    %r14,%rsp
  test   %r14,%r14
  je     L604
  orq    $0x0,(%rsp,%r15,1)
L604:
  mov    -0x120(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r13d,%edx
  mov    %rsp,-0x140(%rbp)
  call   <copy@plt>
  mov    -0x188(%rbp),%rax
  mov    -0xf0(%rbp),%rsi
  add    %rax,%rsi
  lea    (%rsp,%rax,1),%rdi
  add    %rsp,%rsi
  call   <swap@plt>
  cmp    %r13d,-0x108(%rbp)
  je     L76
  jg     L278
L542:
  movslq -0x108(%rbp),%rax
  mov    %rax,-0x190(%rbp)
  mov    %rax,-0xe8(%rbp)
L616:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0x148(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L93
L213:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L213
L93:
  sub    %r14,%rsp
  test   %r14,%r14
  je     L157
  orq    $0x0,(%rsp,%r15,1)
L157:
  mov    -0x140(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r13d,%edx
  mov    %rsp,-0x150(%rbp)
  call   <copy@plt>
  mov    -0xe8(%rbp),%rax
  lea    (%rsp,%rax,1),%rsi
  mov    -0x190(%rbp),%rax
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0x104(%rbp),%r13d
  je     L593
  jl     L115
L238:
  movslq -0x104(%rbp),%rax
  mov    %rax,-0x118(%rbp)
  mov    %rax,-0xe0(%rbp)
L125:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0x158(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L400
L2:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L2
L400:
  sub    %r14,%rsp
  test   %r14,%r14
  je     L84
  orq    $0x0,(%rsp,%r15,1)
L84:
  mov    -0x150(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r13d,%edx
  mov    %rsp,-0x160(%rbp)
  call   <copy@plt>
  mov    -0xe0(%rbp),%rax
  lea    (%rsp,%rax,1),%rsi
  mov    -0x118(%rbp),%rax
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0xd0(%rbp),%r13d
  je     L218
  jl     L487
L387:
  movslq -0xd0(%rbp),%rax
  mov    %rax,-0x110(%rbp)
  mov    %rax,-0xd8(%rbp)
  mov    %r15,%rax
  mov    %r12,%r15
  mov    %r14,%r12
  mov    %rax,%r14
L458:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0x168(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L323
L182:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L182
L323:
  sub    %r12,%rsp
  test   %r12,%r12
  je     L411
  orq    $0x0,(%rsp,%r14,1)
L411:
  mov    -0x160(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r13d,%edx
  mov    %rsp,-0x170(%rbp)
  call   <copy@plt>
  mov    -0xd8(%rbp),%rax
  lea    (%rsp,%rax,1),%rsi
  mov    -0x110(%rbp),%rax
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0xa8(%rbp),%r13d
  je     L528
  jl     L300
L396:
  movslq -0xa8(%rbp),%rax
  mov    %r15,-0x58(%rbp)
  mov    %r12,%r15
  mov    %r13d,%r12d
  mov    %r14,%r13
  mov    %rax,-0xb8(%rbp)
  mov    %rax,-0x50(%rbp)
L116:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0x88(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L313
L406:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L406
L313:
  sub    %r15,%rsp
  test   %r15,%r15
  je     L469
  orq    $0x0,(%rsp,%r13,1)
L469:
  mov    -0x170(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r12d,%edx
  mov    %rsp,-0x178(%rbp)
  call   <copy@plt>
  mov    -0x50(%rbp),%rax
  lea    (%rsp,%rax,1),%rsi
  mov    -0xb8(%rbp),%rax
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0xa4(%rbp),%r12d
  je     L519
  jl     L49
L634:
  movslq -0xa4(%rbp),%rax
  mov    %rax,-0xc8(%rbp)
  mov    %rax,-0x70(%rbp)
  mov    %r13,%rax
  mov    %r15,%r13
  mov    %rax,%r15
  cs nopw 0x0(%rax,%rax,1)
L349:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0xf8(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L467
L88:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L88
L467:
  sub    %r13,%rsp
  test   %r13,%r13
  je     L235
  orq    $0x0,(%rsp,%r15,1)
L235:
  mov    -0x178(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r12d,%edx
  mov    %rsp,-0x100(%rbp)
  call   <copy@plt>
  mov    -0x70(%rbp),%rax
  lea    (%rsp,%rax,1),%rsi
  mov    -0xc8(%rbp),%rax
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0xbc(%rbp),%r12d
  je     L548
  jge    L517
L397:
  addq   $0x1,-0x70(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0xa4(%rbp),%eax
  sub    -0xc8(%rbp),%eax
  add    %edx,%eax
  mov    -0xf8(%rbp),%rsp
  cmp    %eax,%r12d
  jge    L349
  mov    %r15,%rax
  mov    %r13,%r15
  mov    %rax,%r13
L49:
  addq   $0x1,-0x50(%rbp)
  mov    -0x50(%rbp),%rdx
  mov    -0xa8(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  add    %edx,%eax
  mov    -0x88(%rbp),%rsp
  cmp    %eax,%r12d
  jge    L116
  mov    %r13,%r14
  mov    %r12d,%r13d
  mov    %r15,%r12
  mov    -0x58(%rbp),%r15
L300:
  addq   $0x1,-0xd8(%rbp)
  mov    -0xd8(%rbp),%rdx
  mov    -0xd0(%rbp),%eax
  sub    -0x110(%rbp),%eax
  add    %edx,%eax
  mov    -0x168(%rbp),%rsp
  cmp    %eax,%r13d
  jge    L458
  mov    %r14,%rax
  mov    %r12,%r14
  mov    %r15,%r12
  mov    %rax,%r15
L487:
  addq   $0x1,-0xe0(%rbp)
  mov    -0xe0(%rbp),%rdx
  mov    -0x104(%rbp),%eax
  sub    -0x118(%rbp),%eax
  add    %edx,%eax
  mov    -0x158(%rbp),%rsp
  cmp    %eax,%r13d
  jge    L125
L115:
  addq   $0x1,-0xe8(%rbp)
  mov    -0xe8(%rbp),%rax
  mov    -0x148(%rbp),%rsp
  cmp    %eax,%r13d
  jge    L616
L278:
  addq   $0x1,-0xf0(%rbp)
  mov    -0xc0(%rbp),%edx
  mov    -0xf0(%rbp),%rax
  mov    -0x138(%rbp),%rsp
  add    %eax,%edx
  cmp    %edx,%r13d
  jge    L120
L129:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L76:
  mov    -0x108(%rbp),%esi
  mov    %rsp,%rdi
  call   *%r12
  jmp    L542
L548:
  mov    -0x58(%rbp),%rax
  mov    %r12d,%esi
  mov    %rsp,%rdi
  call   *%rax
L517:
  movslq -0xbc(%rbp),%rax
  mov    %r15,%rbx
  mov    %r13,%r15
  mov    %rax,-0xb0(%rbp)
  mov    %rax,-0x80(%rbp)
  nopw   0x0(%rax,%rax,1)
L466:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,-0x180(%rbp)
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L184
L190:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L190
L184:
  sub    %r15,%rsp
  test   %r15,%r15
  je     L70
  orq    $0x0,(%rsp,%rbx,1)
L70:
  mov    -0x100(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r12d,%edx
  mov    %rsp,-0x98(%rbp)
  call   <copy@plt>
  mov    -0x80(%rbp),%rax
  lea    (%rsp,%rax,1),%rsi
  mov    -0xb0(%rbp),%rax
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0x5c(%rbp),%r12d
  je     L324
  jge    L507
L42:
  addq   $0x1,-0x80(%rbp)
  mov    -0x80(%rbp),%rcx
  mov    -0xbc(%rbp),%eax
  sub    -0xb0(%rbp),%eax
  add    %ecx,%eax
  mov    -0x180(%rbp),%rsp
  cmp    %eax,%r12d
  jge    L466
  mov    %r15,%r13
  mov    %rbx,%r15
  jmp    L397
L324:
  mov    -0x58(%rbp),%rax
  mov    %r12d,%esi
  mov    %rsp,%rdi
  call   *%rax
L507:
  movslq -0x5c(%rbp),%rax
  mov    %rbx,-0x78(%rbp)
  mov    %rax,-0x68(%rbp)
  mov    %rax,%r14
  nopl   (%rax)
L279:
  mov    -0x48(%rbp),%rcx
  mov    %rsp,%rax
  mov    %rsp,%r13
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rax
  cmp    %rax,%rsp
  je     L160
L399:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L399
L160:
  sub    %r15,%rsp
  test   %r15,%r15
  je     L429
  mov    -0x78(%rbp),%rax
  orq    $0x0,(%rsp,%rax,1)
L429:
  mov    -0x98(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %r12d,%edx
  mov    %rsp,-0xa0(%rbp)
  call   <copy@plt>
  mov    -0x68(%rbp),%rax
  lea    (%rsp,%r14,1),%rsi
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  cmp    -0x60(%rbp),%r12d
  je     L615
  jge    L639
L162:
  add    $0x1,%r14
  mov    -0x5c(%rbp),%eax
  sub    -0x68(%rbp),%eax
  mov    %r13,%rsp
  add    %r14d,%eax
  cmp    %eax,%r12d
  jge    L279
  mov    -0x78(%rbp),%rbx
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L615:
  mov    -0x58(%rbp),%rax
  mov    %r12d,%esi
  mov    %rsp,%rdi
  call   *%rax
L639:
  mov    -0xc0(%rbp),%eax
  mov    %r14,-0x130(%rbp)
  add    $0x9,%eax
  mov    %eax,-0xcc(%rbp)
  movslq -0x60(%rbp),%rax
  mov    %rax,%rbx
  mov    %rax,-0x90(%rbp)
  mov    -0x48(%rbp),%rax
  and    $0xfffffffffffff000,%rax
  mov    %rax,-0x128(%rbp)
  mov    %r15,%rax
  mov    %r13,%r15
  mov    %r12d,%r13d
  mov    %rbx,%r12
  mov    %rax,%rbx
L513:
  mov    %rsp,%rax
  sub    -0x128(%rbp),%rax
  mov    %rsp,%r14
  cmp    %rax,%rsp
  je     L388
L571:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L571
L388:
  sub    %rbx,%rsp
  test   %rbx,%rbx
  je     L228
  mov    -0x78(%rbp),%rax
  orq    $0x0,(%rsp,%rax,1)
L228:
  mov    -0xa0(%rbp),%rsi
  mov    %r13d,%edx
  mov    %rsp,%rdi
  call   <copy@plt>
  mov    -0x90(%rbp),%rax
  lea    (%rsp,%r12,1),%rsi
  add    $0x1,%r12
  lea    (%rsp,%rax,1),%rdi
  call   <swap@plt>
  mov    -0x58(%rbp),%rcx
  mov    %rsp,%rdi
  mov    %r13d,%edx
  mov    -0xcc(%rbp),%esi
  call   <perm>
  mov    -0x60(%rbp),%eax
  sub    -0x90(%rbp),%eax
  mov    %r14,%rsp
  add    %r12d,%eax
  cmp    %eax,%r13d
  jge    L513
  mov    %r13d,%r12d
  mov    -0x130(%rbp),%r14
  mov    %r15,%r13
  mov    %rbx,%r15
  jmp    L162
L519:
  mov    -0x58(%rbp),%rax
  mov    %r12d,%esi
  mov    %rsp,%rdi
  call   *%rax
  jmp    L634
L528:
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   *%r15
  jmp    L396
L218:
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   *%r12
  jmp    L387
L593:
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   *%r12
  jmp    L238
L638:
  call   *%rcx
  jmp    L456
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void perm(char list[], int left, int right, void (*handle)(char *, int)) {
  if (left == right) {
    handle(list, right);
  }
  int i;
  for (i = left; i <= right; ++i) {
    char tmp[right];
    copy(tmp, list, right);
    swap(&tmp[left], &tmp[i]);
    perm(tmp, left + 1, right, handle);
  }
}
```