#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] *= 0.707106781186547524400844362104849039284835937688;
}


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)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  0xa52(%rip),%xmm0
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    $0x70,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
cvtsi2sd %edi,%xmm1
movsd  0xec2(%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 0xe8c(%rip),%xmm1
mulpd  %xmm1,%xmm4
movapd %xmm0,%xmm8
addsd  %xmm0,%xmm8
movslq %r14d,%rax
sar    %r14d
lea    -0x2(%r14),%r12d
movapd 0xe7c(%rip),%xmm2
xorpd  %xmm8,%xmm2
movapd %xmm5,%xmm3
unpcklpd %xmm0,%xmm3
movapd %xmm3,0x40(%rsp)
unpcklpd %xmm5,%xmm0
movapd %xmm0,0x60(%rsp)
movapd %xmm2,%xmm9
unpcklpd %xmm8,%xmm9
unpcklpd %xmm2,%xmm8
lea    (%rbx,%rax,8),%r15
add    $0xfffffffffffffff0,%r15
xor    %ecx,%ecx
movapd %xmm8,0x50(%rsp)
movapd %xmm9,0x30(%rsp)
nopl   0x0(%rax,%rax,1)
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 %xmm8,%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 %xmm9,%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 0x30(%rsp),%xmm9
movapd 0x50(%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  0x60(%rsp),%xmm2
movapd %xmm1,%xmm4
unpckhpd %xmm1,%xmm4
mulpd  0x40(%rsp),%xmm4
addpd  %xmm2,%xmm4
mov    %ebp,%ecx
jmp    11f0 <dstsub+0xd0>
movslq %r14d,%rax
movsd  0x8(%rbx,%rax,8),%xmm1
movsd  -0x8(%rbx,%rax,8),%xmm2
movsd  (%rbx,%rax,8),%xmm3
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm0,%xmm5
mulsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm5
subsd  %xmm2,%xmm5
mulsd  %xmm1,%xmm4
addsd  %xmm0,%xmm4
movsd  %xmm4,0x8(%rbx,%rax,8)
movsd  %xmm5,-0x8(%rbx,%rax,8)
mulsd  0xc61(%rip),%xmm3
movsd  %xmm3,(%rbx,%rax,8)
add    $0x70,%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** %4
%252 = load i32, i32* %9
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %251, i64 %253
%255 = load double, double* %254
%256 = fmul double %255, 0x3FE6A09E667F3BCD
store double %256, double* %254
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 = %91, %2
%33 = phi i32 [ 0, %2 ], [ %38, %91 ]
%34 = phi <2 x double> [ %14, %2 ], [ %110, %91 ]
%35 = phi <2 x double> [ <double 5.000000e-01, double 5.000000e-01>, %2 ], [ %103, %91 ]
%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
br i1 %40, label %88, label %41
41: ; preds = %32
%42 = sext i32 %33 to i64
%43 = add nsw i64 %42, 2
%44 = sext i32 %38 to i64
br label %45
45: ; preds = %41, %45
%46 = phi i64 [ %42, %41 ], [ %50, %45 ]
%47 = phi i64 [ %43, %41 ], [ %84, %45 ]
%48 = phi <2 x double> [ %34, %41 ], [ %82, %45 ]
%49 = phi <2 x double> [ %35, %41 ], [ %67, %45 ]
%50 = add nsw i64 %46, 2
%51 = sub nsw i64 %19, %47
%52 = add nsw i64 %46, 1
%53 = getelementptr inbounds double, double* %1, i64 %52
%54 = extractelement <2 x double> %48, i64 0
%55 = fneg double %54
%56 = getelementptr inbounds double, double* %1, i64 %47
%57 = bitcast double* %53 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = extractelement <2 x double> %58, i64 0
%60 = fmul double %59, %55
%61 = extractelement <2 x double> %48, i64 1
%62 = getelementptr inbounds double, double* %1, i64 %51
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = extractelement <2 x double> %64, i64 1
%66 = tail call double @llvm.fmuladd.f64(double %61, double %65, double %60)
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %48, <2 x double> %49)
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %48, <2 x double> %49)
%69 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %48, <2 x double> %49)
%70 = extractelement <2 x double> %69, i64 1
%71 = fneg double %70
%72 = extractelement <2 x double> %58, i64 1
%73 = fmul double %72, %71
%74 = extractelement <2 x double> %69, i64 0
%75 = extractelement <2 x double> %64, i64 0
%76 = tail call double @llvm.fmuladd.f64(double %74, double %75, double %73)
%77 = shufflevector <2 x double> %48, <2 x double> %69, <2 x i32> <i32 1, i32 2>
%78 = fmul <2 x double> %77, %58
%79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%80 = shufflevector <2 x double> %69, <2 x double> %48, <2 x i32> <i32 1, i32 2>
%81 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %80, <2 x double> %64, <2 x double> %79)
%82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> %68, <2 x double> %48)
store double %66, double* %53
store double %76, double* %56
%83 = bitcast double* %62 to <2 x double>*
store <2 x double> %81, <2 x double>* %83
%84 = add nsw i64 %47, 2
%85 = icmp sgt i64 %84, %44
br i1 %85, label %86, label %45
86: ; preds = %45
%87 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %69, <2 x double> %48)
br label %88
88: ; preds = %86, %32
%89 = phi <2 x double> [ %34, %32 ], [ %87, %86 ]
%90 = icmp sgt i32 %17, %36
br i1 %90, label %91, label %111
91: ; preds = %88
%92 = sitofp i32 %38 to double
%93 = fmul double %4, %92
%94 = tail call double @cos(double %93)
%95 = tail call double @sin(double %93)
%96 = insertelement <2 x double> poison, double %94, i64 0
%97 = shufflevector <2 x double> %96, <2 x double> poison, <2 x i32> zeroinitializer
%98 = insertelement <2 x double> poison, double %95, i64 0
%99 = shufflevector <2 x double> %98, <2 x double> poison, <2 x i32> zeroinitializer
%100 = fadd <2 x double> %97, %99
%101 = fsub <2 x double> %97, %99
%102 = shufflevector <2 x double> %100, <2 x double> %101, <2 x i32> <i32 0, i32 3>
%103 = fmul <2 x double> %102, <double 5.000000e-01, double 5.000000e-01>
%104 = extractelement <2 x double> %103, i64 0
%105 = fneg double %104
%106 = insertelement <2 x double> poison, double %105, i64 0
%107 = shufflevector <2 x double> %106, <2 x double> %103, <2 x i32> <i32 0, i32 2>
%108 = fmul <2 x double> %21, %107
%109 = shufflevector <2 x double> %103, <2 x double> undef, <2 x i32> <i32 1, i32 1>
%110 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %109, <2 x double> %20, <2 x double> %108)
br label %32
111: ; preds = %88
%112 = add nsw i32 %16, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %1, i64 %113
%115 = load double, double* %114
%116 = add nsw i32 %16, -1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %1, i64 %117
%119 = load double, double* %118
%120 = extractelement <2 x double> %89, i64 0
%121 = fneg double %120
%122 = fmul double %119, %121
%123 = extractelement <2 x double> %89, i64 1
%124 = tail call double @llvm.fmuladd.f64(double %123, double %115, double %122)
%125 = fmul double %123, %119
%126 = tail call double @llvm.fmuladd.f64(double %120, double %115, double %125)
store double %126, double* %114
store double %124, double* %118
%127 = sext i32 %16 to i64
%128 = getelementptr inbounds double, double* %1, i64 %127
%129 = load double, double* %128
%130 = fmul double %129, 0x3FE6A09E667F3BCD
store double %130, double* %128
ret void
}