user: 下面的汇编指令对应的C源代码是什么:

```asm
<dump_ps>:
  endbr64
  push   %r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  mov    %edi,%r12d
  lea    D99(%rip),%rdi
  push   %rbp
  push   %rbx
  lea    D14(%rip),%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <opendir@plt>
  movl   $0x0,0x4(%rsp)
  mov    %rax,%rbp
  jmp    L141
  nopl   0x0(%rax,%rax,1)
L42:
  mov    (%r15),%rax
  movsbl (%rax),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L41
L141:
  mov    %rbp,%rdi
  call   <readdir@plt>
  mov    %rax,%r15
  test   %rax,%rax
  jne    L42
  xor    %r13d,%r13d
L101:
  mov    %rbp,%rdi
  call   <closedir@plt>
  mov    0x4(%rsp),%edx
  mov    %r14d,%ecx
  mov    %r12d,%edi
  lea    D44(%rip),%rsi
  xor    %eax,%eax
  call   <sockprint@plt>
  or     %r13d,%eax
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L65
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L41:
  mov    (%r15),%rcx
  lea    D49(%rip),%rdx
  mov    $0x80,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  lea    D107(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%r10
  test   %rax,%rax
  je     L142
  lea    0x18(%rsp),%rdx
  lea    0x24(%rsp),%rax
  mov    %r10,%rdi
  push   %rax
  lea    D143(%rip),%r8
  lea    D75(%rip),%rcx
  push   %rdx
  lea    D141(%rip),%rsi
  push   %rdx
  push   %rdx
  lea    0x3c(%rsp),%rax
  push   %rax
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  push   %rdx
  lea    0xc0(%rsp),%r9
  mov    %r10,0xa8(%rsp)
  call   <fscanf@plt>
  mov    (%r15),%rdx
  mov    %r12d,%edi
  xor    %eax,%eax
  mov    0xc4(%rsp),%r9d
  mov    0xbc(%rsp),%r8d
  add    $0xa0,%rsp
  lea    D148(%rip),%rsi
  mov    0x20(%rsp),%ecx
  call   <sockprint@plt>
  mov    0x8(%rsp),%rdi
  addl   $0x1,0x4(%rsp)
  mov    %eax,%r13d
  add    0x1c(%rsp),%r14d
  call   <fclose@plt>
  test   %r13d,%r13d
  jne    L101
  mov    (%r15),%rcx
  lea    D71(%rip),%rdx
  mov    $0x80,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  lea    D107(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L142
  lea    D79(%rip),%r13
  mov    $0xfff,%edx
  mov    %rax,%rcx
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <fread@plt>
  mov    %eax,%edx
  test   %eax,%eax
  jns    L81
  lea    D100(%rip),%rsi
  mov    %r12d,%edi
  call   <sockerror@plt>
  mov    %eax,%r13d
L28:
  mov    %r15,%rdi
  call   <fclose@plt>
L78:
  test   %r13d,%r13d
  je     L141
  jmp    L101
  nopl   0x0(%rax)
L142:
  mov    %rbx,%rdx
  lea    D89(%rip),%rsi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <sockprint@plt>
  mov    %eax,%r13d
  jmp    L78
  nopl   0x0(%rax)
L81:
  cltq
  movb   $0x0,0x0(%r13,%rax,1)
  je     L52
  lea    -0x1(%rdx),%eax
  lea    0x1(%r13),%rsi
  mov    %r13,%rcx
  add    %rax,%rsi
  nopw   0x0(%rax,%rax,1)
L63:
  cmpb   $0x0,(%rcx)
  jne    L2
  movb   $0x20,(%rcx)
L2:
  add    $0x1,%rcx
  cmp    %rsi,%rcx
  jne    L63
L52:
  mov    %r13,%rcx
  lea    D38(%rip),%rsi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <sockprint@plt>
  mov    %eax,%r13d
  jmp    L28
L65:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D99
type_infered: string
name: unpack_data
arguments: data_tag: D44
type_infered: string
name: unpack_data
arguments: data_tag: D49
type_infered: string
name: unpack_data
arguments: data_tag: D107
type_infered: string
name: unpack_data
arguments: data_tag: D141
type_infered: string
name: unpack_data
arguments: data_tag: D148
type_infered: string
name: unpack_data
arguments: data_tag: D71
type_infered: string
name: unpack_data
arguments: data_tag: D100
type_infered: string
name: unpack_data
arguments: data_tag: D89
type_infered: string
name: unpack_data
arguments: data_tag: D38
type_infered: string

tool: D99: /proc

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


tool: D49: /proc/%s/stat

tool: D107: r

tool: D141: %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: D148: %5s, ppid %5d, # threads: %2d, rss: %5d 

tool: D71: /proc/%s/cmdline

tool: D100: fread

tool: D89: Error opening %s


tool: D38: %d %s


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