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     L115
  movq   $0x0,(%rdi)
L115:
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  je     L135
  movq   $0x0,(%rax)
L135:
  lea    D37(%rip),%rsi
  lea    D12(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L71
  lea    0x1f(%rsp),%rax
  movq   $0x0,(%rsp)
  xor    %r12d,%r12d
  lea    0x20(%rsp),%rbp
  mov    %rax,0x8(%rsp)
  lea    D18(%rip),%r15
  nop
L95:
  mov    %r14,%rdx
  mov    $0x400,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L218
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x3fd,%eax
  ja     L177
  test   %eax,%eax
  je     L21
  movslq %eax,%rbx
  sub    $0x1,%eax
  lea    0x0(%rbp,%rbx,1),%r13
  add    0x8(%rsp),%rbx
  sub    %rax,%rbx
  jmp    L195
  nopl   (%rax)
L44:
  movb   $0x0,-0x1(%r13)
  sub    $0x1,%r13
  cmp    %rbx,%r13
  je     L21
L195:
  movzbl -0x1(%r13),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L44
L21:
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L137
  cmpb   $0x20,0x1(%rax)
  je     L187
  add    $0x1,%rbx
L137:
  mov    $0xa,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strncasecmp@plt>
  test   %eax,%eax
  jne    L59
  test   %r12,%r12
  je     L73
  mov    %r12,%rdi
  call   <xfree@plt>
L73:
  mov    %rbx,%rdi
  call   <xstrdup@plt>
  cmpq   $0x0,(%rsp)
  mov    %rax,%r12
  je     L95
L218:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x18(%rsp),%rax
  test   %rax,%rax
  je     L173
  mov    %r12,(%rax)
L213:
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  je     L99
  mov    (%rsp),%rcx
  mov    %rcx,(%rax)
L71:
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L94
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L59:
  mov    $0x7,%edx
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncasecmp@plt>
  test   %eax,%eax
  jne    L95
  mov    (%rsp),%rax
  test   %rax,%rax
  je     L83
  mov    %rax,%rdi
  call   <xfree@plt>
L83:
  mov    %rbx,%rdi
  call   <xstrdup@plt>
  mov    %rax,(%rsp)
  test   %r12,%r12
  je     L95
  jmp    L218
  nopw   0x0(%rax,%rax,1)
L187:
  add    $0x2,%rbx
  jmp    L137
L177:
  mov    %r14,%rdi
  call   <fclose@plt>
  jmp    L71
L173:
  mov    %r12,%rdi
  call   <xfree@plt>
  jmp    L213
L99:
  mov    (%rsp),%rdi
  call   <xfree@plt>
  jmp    L71
L94:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D37
data_type: string
name: unpack_data
arguments: label: D12
data_type: string
name: unpack_data
arguments: label: D18
data_type: string
name: unpack_data
arguments: label: D1
data_type: string

tool: D37: r

tool: D12: /proc/cpuinfo

tool: D18: model name

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