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

```asm
<count_freq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x4000(%rsp),%r11
L98:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L98
  sub    $0x50,%rsp
  mov    %rdi,-0x4028(%rbp)
  mov    %rsi,-0x4030(%rbp)
  mov    %edx,-0x4034(%rbp)
  mov    %ecx,-0x4038(%rbp)
  mov    %r8,-0x4040(%rbp)
  mov    %r9,-0x4048(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x4038(%rbp),%eax
  sub    -0x4034(%rbp),%eax
  mov    %eax,-0x4018(%rbp)
  cmpl   $0x0,-0x4018(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  movl   $0x0,-0x401c(%rbp)
  jmp    L109
L88:
  mov    -0x401c(%rbp),%eax
  cltq
  movl   $0x0,-0x4010(%rbp,%rax,4)
  addl   $0x1,-0x401c(%rbp)
L109:
  cmpl   $0xfff,-0x401c(%rbp)
  jle    L88
  movl   $0x0,-0x401c(%rbp)
  jmp    L87
L36:
  mov    -0x4048(%rbp),%rcx
  mov    -0x4040(%rbp),%rax
  mov    -0x4030(%rbp),%r8
  mov    0x10(%rbp),%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%r8
  mov    %eax,-0x4014(%rbp)
  mov    -0x4014(%rbp),%eax
  cmp    -0x4034(%rbp),%eax
  jl     L99
  mov    -0x4014(%rbp),%eax
  cmp    -0x4038(%rbp),%eax
  jg     L99
  mov    -0x4014(%rbp),%eax
  sub    -0x4034(%rbp),%eax
  shl    $0xc,%eax
  cltd
  idivl  -0x4018(%rbp)
  mov    %eax,%ecx
  movslq %ecx,%rax
  mov    -0x4010(%rbp,%rax,4),%eax
  lea    0x1(%rax),%edx
  movslq %ecx,%rax
  mov    %edx,-0x4010(%rbp,%rax,4)
  jmp    L46
L99:
  nop
L46:
  addl   $0x1,-0x401c(%rbp)
L87:
  cmpl   $0x1ffff,-0x401c(%rbp)
  jle    L36
  movl   $0x0,-0x401c(%rbp)
  jmp    L86
L28:
  mov    -0x401c(%rbp),%eax
  cltq
  mov    -0x4010(%rbp,%rax,4),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D24(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rcx
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4034(%rbp),%xmm1
  mov    -0x4018(%rbp),%eax
  imul   -0x401c(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D1(%rip),%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x4028(%rbp),%rax
  movq   %rcx,%xmm0
  lea    D22(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0x401c(%rbp)
L86:
  cmpl   $0xfff,-0x401c(%rbp)
  jle    L28
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L100
  call   <__stack_chk_fail@plt>
L100:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D24
type_infered: f32[2]
name: parse_data
arguments: data_label: D1
type_infered: f32[2]
name: parse_data
arguments: data_label: D22
type_infered: string

tool: {"D24": [0.0,8.0]}

tool: {"D1": [0.0,5.5]}

tool: D22: %.12f %.12f


assistant: ```c
void count_freq(FILE *fout, int (*pdist)(double *, int *, int), int lcutoff, int rcutoff, double *prob_accum, int *energy, int nsample) {
  int i;
  int freq[(1 << 12)];
  int rand_nr;
  int range = rcutoff - lcutoff;
  assert(range > 0);
  srand(time(NULL));
  for (i = 0; i < (1 << 12); i++)
    freq[i] = 0.0;
  for (i = 0; i < (1 << 17); i++) {
    rand_nr = pdist(prob_accum, energy, nsample);
    if ((rand_nr < lcutoff) || (rand_nr > rcutoff))
      continue;
    freq[(rand_nr - lcutoff) * (1 << 12) / range]++;
  }
  for (i = 0; i < (1 << 12); i++) {
    fprintf(fout, "%.12f %.12f\n", lcutoff + (double)(range * i) / (double)(1 << 12), ((double)freq[i] / (double)(1 << 17)));
  }
}
```