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

```asm
<schreier_sims_step>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %esi,-0xdc(%rbp)
  mov    %rdx,-0xe8(%rbp)
  mov    %ecx,-0xe0(%rbp)
  mov    %r8d,-0xec(%rbp)
  mov    %r9d,-0xf0(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xf8(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x100(%rbp)
  mov    0x28(%rbp),%rax
  mov    %rax,-0x108(%rbp)
  mov    0x30(%rbp),%rax
  mov    %rax,-0x110(%rbp)
  mov    0x38(%rbp),%rax
  mov    %rax,-0x118(%rbp)
  mov    0x40(%rbp),%rax
  mov    %rax,-0x120(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xac(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x88(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x80(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x78(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x70(%rbp)
  mov    -0xe0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x68(%rbp)
  mov    -0xe0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x60(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x58(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x50(%rbp)
  mov    -0xec(%rbp),%eax
  imul   %eax,%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0xec(%rbp),%eax
  imul   %eax,%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0xe0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0xe0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x90(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0xdc(%rbp),%edx
  mov    -0x100(%rbp),%rcx
  mov    -0xd8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    -0x108(%rbp),%rax
  mov    -0xdc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0xe0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  mov    %eax,%edx
  mov    -0x110(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0xe8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    -0x118(%rbp),%rax
  mov    -0xe0(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0xf0(%rbp),%eax
  lea    -0x1(%rax),%esi
  mov    -0x68(%rbp),%r9
  mov    -0xec(%rbp),%r8d
  mov    -0xe0(%rbp),%ecx
  mov    -0xe8(%rbp),%rdx
  mov    -0xd8(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0xc8(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stabilizer@plt>
  add    $0x10,%rsp
  mov    -0xc8(%rbp),%esi
  mov    -0x60(%rbp),%r9
  mov    -0xec(%rbp),%r8d
  mov    0x18(%rbp),%ecx
  mov    -0xf8(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0xc4(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <complement@plt>
  add    $0x10,%rsp
  mov    -0xc8(%rbp),%edx
  mov    -0xf0(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rcx
  mov    -0xd8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  lea    -0xc0(%rbp),%r8
  mov    -0x58(%rbp),%rdi
  mov    -0xec(%rbp),%ecx
  mov    -0x68(%rbp),%rsi
  sub    $0x8,%rsp
  push   $0x1
  push   -0x50(%rbp)
  push   -0x48(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <one_schreier_orbit@plt>
  add    $0x20,%rsp
  mov    -0xc4(%rbp),%edx
  mov    -0xf0(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rcx
  mov    -0xd8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  lea    -0xbc(%rbp),%r8
  mov    -0x40(%rbp),%rdi
  mov    -0xec(%rbp),%ecx
  mov    -0x60(%rbp),%rsi
  sub    $0x8,%rsp
  push   $0x1
  push   -0x38(%rbp)
  push   -0x30(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <one_schreier_orbit@plt>
  add    $0x20,%rsp
  movl   $0x0,-0xb0(%rbp)
  jmp    L131
L259:
  mov    -0xb0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xb0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  je     L55
  mov    -0xb0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L55
  mov    -0xb0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb0(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xec(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    -0xb0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0xb0(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x50(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
L55:
  addl   $0x1,-0xb0(%rbp)
L131:
  mov    -0xb0(%rbp),%eax
  cmp    -0xec(%rbp),%eax
  jl     L259
  movl   $0x0,-0x9c(%rbp)
  jmp    L112
L98:
  mov    -0x9c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x94(%rbp)
  mov    -0xbc(%rbp),%edx
  mov    -0x40(%rbp),%rcx
  mov    -0x94(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <position@plt>
  test   %eax,%eax
  je     L60
  mov    0x18(%rbp),%eax
  imul   -0xec(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rcx
  mov    -0xf8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    0x18(%rbp),%eax
  mov    %eax,-0xa0(%rbp)
  jmp    L149
L60:
  mov    -0xc8(%rbp),%eax
  imul   -0xec(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x68(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    -0xc8(%rbp),%eax
  mov    %eax,-0xa0(%rbp)
L149:
  movl   $0x0,-0x98(%rbp)
  jmp    L227
L95:
  mov    -0x98(%rbp),%eax
  imul   -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xec(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    -0x120(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x120(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0xec(%rbp),%edi
  mov    -0x88(%rbp),%rcx
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    -0x94(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <trace_schreier@plt>
  mov    -0xec(%rbp),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x94(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <onpoints@plt>
  mov    %eax,%edi
  mov    -0xec(%rbp),%esi
  mov    -0x78(%rbp),%rcx
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %esi,%r8d
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <trace_schreier@plt>
  mov    -0xec(%rbp),%edx
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <inverse@plt>
  mov    -0xec(%rbp),%ecx
  mov    -0x70(%rbp),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <product@plt>
  mov    -0xec(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0x80(%rbp),%rsi
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <product@plt>
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  imul   -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x90(%rbp)
  mov    -0x118(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x110(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x90(%rbp),%r9
  mov    -0xec(%rbp),%r8d
  mov    -0xf0(%rbp),%esi
  mov    -0x100(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0xb8(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stabilizer@plt>
  add    $0x10,%rsp
  mov    -0xec(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <isid@plt>
  test   %eax,%eax
  jne    L52
  mov    -0xb8(%rbp),%eax
  test   %eax,%eax
  je     L100
  mov    -0xb8(%rbp),%edi
  mov    -0x108(%rbp),%rax
  mov    (%rax),%eax
  sub    -0xf0(%rbp),%eax
  mov    %eax,%edx
  mov    -0xf0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x100(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0xec(%rbp),%r8d
  mov    -0x90(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <perm_member@plt>
  test   %eax,%eax
  jne    L52
L100:
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  imul   -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    -0x110(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x110(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  imul   -0xec(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xec(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <copy_list@plt>
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x118(%rbp),%rax
  mov    %edx,(%rax)
  lea    -0xb4(%rbp),%rcx
  mov    -0x10(%rbp),%rdx
  mov    -0xec(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stable_points@plt>
  movl   $0x0,-0xa8(%rbp)
  jmp    L136
L189:
  mov    -0xb4(%rbp),%edx
  mov    -0xa8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x100(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  mov    -0x10(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <position@plt>
  test   %eax,%eax
  jne    L30
  mov    -0xa8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xac(%rbp)
  jmp    L3
L30:
  mov    -0x108(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    %eax,-0xac(%rbp)
  addl   $0x1,-0xa8(%rbp)
L136:
  mov    -0x108(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xa8(%rbp)
  jl     L189
L3:
  mov    -0x108(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  cmp    %eax,-0xac(%rbp)
  jne    L169
  movl   $0x1,-0xa8(%rbp)
  jmp    L105
L137:
  mov    -0xb4(%rbp),%edx
  mov    -0x10(%rbp),%rcx
  mov    -0xa8(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <position@plt>
  test   %eax,%eax
  jne    L80
  mov    -0x108(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x100(%rbp),%rcx
  mov    -0xa8(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <position@plt>
  test   %eax,%eax
  jne    L80
  mov    -0x108(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
  add    %rax,%rdx
  mov    -0xa8(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x108(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x108(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L169
L80:
  addl   $0x1,-0xa8(%rbp)
L105:
  mov    -0xa8(%rbp),%eax
  cmp    -0xec(%rbp),%eax
  jle    L137
L169:
  mov    -0xac(%rbp),%eax
  mov    %eax,-0xa4(%rbp)
  jmp    L16
L109:
  mov    -0x118(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x110(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x108(%rbp),%rax
  mov    (%rax),%esi
  mov    -0xa4(%rbp),%r8d
  mov    -0xec(%rbp),%edi
  mov    -0x100(%rbp),%rax
  sub    $0x8,%rsp
  push   -0x120(%rbp)
  push   -0x118(%rbp)
  push   -0x110(%rbp)
  push   -0x108(%rbp)
  push   -0x100(%rbp)
  push   $0x1
  push   -0x18(%rbp)
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <schreier_sims_step>
  add    $0x40,%rsp
  subl   $0x1,-0xa4(%rbp)
L16:
  mov    -0xa4(%rbp),%eax
  cmp    -0xf0(%rbp),%eax
  jg     L109
L52:
  addl   $0x1,-0x98(%rbp)
L227:
  mov    -0x98(%rbp),%eax
  cmp    -0xa0(%rbp),%eax
  jl     L95
  addl   $0x1,-0x9c(%rbp)
L112:
  mov    -0xc0(%rbp),%eax
  cmp    %eax,-0x9c(%rbp)
  jl     L98
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  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    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L49
  call   <__stack_chk_fail@plt>
L49:
  leave
  ret
```

