user: Converte this assembly snippet into its equivalent C code:

```asm
<print_environment>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xe18(%rsp)
  xor    %eax,%eax
  lea    D11(%rip),%rsi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,0xc(%rsp)
  lea    0xc(%rsp),%rdi
  call   <ctime@plt>
  mov    %rax,%rsi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  movq   $0x0,0x88(%rsp)
  movq   $0x0,0x90(%rsp)
  movq   $0x0,0x98(%rsp)
  movq   $0x0,0xa0(%rsp)
  movq   $0x0,0xa8(%rsp)
  movq   $0x0,0xb0(%rsp)
  movq   $0x0,0xb8(%rsp)
  movq   $0x0,0xc0(%rsp)
  movq   $0x0,0xc8(%rsp)
  movq   $0x0,0xd0(%rsp)
  movq   $0x0,0xd8(%rsp)
  movq   $0x0,0xe0(%rsp)
  movq   $0x0,0xe8(%rsp)
  movq   $0x0,0xf0(%rsp)
  movq   $0x0,0xf8(%rsp)
  movq   $0x0,0x100(%rsp)
  movq   $0x0,0x108(%rsp)
  movq   $0x0,0x110(%rsp)
  movq   $0x0,0x118(%rsp)
  movq   $0x0,0x120(%rsp)
  movq   $0x0,0x128(%rsp)
  movq   $0x0,0x130(%rsp)
  movq   $0x0,0x138(%rsp)
  movq   $0x0,0x140(%rsp)
  movq   $0x0,0x148(%rsp)
  movq   $0x0,0x150(%rsp)
  movq   $0x0,0x158(%rsp)
  movq   $0x0,0x160(%rsp)
  movq   $0x0,0x168(%rsp)
  movq   $0x0,0x170(%rsp)
  movq   $0x0,0x178(%rsp)
  movq   $0x0,0x180(%rsp)
  movq   $0x0,0x188(%rsp)
  movq   $0x0,0x190(%rsp)
  movq   $0x0,0x198(%rsp)
  movq   $0x0,0x1a0(%rsp)
  movq   $0x0,0x1a8(%rsp)
  movq   $0x0,0x1b0(%rsp)
  movq   $0x0,0x1b8(%rsp)
  movq   $0x0,0x1c0(%rsp)
  movq   $0x0,0x1c8(%rsp)
  movq   $0x0,0x1d0(%rsp)
  movq   $0x0,0x1d8(%rsp)
  movq   $0x0,0x1e0(%rsp)
  movq   $0x0,0x1e8(%rsp)
  movq   $0x0,0x1f0(%rsp)
  movq   $0x0,0x1f8(%rsp)
  movq   $0x0,0x200(%rsp)
  movq   $0x0,0x208(%rsp)
  lea    D45(%rip),%rsi
  lea    D56(%rip),%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L75
  mov    %rax,%r12
  movq   $0x0,0x210(%rsp)
  movq   $0x0,0x218(%rsp)
  lea    0x220(%rsp),%rdi
  mov    $0x7e,%ecx
  mov    $0x0,%eax
  rep stos %rax,%es:(%rdi)
  mov    $0x0,%r15d
  lea    0x210(%rsp),%rbp
  mov    $0x0,%r14d
L39:
  mov    %r12,%rdx
  mov    $0x400,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L77
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L39
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x9,%eax
  jle    L39
  movq   $0x0,0x610(%rsp)
  movq   $0x0,0x618(%rsp)
  lea    0x620(%rsp),%rdi
  mov    $0x7e,%ecx
  mov    %r14,%rax
  rep stos %rax,%es:(%rdi)
  movq   $0x0,0xa10(%rsp)
  movq   $0x0,0xa18(%rsp)
  lea    0xa20(%rsp),%rdi
  mov    $0x7e,%ecx
  rep stos %rax,%es:(%rdi)
  lea    -0x1(%rbx),%rdx
  lea    0x610(%rsp),%r13
  sub    %ebp,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strncpy@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  lea    0x1(%rbx),%rsi
  lea    0xa10(%rsp),%rdi
  call   <strncpy@plt>
  mov    %r13,%rsi
  lea    D13(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L86
  add    $0x1,%r15d
  lea    0xa10(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L39
L86:
  lea    0x610(%rsp),%rsi
  lea    D55(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L39
  lea    0xa10(%rsp),%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  lea    0xa11(%rsp),%rsi
  lea    0x110(%rsp),%rdi
  call   <strncpy@plt>
  jmp    L39
L77:
  mov    %r12,%rdi
  call   <fclose@plt>
  lea    0x10(%rsp),%rdx
  mov    %r15d,%esi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x110(%rsp),%rsi
  lea    D74(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L75:
  mov    0xe18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L82
  add    $0xe28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L82:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D11
data_type: string
name: extract_symbolic_data
arguments: label: D2
data_type: string
name: extract_symbolic_data
arguments: label: D19
data_type: string
name: extract_symbolic_data
arguments: label: D45
data_type: string
name: extract_symbolic_data
arguments: label: D56
data_type: string
name: extract_symbolic_data
arguments: label: D13
data_type: string
name: extract_symbolic_data
arguments: label: D55
data_type: string
name: extract_symbolic_data
arguments: label: D40
data_type: string
name: extract_symbolic_data
arguments: label: D74
data_type: string

tool: D11: 1.1

tool: D2: BTreeDB:	version %s


tool: D19: Date:		%s

tool: D45: r

tool: D56: /proc/cpuinfo

tool: D13: model name

tool: D55: cache size

tool: D40: CPU:		%d * %s

tool: D74: CPUCache:	%s


assistant: ```c
void print_environment() {
  printf("BTreeDB:	version %s\n", "1.1");
  time_t now = time(NULL);
  printf("Date:		%s", (char *)ctime(&now));
  int num_cpus = 0;
  char cpu_type[256] = {0};
  char cache_size[256] = {0};
  FILE *cpuinfo = fopen("/proc/cpuinfo", "r");
  if (cpuinfo) {
    char line[1024] = {0};
    while (fgets(line, sizeof(line), cpuinfo) != NULL) {
      const char *sep = strchr(line, ':');
      if (sep == NULL || strlen(sep) < 10)
        continue;
      char key[1024] = {0};
      char val[1024] = {0};
      strncpy(key, line, sep - 1 - line);
      strncpy(val, sep + 1, strlen(sep) - 1);
      if (strcmp("model name", key) == 0) {
        num_cpus++;
        strcpy(cpu_type, val);
      } else if (strcmp("cache size", key) == 0) {
        strncpy(cache_size, val + 1, strlen(val) - 1);
      }
    }
    fclose(cpuinfo);
    printf("CPU:		%d * %s", num_cpus, cpu_type);
    printf("CPUCache:	%s\n", cache_size);
  }
}
```