user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<cpu_get_performance_info>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L216
  movq   $0x0,(%rdi)
L216:
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  je     L83
  movq   $0x0,(%rax)
L83:
  lea    D14(%rip),%rsi
  lea    D30(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L46
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  lea    0x20(%rsp),%r12
  lea    0x1f(%rsp),%rax
  mov    %rax,0x8(%rsp)
  jmp    L11
L230:
  add    $0x2,%rbx
  jmp    L108
L131:
  mov    %rbx,%rdi
  call   <xstrdup@plt>
  mov    %rax,%r13
  test   %r14,%r14
  jne    L75
L11:
  mov    %r15,%rdx
  mov    $0x400,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L75
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0x3fd,%eax
  ja     L228
  test   %eax,%eax
  jle    L52
  movslq %eax,%rbp
  lea    (%r12,%rbp,1),%rbx
  add    0x8(%rsp),%rbp
  lea    -0x1(%rax),%eax
  sub    %rax,%rbp
L154:
  movzbl -0x1(%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L52
  movb   $0x0,-0x1(%rbx)
  sub    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L154
L52:
  mov    $0x3a,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L108
  cmpb   $0x20,0x1(%rax)
  je     L230
  add    $0x1,%rbx
L108:
  mov    $0xa,%edx
  lea    D7(%rip),%rsi
  mov    %r12,%rdi
  call   <strncasecmp@plt>
  test   %eax,%eax
  jne    L185
  test   %r13,%r13
  je     L131
  mov    %r13,%rdi
  call   <xfree@plt>
  jmp    L131
L185:
  mov    $0x7,%edx
  lea    D9(%rip),%rsi
  mov    %r12,%rdi
  call   <strncasecmp@plt>
  test   %eax,%eax
  jne    L11
  test   %r14,%r14
  je     L120
  mov    %r14,%rdi
  call   <xfree@plt>
L120:
  mov    %rbx,%rdi
  call   <xstrdup@plt>
  mov    %rax,%r14
  test   %r13,%r13
  je     L11
L75:
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    0x18(%rsp),%rax
  test   %rax,%rax
  je     L130
  mov    %r13,(%rax)
L126:
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  je     L111
  mov    %r14,(%rax)
L46:
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L130:
  mov    %r13,%rdi
  call   <xfree@plt>
  jmp    L126
L111:
  mov    %r14,%rdi
  call   <xfree@plt>
  jmp    L46
L228:
  mov    %r15,%rdi
  call   <fclose@plt>
  jmp    L46
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D14
type_infered: string
name: read_data
arguments: data_label: D30
type_infered: string
name: read_data
arguments: data_label: D7
type_infered: string
name: read_data
arguments: data_label: D9
type_infered: string

tool: D14: r

tool: D30: /proc/cpuinfo

tool: D7: model name

tool: D9: cpu mhz

assistant: ```c
void cpu_get_performance_info(unsigned char **p_model, unsigned char **p_mhz) {
  FILE *f = NULL;
  unsigned char buf[1024];
  unsigned char *model = NULL;
  unsigned char *mhz = NULL;
  if (p_model)
    *p_model = NULL;
  if (p_mhz)
    *p_mhz = NULL;
  if (!(f = fopen("/proc/cpuinfo", "r")))
    goto failure;
  while (fgets(buf, sizeof(buf), f)) {
    int buflen = strlen(buf);
    if (buflen > sizeof(buf) - 3)
      goto failure;
    while (buflen > 0 && isspace(buf[buflen - 1]))
      buf[--buflen] = 0;
    unsigned char *s = strchr(buf, ':');
    if (s && s[1] == ' ')
      s += 2;
    else if (s)
      ++s;
    if (!strncasecmp(buf, "model name", 10)) {
      if (model)
        xfree(model);
      model = xstrdup(s);
      if (mhz)
        break;
    } else if (!strncasecmp(buf, "cpu mhz", 7)) {
      if (mhz)
        xfree(mhz);
      mhz = xstrdup(s);
      if (model)
        break;
    }
  }
  fclose(f);
  if (p_model)
    *p_model = model;
  else
    xfree(model);
  if (p_mhz)
    *p_mhz = mhz;
  else
    xfree(mhz);
  return;
failure:
  if (f)
    fclose(f);
}
```