user: Please show me the C implementation that matches the assembly code listed below:

```asm
<schreier_sims_step>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %r8d,%ebx
  mov    %ebx,%ebp
  imul   %ebx,%ebp
  sub    $0x128,%rsp
  mov    0x178(%rsp),%r10
  mov    0x180(%rsp),%r8
  mov    %ecx,0x8(%rsp)
  mov    0x160(%rsp),%rax
  mov    0x168(%rsp),%ecx
  mov    %esi,(%rsp)
  movslq %ebp,%rbp
  mov    0x170(%rsp),%r11
  mov    0x188(%rsp),%r15
  mov    %r10,0x80(%rsp)
  shl    $0x2,%rbp
  mov    0x190(%rsp),%r14
  mov    %rdx,0x58(%rsp)
  mov    %r9d,0xc0(%rsp)
  mov    %ecx,0xf8(%rsp)
  mov    %r8,0x40(%rsp)
  mov    %r11,0x48(%rsp)
  movslq %ebx,%r11
  mov    %r15,0x10(%rsp)
  mov    %r14,0x30(%rsp)
  lea    0x0(,%r11,4),%r14
  mov    %rax,0xe0(%rsp)
  mov    %r14,%rdi
  mov    %r14,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  mov    %r11,0x50(%rsp)
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,0x18(%rsp)
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,0x20(%rsp)
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,0x68(%rsp)
  call   <malloc@plt>
  mov    0x8(%rsp),%ecx
  mov    %ebx,%r9d
  mov    %rax,0x70(%rsp)
  imul   %ecx,%r9d
  mov    %ecx,0x38(%rsp)
  movslq %r9d,%r8
  mov    %r9d,0x28(%rsp)
  lea    0x0(,%r8,4),%r15
  mov    %r15,%rdi
  call   <malloc@plt>
  mov    %r15,%rdi
  mov    %rax,0x98(%rsp)
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,0xd0(%rsp)
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,0xa0(%rsp)
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %rax,0x8(%rsp)
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %rax,0xa8(%rsp)
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,0xd8(%rsp)
  call   <malloc@plt>
  mov    %r15,%rdi
  mov    %rax,0xc8(%rsp)
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %rax,0x90(%rsp)
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %r13,0x60(%rsp)
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    %r15,%rdi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    0x60(%rsp),%rdi
  mov    %rax,%r15
  call   <malloc@plt>
  mov    (%rsp),%edx
  mov    0x48(%rsp),%rsi
  mov    %r12,%rdi
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  call   <copy_list@plt>
  mov    (%rsp),%r11d
  mov    0x58(%rsp),%r10
  xor    %eax,%eax
  mov    0x80(%rsp),%rsi
  mov    0x28(%rsp),%edx
  mov    %r10,%rdi
  mov    %r10,(%rsp)
  mov    %r11d,(%rsi)
  mov    0x40(%rsp),%rsi
  mov    (%rsi),%rsi
  call   <copy_list@plt>
  mov    0x38(%rsp),%ecx
  sub    $0x8,%rsp
  mov    %ebx,%r8d
  mov    0x18(%rsp),%rsi
  mov    0xc8(%rsp),%edi
  lea    0x108(%rsp),%rax
  mov    %ecx,(%rsi)
  lea    -0x1(%rdi),%esi
  mov    %r12,%rdi
  push   %rax
  mov    0xa8(%rsp),%r9
  xor    %eax,%eax
  mov    0x10(%rsp),%rdx
  call   <stabilizer@plt>
  pop    %rdi
  mov    %ebx,%r8d
  lea    0x10c(%rsp),%rax
  push   %rax
  mov    0xe0(%rsp),%r9
  xor    %eax,%eax
  mov    0x108(%rsp),%ecx
  mov    0xf0(%rsp),%rdx
  mov    0x110(%rsp),%esi
  mov    0xa8(%rsp),%rdi
  call   <complement@plt>
  movslq 0xd0(%rsp),%rax
  movl   $0x1,(%rsp)
  lea    0x0(,%rax,4),%rcx
  xor    %eax,%eax
  mov    %rcx,0x10(%rsp)
  lea    -0x4(%r12,%rcx,1),%r12
  mov    %ebx,%ecx
  push   %r14
  push   0x20(%rsp)
  mov    0xc0(%rsp),%r8
  mov    0x120(%rsp),%edx
  mov    0xb8(%rsp),%rsi
  mov    (%r12),%edi
  lea    0x128(%rsp),%r9
  call   <one_schreier_orbit@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  mov    %ebx,%ecx
  push   $0x1
  push   0xe8(%rsp)
  push   0xe0(%rsp)
  mov    0xc8(%rsp),%r8
  mov    0x124(%rsp),%edx
  mov    0xf0(%rsp),%rsi
  mov    (%r12),%edi
  lea    0x12c(%rsp),%r9
  call   <one_schreier_orbit@plt>
  add    $0x20,%rsp
  test   %ebx,%ebx
  mov    0x50(%rsp),%r11
  jle    L204
  mov    %rbp,0x28(%rsp)
  xor    %ecx,%ecx
  mov    0xd8(%rsp),%rbp
  xor    %r12d,%r12d
  mov    %r13,0x38(%rsp)
  mov    %ebx,%r13d
  mov    %ecx,%ebx
  mov    %r15,0x50(%rsp)
  mov    %r11,%r15
L91:
  mov    0x0(%rbp,%r12,4),%eax
  cmp    %eax,(%r14,%r12,4)
  je     L40
  test   %eax,%eax
  je     L40
  mov    0x8(%rsp),%rax
  movslq %ebx,%rdi
  mov    %r13d,%edx
  shl    $0x2,%rdi
  lea    (%rax,%rdi,1),%rsi
  add    0xc8(%rsp),%rdi
  xor    %eax,%eax
  call   <copy_list@plt>
  mov    0x0(%rbp,%r12,4),%eax
  mov    %eax,(%r14,%r12,4)
L40:
  add    $0x1,%r12
  add    %r13d,%ebx
  cmp    %r12,%r15
  jne    L91
  mov    %r13d,%ebx
  mov    0x28(%rsp),%rbp
  mov    0x50(%rsp),%r15
  mov    0x38(%rsp),%r13
L204:
  mov    0x108(%rsp),%esi
  test   %esi,%esi
  jle    L112
  mov    0xf8(%rsp),%eax
  mov    0x10(%rsp),%r12
  mov    %r14,0x28(%rsp)
  movq   $0x0,0x58(%rsp)
  movl   $0x0,0xc4(%rsp)
  imul   %ebx,%eax
  mov    %eax,0xfc(%rsp)
  lea    0x110(%rsp),%rax
  mov    %rax,0x78(%rsp)
  mov    (%rsp),%rax
  add    0x48(%rsp),%rax
  mov    %rax,0xb0(%rsp)
L260:
  mov    0xa0(%rsp),%rax
  mov    0x58(%rsp),%rcx
  mov    0x10c(%rsp),%edx
  mov    0xa8(%rsp),%rsi
  mov    (%rax,%rcx,4),%r14d
  xor    %eax,%eax
  mov    %r14d,%edi
  call   <position@plt>
  test   %eax,%eax
  je     L183
  mov    0xfc(%rsp),%edx
  mov    0x90(%rsp),%rsi
  xor    %eax,%eax
  mov    0xe0(%rsp),%rdi
  call   <copy_list@plt>
  mov    0xf8(%rsp),%eax
  mov    %eax,0x38(%rsp)
L71:
  mov    0x38(%rsp),%ecx
  test   %ecx,%ecx
  jle    L146
  mov    0x90(%rsp),%rax
  movl   $0x0,(%rsp)
  mov    %r14d,0x50(%rsp)
  mov    %rax,0x10(%rsp)
L41:
  mov    0x10(%rsp),%rdi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  xor    %eax,%eax
  call   <copy_list@plt>
  mov    0x30(%rsp),%rax
  mov    0x50(%rsp),%r14d
  mov    %ebx,%r8d
  mov    0x18(%rsp),%rcx
  mov    0x28(%rsp),%rdx
  addl   $0x1,(%rax)
  mov    0x8(%rsp),%rsi
  mov    %r14d,%edi
  xor    %eax,%eax
  call   <trace_schreier@plt>
  mov    %r14d,%edi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  xor    %eax,%eax
  call   <onpoints@plt>
  mov    0x68(%rsp),%r14
  mov    0x28(%rsp),%rdx
  mov    %ebx,%r8d
  mov    0x8(%rsp),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  mov    %r14,%rcx
  call   <trace_schreier@plt>
  mov    0x20(%rsp),%rsi
  mov    %r14,%rdi
  mov    %ebx,%edx
  xor    %eax,%eax
  call   <inverse@plt>
  mov    0x70(%rsp),%r14
  mov    %ebx,%ecx
  mov    %rbp,%rsi
  mov    0x18(%rsp),%rdi
  xor    %eax,%eax
  mov    %r14,%rdx
  call   <product@plt>
  mov    0x20(%rsp),%rsi
  mov    %ebx,%ecx
  mov    %r13,%rdx
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <product@plt>
  mov    (%r12),%esi
  mov    %r15,%rdi
  imul   %ebx,%esi
  movslq %esi,%rsi
  shl    $0x2,%rsi
  call   <realloc@plt>
  sub    $0x8,%rsp
  mov    %ebx,%r8d
  push   0x80(%rsp)
  mov    %rax,%r9
  mov    %rax,%r15
  mov    0x50(%rsp),%rax
  mov    0xd0(%rsp),%esi
  mov    (%rax),%rdx
  mov    0x58(%rsp),%rdi
  xor    %eax,%eax
  mov    (%r12),%ecx
  call   <stabilizer@plt>
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <isid@plt>
  mov    %eax,%r14d
  pop    %rax
  pop    %rdx
  test   %r14d,%r14d
  jne    L120
  mov    0x110(%rsp),%r8d
  test   %r8d,%r8d
  je     L119
  mov    0x80(%rsp),%rax
  mov    %ebx,%r9d
  mov    %r15,%rcx
  mov    %r13,%rdi
  mov    0xb0(%rsp),%rsi
  mov    (%rax),%eax
  mov    %eax,%edx
  mov    %eax,0x88(%rsp)
  sub    0xc0(%rsp),%edx
  xor    %eax,%eax
  call   <perm_member@plt>
  test   %eax,%eax
  je     L119
L120:
  addl   $0x1,(%rsp)
  mov    0x60(%rsp),%rdx
  mov    (%rsp),%eax
  add    %rdx,0x10(%rsp)
  cmp    %eax,0x38(%rsp)
  jne    L41
L146:
  addq   $0x1,0x58(%rsp)
  mov    0x58(%rsp),%rax
  cmp    %eax,0x108(%rsp)
  jg     L260
  mov    0x28(%rsp),%r14
L112:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    0x70(%rsp),%rdi
  call   <free@plt>
  mov    0x98(%rsp),%rdi
  call   <free@plt>
  mov    0xd0(%rsp),%rdi
  call   <free@plt>
  mov    0xa0(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0xa8(%rsp),%rdi
  call   <free@plt>
  mov    0xd8(%rsp),%rdi
  call   <free@plt>
  mov    0xc8(%rsp),%rdi
  call   <free@plt>
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L268
  mov    0xb8(%rsp),%rdi
  add    $0x128,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1140 <free@plt>
  nopl   (%rax)
L183:
  mov    0x100(%rsp),%edx
  mov    0x90(%rsp),%rsi
  xor    %eax,%eax
  mov    0x98(%rsp),%rdi
  imul   %ebx,%edx
  call   <copy_list@plt>
  mov    0x100(%rsp),%eax
  mov    %eax,0x38(%rsp)
  jmp    L71
  nopl   0x0(%rax)
L119:
  mov    (%r12),%eax
  lea    0x1(%rax),%esi
  mov    0x40(%rsp),%rax
  imul   %ebx,%esi
  mov    (%rax),%rdi
  movslq %esi,%rsi
  shl    $0x2,%rsi
  call   <realloc@plt>
  mov    (%r12),%edx
  mov    0x40(%rsp),%rcx
  mov    %r13,%rdi
  imul   %ebx,%edx
  mov    %rax,(%rcx)
  movslq %edx,%rdx
  lea    (%rax,%rdx,4),%rsi
  mov    %ebx,%edx
  xor    %eax,%eax
  call   <copy_list@plt>
  addl   $0x1,(%r12)
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    0xb8(%rsp),%rdx
  lea    0x114(%rsp),%rcx
  xor    %eax,%eax
  call   <stable_points@plt>
  mov    0x80(%rsp),%rax
  mov    0x48(%rsp),%rcx
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L44
  mov    %rbp,0x88(%rsp)
  mov    0xb8(%rsp),%rbp
  mov    %ebx,0xc4(%rsp)
  mov    %r14d,%ebx
  mov    0x80(%rsp),%r14
  mov    %r12,0xe8(%rsp)
  mov    %rcx,%r12
  jmp    L93
  nop
L252:
  mov    (%r14),%eax
  add    $0x4,%r12
  cmp    %ebx,%eax
  jle    L117
L93:
  mov    0x114(%rsp),%edx
  mov    (%r12),%edi
  mov    %rbp,%rsi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <position@plt>
  test   %eax,%eax
  jne    L252
  mov    %ebx,%r14d
  mov    0x80(%rsp),%rax
  mov    0xc4(%rsp),%ebx
  mov    %r14d,0xc4(%rsp)
  mov    0x88(%rsp),%rbp
  mov    0xe8(%rsp),%r12
  mov    (%rax),%eax
L44:
  add    $0x1,%eax
  cmp    0xc4(%rsp),%eax
  je     L99
L229:
  mov    0xc4(%rsp),%eax
  mov    0xc0(%rsp),%ecx
  cmp    %ecx,%eax
  jle    L120
  mov    %rbp,0xe8(%rsp)
  mov    0x80(%rsp),%r14
  mov    %r15,0xf0(%rsp)
  mov    0x48(%rsp),%rbp
  mov    %ebx,%r15d
  mov    0x40(%rsp),%rbx
  mov    %r13,0x88(%rsp)
  mov    %r12,%r13
  mov    %eax,%r12d
L206:
  sub    $0x8,%rsp
  mov    %r12d,%r9d
  mov    %r15d,%r8d
  mov    %rbp,%rdi
  push   0x38(%rsp)
  sub    $0x1,%r12d
  push   %r13
  push   %rbx
  push   %r14
  push   %rbp
  push   $0x1
  push   0xc0(%rsp)
  mov    0x0(%r13),%ecx
  mov    (%rbx),%rdx
  mov    (%r14),%esi
  call   <schreier_sims_step>
  add    $0x40,%rsp
  cmp    %r12d,0xc0(%rsp)
  jne    L206
  mov    %r15d,%ebx
  mov    %r13,%r12
  mov    0xe8(%rsp),%rbp
  mov    0xf0(%rsp),%r15
  mov    0x88(%rsp),%r13
  jmp    L120
  nopl   0x0(%rax)
L117:
  add    $0x1,%eax
  mov    0xc4(%rsp),%ebx
  mov    0x88(%rsp),%rbp
  mov    %eax,0xc4(%rsp)
  mov    0xe8(%rsp),%r12
L99:
  test   %ebx,%ebx
  jle    L229
  mov    $0x1,%ecx
  mov    %rbp,0x88(%rsp)
  mov    0xb8(%rsp),%r14
  mov    %r13,0xe8(%rsp)
  mov    %ecx,%ebp
  mov    0x80(%rsp),%r13
  mov    %r12,0xf0(%rsp)
  mov    0x48(%rsp),%r12
  jmp    L73
  nopw   0x0(%rax,%rax,1)
L139:
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  jl     L88
L73:
  mov    0x114(%rsp),%edx
  xor    %eax,%eax
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <position@plt>
  test   %eax,%eax
  jne    L139
  mov    0x0(%r13),%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <position@plt>
  test   %eax,%eax
  jne    L139
  mov    0x80(%rsp),%rdx
  mov    0x48(%rsp),%rdi
  mov    %ebp,%ecx
  mov    0xe8(%rsp),%r13
  mov    0x88(%rsp),%rbp
  movslq (%rdx),%rax
  mov    0xf0(%rsp),%r12
  mov    %ecx,(%rdi,%rax,4)
  addl   $0x1,(%rdx)
  jmp    L229
  nopl   (%rax)
L88:
  mov    0x88(%rsp),%rbp
  mov    0xe8(%rsp),%r13
  mov    0xf0(%rsp),%r12
  jmp    L229
L268:
  call   <__stack_chk_fail@plt>
```

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);
}
```