assistant: ```c
void schreier_sims_step(int *base, int bl, int *GS, int m, int n, int i, int *T, int mm, int *newbase, int *nbl, int **newGS, int *nm, int *num) {
  int c, j = 0, jj, level;
  int *p = (int *)malloc(n * sizeof(int));
  int *ip = (int *)malloc(n * sizeof(int));
  int *pp = (int *)malloc(n * sizeof(int));
  int *ppp = (int *)malloc(n * sizeof(int));
  int *Si = (int *)malloc(m * n * sizeof(int)), Sil;
  int *oldSi = (int *)malloc(m * n * sizeof(int)), oldSil;
  int *Deltai = (int *)malloc(n * sizeof(int)), Deltail;
  int *w = (int *)malloc(n * sizeof(int));
  int *nu = (int *)malloc(n * n * sizeof(int));
  int *oldDeltai = (int *)malloc(n * sizeof(int)), oldDeltail;
  int *oldw = (int *)malloc(n * sizeof(int));
  int *oldnu = (int *)malloc(n * n * sizeof(int));
  int *genset = (int *)malloc(m * n * sizeof(int)), gensetl;
  int gamma, gn, sn;
  int *s = (int *)malloc(n * sizeof(int));
  int *g = (int *)malloc(n * sizeof(int));
  int *stab = (int *)malloc(m * n * sizeof(int)), stabl;
  int *stabps = (int *)malloc(n * sizeof(int)), stabpsl;
  copy_list(base, newbase, bl);
  *nbl = bl;
  copy_list(GS, *newGS, m * n);
  *nm = m;
  stabilizer(base, i - 1, GS, m, n, Si, &Sil);
  complement(Si, Sil, T, mm, n, oldSi, &oldSil);
  one_schreier_orbit(base[i - 1], Si, Sil, n, Deltai, &Deltail, nu, w, 1);
  one_schreier_orbit(base[i - 1], oldSi, oldSil, n, oldDeltai, &oldDeltail, oldnu, oldw, 1);
  for (c = 0; c < n; c++) {
    if (w[c] != oldw[c] && oldw[c] != 0) {
      copy_list(oldnu + c * n, nu + c * n, n);
      w[c] = oldw[c];
    }
  }
  for (gn = 0; gn < Deltail; gn++) {
    gamma = Deltai[gn];
    if (position(gamma, oldDeltai, oldDeltail)) {
      copy_list(T, genset, mm * n);
      gensetl = mm;
    } else {
      copy_list(Si, genset, Sil * n);
      gensetl = Sil;
    }
    for (sn = 0; sn < gensetl; sn++) {
      copy_list(genset + sn * n, s, n);
      (*num)++;
      trace_schreier(gamma, nu, w, p, n);
      trace_schreier(onpoints(gamma, s, n), nu, w, pp, n);
      inverse(pp, ip, n);
      product(p, s, ppp, n);
      product(ppp, ip, g, n);
      stab = (int *)realloc(stab, (*nm) * n * sizeof(int));
      stabilizer(newbase, i, *newGS, *nm, n, stab, &stabl);
      if (!isid(g, n)) {
        if ((stabl == 0) || (!perm_member(g, newbase + i, *nbl - i, stab, stabl, n))) {
          *newGS = (int *)realloc(*newGS, ((*nm) + 1) * n * sizeof(int));
          copy_list(g, (*newGS) + (*nm) * n, n);
          (*nm)++;
          stable_points(g, n, stabps, &stabpsl);
          for (jj = 0; jj < *nbl; jj++) {
            if (!position(newbase[jj], stabps, stabpsl)) {
              j = jj + 1;
              break;
            }
            j = *nbl + 1;
          }
          if (j == *nbl + 1) {
            for (jj = 1; jj <= n; jj++) {
              if (!position(jj, stabps, stabpsl) && !position(jj, newbase, *nbl)) {
                newbase[*nbl] = jj;
                (*nbl)++;
                break;
              }
            }
          }
          for (level = j; level > i; level--) {
            schreier_sims_step(newbase, *nbl, *newGS, *nm, n, level, g, 1, newbase, nbl, newGS, nm, num);
          }
        }
      }
    }
  }
  free(p);
  free(ip);
  free(pp);
  free(ppp);
  free(Si);
  free(oldSi);
  free(Deltai);
  free(w);
  free(nu);
  free(oldDeltai);
  free(oldw);
  free(oldnu);
  free(genset);
  free(s);
  free(g);
  free(stab);
  free(stabps);
}
```