user: Translate the below assembly code into C programming language:

```asm
<linweights>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebp
  mov    %rdx,%rbx
  mov    %rcx,%r12
  mov    %r8,%r14
  pxor   %xmm5,%xmm5
  cvtsi2ss %edi,%xmm5
  movss  %xmm5,0xc(%rsp)
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm5,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl (%r8),%xmm1
  cvtss2sd %xmm1,%xmm1
  addsd  D3(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <roundf@plt>
  cvttss2si %xmm0,%r13d
  mov    %r13d,0x8(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2ss %r13d,%xmm0
  mulss  D16(%rip),%xmm0
  call   <roundf@plt>
  cvttss2si %xmm0,%r15d
  pxor   %xmm1,%xmm1
  cvtsi2ss %r15d,%xmm1
  movss  0xc(%rsp),%xmm0
  subss  %xmm1,%xmm0
  lea    0x1(%r13),%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  movaps %xmm0,%xmm3
  movss  D4(%rip),%xmm2
  movaps %xmm0,%xmm1
  andps  %xmm2,%xmm1
  movss  D43(%rip),%xmm4
  ucomiss %xmm1,%xmm4
  jbe    L47
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  cmpnless %xmm1,%xmm3
  movss  D31(%rip),%xmm4
  andps  %xmm4,%xmm3
  addss  %xmm1,%xmm3
  andnps %xmm0,%xmm2
  orps   %xmm2,%xmm3
L47:
  cvttss2si %xmm3,%r13d
  mov    %ebp,%esi
  imul   %r13d,%esi
  movslq %esi,%rsi
  shl    $0x2,%rsi
  mov    (%rbx),%rdi
  call   <realloc@plt>
  mov    %rax,(%rbx)
  lea    0x0(%r13,%r13,1),%esi
  movslq %esi,%rsi
  shl    $0x2,%rsi
  mov    (%r12),%rdi
  call   <realloc@plt>
  mov    %rax,(%r12)
  mov    %r13d,(%r14)
  test   %r13d,%r13d
  jle    L76
  mov    $0x0,%r9d
  mov    $0x0,%edi
  mov    $0x0,%esi
  mov    $0x0,%r8d
  mov    %ebp,%r10d
  movss  D31(%rip),%xmm0
  jmp    L33
L92:
  movslq %r9d,%rcx
  lea    0x0(,%rcx,4),%rax
  add    %r10,%rcx
  shl    $0x2,%rcx
L0:
  mov    (%rbx),%rdx
  movss  %xmm0,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L0
L4:
  mov    (%r12),%rax
  mov    %edi,(%rax,%rsi,1)
  mov    (%r12),%rax
  lea    (%r15,%rdi,1),%edx
  mov    %edx,0x4(%rax,%rsi,1)
  add    $0x1,%r8d
  mov    (%r14),%r13d
  add    $0x8,%rsi
  add    0x8(%rsp),%edi
  add    %ebp,%r9d
  cmp    %r8d,%r13d
  jle    L76
L33:
  test   %ebp,%ebp
  jg     L92
  jmp    L4
L76:
  mov    (%r12),%rcx
  lea    -0x2(%r13,%r13,1),%eax
  movslq %eax,%rdx
  lea    0x4(%rcx,%rdx,4),%rsi
  mov    (%rsi),%edx
  cmp    %ebp,%edx
  jle    L45
  cltq
  mov    %ebp,-0x4(%rcx,%rax,4)
  mov    (%r14),%eax
  lea    -0x2(%rax,%rax,1),%eax
  cltq
  mov    (%r12),%rdx
  movl   $0x0,(%rdx,%rax,4)
  mov    (%r14),%eax
  lea    -0x2(%rax,%rax,1),%eax
  cltq
  mov    (%r12),%rdx
  movl   $0x0,0x4(%rdx,%rax,4)
  subl   $0x1,(%r14)
L80:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L45:
  jge    L80
  mov    %ebp,(%rsi)
  jmp    L80
```

tool_calls: name: read_data
arguments: label: D3
type_infered: f64
name: read_data
arguments: label: D16
type_infered: f32
name: read_data
arguments: label: D4
type_infered: byte[4]
name: read_data
arguments: label: D43
type_infered: byte[4]
name: read_data
arguments: label: D31
type_infered: f32

tool: D3: 3.5

tool: D16: 2.5

tool: {"D4": [0xff,0xff,0xff,0x7f]}

tool: {"D43": [0x00,0x00,0x00,0x4b]}

tool: D31: 1

assistant: ```c
void linweights(int nfreqs, int Fs, float dB, float **wts, int **indices, int *nbands) {
  int whop = (int)roundf((float)nfreqs / ((float)(*nbands) + 3.5));
  int wlen = (int)roundf(2.5 * (float)whop);
  int reqbands = ceil(((float)nfreqs - wlen) / (whop + 1));
  *wts = (float *)realloc(*wts, reqbands * nfreqs * sizeof(float));
  *indices = (int *)realloc(*indices, reqbands * 2 * sizeof(int));
  *nbands = reqbands;
  for (int i = 0; i < *nbands; i++) {
    for (int j = 0; j < nfreqs; j++) {
      (*wts)[i * nfreqs + j] = 1.;
    }
    (*indices)[i * 2] = i * whop;
    (*indices)[i * 2 + 1] = i * whop + wlen;
  }
  if ((*indices)[(*nbands - 1) * 2 + 1] > nfreqs) {
    (*indices)[(*nbands - 2) * 2 + 1] = nfreqs;
    (*indices)[(*nbands - 1) * 2] = 0;
    (*indices)[(*nbands - 1) * 2 + 1] = 0;
    *nbands = *nbands - 1;
  } else if ((*indices)[(*nbands - 1) * 2 + 1] < nfreqs) {
    (*indices)[(*nbands - 1) * 2 + 1] = nfreqs;
  }
}
```