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

```asm
<canonical_perm_ext>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  mov    %rcx,-0x88(%rbp)
  mov    %r8d,-0x8c(%rbp)
  mov    %r9,-0x98(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
  mov    0x28(%rbp),%rax
  mov    %rax,-0xa8(%rbp)
  mov    0x38(%rbp),%rax
  mov    %rax,-0xb0(%rbp)
  mov    0x48(%rbp),%rax
  mov    %rax,-0xb8(%rbp)
  mov    0x50(%rbp),%rax
  mov    %rax,-0xc0(%rbp)
  mov    0x60(%rbp),%rax
  mov    %rax,-0xc8(%rbp)
  mov    0x70(%rbp),%rax
  mov    %rax,-0xd0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    0x20(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x58(%rbp)
  mov    0x10(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x50(%rbp)
  lea    -0x50(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  cmpl   $0x0,-0x80(%rbp)
  jne    L64
  mov    -0x20(%rbp),%r8
  mov    -0x7c(%rbp),%edi
  mov    -0x98(%rbp),%rdx
  mov    -0x8c(%rbp),%esi
  mov    -0x88(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x5c(%rbp),%rcx
  push   %rcx
  mov    %r8,%r9
  mov    %edi,%r8d
  mov    0x10(%rbp),%ecx
  mov    %rax,%rdi
  call   <nonstable_points@plt>
  add    $0x10,%rsp
  mov    -0x5c(%rbp),%esi
  mov    -0x30(%rbp),%r8
  mov    -0x7c(%rbp),%edi
  mov    -0x98(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    -0x58(%rbp),%rcx
  push   %rcx
  lea    -0x60(%rbp),%rcx
  push   %rcx
  push   -0x28(%rbp)
  lea    -0x64(%rbp),%rcx
  push   %rcx
  mov    %r8,%r9
  mov    %edi,%r8d
  mov    0x10(%rbp),%ecx
  mov    %rax,%rdi
  call   <schreier_sims@plt>
  add    $0x20,%rsp
  jmp    L15
L64:
  mov    -0x8c(%rbp),%edx
  mov    -0x30(%rbp),%rcx
  mov    -0x88(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copy_list@plt>
  mov    -0x8c(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    0x10(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x98(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copy_list@plt>
  mov    0x10(%rbp),%eax
  mov    %eax,-0x60(%rbp)
L15:
  mov    -0x7c(%rbp),%edx
  mov    -0x40(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <inverse@plt>
  movl   $0x0,-0x54(%rbp)
  jmp    L37
L24:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x48(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    -0x7c(%rbp),%edx
  mov    -0x40(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <onpoints@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x54(%rbp)
L37:
  mov    -0x54(%rbp),%eax
  cmp    0x20(%rbp),%eax
  jl     L24
  mov    -0x28(%rbp),%rax
  mov    (%rax),%r8
  mov    -0x64(%rbp),%ecx
  lea    -0x60(%rbp),%r9
  mov    -0x30(%rbp),%rdx
  mov    -0x7c(%rbp),%esi
  mov    -0x78(%rbp),%rax
  sub    $0x8,%rsp
  push   -0x40(%rbp)
  mov    0x20(%rbp),%edi
  push   %rdi
  push   -0x48(%rbp)
  mov    %rax,%rdi
  call   <coset_rep@plt>
  add    $0x20,%rsp
  mov    0x40(%rbp),%edx
  mov    0x68(%rbp),%eax
  add    %edx,%eax
  test   %eax,%eax
  jne    L44
  mov    -0x7c(%rbp),%edx
  mov    -0xd0(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copy_list@plt>
  jmp    L48
L44:
  mov    -0x64(%rbp),%esi
  mov    -0x20(%rbp),%r8
  mov    0x20(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x5c(%rbp),%rdi
  push   %rdi
  mov    %r8,%r9
  mov    $0x1,%r8d
  mov    %rax,%rdi
  call   <complement@plt>
  add    $0x10,%rsp
  mov    -0x5c(%rbp),%edx
  mov    -0x30(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copy_list@plt>
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%r9
  mov    -0x60(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x7c(%rbp),%r8d
  mov    0x20(%rbp),%esi
  mov    -0x48(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x60(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  call   <stabilizer@plt>
  add    $0x10,%rsp
  mov    -0x60(%rbp),%r9d
  mov    -0x28(%rbp),%rax
  mov    (%rax),%r8
  mov    -0x64(%rbp),%ecx
  mov    -0x30(%rbp),%rdx
  mov    -0x7c(%rbp),%esi
  mov    -0x40(%rbp),%rax
  push   -0x38(%rbp)
  mov    0x68(%rbp),%edi
  push   %rdi
  push   -0xc8(%rbp)
  mov    0x58(%rbp),%edi
  push   %rdi
  push   -0xc0(%rbp)
  push   -0xb8(%rbp)
  mov    0x40(%rbp),%edi
  push   %rdi
  push   -0xb0(%rbp)
  mov    0x30(%rbp),%edi
  push   %rdi
  push   -0xa8(%rbp)
  mov    %rax,%rdi
  call   <double_coset_rep@plt>
  add    $0x50,%rsp
  mov    -0x7c(%rbp),%edx
  mov    -0xd0(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copy_list@plt>
L48:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L52
  call   <__stack_chk_fail@plt>
L52:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void canonical_perm_ext(int *PERM, int n, int SGSQ, int *base, int bl, int *GS, int m, int *frees, int fl, int *vds, int vdsl, int *dummies, int dl, int *mQ, int *vrs, int vrsl, int *repes, int rl, int *CPERM) {
  int i;
  int *freeps = (int *)malloc(fl * sizeof(int));
  int *PERM1 = (int *)malloc(n * sizeof(int));
  int *PERM2 = (int *)malloc(n * sizeof(int));
  int *newbase = (int *)malloc(n * sizeof(int)), newbl;
  int **newGS = NULL;
  int *pointer;
  int newm;
  int *tmpbase = (int *)malloc(n * sizeof(int)), tmpbl;
  int num = 0;
  pointer = (int *)malloc(m * n * sizeof(int));
  newGS = &pointer;
  if (!SGSQ) {
    nonstable_points(base, bl, GS, m, n, tmpbase, &tmpbl);
    schreier_sims(tmpbase, tmpbl, GS, m, n, newbase, &newbl, newGS, &newm, &num);
  } else {
    copy_list(base, newbase, bl);
    newbl = bl;
    copy_list(GS, *newGS, m * n);
    newm = m;
  }
  inverse(PERM, PERM1, n);
  for (i = 0; i < fl; i++) {
    freeps[i] = onpoints(frees[i], PERM1, n);
  }
  coset_rep(PERM, n, newbase, newbl, *newGS, &newm, freeps, fl, PERM1);
  if (dl + rl == 0) {
    copy_list(PERM1, CPERM, n);
  } else {
    complement(newbase, newbl, freeps, fl, 1, tmpbase, &tmpbl);
    copy_list(tmpbase, newbase, tmpbl);
    newbl = tmpbl;
    stabilizer(freeps, fl, *newGS, newm, n, *newGS, &newm);
    double_coset_rep(PERM1, n, newbase, newbl, *newGS, newm, vds, vdsl, dummies, dl, mQ, vrs, vrsl, repes, rl, PERM2);
    copy_list(PERM2, CPERM, n);
  }
  free(freeps);
  free(PERM1);
  free(PERM2);
  free(newbase);
  free(tmpbase);
  free(*newGS);
}
```