user: Converte this assembly snippet into its equivalent C code:

```asm
<perm_member>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r8d,0xc(%rsp)
  mov    %r9d,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  jne    L45
  mov    %r9d,%esi
  call   <isid@plt>
  mov    %eax,0x38(%rsp)
L34:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  mov    0x38(%rsp),%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L45:
  mov    %rsi,%rbp
  mov    %edx,%r12d
  lea    0x0(,%r9,4),%r13d
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,0x28(%rsp)
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    %ebx,%edi
  imul   %ebx,%edi
  shl    $0x2,%edi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    0xc(%rsp),%edi
  imul   %ebx,%edi
  shl    $0x2,%edi
  call   <malloc@plt>
  mov    %rax,0x30(%rsp)
  sub    $0x8,%rsp
  push   $0x1
  push   %r13
  push   %r15
  lea    0x60(%rsp),%r9
  mov    %r14,%r8
  mov    %ebx,%ecx
  mov    0x2c(%rsp),%edx
  mov    0x38(%rsp),%rsi
  mov    0x0(%rbp),%edi
  call   <one_schreier_orbit@plt>
  add    $0x20,%rsp
  mov    %ebx,%edx
  mov    0x10(%rsp),%rsi
  mov    0x0(%rbp),%edi
  call   <onpoints@plt>
  mov    %eax,0x3c(%rsp)
  mov    0x40(%rsp),%edx
  mov    %r14,%rsi
  mov    %eax,%edi
  call   <position@plt>
  movl   $0x0,0x38(%rsp)
  test   %rax,%rax
  jne    L12
L19:
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  jmp    L34
L12:
  mov    %ebx,%r8d
  mov    0x20(%rsp),%rcx
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    0x3c(%rsp),%edi
  call   <trace_schreier@plt>
  mov    %ebx,%edx
  mov    0x28(%rsp),%rsi
  mov    0x20(%rsp),%rdi
  call   <inverse@plt>
  mov    %ebx,%ecx
  mov    0x20(%rsp),%rdx
  mov    0x28(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  call   <product@plt>
  sub    $0x8,%rsp
  lea    0x4c(%rsp),%rax
  push   %rax
  mov    0x40(%rsp),%r9
  mov    %ebx,%r8d
  mov    0x1c(%rsp),%ecx
  mov    0x28(%rsp),%rdx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <stabilizer@plt>
  lea    -0x1(%r12),%edx
  lea    0x4(%rbp),%rsi
  mov    %ebx,%r9d
  mov    0x54(%rsp),%r8d
  mov    0x40(%rsp),%rcx
  mov    0x30(%rsp),%rdi
  call   <perm_member>
  mov    %eax,0x48(%rsp)
  add    $0x10,%rsp
  jmp    L19
L20:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int perm_member(int *p, int *base, int bl, int *GS, int m, int n) {
  if (bl == 0)
    return (isid(p, n));
  else {
    int *pp = (int *)malloc(n * sizeof(int));
    int *ip = (int *)malloc(n * sizeof(int));
    int *orbit = (int *)malloc(n * sizeof(int)), ol;
    int *w = (int *)malloc(n * sizeof(int));
    int *nu = (int *)malloc(n * n * sizeof(int));
    int *stab = (int *)malloc(m * n * sizeof(int)), sl;
    int point, ret;
    one_schreier_orbit(base[0], GS, m, n, orbit, &ol, nu, w, 1);
    point = onpoints(base[0], p, n);
    if (position(point, orbit, ol)) {
      trace_schreier(point, nu, w, pp, n);
      inverse(pp, ip, n);
      product(p, ip, pp, n);
      stabilizer(base, 1, GS, m, n, stab, &sl);
      ret = perm_member(pp, base + 1, bl - 1, stab, sl, n);
    } else
      ret = 0;
    free(pp);
    free(ip);
    free(orbit);
    free(w);
    free(nu);
    free(stab);
    return (ret);
  }
}
```