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    D38(%rip),%rdi
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,0x18(%rsp)
  call   <puts@plt>
  mov    %rbp,%rsi
  lea    D122(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rax
  lea    0x400(%r15),%rdx
  pxor   %xmm2,%xmm2
  nopw   0x0(%rax,%rax,1)
L2:
  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    L2
  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    L86
  cs nopw 0x0(%rax,%rax,1)
L51:
  lea    D78(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  (%rsp),%xmm2
L21:
  movapd %xmm2,%xmm0
  mov    $0x2,%eax
  movsd  D20(%rip),%xmm1
  lea    D114(%rip),%rdi
  movsd  %xmm2,0x10(%rsp)
  mulsd  %xmm2,%xmm1
  divsd  D152(%rip),%xmm1
  call   <printf@plt>
  mov    %r13d,%esi
  pxor   %xmm3,%xmm3
  cvtsi2sd %r13d,%xmm3
  movsd  D20(%rip),%xmm0
  mov    $0x1,%eax
  lea    D119(%rip),%rdi
  mulsd  %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  divsd  D152(%rip),%xmm0
  call   <printf@plt>
  mov    %r14d,%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %r14d,%xmm1
  movsd  D20(%rip),%xmm0
  mov    $0x1,%eax
  lea    D81(%rip),%rdi
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  divsd  D152(%rip),%xmm0
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm3
  lea    D46(%rip),%rdi
  mov    $0x1,%eax
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movapd %xmm2,%xmm1
  subsd  %xmm3,%xmm1
  maxsd  %xmm0,%xmm1
  movsd  D95(%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    $0xc7,%r14
  je     L80
L86:
  mov    0x4(%r15,%r14,4),%edx
  lea    0x1(%r14),%eax
  mov    %r14d,%ebx
  mov    %eax,0x8(%rsp)
  test   %edx,%edx
  jg     L75
  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    L51
  lea    D79(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  (%rsp),%xmm2
  jmp    L21
  nopl   (%rax)
L75:
  mov    %eax,%esi
  lea    D102(%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    L27
  xor    %r12d,%r12d
  cs nopw 0x0(%rax,%rax,1)
L9:
  mov    $0x6f,%edi
  add    $0x1,%r12d
  call   <putchar@plt>
  cmp    %r12d,%ebx
  jne    L9
  mov    0x4(%r15,%r14,4),%esi
L27:
  lea    D113(%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    $0xc7,%r14
  jne    L86
L80:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D38
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D122
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D78
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D20
type_guessed: f64
name: extract_symbolic_data
arguments: data_label: D114
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D152
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_label: D119
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D81
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D46
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D95
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_label: D79
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D102
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D113
type_guessed: string

tool: D38: -------------------------------------------------------------------------------

tool: D122: %s:


tool: D78: pulse 

tool: D20: 1000000

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

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

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

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

tool: D46: tol: %4.1f%%


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

tool: D79: pause 

tool: D102: %3d 

tool: D113:  %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 < 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;
    }
  }
}
```