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

```asm
<cosqb1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r14d
  mov    %rsi,%rbx
  mov    %rdx,%r12
  mov    %rcx,%rbp
  lea    0x1(%rdi),%eax
  mov    %eax,%r13d
  shr    $0x1f,%r13d
  add    %eax,%r13d
  sar    %r13d
  cmp    $0x2,%edi
  jle    L25
  lea    0x8(%rsi),%rax
  lea    -0x3(%rdi),%edx
  shr    %edx
  mov    %edx,%edx
  shl    $0x4,%rdx
  lea    0x18(%rsi,%rdx,1),%rdx
L1:
  movsd  (%rax),%xmm0
  movsd  0x8(%rax),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm0,%xmm2
  movsd  %xmm2,0x8(%rax)
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L1
L25:
  movsd  (%rbx),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,(%rbx)
  mov    %r14d,%r15d
  and    $0x1,%r15d
  jne    L98
  movslq %r14d,%rax
  lea    -0x8(%rbx,%rax,8),%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <rfftb@plt>
  cmp    $0x2,%r14d
  jle    L3
L76:
  movslq %r14d,%rax
  lea    -0x8(,%rax,8),%rdx
  mov    $0x1,%eax
L46:
  movsd  -0x8(%r12,%rax,8),%xmm0
  mulsd  (%rbx,%rdx,1),%xmm0
  movsd  -0x8(%r12,%rdx,1),%xmm1
  mulsd  (%rbx,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  movsd  -0x8(%r12,%rax,8),%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  movsd  -0x8(%r12,%rdx,1),%xmm1
  mulsd  (%rbx,%rdx,1),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%rbp,%rdx,1)
  add    $0x1,%rax
  sub    $0x8,%rdx
  cmp    %eax,%r13d
  jg     L46
  test   %r15d,%r15d
  je     L62
L108:
  movslq %r14d,%r14
  lea    -0x8(,%r14,8),%rdx
  mov    $0x1,%eax
L90:
  movsd  0x0(%rbp,%rax,8),%xmm0
  addsd  0x0(%rbp,%rdx,1),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  movsd  0x0(%rbp,%rax,8),%xmm0
  subsd  0x0(%rbp,%rdx,1),%xmm0
  movsd  %xmm0,(%rbx,%rdx,1)
  add    $0x1,%rax
  sub    $0x8,%rdx
  cmp    %eax,%r13d
  jg     L90
L66:
  movsd  (%rbx),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  test   %r15d,%r15d
  jne    L66
  movslq %r13d,%rax
  shl    $0x3,%rax
  lea    (%rbx,%rax,1),%rdx
  movsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x8(%r12,%rax,1),%xmm0
  movsd  %xmm0,(%rdx)
  jmp    L66
L62:
  movslq %r13d,%rax
  shl    $0x3,%rax
  lea    (%rbx,%rax,1),%rdx
  movsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x8(%r12,%rax,1),%xmm0
  movsd  %xmm0,(%rdx)
  jmp    L108
L98:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <rfftb@plt>
  cmp    $0x2,%r14d
  jg     L76
  jmp    L66
```

assistant: ```c
void cosqb1(int n, double x[], double w[], double xh[]) {
  int modn, i, k;
  int kc, ns2;
  double xim1;
  ns2 = (n + 1) / 2;
  for (i = 2; i < n; i += 2) {
    xim1 = x[i - 1] + x[i];
    x[i] -= x[i - 1];
    x[i - 1] = xim1;
  }
  x[0] += x[0];
  modn = n % 2;
  if (modn == 0)
    x[n - 1] += x[n - 1];
  rfftb(n, x, xh);
  for (k = 1; k < ns2; k++) {
    kc = n - k;
    xh[k] = w[k - 1] * x[kc] + w[kc - 1] * x[k];
    xh[kc] = w[k - 1] * x[k] - w[kc - 1] * x[kc];
  }
  if (modn == 0)
    x[ns2] = w[ns2 - 1] * (x[ns2] + x[ns2]);
  for (k = 1; k < ns2; k++) {
    kc = n - k;
    x[k] = xh[k] + xh[kc];
    x[kc] = xh[k] - xh[kc];
  }
  x[0] += x[0];
}
```