#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 dctsub(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[j - 1] - wdr * a[k + 1];
      xi = wdr * a[j - 1] + wdi * a[k + 1];
      wkr -= ss * wdi;
      wki += ss * wdr;
      yr = wki * a[j] - wkr * a[k];
      yi = wkr * a[j] + wki * a[k];
      wdr -= ss * wki;
      wdi += ss * wkr;
      a[k + 1] = xr;
      a[k] = yr;
      a[j - 1] = xi;
      a[j] = 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):
<dctsub>:
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 <dctsub+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 <dctsub+0x305>
mov    -0x4(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $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    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $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 -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x20(%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 -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x20(%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    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    1206 <dctsub+0xe6>
mov    -0x18(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jne    143b <dctsub+0x31b>
jmp    1505 <dctsub+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 <dctsub+0xb8>
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $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
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $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):
<dctsub>:
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,%xmm6
subsd  %xmm0,%xmm6
movapd %xmm2,%xmm1
movapd %xmm2,%xmm3
addsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm6
movapd 0xe8b(%rip),%xmm8
mulpd  %xmm8,%xmm6
movapd %xmm0,%xmm9
addsd  %xmm0,%xmm9
movslq %r14d,%rax
sar    %r14d
lea    -0x2(%r14),%r12d
movapd 0xe7a(%rip),%xmm2
xorpd  %xmm9,%xmm2
movapd %xmm3,%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
unpcklpd %xmm3,%xmm0
movapd %xmm0,0x60(%rsp)
movapd %xmm2,%xmm10
unpcklpd %xmm9,%xmm10
unpcklpd %xmm2,%xmm9
lea    (%rbx,%rax,8),%r15
add    $0xfffffffffffffff0,%r15
xor    %ecx,%ecx
movapd %xmm9,0x50(%rsp)
movapd %xmm10,0x30(%rsp)
nopw   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     12d1 <dctsub+0x1b1>
movslq %ecx,%rdi
lea    0x2(%rdi),%rcx
movslq %ebp,%rdx
shl    $0x3,%rdi
mov    %r15,%rsi
sub    %rdi,%rsi
xchg   %ax,%ax
movapd %xmm6,%xmm0
movupd (%rsi),%xmm1
movapd %xmm6,%xmm5
mulpd  %xmm1,%xmm5
unpckhpd %xmm5,%xmm5
movupd -0x8(%rbx,%rcx,8),%xmm3
movapd %xmm3,%xmm6
shufpd $0x1,%xmm3,%xmm6
movapd %xmm0,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm5,%xmm4
movapd %xmm9,%xmm5
mulpd  %xmm0,%xmm5
addpd  %xmm5,%xmm8
movapd %xmm8,%xmm5
unpckhpd %xmm8,%xmm5
movapd %xmm8,%xmm7
shufpd $0x1,%xmm0,%xmm7
mulpd  %xmm1,%xmm7
movapd %xmm0,%xmm2
movsd  %xmm8,%xmm2
mulpd  %xmm6,%xmm2
subpd  %xmm7,%xmm2
mulsd  %xmm8,%xmm1
unpckhpd %xmm3,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm1,%xmm3
movapd %xmm10,%xmm5
mulpd  %xmm8,%xmm5
movapd %xmm5,%xmm6
addpd  %xmm0,%xmm6
movupd %xmm2,(%rsi)
movsd  %xmm4,-0x8(%rbx,%rcx,8)
movsd  %xmm3,(%rbx,%rcx,8)
add    $0x2,%rcx
add    $0xfffffffffffffff0,%rsi
cmp    %rdx,%rcx
jle    1220 <dctsub+0x100>
addpd  %xmm0,%xmm5
movapd %xmm5,%xmm6
cmp    %eax,%r12d
jle    1366 <dctsub+0x246>
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),%xmm10
movapd 0x50(%rsp),%xmm9
movapd 0x10(%rsp),%xmm1
movapd %xmm1,%xmm8
addsd  %xmm0,%xmm8
subsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm8
mulpd  0xcdd(%rip),%xmm8
movapd %xmm8,%xmm0
xorpd  0xce0(%rip),%xmm0
unpcklpd %xmm8,%xmm0
mulpd  0x60(%rsp),%xmm0
movapd %xmm8,%xmm6
unpckhpd %xmm8,%xmm6
mulpd  0x40(%rsp),%xmm6
addpd  %xmm0,%xmm6
mov    %ebp,%ecx
jmp    11f0 <dctsub+0xd0>
movslq %r14d,%rax
movsd  0x8(%rbx,%rax,8),%xmm0
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm6,%xmm0
movsd  -0x8(%rbx,%rax,8),%xmm3
movsd  (%rbx,%rax,8),%xmm4
mulsd  %xmm3,%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm6
addsd  %xmm1,%xmm6
movsd  %xmm6,-0x8(%rbx,%rax,8)
movsd  %xmm2,0x8(%rbx,%rax,8)
mulsd  0xc56(%rip),%xmm4
movsd  %xmm4,(%rbx,%rax,8)
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dctsub(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* %7
%65 = sub 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* %8
%72 = add 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* %7
%82 = sub 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* %8
%89 = add 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* %7
%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* %8
%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* %7
%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* %8
%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* %8
%145 = add 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* %8
%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* %7
%156 = sub 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* %7
%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 = sub 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 = add 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 = sub 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 = add 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 = sub 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 = add 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 @dctsub(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 = %88, %2
%33 = phi i32 [ 0, %2 ], [ %38, %88 ]
%34 = phi <2 x double> [ %14, %2 ], [ %107, %88 ]
%35 = phi <2 x double> [ <double 5.000000e-01, double 5.000000e-01>, %2 ], [ %100, %88 ]
%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 %85, 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 ], [ %81, %45 ]
%48 = phi <2 x double> [ %34, %41 ], [ %79, %45 ]
%49 = phi <2 x double> [ %35, %41 ], [ %66, %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 = getelementptr inbounds double, double* %1, i64 %51
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = fmul <2 x double> %48, %57
%59 = extractelement <2 x double> %58, i64 1
%60 = getelementptr inbounds double, double* %1, i64 %47
%61 = bitcast double* %53 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = shufflevector <2 x double> %62, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%64 = extractelement <2 x double> %62, i64 0
%65 = tail call double @llvm.fmuladd.f64(double %54, double %64, double %59)
%66 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %48, <2 x double> %49)
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %48, <2 x double> %49)
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %48, <2 x double> %49)
%69 = extractelement <2 x double> %68, i64 1
%70 = shufflevector <2 x double> %68, <2 x double> %48, <2 x i32> <i32 1, i32 2>
%71 = fneg <2 x double> %70
%72 = fmul <2 x double> %57, %71
%73 = shufflevector <2 x double> %68, <2 x double> %48, <2 x i32> <i32 0, i32 3>
%74 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %73, <2 x double> %63, <2 x double> %72)
%75 = fmul <2 x double> %68, %57
%76 = extractelement <2 x double> %75, i64 0
%77 = extractelement <2 x double> %62, i64 1
%78 = tail call double @llvm.fmuladd.f64(double %69, double %77, double %76)
%79 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> %67, <2 x double> %48)
%80 = bitcast double* %55 to <2 x double>*
store <2 x double> %74, <2 x double>* %80
store double %65, double* %53
store double %78, double* %60
%81 = add nsw i64 %47, 2
%82 = icmp sgt i64 %81, %44
br i1 %82, label %83, label %45
83: ; preds = %45
%84 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %68, <2 x double> %48)
br label %85
85: ; preds = %83, %32
%86 = phi <2 x double> [ %34, %32 ], [ %84, %83 ]
%87 = icmp sgt i32 %17, %36
br i1 %87, label %88, label %108
88: ; preds = %85
%89 = sitofp i32 %38 to double
%90 = fmul double %4, %89
%91 = tail call double @cos(double %90)
%92 = tail call double @sin(double %90)
%93 = insertelement <2 x double> poison, double %91, i64 0
%94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> zeroinitializer
%95 = insertelement <2 x double> poison, double %92, i64 0
%96 = shufflevector <2 x double> %95, <2 x double> poison, <2 x i32> zeroinitializer
%97 = fadd <2 x double> %94, %96
%98 = fsub <2 x double> %94, %96
%99 = shufflevector <2 x double> %97, <2 x double> %98, <2 x i32> <i32 0, i32 3>
%100 = fmul <2 x double> %99, <double 5.000000e-01, double 5.000000e-01>
%101 = extractelement <2 x double> %100, i64 0
%102 = fneg double %101
%103 = insertelement <2 x double> poison, double %102, i64 0
%104 = shufflevector <2 x double> %103, <2 x double> %100, <2 x i32> <i32 0, i32 2>
%105 = fmul <2 x double> %21, %104
%106 = shufflevector <2 x double> %100, <2 x double> undef, <2 x i32> <i32 1, i32 1>
%107 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %106, <2 x double> %20, <2 x double> %105)
br label %32
108: ; preds = %85
%109 = add nsw i32 %16, -1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %1, i64 %110
%112 = load double, double* %111
%113 = add nsw i32 %16, 1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %1, i64 %114
%116 = load double, double* %115
%117 = extractelement <2 x double> %86, i64 0
%118 = fneg double %117
%119 = fmul double %116, %118
%120 = extractelement <2 x double> %86, i64 1
%121 = tail call double @llvm.fmuladd.f64(double %120, double %112, double %119)
%122 = fmul double %120, %116
%123 = tail call double @llvm.fmuladd.f64(double %117, double %112, double %122)
store double %123, double* %111
store double %121, double* %115
%124 = sext i32 %16 to i64
%125 = getelementptr inbounds double, double* %1, i64 %124
%126 = load double, double* %125
%127 = fmul double %126, 0x3FE6A09E667F3BCD
store double %127, double* %125
ret void
}