user: 请从给定的汇编指令推导出C源代码：

```asm
<getmeminfo>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x4b8,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x4a8(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rdi)
  movl   $0x0,(%rsi)
  lea    D37(%rip),%rsi
  lea    D2(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  lea    D29(%rip),%r15
  lea    D42(%rip),%r14
L82:
  lea    D9(%rip),%r13
  jmp    L42
L88:
  lea    0x60(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    0x18(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    %ebx,%eax
  shl    $0xa,%eax
  test   %rdx,%rdx
  cmove  %eax,%ebx
  mov    0x8(%rsp),%rax
  mov    %ebx,(%rax)
  jmp    L62
L28:
  lea    0x60(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    0x18(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    %ebx,%eax
  shl    $0xa,%eax
  test   %rdx,%rdx
  cmove  %eax,%ebx
  add    %ebx,0x0(%rbp)
  jmp    L83
L57:
  lea    0x20(%rsp),%rsi
  lea    D66(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L103
L42:
  lea    0xa0(%rsp),%rdi
  mov    %r12,%rdx
  mov    $0x400,%esi
  call   <fgets@plt>
  test   %rax,%rax
  je     L105
  movb   $0x0,0x20(%rsp)
  movb   $0x0,0x60(%rsp)
  movb   $0x0,0x18(%rsp)
  lea    0x60(%rsp),%rcx
  lea    0x20(%rsp),%rbx
  lea    0xa0(%rsp),%rdi
  lea    0x18(%rsp),%r8
  mov    %rbx,%rdx
  mov    %r15,%rsi
  call   <sscanf@plt>
  mov    %rbx,%rsi
  lea    D68(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L88
L62:
  lea    0x20(%rsp),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L28
L83:
  lea    0x20(%rsp),%rsi
  lea    D45(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L57
  lea    0x60(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    0x18(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    %ebx,%eax
  shl    $0xa,%eax
  test   %rdx,%rdx
  cmove  %eax,%ebx
  add    %ebx,0x0(%rbp)
  jmp    L57
L103:
  lea    0x60(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    0x18(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    %ebx,%eax
  shl    $0xa,%eax
  test   %rdx,%rdx
  cmove  %eax,%ebx
  add    %ebx,0x0(%rbp)
  jmp    L82
L105:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0x4a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L50
  mov    $0x0,%eax
  add    $0x4b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D37
data_type: string
name: retrieve_data
arguments: data_label: D2
data_type: string
name: retrieve_data
arguments: data_label: D29
data_type: string
name: retrieve_data
arguments: data_label: D42
data_type: string
name: retrieve_data
arguments: data_label: D9
data_type: string
name: retrieve_data
arguments: data_label: D66
data_type: string
name: retrieve_data
arguments: data_label: D68
data_type: string
name: retrieve_data
arguments: data_label: D45
data_type: string

tool: D37: r

tool: D2: /proc/meminfo

tool: D29: %s%s%s

tool: D42: kB

tool: D9: MemFree:

tool: D66: Cached:

tool: D68: MemTotal:

tool: D45: Buffers:

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);
}
```