user: 这段汇编代码用C语言表示是什么样的?

```asm
<dump_ps>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  lea    D90(%rip),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x18(%rbp)
  jmp    L140
L95:
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L140
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rcx
  lea    D102(%rip),%rax
  mov    %rax,%rdx
  mov    $0x80,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    D180(%rip),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L18
  lea    -0x3c(%rbp),%rsi
  lea    -0x44(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    -0x38(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x40(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  lea    -0x44(%rbp),%rcx
  push   %rcx
  mov    %rsi,%r9
  lea    D84(%rip),%r8
  lea    D20(%rip),%rcx
  lea    D14(%rip),%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  add    $0xa0,%rsp
  mov    -0x38(%rbp),%edi
  mov    -0x40(%rbp),%esi
  mov    -0x3c(%rbp),%ecx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x54(%rbp),%eax
  mov    %edi,%r9d
  mov    %esi,%r8d
  lea    D11(%rip),%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <sockprint@plt>
  or     %eax,-0x34(%rbp)
  addl   $0x1,-0x30(%rbp)
  mov    -0x40(%rbp),%eax
  add    %eax,-0x2c(%rbp)
L18:
  cmpq   $0x0,-0x20(%rbp)
  je     L13
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  cmpl   $0x0,-0x34(%rbp)
  jne    L17
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rcx
  lea    D67(%rip),%rax
  mov    %rax,%rdx
  mov    $0x80,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    D180(%rip),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x20(%rbp)
L13:
  cmpq   $0x0,-0x20(%rbp)
  je     L134
  mov    -0x20(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xfff,%edx
  mov    $0x1,%esi
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L71
  mov    -0x54(%rbp),%eax
  lea    D87(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <sockerror@plt>
  or     %eax,-0x34(%rbp)
  jmp    L41
L71:
  mov    -0x24(%rbp),%eax
  cltq
  lea    D83(%rip),%rdx
  movb   $0x0,(%rax,%rdx,1)
  movl   $0x0,-0x28(%rbp)
  jmp    L1
L143:
  mov    -0x28(%rbp),%eax
  cltq
  lea    D83(%rip),%rdx
  movzbl (%rax,%rdx,1),%eax
  test   %al,%al
  jne    L138
  mov    -0x28(%rbp),%eax
  cltq
  lea    D83(%rip),%rdx
  movb   $0x20,(%rax,%rdx,1)
L138:
  addl   $0x1,-0x28(%rbp)
L1:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L143
  mov    -0x24(%rbp),%edx
  mov    -0x54(%rbp),%eax
  lea    D83(%rip),%rcx
  lea    D63(%rip),%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <sockprint@plt>
  or     %eax,-0x34(%rbp)
L41:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  jmp    L168
L134:
  mov    -0x54(%rbp),%eax
  lea    D6(%rip),%rdx
  lea    D48(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <sockprint@plt>
  or     %eax,-0x34(%rbp)
L168:
  cmpl   $0x0,-0x34(%rbp)
  jne    L107
L140:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L95
  jmp    L124
L17:
  nop
  jmp    L124
L107:
  nop
L124:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  mov    -0x2c(%rbp),%ecx
  mov    -0x30(%rbp),%edx
  mov    -0x54(%rbp),%eax
  lea    D207(%rip),%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <sockprint@plt>
  or     %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L117
  call   <__stack_chk_fail@plt>
L117:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D90
datatype: string
name: extract_symbolic_data
arguments: label: D102
datatype: string
name: extract_symbolic_data
arguments: label: D180
datatype: string
name: extract_symbolic_data
arguments: label: D14
datatype: string
name: extract_symbolic_data
arguments: label: D11
datatype: string
name: extract_symbolic_data
arguments: label: D67
datatype: string
name: extract_symbolic_data
arguments: label: D87
datatype: string
name: extract_symbolic_data
arguments: label: D63
datatype: string
name: extract_symbolic_data
arguments: label: D48
datatype: string
name: extract_symbolic_data
arguments: label: D207
datatype: string

tool: D90: /proc

tool: D102: /proc/%s/stat

tool: D180: r

tool: D14: %d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d

tool: D11: %5s, ppid %5d, # threads: %2d, rss: %5d 

tool: D67: /proc/%s/cmdline

tool: D87: fread

tool: D63: %d %s


tool: D48: Error opening %s


tool: D207: # procs: %d, # threads: %d


assistant: ```c
int dump_ps(int fd) {
  int rc = 0, tnprocs = 0, tnthreads = 0;
  struct dirent *de;
  DIR *dirp = opendir("/proc");
  while ((de = readdir(dirp)) != NULL) {
    if (isdigit(de->d_name[0])) {
      FILE *fh;
      static char path[128];
      snprintf(path, sizeof(path), "/proc/%s/stat", de->d_name);
      fh = fopen(path, "r");
      if (fh) {
        static char fname[4096], dummystr[2];
        int dummy, nthreads, ppid, rss;
        fscanf(fh, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", &dummy, fname, &dummystr[0], &ppid, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &nthreads, &dummy, &dummy, &dummy, &rss);
        rc |= sockprint(fd, "%5s, ppid %5d, # threads: %2d, rss: %5d ", de->d_name, ppid, nthreads, rss);
        tnprocs++;
        tnthreads += nthreads;
      }
      if (fh) {
        fclose(fh);
        if (rc)
          break;
        snprintf(path, sizeof(path), "/proc/%s/cmdline", de->d_name);
        fh = fopen(path, "r");
      }
      if (fh) {
        int len, loop;
        static char non_ret_buffer[4096];
        len = fread(non_ret_buffer, 1, sizeof(non_ret_buffer) - 1, fh);
        if (len < 0)
          rc |= sockerror(fd, "fread");
        else {
          non_ret_buffer[len] = 0x00;
          for (loop = 0; loop < len; loop++) {
            if (non_ret_buffer[loop] == 0x00)
              non_ret_buffer[loop] = ' ';
          }
          rc |= sockprint(fd, "%d %s\r\n", len, non_ret_buffer);
        }
        fclose(fh);
      } else {
        rc |= sockprint(fd, "Error opening %s\r\n", path);
      }
      if (rc)
        break;
    }
  }
  closedir(dirp);
  rc |= sockprint(fd, "# procs: %d, # threads: %d\r\n", tnprocs, tnthreads);
  return rc;
}
```