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

```asm
<print_spectrum>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r15
  mov    %edx,0x1c(%rsp)
  lea    D94(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rsi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15,%rax
  lea    0x400(%r15),%rcx
  mov    $0x0,%r12d
L21:
  mov    (%rax),%edx
  cmp    %edx,%r12d
  cmovl  %edx,%r12d
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L21
  mov    $0x1,%ebx
  mov    $0x0,%r14d
  movl   $0x0,(%rsp)
  jmp    L87
L56:
  mov    %ebx,%esi
  lea    D55(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  imul   $0x3c,(%r15,%rbx,4),%eax
  cltd
  idiv   %r12d
  mov    %eax,%r13d
  test   %eax,%eax
  jle    L22
  mov    $0x0,%ebp
L78:
  mov    $0x6f,%edi
  call   <putchar@plt>
  add    $0x1,%ebp
  cmp    %ebp,%r13d
  jne    L78
L22:
  mov    (%r15,%rbx,4),%esi
  lea    D83(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    (%r15,%rbx,4),%edx
  mov    0x8(%rsp),%eax
  imul   %edx,%eax
  add    %eax,(%rsp)
  add    %edx,%r14d
  jmp    L24
L89:
  lea    D140(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L51:
  lea    -0x1(%rbp),%r13d
  movsd  (%rsp),%xmm2
  movapd %xmm2,%xmm1
  mulsd  D47(%rip),%xmm1
  divsd  D58(%rip),%xmm1
  movapd %xmm2,%xmm0
  lea    D92(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  mov    0x10(%rsp),%esi
  pxor   %xmm5,%xmm5
  cvtsi2sd %esi,%xmm5
  movsd  %xmm5,0x8(%rsp)
  movapd %xmm5,%xmm6
  mulsd  D47(%rip),%xmm6
  movapd %xmm6,%xmm0
  divsd  D58(%rip),%xmm0
  lea    D26(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm3,%xmm3
  cvtsi2sd %r13d,%xmm3
  movsd  %xmm3,0x10(%rsp)
  movapd %xmm3,%xmm4
  mulsd  D47(%rip),%xmm4
  movapd %xmm4,%xmm0
  divsd  D58(%rip),%xmm0
  mov    %r13d,%esi
  lea    D56(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  (%rsp),%xmm2
  subsd  %xmm2,%xmm3
  movapd %xmm2,%xmm1
  subsd  0x8(%rsp),%xmm1
  maxsd  %xmm3,%xmm1
  movapd %xmm1,%xmm0
  mulsd  D115(%rip),%xmm0
  divsd  %xmm2,%xmm0
  lea    D137(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L80:
  lea    0x1(%rbp),%eax
  mov    %eax,0x10(%rsp)
  mov    $0x0,%r14d
  movl   $0x0,(%rsp)
L24:
  add    $0x1,%rbx
  cmp    $0xc8,%rbx
  je     L98
L87:
  mov    %ebx,%ebp
  mov    %ebx,0x8(%rsp)
  cmpl   $0x0,(%r15,%rbx,4)
  jg     L56
  test   %r14d,%r14d
  jle    L80
  pxor   %xmm0,%xmm0
  cvtsi2ssl (%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r14d,%xmm1
  divss  %xmm1,%xmm0
  pxor   %xmm7,%xmm7
  cvtss2sd %xmm0,%xmm7
  movsd  %xmm7,(%rsp)
  cmpl   $0x0,0x1c(%rsp)
  je     L89
  lea    D87(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L51
L98:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D94
datatype: string
name: extract_symbolic_data
arguments: label: D19
datatype: string
name: extract_symbolic_data
arguments: label: D55
datatype: string
name: extract_symbolic_data
arguments: label: D83
datatype: string
name: extract_symbolic_data
arguments: label: D140
datatype: string
name: extract_symbolic_data
arguments: label: D47
datatype: f64
name: extract_symbolic_data
arguments: label: D58
datatype: f32[2]
name: extract_symbolic_data
arguments: label: D92
datatype: string
name: extract_symbolic_data
arguments: label: D26
datatype: string
name: extract_symbolic_data
arguments: label: D56
datatype: string
name: extract_symbolic_data
arguments: label: D115
datatype: f32[2]
name: extract_symbolic_data
arguments: label: D137
datatype: string
name: extract_symbolic_data
arguments: label: D87
datatype: string

tool: D94: -------------------------------------------------------------------------------

tool: D19: %s:


tool: D55: %3d 

tool: D83:  %d


tool: D140: pause 

tool: D47: 1000000

tool: {"D58": [0.0,6.6103515625]}

tool: D92: avg: %4.1f=%6.1f us, 

tool: D26: min: %2d=%6.1f us, 

tool: D56: max: %2d=%6.1f us, 

tool: {"D115": [0.0,3.390625]}

tool: D137: tol: %4.1f%%


tool: D87: pulse 

assistant: ```c
void print_spectrum(char *text, int *buf, int is_pulse) {
  int i;
  int j;
  int min;
  int max;
  int max_value = 0;
  int value;
  int sum = 0;
  int counter = 0;
  double average = 0;
  double tolerance;
  puts("-------------------------------------------------------------------------------");
  printf("%s:\n", text);
  for (i = 0; i < 256; i++) {
    if (buf[i] > max_value) {
      max_value = buf[i];
    }
  }
  for (i = 1; i < 200; i++) {
    if (buf[i] > 0) {
      printf("%3d ", i);
      value = (buf[i] * 60) / max_value;
      for (j = 0; j < value; j++) {
        putchar('o');
      }
      printf(" %d\n", buf[i]);
      sum += i * buf[i];
      counter += buf[i];
    } else {
      max = i - 1;
      if (counter > 0) {
        average = (float)sum / (float)counter;
        if (is_pulse) {
          printf("pulse ");
        } else {
          printf("pause ");
        }
        printf("avg: %4.1f=%6.1f us, ", average, (1000000. * average) / (float)20000);
        printf("min: %2d=%6.1f us, ", min, (1000000. * min) / (float)20000);
        printf("max: %2d=%6.1f us, ", max, (1000000. * max) / (float)20000);
        tolerance = (max - average);
        if (average - min > tolerance) {
          tolerance = average - min;
        }
        tolerance = tolerance * 100 / average;
        printf("tol: %4.1f%%\n", tolerance);
      }
      counter = 0;
      sum = 0;
      min = i + 1;
    }
  }
}
```