user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<print_spectrum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  lea    D148(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D71(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x30(%rbp)
  jmp    L42
L99:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jge    L68
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
L68:
  addl   $0x1,-0x30(%rbp)
L42:
  cmpl   $0xff,-0x30(%rbp)
  jle    L99
  movl   $0x1,-0x30(%rbp)
  jmp    L28
L2:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L90
  mov    -0x30(%rbp),%eax
  mov    %eax,%esi
  lea    D96(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   $0x3c,%eax,%eax
  cltd
  idivl  -0x24(%rbp)
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L18
L87:
  mov    $0x6f,%edi
  call   <putchar@plt>
  addl   $0x1,-0x2c(%rbp)
L18:
  mov    -0x2c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L87
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D81(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   -0x30(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x1c(%rbp)
  jmp    L34
L90:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L12
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x20(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x1c(%rbp),%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  je     L54
  lea    D123(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L82
L54:
  lea    D138(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L82:
  movsd  -0x8(%rbp),%xmm1
  movsd  D154(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D67(%rip),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x8(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x28(%rbp),%xmm1
  movsd  D154(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D67(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x28(%rbp),%eax
  movq   %rdx,%xmm0
  mov    %eax,%esi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  D154(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D67(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x18(%rbp),%eax
  movq   %rdx,%xmm0
  mov    %eax,%esi
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x18(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x28(%rbp),%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L23
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x28(%rbp),%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L23:
  movsd  -0x10(%rbp),%xmm1
  movsd  D89(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L12:
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x28(%rbp)
L34:
  addl   $0x1,-0x30(%rbp)
L28:
  cmpl   $0x63,-0x30(%rbp)
  jle    L2
  nop
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D148
datatype: string
name: extract_symbolic_data
arguments: tag: D71
datatype: string
name: extract_symbolic_data
arguments: tag: D96
datatype: string
name: extract_symbolic_data
arguments: tag: D81
datatype: string
name: extract_symbolic_data
arguments: tag: D123
datatype: string
name: extract_symbolic_data
arguments: tag: D138
datatype: string
name: extract_symbolic_data
arguments: tag: D154
datatype: f64
name: extract_symbolic_data
arguments: tag: D67
datatype: f32[2]
name: extract_symbolic_data
arguments: tag: D28
datatype: string
name: extract_symbolic_data
arguments: tag: D59
datatype: string
name: extract_symbolic_data
arguments: tag: D152
datatype: string
name: extract_symbolic_data
arguments: tag: D89
datatype: f32[2]
name: extract_symbolic_data
arguments: tag: D52
datatype: string

tool: D148: -------------------------------------------------------------------------------

tool: D71: %s:


tool: D96: %3d 

tool: D81:  %d


tool: D123: pulse 

tool: D138: pause 

tool: D154: 1000000

tool: {"D67": [0.0,6.41552734375]}

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

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

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

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

tool: D52: tol: %4.1f%%


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 < 100; 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)15000);
        printf("min: %2d=%6.1f us, ", min, (1000000. * min) / (float)15000);
        printf("max: %2d=%6.1f us, ", max, (1000000. * max) / (float)15000);
        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;
    }
  }
}
```