#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cos(double);
double sin(double);
void rftbsub(int n, double *a) {
  int i, i0, j, k;
  double ec, w1r, w1i, wkr, wki, wdr, wdi, ss, xr, xi, yr, yi;
  ec = 2 * ((double)1.570796326794896619231321691639751442098584) / n;
  wkr = 0;
  wki = 0;
  wdi = cos(ec);
  wdr = sin(ec);
  wdi *= wdr;
  wdr *= wdr;
  w1r = 1 - 2 * wdr;
  w1i = 2 * wdi;
  ss = 2 * w1i;
  i = n >> 1;
  for (;;) {
    i0 = i - 4 * 64;
    if (i0 < 4) {
      i0 = 4;
    }
    for (j = i - 4; j >= i0; j -= 4) {
      k = n - j;
      xr = a[j + 2] - a[k - 2];
      xi = a[j + 3] + a[k - 1];
      yr = wdr * xr + wdi * xi;
      yi = wdr * xi - wdi * xr;
      a[j + 2] -= yr;
      a[j + 3] -= yi;
      a[k - 2] += yr;
      a[k - 1] -= yi;
      wkr += ss * wdi;
      wki += ss * (((double)0.5) - wdr);
      xr = a[j] - a[k];
      xi = a[j + 1] + a[k + 1];
      yr = wkr * xr + wki * xi;
      yi = wkr * xi - wki * xr;
      a[j] -= yr;
      a[j + 1] -= yi;
      a[k] += yr;
      a[k + 1] -= yi;
      wdr += ss * wki;
      wdi += ss * (((double)0.5) - wkr);
    }
    if (i0 == 4) {
      break;
    }
    wkr = ((double)0.5) * sin(ec * i0);
    wki = ((double)0.5) * cos(ec * i0);
    wdr = ((double)0.5) - (wkr * w1r - wki * w1i);
    wdi = wkr * w1i + wki * w1r;
    wkr = ((double)0.5) - wkr;
    i = i0;
  }
  xr = a[2] - a[n - 2];
  xi = a[3] + a[n - 1];
  yr = wdr * xr + wdi * xi;
  yi = wdr * xi - wdi * xr;
  a[2] -= yr;
  a[3] -= yi;
  a[n - 2] += yr;
  a[n - 1] -= yi;
}


