user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<graph_dfs_preorder>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x68,%rsp
  mov    %rsi,0x28(%rsp)
  lea    0x50(%rsp),%rbp
  mov    %rcx,0x30(%rsp)
  mov    %rbp,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %r8,0x50(%rsp)
  call   <u_alloc@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  mov    %rax,%r13
  call   <u_alloc@plt>
  test   %ebx,%ebx
  jle    L123
  mov    %rax,%rbp
  movslq %ebx,%rax
  lea    0x4c(%rsp),%r14
  xor    %esi,%esi
  lea    0x0(,%rax,4),%rdx
  mov    %rbp,%rdi
  mov    %rax,0x38(%rsp)
  mov    %rbp,%r12
  call   <memset@plt>
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <s_reset@plt>
  movl   $0x0,0x24(%rsp)
  movq   $0x0,0x10(%rsp)
  jmp    L35
  nopl   0x0(%rax,%rax,1)
L125:
  addq   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%rax
  cmp    0x38(%rsp),%rax
  je     L81
L35:
  mov    0x10(%rsp),%rax
  mov    (%r12,%rax,4),%r8d
  mov    %eax,%edi
  test   %r8d,%r8d
  jne    L125
  mov    %r13,%rsi
  mov    %r14,%rdx
  call   <s_push@plt>
  mov    0x10(%rsp),%rax
  movl   $0x1,(%r12,%rax,4)
  mov    0x4c(%rsp),%esi
  test   %esi,%esi
  jle    L125
  mov    0x24(%rsp),%ebx
  add    $0x1,%ebx
  movslq %ebx,%rax
  mov    %rax,0x18(%rsp)
  nopl   (%rax)
L76:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <s_pop@plt>
  mov    0x18(%rsp),%rcx
  mov    0x30(%rsp),%rdx
  mov    0x28(%rsp),%rsi
  mov    %eax,-0x4(%rdx,%rcx,4)
  cltq
  lea    0x4(%rsi,%rax,4),%rbx
  mov    %ecx,0x24(%rsp)
  mov    (%rsi,%rax,4),%ecx
  cmp    (%rbx),%ecx
  jge    L18
  mov    %r14,%rdx
  movslq %ecx,%rbp
  mov    %r13,%r14
  mov    %rbx,%r13
  jmp    L122
  cs nopw 0x0(%rax,%rax,1)
L62:
  add    $0x1,%rbp
  cmp    %ebp,0x0(%r13)
  jle    L107
L122:
  movslq (%r15,%rbp,4),%rax
  lea    (%r12,%rax,4),%rbx
  mov    %rax,%rdi
  mov    (%rbx),%ecx
  test   %ecx,%ecx
  jne    L62
  mov    %r14,%rsi
  mov    %rdx,0x8(%rsp)
  add    $0x1,%rbp
  call   <s_push@plt>
  movl   $0x1,(%rbx)
  mov    0x8(%rsp),%rdx
  cmp    %ebp,0x0(%r13)
  jg     L122
L107:
  mov    %r14,%r13
  mov    %rdx,%r14
L18:
  mov    0x4c(%rsp),%eax
  addq   $0x1,0x18(%rsp)
  test   %eax,%eax
  jg     L76
  jmp    L125
L123:
  lea    0x4c(%rsp),%rsi
  mov    %r13,%rdi
  call   <s_reset@plt>
  nopw   0x0(%rax,%rax,1)
L81:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L52:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void graph_dfs_preorder(int n, int *xadj, int *adj, int *perm, int *aux) {
  int *auxptr = aux;
  int *active = u_alloc(n, &auxptr);
  int *visit = u_alloc(n, &auxptr);
  for (int v = 0; v < n; v++) {
    visit[v] = 0;
  }
  int p = 0;
  int size;
  s_reset(active, &size);
  for (int v = 0; v < n; v++) {
    if (!visit[v]) {
      s_push(v, active, &size);
      visit[v] = 1;
      while (size > 0) {
        int v = s_pop(active, &size);
        perm[p++] = v;
        for (int j = xadj[v]; j < xadj[v + 1]; j++) {
          int w = adj[j];
          if (!visit[w]) {
            s_push(w, active, &size);
            visit[w] = 1;
          }
        }
      }
    }
  }
}
```