user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<WebRtcIsac_GetVarsUB>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  D65(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L79
L2:
  movsd  -0x30(%rbp),%xmm1
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addl   $0x1,-0x3c(%rbp)
L79:
  cmpl   $0x3b,-0x3c(%rbp)
  jle    L2
  movsd  D65(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  jmp    L80
L29:
  movsd  -0x28(%rbp),%xmm1
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x3c(%rbp)
L80:
  cmpl   $0x77,-0x3c(%rbp)
  jle    L29
  movsd  D65(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  jmp    L46
L75:
  movsd  -0x20(%rbp),%xmm1
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  addl   $0x1,-0x3c(%rbp)
L46:
  cmpl   $0xb3,-0x3c(%rbp)
  jle    L75
  movsd  D65(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L67
L83:
  movsd  -0x18(%rbp),%xmm1
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x3c(%rbp)
L67:
  cmpl   $0xef,-0x3c(%rbp)
  jle    L83
  movsd  -0x18(%rbp),%xmm0
  movsd  -0x20(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log10@plt>
  movsd  D67(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movq   D16(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  movapd %xmm0,%xmm4
  divsd  %xmm1,%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  call   <log10@plt>
  movsd  D67(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movq   D16(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movapd %xmm0,%xmm5
  addsd  -0x60(%rbp),%xmm5
  movsd  %xmm5,-0x60(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movsd  -0x30(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log10@plt>
  movsd  D67(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movq   D16(%rip),%xmm1
  andpd  %xmm1,%xmm0
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x30(%rbp),%xmm0
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm1
  movapd %xmm0,%xmm6
  divsd  %xmm1,%xmm6
  movq   %xmm6,%rax
  movq   %rax,%xmm0
  call   <log10@plt>
  movsd  D67(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movq   D16(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  -0x60(%rbp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  D155(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm1
  movsd  D106(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D115(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D125(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    -0x58(%rbp),%rdx
  mov    %rax,(%rdx)
  movsd  -0x18(%rbp),%xmm0
  mov    -0x50(%rbp),%rax
  movsd  %xmm0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L13
  call   <__stack_chk_fail@plt>
L13:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D65
type: f64
name: extract_symbolic_data
arguments: label: D67
type: f64
name: extract_symbolic_data
arguments: label: D16
type: qword
name: extract_symbolic_data
arguments: label: D155
type: f64
name: extract_symbolic_data
arguments: label: D106
type: f64
name: extract_symbolic_data
arguments: label: D115
type: f64
name: extract_symbolic_data
arguments: label: D125
type: byte[8]

tool: D65: 0.0001

tool: D67: 10

tool: D16: 9223372036854775807

tool: D155: 0.25

tool: D106: 0.4

tool: D115: 1

tool: {"D125": [0x66,0x66,0x66,0x66,0x66,0x66,0xf6,0xbf]}

assistant: ```c
void WebRtcIsac_GetVarsUB(const double *input, double *oldEnergy, double *varscale) {
  double nrg[4], chng;
  int k;
  nrg[0] = 0.0001;
  for (k = 0; k < (120) / 2; k++) {
    nrg[0] += input[k] * input[k];
  }
  nrg[1] = 0.0001;
  for (; k < (240) / 2; k++) {
    nrg[1] += input[k] * input[k];
  }
  nrg[2] = 0.0001;
  for (; k < (480 * 3 / 4) / 2; k++) {
    nrg[2] += input[k] * input[k];
  }
  nrg[3] = 0.0001;
  for (; k < (480) / 2; k++) {
    nrg[3] += input[k] * input[k];
  }
  chng = 0.25 * (fabs(10.0 * log10(nrg[3] / nrg[2])) + fabs(10.0 * log10(nrg[2] / nrg[1])) + fabs(10.0 * log10(nrg[1] / nrg[0])) + fabs(10.0 * log10(nrg[0] / *oldEnergy)));
  *varscale = exp(-1.4 / (1.0 + 0.4 * chng));
  *oldEnergy = nrg[3];
}
```