user: What would the C source look like for the assembly code provided here?

```asm
<print_spectrum>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  lea    D87(%rip),%rdi
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,0x18(%rsp)
  call   <puts@plt>
  mov    %rbp,%rsi
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rax
  lea    0x400(%r15),%rdx
  pxor   %xmm2,%xmm2
  nopw   0x0(%rax,%rax,1)
L73:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  por    %xmm0,%xmm2
  cmp    %rax,%rdx
  jne    L73
  movdqa %xmm2,%xmm1
  movl   $0x0,(%rsp)
  xor    %r14d,%r14d
  xor    %ebp,%ebp
  psrldq $0x8,%xmm1
  movdqa %xmm1,%xmm0
  pcmpgtd %xmm2,%xmm0
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movd   %xmm1,0x1c(%rsp)
  jmp    L7
  cs nopw 0x0(%rax,%rax,1)
L75:
  lea    D70(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  (%rsp),%xmm2
L26:
  movapd %xmm2,%xmm0
  mov    $0x2,%eax
  movsd  D6(%rip),%xmm1
  lea    D72(%rip),%rdi
  movsd  %xmm2,0x10(%rsp)
  mulsd  %xmm2,%xmm1
  divsd  D85(%rip),%xmm1
  call   <printf@plt>
  mov    %r13d,%esi
  pxor   %xmm3,%xmm3
  cvtsi2sd %r13d,%xmm3
  movsd  D6(%rip),%xmm0
  mov    $0x1,%eax
  lea    D45(%rip),%rdi
  mulsd  %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  divsd  D85(%rip),%xmm0
  call   <printf@plt>
  mov    %r14d,%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %r14d,%xmm1
  movsd  D6(%rip),%xmm0
  mov    $0x1,%eax
  lea    D78(%rip),%rdi
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  divsd  D85(%rip),%xmm0
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm3
  lea    D168(%rip),%rdi
  mov    $0x1,%eax
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movapd %xmm2,%xmm1
  subsd  %xmm3,%xmm1
  maxsd  %xmm0,%xmm1
  movsd  D80(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  divsd  %xmm2,%xmm0
  call   <printf@plt>
L87:
  add    $0x1,%r14
  movl   $0x0,(%rsp)
  lea    0x2(%rbx),%r13d
  xor    %ebp,%ebp
  cmp    $0x63,%r14
  je     L61
L7:
  mov    0x4(%r15,%r14,4),%edx
  lea    0x1(%r14),%eax
  mov    %r14d,%ebx
  mov    %eax,0x8(%rsp)
  test   %edx,%edx
  jg     L9
  test   %ebp,%ebp
  jle    L87
  pxor   %xmm2,%xmm2
  pxor   %xmm0,%xmm0
  mov    0x18(%rsp),%eax
  cvtsi2ssl (%rsp),%xmm2
  cvtsi2ss %ebp,%xmm0
  test   %eax,%eax
  divss  %xmm0,%xmm2
  cvtss2sd %xmm2,%xmm2
  movsd  %xmm2,(%rsp)
  jne    L75
  lea    D68(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  (%rsp),%xmm2
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L9:
  mov    %eax,%esi
  lea    D57(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%r15,%r14,4),%esi
  imul   $0x3c,%esi,%eax
  cltd
  idivl  0x1c(%rsp)
  mov    %eax,%ebx
  test   %eax,%eax
  jle    L65
  xor    %r12d,%r12d
  cs nopw 0x0(%rax,%rax,1)
L70:
  mov    $0x6f,%edi
  add    $0x1,%r12d
  call   <putchar@plt>
  cmp    %r12d,%ebx
  jne    L70
  mov    0x4(%r15,%r14,4),%esi
L65:
  lea    D44(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%r15,%r14,4),%eax
  mov    0x8(%rsp),%r12d
  add    $0x1,%r14
  imul   %eax,%r12d
  add    %eax,%ebp
  add    %r12d,(%rsp)
  cmp    $0x63,%r14
  jne    L7
L61:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D87
type: string
name: extract_symbolic_data
arguments: tag: D55
type: string
name: extract_symbolic_data
arguments: tag: D70
type: string
name: extract_symbolic_data
arguments: tag: D6
type: f64
name: extract_symbolic_data
arguments: tag: D72
type: string
name: extract_symbolic_data
arguments: tag: D85
type: f32[2]
name: extract_symbolic_data
arguments: tag: D45
type: string
name: extract_symbolic_data
arguments: tag: D78
type: string
name: extract_symbolic_data
arguments: tag: D168
type: string
name: extract_symbolic_data
arguments: tag: D80
type: f32[2]
name: extract_symbolic_data
arguments: tag: D68
type: string
name: extract_symbolic_data
arguments: tag: D57
type: string
name: extract_symbolic_data
arguments: tag: D44
type: string

tool: D87: -------------------------------------------------------------------------------

tool: D55: %s:


tool: D70: pulse 

tool: D6: 1000000

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

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

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

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

tool: D168: tol: %4.1f%%


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

tool: D68: pause 

tool: D57: %3d 

tool: D44:  %d


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;
    }
  }
}
```