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

```asm
<getmeminfo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x4c0,%rsp
  mov    %rdi,-0x4b8(%rbp)
  mov    %rsi,-0x4c0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x4b8(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x4c0(%rbp),%rax
  movl   $0x0,(%rax)
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x4a0(%rbp)
  jmp    L66
L98:
  movb   $0x0,-0x490(%rbp)
  movb   $0x0,-0x450(%rbp)
  movb   $0x0,-0x498(%rbp)
  lea    -0x498(%rbp),%rsi
  lea    -0x450(%rbp),%rcx
  lea    -0x490(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rsi,%r8
  lea    D58(%rip),%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  lea    -0x490(%rbp),%rax
  mov    %rax,%rsi
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L75
  lea    -0x450(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x4a4(%rbp)
  lea    -0x498(%rbp),%rax
  mov    %rax,%rsi
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L35
  shll   $0xa,-0x4a4(%rbp)
L35:
  mov    -0x4b8(%rbp),%rax
  mov    -0x4a4(%rbp),%edx
  mov    %edx,(%rax)
L75:
  lea    -0x490(%rbp),%rax
  mov    %rax,%rsi
  lea    D74(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L29
  lea    -0x450(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x4a4(%rbp)
  lea    -0x498(%rbp),%rax
  mov    %rax,%rsi
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L25
  shll   $0xa,-0x4a4(%rbp)
L25:
  mov    -0x4c0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4a4(%rbp),%eax
  add    %eax,%edx
  mov    -0x4c0(%rbp),%rax
  mov    %edx,(%rax)
L29:
  lea    -0x490(%rbp),%rax
  mov    %rax,%rsi
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L23
  lea    -0x450(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x4a4(%rbp)
  lea    -0x498(%rbp),%rax
  mov    %rax,%rsi
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L94
  shll   $0xa,-0x4a4(%rbp)
L94:
  mov    -0x4c0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4a4(%rbp),%eax
  add    %eax,%edx
  mov    -0x4c0(%rbp),%rax
  mov    %edx,(%rax)
L23:
  lea    -0x490(%rbp),%rax
  mov    %rax,%rsi
  lea    D102(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L66
  lea    -0x450(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x4a4(%rbp)
  lea    -0x498(%rbp),%rax
  mov    %rax,%rsi
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L109
  shll   $0xa,-0x4a4(%rbp)
L109:
  mov    -0x4c0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4a4(%rbp),%eax
  add    %eax,%edx
  mov    -0x4c0(%rbp),%rax
  mov    %edx,(%rax)
L66:
  mov    -0x4a0(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L98
  mov    -0x4a0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D90
type: string
name: read_data
arguments: data_label: D103
type: string
name: read_data
arguments: data_label: D58
type: string
name: read_data
arguments: data_label: D43
type: string
name: read_data
arguments: data_label: D100
type: string
name: read_data
arguments: data_label: D74
type: string
name: read_data
arguments: data_label: D76
type: string
name: read_data
arguments: data_label: D102
type: string

tool: D90: r

tool: D103: /proc/meminfo

tool: D58: %s%s%s

tool: D43: MemTotal:

tool: D100: kB

tool: D74: MemFree:

tool: D76: Buffers:

tool: D102: Cached:

assistant: ```c
int getmeminfo(uint64_t *size, uint64_t *free) {
  FILE *f;
  char key[64];
  char val[64];
  char unit[8];
  char buff[1024];
  uint64_t data;
  *size = 0;
  *free = 0;
  f = fopen("/proc/meminfo", "r");
  while (fgets(buff, sizeof(buff), f)) {
    key[0] = 0;
    val[0] = 0;
    unit[0] = 0;
    sscanf(buff, "%s%s%s", key, val, unit);
    if (strcmp("MemTotal:", key) == 0) {
      data = atoi(val);
      if (strcmp("kB", unit) == 0) {
        data *= 1024;
      }
      *size = data;
    }
    if (strcmp("MemFree:", key) == 0) {
      data = atoi(val);
      if (strcmp("kB", unit) == 0) {
        data *= 1024;
      }
      *free += data;
    }
    if (strcmp("Buffers:", key) == 0) {
      data = atoi(val);
      if (strcmp("kB", unit) == 0) {
        data *= 1024;
      }
      *free += data;
    }
    if (strcmp("Cached:", key) == 0) {
      data = atoi(val);
      if (strcmp("kB", unit) == 0) {
        data *= 1024;
      }
      *free += data;
    }
  }
  fclose(f);
  return (0);
}
```