user: Demonstrate the C code that generates the assembly output below:

```asm
<arch__cpuinfo_freq>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  lea    D11(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  lea    D86(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  call   <fopen@plt>
  test   %rax,%rax
  je     L35
  mov    %rax,%rbp
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbx
  lea    D72(%rip),%r13
  nopl   0x0(%rax)
L4:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jle    L41
  mov    0x18(%rsp),%rdi
  mov    $0x5,%edx
  mov    %r13,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L4
  mov    0x18(%rsp),%r14
  lea    D21(%rip),%rsi
  mov    %r14,%rdi
  call   <strcspn@plt>
  mov    0x8(%rsp),%rdx
  mov    %r15,%rcx
  lea    D103(%rip),%rsi
  cltq
  lea    0x1(%r14,%rax,1),%rdi
  call   <sscanf@plt>
  cmp    $0x2,%eax
  jne    L4
  lea    D45(%rip),%rsi
  mov    %r15,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L89
  mov    0x8(%rsp),%rax
  movsd  D62(%rip),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
L41:
  lea    D5(%rip),%r13
  lea    D12(%rip),%r14
  nopl   0x0(%rax)
L102:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jle    L26
  mov    0x18(%rsp),%rdi
  mov    $0x6,%edx
  mov    %r13,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L102
  mov    0x18(%rsp),%rdi
  mov    $0x3a,%esi
  call   <strchr@plt>
  mov    %rax,%rdx
  sub    0x18(%rsp),%rdx
  add    $0x2,%rdx
  cmp    0x20(%rsp),%rdx
  jae    L102
  lea    0x2(%rax),%rdi
  mov    $0x7,%edx
  mov    %r14,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L102
  xor    %r12d,%r12d
  jmp    L49
  nopw   0x0(%rax,%rax,1)
L26:
  mov    $0xffffffff,%r12d
L49:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
L2:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L89:
  lea    D101(%rip),%rsi
  mov    %r15,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L41
  mov    0x8(%rsp),%rax
  movsd  D3(%rip),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L41
L35:
  mov    $0xffffffff,%r12d
  jmp    L2
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D11
type: string
name: read_data
arguments: label: D86
type: string
name: read_data
arguments: label: D72
type: string
name: read_data
arguments: label: D21
type: string
name: read_data
arguments: label: D103
type: string
name: read_data
arguments: label: D45
type: string
name: read_data
arguments: label: D62
type: byte[8]
name: read_data
arguments: label: D5
type: string
name: read_data
arguments: label: D12
type: string
name: read_data
arguments: label: D101
type: string
name: read_data
arguments: label: D3
type: byte[8]

tool: D11: r

tool: D86: /proc/cpuinfo

tool: D72: clock

tool: D21: :

tool: D103: %lf%10s

tool: D45: GHz

tool: {"D62": [0x00,0x00,0x00,0x00,0x65,0xcd,0xcd,0x41]}

tool: D5: platform

tool: D12: pSeries

tool: D101: MHz

tool: {"D3": [0x00,0x00,0x00,0x00,0x80,0x84,0x2e,0x41]}

assistant: ```c
int arch__cpuinfo_freq(double *freq, char *unit) {
  FILE *f;
  char *line = NULL, *c;
  size_t len = 0;
  int ret = -1;
  if ((f = fopen("/proc/cpuinfo", "r")) == NULL) {
    return -1;
  }
  while (getline(&line, &len, f) > 0) {
    if (strncmp(line, "clock", sizeof("clock") - 1)) {
      continue;
    }
    if (sscanf(line + strcspn(line, ":") + 1, "%lf%10s", freq, unit) == 2) {
      if (strcasecmp(unit, "GHz") == 0) {
        *freq *= 1000000000;
      } else if (strcasecmp(unit, "MHz") == 0) {
        *freq *= 1000000;
      }
      break;
    }
  }
  while (getline(&line, &len, f) > 0) {
    if (strncmp(line, "platform", sizeof("sizeof") - 1)) {
      continue;
    }
    c = strchr(line, ':');
    if (c - line + 2 < len && !strncmp(c + 2, "pSeries", sizeof("pSeries") - 1)) {
      ret = 0;
      break;
    }
  }
  free(line);
  fclose(f);
  return ret;
}
```