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

```asm
<radfg>:
  endbr64
  push   %r15
  lea    0x1(%rsi),%rax
  mov    %rdx,%r15
  lea    0x0(,%rcx,8),%rdx
  push   %r14
  shr    %rax
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x98,%rsp
  mov    %rax,0x8(%rsp)
  lea    -0x1(%rsi),%rax
  mov    %rsi,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %rax,0x68(%rsp)
  cmp    $0x1,%rdi
  je     L191
  mov    %rsi,%r14
  mov    %r9,%rdi
  mov    %r8,%rsi
  call   <memcpy@plt>
  cmp    $0x1,%r14
  jbe    L265
  mov    %rbp,%rax
  mov    %r13,0x40(%rsp)
  xor    %r14d,%r14d
  lea    0x0(,%rbp,8),%r11
  movq   $0x1,0x10(%rsp)
  imul   %r15,%rax
  mov    %rax,%rdi
  mov    %rax,0x18(%rsp)
  lea    -0x3(%rbp),%rax
  and    $0xfffffffffffffffe,%rax
  mov    %rax,0x30(%rsp)
  mov    %rdi,%rax
  mov    0xd0(%rsp),%rdi
  mov    %rax,%r13
  add    $0x10,%rdi
  mov    %rdi,0x38(%rsp)
L113:
  test   %r15,%r15
  je     L163
  mov    0xd0(%rsp),%rax
  mov    0x38(%rsp),%rdi
  lea    0x8(,%r13,8),%r8
  xor    %r9d,%r9d
  lea    (%rax,%r14,8),%r10
  mov    0x30(%rsp),%rax
  add    %r14,%rax
  lea    (%rdi,%rax,8),%rsi
  mov    %r13,%rdi
  nopl   (%rax)
L79:
  movsd  (%r12,%rdi,8),%xmm0
  lea    (%r12,%r8,1),%rdx
  lea    (%rbx,%r8,1),%rcx
  mov    %r10,%rax
  movsd  %xmm0,(%rbx,%rdi,8)
  cmp    $0x2,%rbp
  jbe    L326
  nopl   0x0(%rax)
L41:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x10,%rax
  add    $0x10,%rdx
  movsd  -0x8(%rax),%xmm1
  mulsd  -0x8(%rdx),%xmm1
  add    $0x10,%rcx
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rcx)
  movsd  -0x10(%rax),%xmm0
  movsd  -0x8(%rax),%xmm1
  mulsd  -0x8(%rdx),%xmm0
  mulsd  -0x10(%rdx),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rcx)
  cmp    %rsi,%rax
  jne    L41
L326:
  add    $0x1,%r9
  add    %rbp,%rdi
  add    %r11,%r8
  cmp    %r9,%r15
  jne    L79
L163:
  addq   $0x1,0x10(%rsp)
  add    %rbp,%r14
  mov    0x10(%rsp),%rax
  add    0x18(%rsp),%r13
  cmp    %rax,0x20(%rsp)
  jne    L113
  mov    0x40(%rsp),%r13
L265:
  cmpq   $0x1,0x8(%rsp)
  jbe    L362
  mov    %rbp,%rdi
  mov    0x68(%rsp),%rax
  lea    0x8(%r12),%rcx
  movq   $0x1,0x10(%rsp)
  imul   %r15,%rdi
  mov    %r13,0x40(%rsp)
  lea    0x8(%rbx),%r11
  mov    %r12,0x48(%rsp)
  lea    0x18(%r12),%r14
  mov    %rcx,%r12
  mov    %rbx,0x50(%rsp)
  imul   %rdi,%rax
  mov    %rdi,0x30(%rsp)
  mov    %rdi,%r13
  mov    %rax,0x18(%rsp)
  lea    (%r15,%r15,1),%rax
  neg    %rax
  imul   %rbp,%rax
  mov    %rax,0x38(%rsp)
  mov    0x20(%rsp),%rax
  lea    -0x2(%rax),%rsi
  lea    -0x3(%rbp),%rax
  imul   %rdi,%rsi
  and    $0xfffffffffffffffe,%rax
  mov    %rax,%rbx
L29:
  mov    0x18(%rsp),%r10
  mov    %r13,%r8
  xor    %r9d,%r9d
  test   %r15,%r15
  je     L235
  nopl   0x0(%rax)
L253:
  cmp    $0x2,%rbp
  jbe    L483
  lea    0x0(,%r8,8),%rax
  lea    (%rbx,%r8,1),%rdi
  lea    (%r11,%rax,1),%rdx
  lea    (%r11,%r10,8),%rcx
  add    %r12,%rax
  lea    (%r14,%rdi,8),%rdi
  nopl   0x0(%rax)
L5:
  movsd  (%rcx),%xmm0
  addsd  (%rdx),%xmm0
  add    $0x10,%rcx
  add    $0x10,%rdx
  movsd  %xmm0,(%rax)
  movsd  -0x10(%rcx),%xmm0
  subsd  -0x10(%rdx),%xmm0
  movsd  %xmm0,0x8(%rax,%rsi,8)
  movsd  -0x8(%rdx),%xmm0
  addsd  -0x8(%rcx),%xmm0
  movsd  %xmm0,0x8(%rax)
  movsd  -0x8(%rdx),%xmm0
  subsd  -0x8(%rcx),%xmm0
  movsd  %xmm0,(%rax,%rsi,8)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L5
L483:
  add    $0x1,%r9
  add    %rbp,%r10
  add    %rbp,%r8
  cmp    %r9,%r15
  jne    L253
L235:
  mov    0x30(%rsp),%rcx
  addq   $0x1,0x10(%rsp)
  sub    %rcx,0x18(%rsp)
  mov    0x10(%rsp),%rax
  add    %rcx,%r13
  add    0x38(%rsp),%rsi
  cmp    %rax,0x8(%rsp)
  jne    L29
  mov    0x40(%rsp),%r13
  mov    0x48(%rsp),%r12
  mov    0x50(%rsp),%rbx
L481:
  mov    %rbp,%r10
  mov    0x68(%rsp),%r9
  mov    0x8(%rsp),%r11
  lea    0x0(,%rbp,8),%rsi
  imul   %r15,%r10
  mov    $0x1,%r8d
  neg    %r10
  shl    $0x3,%r10
  mov    %r10,%rdi
  neg    %rdi
  imul   %rdi,%r9
  nopl   (%rax)
L384:
  mov    %rdi,%rdx
  mov    %r9,%rax
  xor    %ecx,%ecx
  test   %r15,%r15
  je     L491
  nopl   (%rax)
L205:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  (%rbx,%rdx,1),%xmm0
  add    $0x1,%rcx
  movsd  %xmm0,(%r12,%rdx,1)
  movsd  (%rbx,%rax,1),%xmm0
  subsd  (%rbx,%rdx,1),%xmm0
  add    %rsi,%rdx
  movsd  %xmm0,(%r12,%rax,1)
  add    %rsi,%rax
  cmp    %rcx,%r15
  jne    L205
L491:
  add    $0x1,%r8
  add    %r10,%r9
  sub    %r10,%rdi
  cmp    %r8,%r11
  ja     L384
L362:
  mov    0x20(%rsp),%r14
  mov    %r14d,%edi
  shl    $0x4,%edi
  call   <util_malloc_@plt>
  mov    %rax,0x60(%rsp)
  test   %r14,%r14
  js     L173
  pxor   %xmm0,%xmm0
  cvtsi2sd %r14,%xmm0
L519:
  movsd  D50(%rip),%xmm1
  mov    0x60(%rsp),%rax
  mov    D42(%rip),%rdi
  movapd %xmm1,%xmm4
  movq   $0x0,0x8(%rax)
  divsd  %xmm0,%xmm4
  mov    %rdi,(%rax)
  comisd D5(%rip),%xmm4
  movsd  %xmm4,0x10(%rsp)
  jae    L513
  cvttsd2si %xmm4,%rdi
L450:
  mov    0x20(%rsp),%r14
  mov    0x60(%rsp),%rsi
  mov    %rdi,0x18(%rsp)
  shl    $0x4,%r14
  lea    -0x10(%rsi,%r14,1),%rax
  mov    %rax,0x30(%rsp)
  call   <cos@plt>
  mov    0x30(%rsp),%rax
  mov    0x60(%rsp),%rdi
  movsd  %xmm0,(%rax)
  movsd  %xmm0,0x10(%rdi)
  mov    0x18(%rsp),%rdi
  call   <sin@plt>
  mov    0x60(%rsp),%rdi
  mov    0x20(%rsp),%rax
  movsd  %xmm0,0x18(%rdi)
  xorpd  D59(%rip),%xmm0
  movsd  %xmm0,-0x8(%rdi,%r14,1)
  mov    %rax,%rdi
  shr    %rdi
  mov    %rdi,%rcx
  cmp    $0x3,%rax
  jbe    L456
  mov    0x20(%rsp),%rax
  mov    0x60(%rsp),%rsi
  mov    %rbp,0x18(%rsp)
  mov    %r15,0x30(%rsp)
  mov    %rcx,%r15
  sub    $0x2,%rax
  mov    %rbx,0x40(%rsp)
  lea    0x20(%rsi),%r14
  shl    $0x4,%rax
  mov    %r12,0x38(%rsp)
  add    %rsi,%rax
  mov    %rax,%rdi
  mov    $0x2,%eax
  mov    %rdi,%rbp
  mov    %rax,%rbx
  jmp    L425
L62:
  cvttsd2si %xmm0,%r12
L4:
  mov    %r12,%rdi
  sub    $0x10,%rbp
  add    $0x10,%r14
  call   <cos@plt>
  mov    %r12,%rdi
  movsd  %xmm0,0x10(%rbp)
  movsd  %xmm0,-0x10(%r14)
  call   <sin@plt>
  mov    %rbx,%rdx
  add    $0x1,%rbx
  movsd  %xmm0,-0x8(%r14)
  xorpd  D59(%rip),%xmm0
  movsd  %xmm0,0x18(%rbp)
  cmp    %rdx,%r15
  je     L140
L425:
  pxor   %xmm0,%xmm0
  cvtsi2sd %rbx,%xmm0
  mulsd  0x10(%rsp),%xmm0
  comisd D5(%rip),%xmm0
  jb     L62
  subsd  D5(%rip),%xmm0
  movabs $0x8000000000000000,%rax
  cvttsd2si %xmm0,%r12
  xor    %rax,%r12
  jmp    L4
L140:
  mov    0x18(%rsp),%rbp
  mov    0x30(%rsp),%r15
  mov    0x38(%rsp),%r12
  mov    0x40(%rsp),%rbx
L456:
  cmpq   $0x1,0x8(%rsp)
  jbe    L236
  mov    0x60(%rsp),%r10
  mov    0x20(%rsp),%rsi
  mov    %r13,%rdi
  lea    0x0(%r13,%r13,1),%r9
  mov    0x28(%rsp),%rdx
  mov    0x8(%rsp),%rcx
  shl    $0x4,%rdi
  mov    %rbp,0x78(%rsp)
  lea    0x10(%r10),%rax
  lea    (%rsi,%rsi,1),%r14
  mov    %r12,0x40(%rsp)
  add    %rbx,%rdi
  mov    %rax,0x10(%rsp)
  lea    -0x2(%rsi),%rax
  add    %rcx,%rcx
  lea    (%rbx,%rdx,1),%r11
  mov    %rax,0x70(%rsp)
  imul   %r13,%rax
  mov    %rcx,0x38(%rsp)
  lea    (%r12,%rdx,1),%rcx
  mov    %rcx,0x30(%rsp)
  mov    %rax,0x18(%rsp)
  mov    0x68(%rsp),%rax
  mov    0x18(%rsp),%rcx
  mov    %r15,0x80(%rsp)
  mov    %r9,%r15
  imul   %rdx,%rax
  mov    %rbx,0x88(%rsp)
  lea    (%rbx,%rax,1),%r8
  add    %r12,%rax
  mov    %r10,%rbx
  mov    %rax,0x48(%rsp)
  mov    $0x4,%eax
  sub    %rsi,%rax
  imul   %rdx,%rsi
  imul   %r13,%rax
  mov    %rax,0x58(%rsp)
  mov    %rsi,%rax
  add    %r12,%rax
  mov    %r8,%r12
  mov    %rax,0x50(%rsp)
  mov    $0x2,%eax
  mov    %rax,%rbp
  nopl   (%rax)
L344:
  mov    0x10(%rsp),%rax
  movsd  (%rax),%xmm2
  movsd  0x8(%rax),%xmm1
  xor    %eax,%eax
  test   %r13,%r13
  je     L248
  mov    0x48(%rsp),%rdx
  mov    0x30(%rsp),%rsi
  mov    0x40(%rsp),%r8
  nopl   0x0(%rax)
L44:
  movsd  (%rsi,%rax,8),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  (%r8,%rax,8),%xmm0
  movsd  %xmm0,(%r11,%rax,8)
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r13
  jne    L44
L248:
  cmpq   $0x2,0x8(%rsp)
  je     L479
  mov    %r12,0x18(%rsp)
  mov    0x58(%rsp),%rsi
  mov    %r15,%r10
  mov    %rbp,%r8
  mov    0x50(%rsp),%r12
  mov    $0x2,%r9d
  nopl   0x0(%rax)
L16:
  add    %rbp,%r8
  mov    %r8,%rax
  sub    %r14,%rax
  cmp    %r8,%r14
  cmovbe %rax,%r8
  movsd  (%rbx,%r8,8),%xmm1
  movsd  0x8(%rbx,%r8,8),%xmm2
  test   %r13,%r13
  je     L374
  mov    %r10,%rax
  neg    %rax
  lea    (%r12,%rax,8),%rdx
  mov    %r11,%rax
  nop
L354:
  movsd  (%rdx,%rsi,8),%xmm0
  add    $0x8,%rdx
  mulsd  %xmm1,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x8(%rdx),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  (%rax,%rcx,8),%xmm0
  movsd  %xmm0,(%rax,%rcx,8)
  add    $0x8,%rax
  cmp    %rax,%rdi
  jne    L354
L374:
  add    $0x1,%r9
  add    %r13,%r10
  add    %r15,%rsi
  cmp    %r9,0x8(%rsp)
  jne    L16
  mov    0x18(%rsp),%r12
L479:
  mov    0x28(%rsp),%rax
  addq   $0x10,0x10(%rsp)
  sub    %r15,%rcx
  add    $0x2,%rbp
  add    %rax,%r11
  add    %rax,%rdi
  sub    %rax,%r12
  cmp    0x38(%rsp),%rbp
  jne    L344
  mov    0x60(%rsp),%rdi
  mov    0x78(%rsp),%rbp
  mov    0x80(%rsp),%r15
  mov    0x40(%rsp),%r12
  mov    0x88(%rsp),%rbx
  call   <util_free_@plt>
  mov    0x30(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  mov    $0x1,%ecx
  mov    0x28(%rsp),%rdi
  nopl   (%rax)
L323:
  xor    %eax,%eax
  test   %r13,%r13
  je     L66
  nop
L515:
  movsd  (%rbx,%rax,8),%xmm0
  addsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r13
  jne    L515
L66:
  add    $0x1,%rcx
  add    %rdi,%rdx
  cmp    %rcx,%rsi
  jne    L323
  test   %r15,%r15
  je     L307
L151:
  mov    0x20(%rsp),%rax
  mov    %r12,%rcx
  mov    %rbp,0x10(%rsp)
  xor    %r14d,%r14d
  lea    0x0(,%rbp,8),%rdx
  mov    %r12,0x18(%rsp)
  mov    %rcx,%r13
  mov    %rbx,%r12
  imul   %rdx,%rax
  mov    %rbx,0x28(%rsp)
  mov    %rdx,%rbp
  mov    %rax,%rbx
  nopl   0x0(%rax,%rax,1)
L359:
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    %rbp,%rdx
  add    $0x1,%r14
  call   <memcpy@plt>
  add    %rbx,%r13
  add    %rbp,%r12
  cmp    %r14,%r15
  jne    L359
  mov    0x20(%rsp),%rax
  mov    0x10(%rsp),%rbp
  mov    0x18(%rsp),%r12
  mov    0x28(%rsp),%rbx
  sub    $0x2,%rax
  cmpq   $0x1,0x8(%rsp)
  mov    %rax,0x70(%rsp)
  jbe    L358
L307:
  lea    (%r15,%r15,1),%rax
  mov    %rbp,%rdi
  mov    0x70(%rsp),%rsi
  mov    %rbp,%rcx
  neg    %rax
  imul   %r15,%rdi
  mov    0x20(%rsp),%r13
  shl    $0x4,%rcx
  imul   %rbp,%rax
  mov    %rcx,0x28(%rsp)
  lea    (%r12,%rcx,1),%r8
  mov    $0x2,%r10d
  mov    %r12,0x10(%rsp)
  mov    %rcx,%r12
  lea    0x0(,%rdi,8),%r11
  mov    %rdi,0x30(%rsp)
  mov    %rax,%r14
  mov    0x8(%rsp),%rax
  imul   %rdi,%rsi
  lea    (%rbx,%r11,1),%r9
  lea    0x0(,%rbp,8),%rdi
  mov    %rbp,0x8(%rsp)
  add    %rax,%rax
  imul   %rdi,%r13
  mov    %rax,0x38(%rsp)
  mov    %rax,%rbp
  nopl   0x0(%rax)
L145:
  mov    %r8,%rdx
  mov    %r9,%rax
  xor    %ecx,%ecx
  test   %r15,%r15
  je     L97
  nopl   (%rax)
L443:
  movsd  (%rax),%xmm0
  add    $0x1,%rcx
  movsd  %xmm0,-0x8(%rdx)
  movsd  (%rax,%rsi,8),%xmm0
  add    %rdi,%rax
  movsd  %xmm0,(%rdx)
  add    %r13,%rdx
  cmp    %rcx,%r15
  jne    L443
L97:
  add    $0x2,%r10
  add    %r11,%r9
  add    %r12,%r8
  add    %r14,%rsi
  cmp    %r10,%rbp
  jne    L145
  mov    0x8(%rsp),%rbp
  mov    0x10(%rsp),%r12
  cmp    $0x1,%rbp
  je     L358
  mov    0x28(%rsp),%rax
  mov    0x30(%rsp),%rdi
  lea    -0x3(%rbp),%r14
  movq   $0x2,0x8(%rsp)
  and    $0xfffffffffffffffe,%r14
  lea    0x8(%r12,%rax,1),%rax
  mov    %rdi,0x18(%rsp)
  lea    0x8(%rbx),%r12
  add    $0x18,%rbx
  mov    %rax,0x20(%rsp)
  mov    0x68(%rsp),%rax
  imul   %rdi,%rax
  mov    %rax,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L231:
  test   %r15,%r15
  je     L39
  mov    0x10(%rsp),%r11
  mov    0x18(%rsp),%r9
  xor    %r10d,%r10d
  mov    0x20(%rsp),%r8
  nopl   0x0(%rax,%rax,1)
L469:
  cmp    $0x2,%rbp
  jbe    L2
  lea    (%r9,%r14,1),%rcx
  lea    (%r12,%r9,8),%rax
  lea    (%rbx,%rcx,8),%rdi
  lea    (%r12,%r11,8),%rdx
  mov    %r8,%rcx
  lea    -0x20(%r8),%rsi
  nopl   (%rax)
L240:
  movsd  (%rax),%xmm0
  addsd  (%rdx),%xmm0
  add    $0x10,%rax
  add    $0x10,%rdx
  add    $0x10,%rcx
  sub    $0x10,%rsi
  movsd  %xmm0,-0x10(%rcx)
  movsd  -0x10(%rax),%xmm0
  subsd  -0x10(%rdx),%xmm0
  movsd  %xmm0,0x10(%rsi)
  movsd  -0x8(%rdx),%xmm0
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rcx)
  movsd  -0x8(%rdx),%xmm0
  subsd  -0x8(%rax),%xmm0
  movsd  %xmm0,0x18(%rsi)
  cmp    %rdi,%rax
  jne    L240
L2:
  add    $0x1,%r10
  add    %r13,%r8
  add    %rbp,%r9
  add    %rbp,%r11
  cmp    %r10,%r15
  jne    L469
L39:
  mov    0x28(%rsp),%rdi
  addq   $0x2,0x8(%rsp)
  add    %rdi,0x20(%rsp)
  mov    0x8(%rsp),%rax
  mov    0x30(%rsp),%rdi
  add    %rdi,0x18(%rsp)
  sub    %rdi,0x10(%rsp)
  cmp    %rax,0x38(%rsp)
  jne    L231
L358:
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L513:
  movsd  0x10(%rsp),%xmm0
  subsd  D5(%rip),%xmm0
  cvttsd2si %xmm0,%rdi
  btc    $0x3f,%rdi
  jmp    L450
L173:
  mov    0x20(%rsp),%rdi
  pxor   %xmm0,%xmm0
  mov    %rdi,%rax
  and    $0x1,%edi
  shr    %rax
  or     %rdi,%rax
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L519
L191:
  mov    0x28(%rsp),%rdx
  mov    %r9,%rsi
  mov    %r8,%rdi
  call   <memcpy@plt>
  cmpq   $0x1,0x8(%rsp)
  ja     L481
  jmp    L362
L236:
  mov    0x60(%rsp),%rdi
  call   <util_free_@plt>
  test   %r15,%r15
  jne    L151
  jmp    L358
```

