user: Converte this assembly snippet into its equivalent C code:

```asm
<iCBConstruct>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xe0(%rbp)
  mov    %rdx,-0xe8(%rbp)
  mov    %rcx,-0xf0(%rbp)
  mov    %r8d,-0xf4(%rbp)
  mov    %r9d,-0xf8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xe8(%rbp),%rax
  mov    (%rax),%eax
  mov    D4(%rip),%rdx
  mov    $0x20,%esi
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <gaindequant@plt>
  movd   %xmm0,%eax
  mov    %eax,-0xbc(%rbp)
  cmpl   $0x1,0x10(%rbp)
  jle    L79
  mov    -0xbc(%rbp),%eax
  movd   %eax,%xmm0
  call   <fabsf@plt>
  movq   %xmm0,%rax
  mov    -0xe8(%rbp),%rdx
  add    $0x4,%rdx
  mov    (%rdx),%edx
  mov    $0x10,%esi
  movq   %rax,%xmm0
  mov    %edx,%edi
  call   <gaindequant@plt>
  movd   %xmm0,%eax
  mov    %eax,-0xb8(%rbp)
L79:
  cmpl   $0x2,0x10(%rbp)
  jle    L24
  mov    -0xb8(%rbp),%eax
  movd   %eax,%xmm0
  call   <fabsf@plt>
  movq   %xmm0,%rax
  mov    -0xe8(%rbp),%rdx
  add    $0x8,%rdx
  mov    (%rdx),%edx
  mov    $0x8,%esi
  movq   %rax,%xmm0
  mov    %edx,%edi
  call   <gaindequant@plt>
  movd   %xmm0,%eax
  mov    %eax,-0xb4(%rbp)
L24:
  mov    -0xe0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0xf8(%rbp),%edi
  mov    -0xf4(%rbp),%ecx
  mov    -0xf0(%rbp),%rsi
  lea    -0xb0(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <getCBvec@plt>
  movl   $0x0,-0xc4(%rbp)
  jmp    L71
L26:
  movss  -0xbc(%rbp),%xmm1
  mov    -0xc4(%rbp),%eax
  cltq
  movss  -0xb0(%rbp,%rax,4),%xmm0
  mov    -0xc4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mulss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0xc4(%rbp)
L71:
  mov    -0xc4(%rbp),%eax
  cmp    -0xf8(%rbp),%eax
  jl     L26
  cmpl   $0x1,0x10(%rbp)
  jle    L81
  movl   $0x1,-0xc0(%rbp)
  jmp    L68
L7:
  mov    -0xc0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xe0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xf8(%rbp),%edi
  mov    -0xf4(%rbp),%ecx
  mov    -0xf0(%rbp),%rsi
  lea    -0xb0(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <getCBvec@plt>
  movl   $0x0,-0xc4(%rbp)
  jmp    L62
L96:
  mov    -0xc4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0xc0(%rbp),%eax
  cltq
  movss  -0xbc(%rbp,%rax,4),%xmm2
  mov    -0xc4(%rbp),%eax
  cltq
  movss  -0xb0(%rbp,%rax,4),%xmm0
  mulss  %xmm2,%xmm0
  mov    -0xc4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0xc4(%rbp)
L62:
  mov    -0xc4(%rbp),%eax
  cmp    -0xf8(%rbp),%eax
  jl     L96
  addl   $0x1,-0xc0(%rbp)
L68:
  mov    -0xc0(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L7
L81:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L51
  call   <__stack_chk_fail@plt>
L51:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D4
type_infered: f64

tool: D4: 1

assistant: ```c
void iCBConstruct(float *decvector, int *index, int *gain_index, float *mem, int lMem, int veclen, int nStages) {
  int j;
  int k;
  float gain[3];
  float cbvec[40];
  gain[0] = gaindequant(gain_index[0], 1.0, 32);
  if (nStages > 1)
    gain[1] = gaindequant(gain_index[1], fabsf(gain[0]), 16);
  if (nStages > 2)
    gain[2] = gaindequant(gain_index[2], fabsf(gain[1]), 8);
  getCBvec(cbvec, mem, index[0], lMem, veclen);
  for (j = 0; j < veclen; j++)
    decvector[j] = gain[0] * cbvec[j];
  if (nStages > 1) {
    for (k = 1; k < nStages; k++) {
      getCBvec(cbvec, mem, index[k], lMem, veclen);
      for (j = 0; j < veclen; j++)
        decvector[j] += gain[k] * cbvec[j];
    }
  }
}
```