#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 dstsub(int n, double *a) {
  int i, i0, j, k, m;
  double ec, w1r, w1i, wkr, wki, wdr, wdi, ss, xr, xi, yr, yi;
  ec = 1.570796326794896619231321691639751442098584699687 / n;
  wkr = 0.5;
  wki = 0.5;
  w1r = cos(ec);
  w1i = sin(ec);
  wdr = 0.5 * (w1r - w1i);
  wdi = 0.5 * (w1r + w1i);
  ss = 2 * w1i;
  m = n >> 1;
  i = 0;
  for (;;) {
    i0 = i + 2 * 64;
    if (i0 > m - 2) {
      i0 = m - 2;
    }
    for (j = i + 2; j <= i0; j += 2) {
      k = n - j;
      xr = wdi * a[k + 1] - wdr * a[j - 1];
      xi = wdr * a[k + 1] + wdi * a[j - 1];
      wkr -= ss * wdi;
      wki += ss * wdr;
      yr = wki * a[k] - wkr * a[j];
      yi = wkr * a[k] + wki * a[j];
      wdr -= ss * wki;
      wdi += ss * wkr;
      a[j - 1] = xr;
      a[j] = yr;
      a[k + 1] = xi;
      a[k] = yi;
    }
    if (i0 == m - 2) {
      break;
    }
    wdr = cos(ec * i0);
    wdi = sin(ec * i0);
    wkr = 0.5 * (wdr - wdi);
    wki = 0.5 * (wdr + wdi);
    wdr = wkr * w1r - wki * w1i;
    wdi = wkr * w1i + wki * w1r;
    i = i0;
  }
  xr = wdi * a[m + 1] - wdr * a[m - 1];
  a[m + 1] = wdr * a[m + 1] + wdi * a[m - 1];
  a[m - 1] = xr;
  a[m] *= wki + ss * wdr;
}


x86 assembly (clang, -O0):
<dstsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0xe76(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
movsd  0xe5b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe42(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x80,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jle    11fd <dstsub+0xdd>
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1425 <dstsub+0x305>
mov    -0x4(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    1206 <dstsub+0xe6>
mov    -0x18(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jne    143b <dstsub+0x31b>
jmp    1505 <dstsub+0x3e5>
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm1
subsd  -0x60(%rbp),%xmm1
movsd  0xb8b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm1
addsd  -0x60(%rbp),%xmm1
movsd  0xb70(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11d8 <dstsub+0xb8>
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstsub>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
cvtsi2sd %edi,%xmm1
movsd  0xebf(%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),%xmm2
movapd %xmm2,%xmm4
subsd  %xmm0,%xmm4
movapd %xmm2,%xmm1
movapd %xmm2,%xmm5
addsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm4
movapd 0xe89(%rip),%xmm1
mulpd  %xmm1,%xmm4
movapd %xmm0,%xmm2
addsd  %xmm0,%xmm2
movslq %r14d,%rax
sar    %r14d
lea    -0x2(%r14),%r12d
movapd 0xe7a(%rip),%xmm8
xorpd  %xmm2,%xmm8
movapd %xmm5,%xmm3
unpcklpd %xmm0,%xmm3
movapd %xmm3,0x50(%rsp)
unpcklpd %xmm5,%xmm0
movapd %xmm0,0x70(%rsp)
movapd %xmm2,%xmm9
unpcklpd %xmm8,%xmm9
movapd %xmm2,0x30(%rsp)
unpcklpd %xmm2,%xmm8
lea    (%rbx,%rax,8),%r15
add    $0xfffffffffffffff0,%r15
xor    %ecx,%ecx
movapd %xmm8,0x60(%rsp)
movapd %xmm9,0x40(%rsp)
lea    0x80(%rcx),%eax
cmp    %r12d,%eax
mov    %eax,%ebp
cmovg  %r12d,%ebp
lea    0x2(%rcx),%edx
cmp    %ebp,%edx
jg     12ce <dstsub+0x1ae>
movslq %ecx,%rdi
lea    0x2(%rdi),%rcx
movslq %ebp,%rdx
shl    $0x3,%rdi
mov    %r15,%rsi
sub    %rdi,%rsi
xchg   %ax,%ax
movapd %xmm4,%xmm2
movupd -0x8(%rbx,%rcx,8),%xmm0
movapd %xmm0,%xmm3
mulsd  %xmm4,%xmm3
unpckhpd %xmm4,%xmm4
movupd (%rsi),%xmm5
movapd %xmm9,%xmm6
mulpd  %xmm2,%xmm6
addpd  %xmm6,%xmm1
movapd %xmm1,%xmm6
mulsd  %xmm5,%xmm6
movapd %xmm1,%xmm7
shufpd $0x1,%xmm2,%xmm7
mulpd  %xmm5,%xmm7
unpckhpd %xmm5,%xmm5
mulsd  %xmm4,%xmm5
subsd  %xmm3,%xmm5
movapd %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
movapd %xmm0,%xmm4
unpckhpd %xmm0,%xmm4
mulsd  %xmm3,%xmm4
subsd  %xmm4,%xmm6
movapd %xmm2,%xmm3
movsd  %xmm1,%xmm3
shufpd $0x1,%xmm0,%xmm0
mulpd  %xmm3,%xmm0
addpd  %xmm0,%xmm7
movapd %xmm8,%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm3,%xmm4
addpd  %xmm2,%xmm4
movsd  %xmm5,-0x8(%rbx,%rcx,8)
movsd  %xmm6,(%rbx,%rcx,8)
movupd %xmm7,(%rsi)
add    $0x2,%rcx
add    $0xfffffffffffffff0,%rsi
cmp    %rdx,%rcx
jle    1220 <dstsub+0x100>
addpd  %xmm2,%xmm3
movapd %xmm3,%xmm4
cmp    %eax,%r12d
jle    135b <dstsub+0x23b>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x40(%rsp),%xmm9
movapd 0x60(%rsp),%xmm8
movapd 0x10(%rsp),%xmm2
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm0,%xmm2
unpcklpd %xmm2,%xmm1
mulpd  0xce4(%rip),%xmm1
movapd %xmm1,%xmm2
xorpd  0xce8(%rip),%xmm2
unpcklpd %xmm1,%xmm2
mulpd  0x70(%rsp),%xmm2
movapd %xmm1,%xmm4
unpckhpd %xmm1,%xmm4
mulpd  0x50(%rsp),%xmm4
addpd  %xmm2,%xmm4
mov    %ebp,%ecx
jmp    11f0 <dstsub+0xd0>
movslq %r14d,%rax
movsd  -0x8(%rbx,%rax,8),%xmm2
movsd  0x8(%rbx,%rax,8),%xmm3
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm0,%xmm5
mulsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm5
subsd  %xmm2,%xmm5
mulsd  %xmm4,%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x8(%rbx,%rax,8)
movsd  %xmm5,-0x8(%rbx,%rax,8)
movapd 0x30(%rsp),%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
mulsd  (%rbx,%rax,8),%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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