tool_calls: name: unpack_data
arguments: tag: D50
data_type: f64
name: unpack_data
arguments: tag: D42
data_type: f64
name: unpack_data
arguments: tag: D5
data_type: f32[4]
name: unpack_data
arguments: tag: D59
data_type: f32[4]

tool: D50: 6.283185307179586

tool: D42: 1

tool: {"D5": [0.0,448.0,0.0,0.0]}

tool: {"D59": [0.0,-0.0,0.0,0.0]}

assistant: ```c
void radfg(size_t ido, size_t ip, size_t l1, size_t idl1, double *cc, double *ch, const double *wa) {
  const size_t cdim = ip;
  static const double twopi = 6.28318530717958647692;
  size_t idij, ipph, i, j, k, l, j2, ic, jc, lc, ik;
  double ai1, ai2, ar1, ar2, arg;
  double *csarr;
  size_t aidx;
  ipph = (ip + 1) / 2;
  if (ido != 1) {
    memcpy(ch, cc, idl1 * sizeof(double));
    for (j = 1; j < ip; j++)
      for (k = 0; k < l1; k++) {
        ch[(0) + ido * ((k) + l1 * (j))] = cc[(0) + ido * ((k) + l1 * (j))];
        idij = (j - 1) * ido + 1;
        for (i = 2; i < ido; i += 2, idij += 2) {
          ch[(i - 1) + ido * ((k) + l1 * (j))] = wa[idij - 1] * cc[(i - 1) + ido * ((k) + l1 * (j))] + wa[idij] * cc[(i) + ido * ((k) + l1 * (j))];
          ch[(i) + ido * ((k) + l1 * (j))] = wa[idij - 1] * cc[(i) + ido * ((k) + l1 * (j))] - wa[idij] * cc[(i - 1) + ido * ((k) + l1 * (j))];
        }
      }
    for (j = 1, jc = ip - 1; j < ipph; j++, jc--)
      for (k = 0; k < l1; k++)
        for (i = 2; i < ido; i += 2) {
          {
            cc[(i - 1) + ido * ((k) + l1 * (j))] = ch[(i - 1) + ido * ((k) + l1 * (jc))] + ch[(i - 1) + ido * ((k) + l1 * (j))];
            cc[(i) + ido * ((k) + l1 * (jc))] = ch[(i - 1) + ido * ((k) + l1 * (jc))] - ch[(i - 1) + ido * ((k) + l1 * (j))];
          }
          {
            cc[(i) + ido * ((k) + l1 * (j))] = ch[(i) + ido * ((k) + l1 * (j))] + ch[(i) + ido * ((k) + l1 * (jc))];
            cc[(i - 1) + ido * ((k) + l1 * (jc))] = ch[(i) + ido * ((k) + l1 * (j))] - ch[(i) + ido * ((k) + l1 * (jc))];
          }
        }
  } else
    memcpy(cc, ch, idl1 * sizeof(double));
  for (j = 1, jc = ip - 1; j < ipph; j++, jc--)
    for (k = 0; k < l1; k++) {
      cc[(0) + ido * ((k) + l1 * (j))] = ch[(0) + ido * ((k) + l1 * (jc))] + ch[(0) + ido * ((k) + l1 * (j))];
      cc[(0) + ido * ((k) + l1 * (jc))] = ch[(0) + ido * ((k) + l1 * (jc))] - ch[(0) + ido * ((k) + l1 * (j))];
    }
  csarr = ((double *)util_malloc_((2 * ip) * sizeof(double)));
  arg = twopi / ip;
  csarr[0] = 1.;
  csarr[1] = 0.;
  csarr[2] = csarr[2 * ip - 2] = cos(arg);
  csarr[3] = sin(arg);
  csarr[2 * ip - 1] = -csarr[3];
  for (i = 2; i <= ip / 2; ++i) {
    csarr[2 * i] = csarr[2 * ip - 2 * i] = cos(i * arg);
    csarr[2 * i + 1] = sin(i * arg);
    csarr[2 * ip - 2 * i + 1] = -csarr[2 * i + 1];
  }
  for (l = 1, lc = ip - 1; l < ipph; l++, lc--) {
    ar1 = csarr[2 * l];
    ai1 = csarr[2 * l + 1];
    for (ik = 0; ik < idl1; ik++) {
      ch[(ik) + idl1 * (l)] = cc[(ik) + idl1 * (0)] + ar1 * cc[(ik) + idl1 * (1)];
      ch[(ik) + idl1 * (lc)] = ai1 * cc[(ik) + idl1 * (ip - 1)];
    }
    aidx = 2 * l;
    for (j = 2, jc = ip - 2; j < ipph; j++, jc--) {
      aidx += 2 * l;
      if (aidx >= 2 * ip)
        aidx -= 2 * ip;
      ar2 = csarr[aidx];
      ai2 = csarr[aidx + 1];
      for (ik = 0; ik < idl1; ik++) {
        ch[(ik) + idl1 * (l)] += ar2 * cc[(ik) + idl1 * (j)];
        ch[(ik) + idl1 * (lc)] += ai2 * cc[(ik) + idl1 * (jc)];
      }
    }
  }
  do {
    util_free_(csarr);
    (csarr) = NULL;
  } while (0);
  for (j = 1; j < ipph; j++)
    for (ik = 0; ik < idl1; ik++)
      ch[(ik) + idl1 * (0)] += cc[(ik) + idl1 * (j)];
  for (k = 0; k < l1; k++)
    memcpy(&cc[(0) + ido * ((0) + cdim * (k))], &ch[(0) + ido * ((k) + l1 * (0))], ido * sizeof(double));
  for (j = 1; j < ipph; j++) {
    jc = ip - j;
    j2 = 2 * j;
    for (k = 0; k < l1; k++) {
      cc[(ido - 1) + ido * ((j2 - 1) + cdim * (k))] = ch[(0) + ido * ((k) + l1 * (j))];
      cc[(0) + ido * ((j2) + cdim * (k))] = ch[(0) + ido * ((k) + l1 * (jc))];
    }
  }
  if (ido == 1)
    return;
  for (j = 1; j < ipph; j++) {
    jc = ip - j;
    j2 = 2 * j;
    for (k = 0; k < l1; k++)
      for (i = 2; i < ido; i += 2) {
        ic = ido - i;
        {
          cc[(i - 1) + ido * ((j2) + cdim * (k))] = ch[(i - 1) + ido * ((k) + l1 * (j))] + ch[(i - 1) + ido * ((k) + l1 * (jc))];
          cc[(ic - 1) + ido * ((j2 - 1) + cdim * (k))] = ch[(i - 1) + ido * ((k) + l1 * (j))] - ch[(i - 1) + ido * ((k) + l1 * (jc))];
        }
        {
          cc[(i) + ido * ((j2) + cdim * (k))] = ch[(i) + ido * ((k) + l1 * (jc))] + ch[(i) + ido * ((k) + l1 * (j))];
          cc[(ic) + ido * ((j2 - 1) + cdim * (k))] = ch[(i) + ido * ((k) + l1 * (jc))] - ch[(i) + ido * ((k) + l1 * (j))];
        }
      }
  }
}
```