user: 请将以下的汇编代码转换成C语言代码：

```asm
<iCBConstruct>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0xe8,%rsp
  movsd  D7(%rip),%xmm0
  mov    (%rdx),%edi
  mov    %rsi,0x8(%rsp)
  mov    0x120(%rsp),%r12d
  mov    $0x20,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  call   <gaindequant@plt>
  movaps %xmm0,%xmm2
  cmp    $0x1,%r12d
  jg     L14
L65:
  mov    0x8(%rsp),%rax
  lea    0x30(%rsp),%rbp
  mov    %r13d,%r8d
  mov    %r15d,%ecx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  movss  %xmm2,0x10(%rsp)
  mov    (%rax),%edx
  call   <getCBvec@plt>
  test   %r13d,%r13d
  movss  0x10(%rsp),%xmm2
  jle    L68
L72:
  movslq %r13d,%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L96:
  movss  0x0(%rbp,%rax,4),%xmm1
  mulss  %xmm2,%xmm1
  movss  %xmm1,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L96
L68:
  cmp    $0x1,%r12d
  jle    L16
L59:
  mov    %r12d,%eax
  mov    $0x1,%r9d
  movslq %r13d,%r12
  mov    %rax,0x18(%rsp)
L64:
  mov    0x8(%rsp),%rax
  mov    %r13d,%r8d
  mov    %r15d,%ecx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    %r9,0x10(%rsp)
  mov    (%rax,%r9,4),%edx
  call   <getCBvec@plt>
  test   %r13d,%r13d
  mov    0x10(%rsp),%r9
  jle    L58
  movss  0x24(%rsp,%r9,4),%xmm1
  xor    %eax,%eax
  nopl   0x0(%rax)
L83:
  movss  0x0(%rbp,%rax,4),%xmm0
  mulss  %xmm1,%xmm0
  addss  (%rbx,%rax,4),%xmm0
  movss  %xmm0,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %r12,%rax
  jne    L83
L58:
  add    $0x1,%r9
  cmp    %r9,0x18(%rsp)
  jne    L64
L16:
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L74
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L14:
  movss  %xmm0,0x10(%rsp)
  call   <fabsf@plt>
  mov    0x4(%rbp),%edi
  mov    $0x10,%esi
  call   <gaindequant@plt>
  cmp    $0x2,%r12d
  movss  0x10(%rsp),%xmm2
  movss  %xmm0,0x28(%rsp)
  je     L65
  call   <fabsf@plt>
  mov    0x8(%rbp),%edi
  mov    $0x8,%esi
  lea    0x30(%rsp),%rbp
  call   <gaindequant@plt>
  mov    0x8(%rsp),%rax
  mov    %r13d,%r8d
  mov    %r15d,%ecx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  movss  %xmm0,0x2c(%rsp)
  mov    (%rax),%edx
  call   <getCBvec@plt>
  test   %r13d,%r13d
  movss  0x10(%rsp),%xmm2
  jg     L72
  jmp    L59
L74:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D7
data_type: f64

tool: D7: 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];
    }
  }
}
```