user: Demonstrate the C code that generates the assembly output below:

```asm
<print_proc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x360,%rsp
  mov    %rdi,-0x358(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x358(%rbp),%rdx
  lea    -0x310(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x310(%rbp),%rax
  lea    D64(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x310(%rbp),%rax
  lea    D67(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x348(%rbp)
  cmpq   $0x0,-0x348(%rbp)
  jne    L74
  mov    $0x1,%eax
  jmp    L65
L84:
  lea    -0x210(%rbp),%rax
  lea    D17(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x340(%rbp)
  lea    D17(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,-0x338(%rbp)
  cmpq   $0x0,-0x340(%rbp)
  je     L74
  cmpq   $0x0,-0x338(%rbp)
  je     L74
  mov    -0x340(%rbp),%rax
  mov    %rax,%rdi
  call   <trim@plt>
  mov    -0x338(%rbp),%rax
  mov    %rax,%rdi
  call   <trim@plt>
  mov    -0x340(%rbp),%rax
  lea    D66(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L55
  mov    -0x338(%rbp),%rdx
  lea    -0x330(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L74
L55:
  mov    -0x340(%rbp),%rax
  lea    D60(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L74
  mov    -0x338(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L74:
  mov    -0x348(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    $0x100,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L84
  lea    -0x330(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rax,%rsi
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
L65:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L38
  call   <__stack_chk_fail@plt>
L38:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D64
type_infered: string
name: parse_data
arguments: tag: D67
type_infered: string
name: parse_data
arguments: tag: D17
type_infered: string
name: parse_data
arguments: tag: D66
type_infered: string
name: parse_data
arguments: tag: D60
type_infered: string
name: parse_data
arguments: tag: D43
type_infered: string

tool: D64: /status

tool: D67: r

tool: D17: :

tool: D66: Pid

tool: D60: Name

tool: D43: %s (pid: %s)


assistant: ```c
int print_proc(char *dirname) {
  char filename[256];
  char linebuf[256];
  char procname[256];
  char pid[32];
  char *key;
  char *value;
  FILE *p_file;
  strcpy(filename, dirname);
  strcat(filename, "/status");
  p_file = fopen(filename, "r");
  if (p_file == NULL) {
    return 1;
  }
  while (fgets(linebuf, sizeof(linebuf), p_file) != NULL) {
    key = strtok(linebuf, ":");
    value = strtok(NULL, ":");
    if (key != NULL && value != NULL) {
      trim(key);
      trim(value);
      if (strcmp(key, "Pid") == 0) {
        strcpy(pid, value);
      } else if (strcmp(key, "Name") == 0) {
        strcpy(procname, value);
      }
    }
  }
  printf("%s (pid: %s)\n", procname, pid);
  return 0;
}
```