x86 assembly (clang, -O0):
<rftbsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe63(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe4a(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe38(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    11f7 <rftbsub+0xd7>
movl   $0x4,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     14dd <rftbsub+0x3bd>
mov    -0x4(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xcb3(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xb60(%rip),%xmm2
subsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    1200 <rftbsub+0xe0>
cmpl   $0x4,-0x18(%rbp)
jne    14ec <rftbsub+0x3cc>
jmp    15bc <rftbsub+0x49c>
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xb0e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xae7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xaa3(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xa71(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11db <rftbsub+0xbb>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x80(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rftbsub>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm1
movsd  0xec3(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm9
mulsd  %xmm0,%xmm9
mulsd  %xmm0,%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x30(%rsp)
movapd %xmm9,%xmm1
addsd  %xmm9,%xmm1
movsd  %xmm1,0x28(%rsp)
movapd %xmm1,%xmm10
addsd  %xmm1,%xmm10
movslq %ebp,%r14
sar    %ebp
lea    (%rbx,%r14,8),%r15
add    $0x20,%r15
xorpd  %xmm8,%xmm8
movsd  0xe54(%rip),%xmm11
movapd 0xe5b(%rip),%xmm12
xorpd  %xmm1,%xmm1
movsd  %xmm10,0x20(%rsp)
cmp    $0x105,%ebp
mov    $0x104,%eax
cmovge %ebp,%eax
lea    -0x100(%rax),%r12d
add    $0xffffff04,%eax
cmp    %eax,%ebp
jl     133c <rftbsub+0x21c>
movslq %ebp,%rsi
lea    -0x4(%rsi),%rax
mov    %r12d,%ecx
shl    $0x3,%rsi
mov    %r15,%rdx
sub    %rsi,%rdx
cs nopw 0x0(%rax,%rax,1)
movupd 0x10(%rbx,%rax,8),%xmm3
movupd -0x10(%rdx),%xmm4
movapd %xmm3,%xmm5
subpd  %xmm4,%xmm5
addpd  %xmm3,%xmm4
movapd %xmm4,%xmm6
movsd  %xmm5,%xmm6
movapd %xmm9,%xmm7
xorpd  %xmm12,%xmm7
movapd %xmm9,%xmm2
unpcklpd %xmm5,%xmm2
shufpd $0x1,%xmm7,%xmm4
mulpd  %xmm2,%xmm4
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm6,%xmm2
addpd  %xmm4,%xmm2
subpd  %xmm2,%xmm3
movupd %xmm3,0x10(%rbx,%rax,8)
movupd -0x10(%rdx),%xmm4
movupd (%rdx),%xmm3
movapd %xmm4,%xmm5
addpd  %xmm2,%xmm5
subpd  %xmm2,%xmm4
movsd  %xmm5,%xmm4
movupd %xmm4,-0x10(%rdx)
movapd %xmm10,%xmm2
mulsd  %xmm9,%xmm2
addsd  %xmm2,%xmm8
movapd %xmm11,%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm10,%xmm2
addsd  %xmm2,%xmm1
movupd (%rbx,%rax,8),%xmm2
movapd %xmm2,%xmm4
subpd  %xmm3,%xmm4
addpd  %xmm2,%xmm3
movapd %xmm3,%xmm5
movsd  %xmm4,%xmm5
movapd %xmm1,%xmm6
xorpd  %xmm12,%xmm6
movapd %xmm1,%xmm7
unpcklpd %xmm4,%xmm7
shufpd $0x1,%xmm6,%xmm3
mulpd  %xmm7,%xmm3
movapd %xmm8,%xmm4
unpcklpd %xmm8,%xmm4
mulpd  %xmm5,%xmm4
addpd  %xmm3,%xmm4
subpd  %xmm4,%xmm2
movupd %xmm2,(%rbx,%rax,8)
movupd (%rdx),%xmm2
movapd %xmm2,%xmm3
addpd  %xmm4,%xmm3
subpd  %xmm4,%xmm2
movsd  %xmm3,%xmm2
movupd %xmm2,(%rdx)
movapd %xmm10,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movapd %xmm11,%xmm2
subsd  %xmm8,%xmm2
mulsd  %xmm10,%xmm2
addsd  %xmm2,%xmm9
add    $0xfffffffffffffffc,%rax
add    $0x20,%rdx
cmp    %rcx,%rax
jge    1210 <rftbsub+0xf0>
cmp    $0x4,%r12d
je     13ef <rftbsub+0x2cf>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
call   1030 <sin@plt>
mulsd  0xca9(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
call   1040 <cos@plt>
movapd 0xc9f(%rip),%xmm12
movsd  0xc86(%rip),%xmm11
movsd  0x20(%rsp),%xmm10
movapd 0x10(%rsp),%xmm9
movapd %xmm0,%xmm1
mulsd  %xmm11,%xmm1
movsd  0x28(%rsp),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm9,%xmm2
movsd  0x30(%rsp),%xmm3
mulsd  %xmm3,%xmm2
subsd  %xmm0,%xmm2
movapd %xmm11,%xmm0
subsd  %xmm2,%xmm0
movapd %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm11,%xmm8
subsd  %xmm9,%xmm8
mulsd  %xmm4,%xmm9
addsd  %xmm2,%xmm9
mov    %r12d,%ebp
jmp    11d0 <rftbsub+0xb0>
movupd 0x10(%rbx),%xmm1
movupd -0x10(%rbx,%r14,8),%xmm2
movapd %xmm1,%xmm3
subpd  %xmm2,%xmm3
addpd  %xmm1,%xmm2
movapd %xmm2,%xmm4
movsd  %xmm3,%xmm4
movapd 0xc09(%rip),%xmm5
xorpd  %xmm9,%xmm5
unpcklpd %xmm3,%xmm9
shufpd $0x1,%xmm5,%xmm2
mulpd  %xmm9,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  %xmm4,%xmm0
addpd  %xmm2,%xmm0
subpd  %xmm0,%xmm1
movupd %xmm1,0x10(%rbx)
movsd  -0x10(%rbx,%r14,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x10(%rbx,%r14,8)
movsd  -0x8(%rbx,%r14,8),%xmm1
unpckhpd %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rbx,%r14,8)
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @rftbsub(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store i32 %0, i32* %3
store double* %1, double** %4
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to double
%23 = fdiv double 0x400921FB54442D18, %22
store double %23, double* %9
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
%24 = load double, double* %9
%25 = call double @cos(double %24)
store double %25, double* %15
%26 = load double, double* %9
%27 = call double @sin(double %26)
store double %27, double* %14
%28 = load double, double* %14
%29 = load double, double* %15
%30 = fmul double %29, %28
store double %30, double* %15
%31 = load double, double* %14
%32 = load double, double* %14
%33 = fmul double %32, %31
store double %33, double* %14
%34 = load double, double* %14
%35 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %34, double 1.000000e+00)
store double %35, double* %10
%36 = load double, double* %15
%37 = fmul double 2.000000e+00, %36
store double %37, double* %11
%38 = load double, double* %11
%39 = fmul double 2.000000e+00, %38
store double %39, double* %16
%40 = load i32, i32* %3
%41 = ashr i32 %40, 1
store i32 %41, i32* %5
br label %42
42: ; preds = %222, %2
%43 = load i32, i32* %5
%44 = sub nsw i32 %43, 256
store i32 %44, i32* %6
%45 = load i32, i32* %6
%46 = icmp slt i32 %45, 4
br i1 %46, label %47, label %48
47: ; preds = %42
store i32 4, i32* %6
br label %48
48: ; preds = %47, %42
%49 = load i32, i32* %5
%50 = sub nsw i32 %49, 4
store i32 %50, i32* %7
br label %51
51: ; preds = %215, %48
%52 = load i32, i32* %7
%53 = load i32, i32* %6
%54 = icmp sge i32 %52, %53
br i1 %54, label %55, label %218
55: ; preds = %51
%56 = load i32, i32* %3
%57 = load i32, i32* %7
%58 = sub nsw i32 %56, %57
store i32 %58, i32* %8
%59 = load double*, double** %4
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 2
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %59, i64 %62
%64 = load double, double* %63
%65 = load double*, double** %4
%66 = load i32, i32* %8
%67 = sub nsw i32 %66, 2
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %65, i64 %68
%70 = load double, double* %69
%71 = fsub double %64, %70
store double %71, double* %17
%72 = load double*, double** %4
%73 = load i32, i32* %7
%74 = add nsw i32 %73, 3
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
%77 = load double, double* %76
%78 = load double*, double** %4
%79 = load i32, i32* %8
%80 = sub nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %78, i64 %81
%83 = load double, double* %82
%84 = fadd double %77, %83
store double %84, double* %18
%85 = load double, double* %14
%86 = load double, double* %17
%87 = load double, double* %15
%88 = load double, double* %18
%89 = fmul double %87, %88
%90 = call double @llvm.fmuladd.f64(double %85, double %86, double %89)
store double %90, double* %19
%91 = load double, double* %14
%92 = load double, double* %18
%93 = load double, double* %15
%94 = load double, double* %17
%95 = fmul double %93, %94
%96 = fneg double %95
%97 = call double @llvm.fmuladd.f64(double %91, double %92, double %96)
store double %97, double* %20
%98 = load double, double* %19
%99 = load double*, double** %4
%100 = load i32, i32* %7
%101 = add nsw i32 %100, 2
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %99, i64 %102
%104 = load double, double* %103
%105 = fsub double %104, %98
store double %105, double* %103
%106 = load double, double* %20
%107 = load double*, double** %4
%108 = load i32, i32* %7
%109 = add nsw i32 %108, 3
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %107, i64 %110
%112 = load double, double* %111
%113 = fsub double %112, %106
store double %113, double* %111
%114 = load double, double* %19
%115 = load double*, double** %4
%116 = load i32, i32* %8
%117 = sub nsw i32 %116, 2
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %115, i64 %118
%120 = load double, double* %119
%121 = fadd double %120, %114
store double %121, double* %119
%122 = load double, double* %20
%123 = load double*, double** %4
%124 = load i32, i32* %8
%125 = sub nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %123, i64 %126
%128 = load double, double* %127
%129 = fsub double %128, %122
store double %129, double* %127
%130 = load double, double* %16
%131 = load double, double* %15
%132 = load double, double* %12
%133 = call double @llvm.fmuladd.f64(double %130, double %131, double %132)
store double %133, double* %12
%134 = load double, double* %16
%135 = load double, double* %14
%136 = fsub double 5.000000e-01, %135
%137 = load double, double* %13
%138 = call double @llvm.fmuladd.f64(double %134, double %136, double %137)
store double %138, double* %13
%139 = load double*, double** %4
%140 = load i32, i32* %7
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = load double*, double** %4
%145 = load i32, i32* %8
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = fsub double %143, %148
store double %149, double* %17
%150 = load double*, double** %4
%151 = load i32, i32* %7
%152 = add nsw i32 %151, 1
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %150, i64 %153
%155 = load double, double* %154
%156 = load double*, double** %4
%157 = load i32, i32* %8
%158 = add nsw i32 %157, 1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %156, i64 %159
%161 = load double, double* %160
%162 = fadd double %155, %161
store double %162, double* %18
%163 = load double, double* %12
%164 = load double, double* %17
%165 = load double, double* %13
%166 = load double, double* %18
%167 = fmul double %165, %166
%168 = call double @llvm.fmuladd.f64(double %163, double %164, double %167)
store double %168, double* %19
%169 = load double, double* %12
%170 = load double, double* %18
%171 = load double, double* %13
%172 = load double, double* %17
%173 = fmul double %171, %172
%174 = fneg double %173
%175 = call double @llvm.fmuladd.f64(double %169, double %170, double %174)
store double %175, double* %20
%176 = load double, double* %19
%177 = load double*, double** %4
%178 = load i32, i32* %7
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
%181 = load double, double* %180
%182 = fsub double %181, %176
store double %182, double* %180
%183 = load double, double* %20
%184 = load double*, double** %4
%185 = load i32, i32* %7
%186 = add nsw i32 %185, 1
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %184, i64 %187
%189 = load double, double* %188
%190 = fsub double %189, %183
store double %190, double* %188
%191 = load double, double* %19
%192 = load double*, double** %4
%193 = load i32, i32* %8
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %192, i64 %194
%196 = load double, double* %195
%197 = fadd double %196, %191
store double %197, double* %195
%198 = load double, double* %20
%199 = load double*, double** %4
%200 = load i32, i32* %8
%201 = add nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds double, double* %199, i64 %202
%204 = load double, double* %203
%205 = fsub double %204, %198
store double %205, double* %203
%206 = load double, double* %16
%207 = load double, double* %13
%208 = load double, double* %14
%209 = call double @llvm.fmuladd.f64(double %206, double %207, double %208)
store double %209, double* %14
%210 = load double, double* %16
%211 = load double, double* %12
%212 = fsub double 5.000000e-01, %211
%213 = load double, double* %15
%214 = call double @llvm.fmuladd.f64(double %210, double %212, double %213)
store double %214, double* %15
br label %215
215: ; preds = %55
%216 = load i32, i32* %7
%217 = sub nsw i32 %216, 4
store i32 %217, i32* %7
br label %51
218: ; preds = %51
%219 = load i32, i32* %6
%220 = icmp eq i32 %219, 4
br i1 %220, label %221, label %222
221: ; preds = %218
br label %252
222: ; preds = %218
%223 = load double, double* %9
%224 = load i32, i32* %6
%225 = sitofp i32 %224 to double
%226 = fmul double %223, %225
%227 = call double @sin(double %226)
%228 = fmul double 5.000000e-01, %227
store double %228, double* %12
%229 = load double, double* %9
%230 = load i32, i32* %6
%231 = sitofp i32 %230 to double
%232 = fmul double %229, %231
%233 = call double @cos(double %232)
%234 = fmul double 5.000000e-01, %233
store double %234, double* %13
%235 = load double, double* %12
%236 = load double, double* %10
%237 = load double, double* %13
%238 = load double, double* %11
%239 = fmul double %237, %238
%240 = fneg double %239
%241 = call double @llvm.fmuladd.f64(double %235, double %236, double %240)
%242 = fsub double 5.000000e-01, %241
store double %242, double* %14
%243 = load double, double* %12
%244 = load double, double* %11
%245 = load double, double* %13
%246 = load double, double* %10
%247 = fmul double %245, %246
%248 = call double @llvm.fmuladd.f64(double %243, double %244, double %247)
store double %248, double* %15
%249 = load double, double* %12
%250 = fsub double 5.000000e-01, %249
store double %250, double* %12
%251 = load i32, i32* %6
store i32 %251, i32* %5
br label %42
252: ; preds = %221
%253 = load double*, double** %4
%254 = getelementptr inbounds double, double* %253, i64 2
%255 = load double, double* %254
%256 = load double*, double** %4
%257 = load i32, i32* %3
%258 = sub nsw i32 %257, 2
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %256, i64 %259
%261 = load double, double* %260
%262 = fsub double %255, %261
store double %262, double* %17
%263 = load double*, double** %4
%264 = getelementptr inbounds double, double* %263, i64 3
%265 = load double, double* %264
%266 = load double*, double** %4
%267 = load i32, i32* %3
%268 = sub nsw i32 %267, 1
%269 = sext i32 %268 to i64
%270 = getelementptr inbounds double, double* %266, i64 %269
%271 = load double, double* %270
%272 = fadd double %265, %271
store double %272, double* %18
%273 = load double, double* %14
%274 = load double, double* %17
%275 = load double, double* %15
%276 = load double, double* %18
%277 = fmul double %275, %276
%278 = call double @llvm.fmuladd.f64(double %273, double %274, double %277)
store double %278, double* %19
%279 = load double, double* %14
%280 = load double, double* %18
%281 = load double, double* %15
%282 = load double, double* %17
%283 = fmul double %281, %282
%284 = fneg double %283
%285 = call double @llvm.fmuladd.f64(double %279, double %280, double %284)
store double %285, double* %20
%286 = load double, double* %19
%287 = load double*, double** %4
%288 = getelementptr inbounds double, double* %287, i64 2
%289 = load double, double* %288
%290 = fsub double %289, %286
store double %290, double* %288
%291 = load double, double* %20
%292 = load double*, double** %4
%293 = getelementptr inbounds double, double* %292, i64 3
%294 = load double, double* %293
%295 = fsub double %294, %291
store double %295, double* %293
%296 = load double, double* %19
%297 = load double*, double** %4
%298 = load i32, i32* %3
%299 = sub nsw i32 %298, 2
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double, double* %297, i64 %300
%302 = load double, double* %301
%303 = fadd double %302, %296
store double %303, double* %301
%304 = load double, double* %20
%305 = load double*, double** %4
%306 = load i32, i32* %3
%307 = sub nsw i32 %306, 1
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds double, double* %305, i64 %308
%310 = load double, double* %309
%311 = fsub double %310, %304
store double %311, double* %309
ret void
}

LLVM IR (-O2):
define void @rftbsub(i32 %0, double* nocapture %1) {
%3 = sitofp i32 %0 to double
%4 = fdiv double 0x400921FB54442D18, %3
%5 = tail call double @cos(double %4)
%6 = tail call double @sin(double %4)
%7 = fmul double %5, %6
%8 = fmul double %6, %6
%9 = tail call double @llvm.fmuladd.f64(double %8, double -2.000000e+00, double 1.000000e+00)
%10 = fmul double %7, 2.000000e+00
%11 = fmul double %10, 2.000000e+00
%12 = ashr i32 %0, 1
%13 = sext i32 %0 to i64
br label %14
14: ; preds = %110, %2
%15 = phi double [ 0.000000e+00, %2 ], [ %123, %110 ]
%16 = phi double [ 0.000000e+00, %2 ], [ %116, %110 ]
%17 = phi double [ %8, %2 ], [ %120, %110 ]
%18 = phi double [ %7, %2 ], [ %122, %110 ]
%19 = phi i32 [ %12, %2 ], [ %22, %110 ]
%20 = icmp sgt i32 %19, 260
%21 = select i1 %20, i32 %19, i32 260
%22 = add nsw i32 %21, -256
%23 = add nsw i32 %21, -252
%24 = icmp slt i32 %19, %23
br i1 %24, label %106, label %25
25: ; preds = %14
%26 = sext i32 %19 to i64
%27 = add nsw i64 %26, -4
%28 = zext i32 %22 to i64
br label %29
29: ; preds = %25, %29
%30 = phi i64 [ %26, %25 ], [ %36, %29 ]
%31 = phi i64 [ %27, %25 ], [ %104, %29 ]
%32 = phi double [ %18, %25 ], [ %103, %29 ]
%33 = phi double [ %17, %25 ], [ %101, %29 ]
%34 = phi double [ %16, %25 ], [ %69, %29 ]
%35 = phi double [ %15, %25 ], [ %67, %29 ]
%36 = add nsw i64 %30, -4
%37 = sub nsw i64 %13, %31
%38 = add nsw i64 %30, -2
%39 = getelementptr inbounds double, double* %1, i64 %38
%40 = add nsw i64 %37, -2
%41 = getelementptr inbounds double, double* %1, i64 %40
%42 = bitcast double* %39 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = bitcast double* %41 to <2 x double>*
%45 = load <2 x double>, <2 x double>* %44
%46 = fsub <2 x double> %43, %45
%47 = fadd <2 x double> %43, %45
%48 = shufflevector <2 x double> %46, <2 x double> %47, <2 x i32> <i32 0, i32 3>
%49 = fneg double %32
%50 = insertelement <2 x double> poison, double %32, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> %46, <2 x i32> <i32 0, i32 2>
%52 = extractelement <2 x double> %47, i64 1
%53 = insertelement <2 x double> poison, double %52, i64 0
%54 = insertelement <2 x double> %53, double %49, i64 1
%55 = fmul <2 x double> %51, %54
%56 = insertelement <2 x double> poison, double %33, i64 0
%57 = shufflevector <2 x double> %56, <2 x double> poison, <2 x i32> zeroinitializer
%58 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %57, <2 x double> %48, <2 x double> %55)
%59 = fsub <2 x double> %43, %58
%60 = bitcast double* %39 to <2 x double>*
store <2 x double> %59, <2 x double>* %60
%61 = bitcast double* %41 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = fadd <2 x double> %62, %58
%64 = fsub <2 x double> %62, %58
%65 = shufflevector <2 x double> %63, <2 x double> %64, <2 x i32> <i32 0, i32 3>
%66 = bitcast double* %41 to <2 x double>*
store <2 x double> %65, <2 x double>* %66
%67 = tail call double @llvm.fmuladd.f64(double %11, double %32, double %35)
%68 = fsub double 5.000000e-01, %33
%69 = tail call double @llvm.fmuladd.f64(double %11, double %68, double %34)
%70 = getelementptr inbounds double, double* %1, i64 %31
%71 = getelementptr inbounds double, double* %1, i64 %37
%72 = add nsw i64 %30, -3
%73 = getelementptr inbounds double, double* %1, i64 %72
%74 = bitcast double* %70 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = bitcast double* %71 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = fsub <2 x double> %75, %77
%79 = fadd <2 x double> %75, %77
%80 = shufflevector <2 x double> %78, <2 x double> %79, <2 x i32> <i32 0, i32 3>
%81 = fneg double %69
%82 = insertelement <2 x double> poison, double %69, i64 0
%83 = shufflevector <2 x double> %82, <2 x double> %78, <2 x i32> <i32 0, i32 2>
%84 = extractelement <2 x double> %79, i64 1
%85 = insertelement <2 x double> poison, double %84, i64 0
%86 = insertelement <2 x double> %85, double %81, i64 1
%87 = fmul <2 x double> %83, %86
%88 = insertelement <2 x double> poison, double %67, i64 0
%89 = shufflevector <2 x double> %88, <2 x double> poison, <2 x i32> zeroinitializer
%90 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %89, <2 x double> %80, <2 x double> %87)
%91 = fsub <2 x double> %75, %90
%92 = extractelement <2 x double> %91, i64 0
store double %92, double* %70
%93 = fsub <2 x double> %75, %90
%94 = extractelement <2 x double> %93, i64 1
store double %94, double* %73
%95 = bitcast double* %71 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = fadd <2 x double> %96, %90
%98 = fsub <2 x double> %96, %90
%99 = shufflevector <2 x double> %97, <2 x double> %98, <2 x i32> <i32 0, i32 3>
%100 = bitcast double* %71 to <2 x double>*
store <2 x double> %99, <2 x double>* %100
%101 = tail call double @llvm.fmuladd.f64(double %11, double %69, double %33)
%102 = fsub double 5.000000e-01, %67
%103 = tail call double @llvm.fmuladd.f64(double %11, double %102, double %32)
%104 = add nsw i64 %31, -4
%105 = icmp slt i64 %104, %28
br i1 %105, label %106, label %29
106: ; preds = %29, %14
%107 = phi double [ %17, %14 ], [ %101, %29 ]
%108 = phi double [ %18, %14 ], [ %103, %29 ]
%109 = icmp eq i32 %22, 4
br i1 %109, label %124, label %110
110: ; preds = %106
%111 = sitofp i32 %22 to double
%112 = fmul double %4, %111
%113 = tail call double @sin(double %112)
%114 = fmul double %113, 5.000000e-01
%115 = tail call double @cos(double %112)
%116 = fmul double %115, 5.000000e-01
%117 = fneg double %116
%118 = fmul double %10, %117
%119 = tail call double @llvm.fmuladd.f64(double %114, double %9, double %118)
%120 = fsub double 5.000000e-01, %119
%121 = fmul double %9, %116
%122 = tail call double @llvm.fmuladd.f64(double %114, double %10, double %121)
%123 = fsub double 5.000000e-01, %114
br label %14
124: ; preds = %106
%125 = getelementptr inbounds double, double* %1, i64 2
%126 = add nsw i32 %0, -2
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %1, i64 %127
%129 = load double, double* %128
%130 = bitcast double* %125 to <2 x double>*
%131 = load <2 x double>, <2 x double>* %130
%132 = add nsw i32 %0, -1
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %1, i64 %133
%135 = load double, double* %134
%136 = insertelement <2 x double> poison, double %129, i64 0
%137 = insertelement <2 x double> %136, double %135, i64 1
%138 = fsub <2 x double> %131, %137
%139 = fadd <2 x double> %131, %137
%140 = shufflevector <2 x double> %138, <2 x double> %139, <2 x i32> <i32 0, i32 3>
%141 = fneg double %108
%142 = insertelement <2 x double> poison, double %108, i64 0
%143 = shufflevector <2 x double> %142, <2 x double> %138, <2 x i32> <i32 0, i32 2>
%144 = extractelement <2 x double> %139, i64 1
%145 = insertelement <2 x double> poison, double %144, i64 0
%146 = insertelement <2 x double> %145, double %141, i64 1
%147 = fmul <2 x double> %143, %146
%148 = insertelement <2 x double> poison, double %107, i64 0
%149 = shufflevector <2 x double> %148, <2 x double> poison, <2 x i32> zeroinitializer
%150 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %149, <2 x double> %140, <2 x double> %147)
%151 = fsub <2 x double> %131, %150
%152 = bitcast double* %125 to <2 x double>*
store <2 x double> %151, <2 x double>* %152
%153 = load double, double* %128
%154 = extractelement <2 x double> %150, i64 0
%155 = fadd double %153, %154
store double %155, double* %128
%156 = load double, double* %134
%157 = extractelement <2 x double> %150, i64 1
%158 = fsub double %156, %157
store double %158, double* %134
ret void
}