user: What is the c source code of the assembly code below?

```asm
<getProcCmdLine>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x6c(%rbp)
  movl   $0x0,-0x68(%rbp)
  mov    -0x78(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x80(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%edx
  lea    -0x50(%rbp),%rax
  mov    %edx,%ecx
  lea    D2(%rip),%rdx
  mov    $0x40,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x50(%rbp),%rax
  lea    D17(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__real_fopen@plt>
  mov    %rax,-0x58(%rbp)
  cmpq   $0x0,-0x58(%rbp)
  je     L45
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L47
  mov    $0x1000,%edi
  call   <malloc@plt>
  mov    -0x80(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rax
  mov    $0x1000,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x58(%rbp),%rdx
  mov    %rdx,%rcx
  mov    $0x1000,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <__real_fread@plt>
  mov    %eax,-0x68(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  jle    L47
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x60(%rbp)
  jmp    L67
L50:
  cmpl   $0x0,-0x6c(%rbp)
  je     L15
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  mov    -0x60(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x60(%rbp),%rdx
  mov    -0x6c(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L15:
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1000,%rax
  cmp    %rax,%rdx
  jae    L58
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  add    %rax,-0x60(%rbp)
L58:
  addl   $0x1,-0x6c(%rbp)
L67:
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L50
L47:
  mov    -0x78(%rbp),%rax
  mov    -0x6c(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <__real_fclose@plt>
L45:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D2
data_type: string
name: read_data
arguments: label: D17
data_type: string
name: read_data
arguments: label: D1
data_type: string

tool: D2: /proc/%d/cmdline

tool: D17: r

tool: D1: %d: %s


assistant: ```c
void getProcCmdLine(int *ac, char **av) {
  int i = 0, pid;
  int length = 0;
  char *inbuf;
  char file[64];
  FILE *infile;
  char *arg_ptr;
  *ac = 0;
  *av = NULL;
  pid = getpid();
  snprintf(file, 64, "/proc/%d/cmdline", pid);
  infile = __real_fopen(file, "r");
  if (infile != NULL) {
    if (!feof(infile)) {
      av[0] = malloc(4096);
      memset(av[0], 0, 4096);
      length = __real_fread(av[0], 1, 4096, infile);
      if (length > 0) {
        arg_ptr = av[0];
        while (*arg_ptr != '\0') {
          if (i != 0) {
            av[i] = arg_ptr;
            printf("%d: %s\n", i, arg_ptr);
          }
          if ((arg_ptr + strlen(av[i]) + 1) < av[0] + 4096)
            arg_ptr += strlen(av[i]) + 1;
          i++;
        }
      }
    }
    *ac = i;
    __real_fclose(infile);
  }
}
```