user: Translate the below assembly code into C programming language:

```asm
<get_flags>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x50(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x58(%rbp),%rax
  movq   $0x0,(%rax)
  cmpq   $0x0,-0x48(%rbp)
  je     L86
  mov    -0x48(%rbp),%rax
  lea    D25(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x28(%rbp)
  jmp    L25
L86:
  lea    D25(%rip),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x28(%rbp)
L25:
  cmpq   $0x0,-0x28(%rbp)
  je     L66
  movq   $0x0,-0x38(%rbp)
  jmp    L79
L113:
  mov    -0x38(%rbp),%rbx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  sub    $0x1,%rax
  add    %rbx,%rax
  movb   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strtrim@plt>
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L10
  jmp    L79
L10:
  mov    -0x38(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L34
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <get_value@plt>
  mov    %eax,%edi
  call   <xstrdup@plt>
  mov    -0x50(%rbp),%rdx
  mov    %rax,(%rdx)
  jmp    L79
L34:
  mov    -0x38(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L31
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <get_value@plt>
  mov    %eax,%edi
  call   <xstrdup@plt>
  mov    -0x58(%rbp),%rdx
  mov    %rax,(%rdx)
  jmp    L79
L31:
  nop
L79:
  mov    -0x28(%rbp),%rdx
  lea    -0x30(%rbp),%rcx
  lea    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getline@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jns    L113
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  jmp    L125
L66:
  nop
L125:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L78
  call   <__stack_chk_fail@plt>
L78:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D25
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D19
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D4
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D3
type_guessed: string

tool: D25: r

tool: D19: /etc/pkgmk.conf

tool: D4: CFLAGS

tool: D3: CXXFLAGS

assistant: ```c
void get_flags(const char *filename, char **cflags, char **cxxflags) {
  FILE *file;
  char *line, *token;
  size_t n;
  int nread;
  *cflags = NULL;
  *cxxflags = NULL;
  if (filename != NULL)
    file = fopen(filename, "r");
  else
    file = fopen("/etc/pkgmk.conf", "r");
  if (file == NULL)
    return;
  line = 0;
  while ((nread = getline(&line, &n, file)) >= 0) {
    *(line + strlen(line) - 1) = 0;
    strtrim(line);
    if (*line == '#')
      continue;
    if ((token = strstr(line, "CFLAGS")) != NULL) {
      free(*cflags);
      *cflags = xstrdup(get_value(token));
    } else if ((token = strstr(line, "CXXFLAGS")) != NULL) {
      free(*cxxflags);
      *cxxflags = xstrdup(get_value(line));
    } else
      continue;
  }
  free(line);
  fclose(file);
}
```