#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] *= wki + ss * wdr;
}


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)
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):
<dctsub>:
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,%xmm6
subsd  %xmm0,%xmm6
movapd %xmm2,%xmm1
movapd %xmm2,%xmm3
addsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm6
movapd 0xe88(%rip),%xmm8
mulpd  %xmm8,%xmm6
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movslq %r14d,%rax
sar    %r14d
lea    -0x2(%r14),%r12d
movapd 0xe78(%rip),%xmm9
xorpd  %xmm1,%xmm9
unpcklpd %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
unpcklpd %xmm3,%xmm0
movapd %xmm0,0x70(%rsp)
movapd %xmm1,%xmm10
unpcklpd %xmm9,%xmm10
movapd %xmm1,0x30(%rsp)
unpcklpd %xmm1,%xmm9
lea    (%rbx,%rax,8),%r15
add    $0xfffffffffffffff0,%r15
xor    %ecx,%ecx
movapd %xmm9,0x60(%rsp)
movapd %xmm10,0x40(%rsp)
xchg   %ax,%ax
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 %xmm10,%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 %xmm9,%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 0x40(%rsp),%xmm10
movapd 0x60(%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  0x70(%rsp),%xmm0
movapd %xmm8,%xmm6
unpckhpd %xmm8,%xmm6
mulpd  0x50(%rsp),%xmm6
addpd  %xmm0,%xmm6
mov    %ebp,%ecx
jmp    11f0 <dctsub+0xd0>
movslq %r14d,%rax
movsd  -0x8(%rbx,%rax,8),%xmm0
movsd  0x8(%rbx,%rax,8),%xmm1
movapd %xmm6,%xmm2
unpckhpd %xmm6,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm1,%xmm2
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm6,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,-0x8(%rbx,%rax,8)
movsd  %xmm3,0x8(%rbx,%rax,8)
movapd 0x30(%rsp),%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm8,%xmm0
mulsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x80,%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* %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 @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 = %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
%41 = extractelement <2 x double> %35, i64 0
br i1 %40, label %87, 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 ], [ %82, %46 ]
%49 = phi <2 x double> [ %34, %42 ], [ %80, %46 ]
%50 = phi <2 x double> [ %35, %42 ], [ %67, %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 = getelementptr inbounds double, double* %1, i64 %52
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = fmul <2 x double> %49, %58
%60 = extractelement <2 x double> %59, i64 1
%61 = getelementptr inbounds double, double* %1, i64 %48
%62 = bitcast double* %54 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = shufflevector <2 x double> %63, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%65 = extractelement <2 x double> %63, i64 0
%66 = tail call double @llvm.fmuladd.f64(double %55, double %65, double %60)
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %49, <2 x double> %50)
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %49, <2 x double> %50)
%69 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %49, <2 x double> %50)
%70 = extractelement <2 x double> %69, i64 1
%71 = shufflevector <2 x double> %69, <2 x double> %49, <2 x i32> <i32 1, i32 2>
%72 = fneg <2 x double> %71
%73 = fmul <2 x double> %58, %72
%74 = shufflevector <2 x double> %69, <2 x double> %49, <2 x i32> <i32 0, i32 3>
%75 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %64, <2 x double> %73)
%76 = fmul <2 x double> %69, %58
%77 = extractelement <2 x double> %76, i64 0
%78 = extractelement <2 x double> %63, i64 1
%79 = tail call double @llvm.fmuladd.f64(double %70, double %78, double %77)
%80 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> %68, <2 x double> %49)
%81 = bitcast double* %56 to <2 x double>*
store <2 x double> %75, <2 x double>* %81
store double %66, double* %54
store double %79, double* %61
%82 = add nsw i64 %48, 2
%83 = icmp sgt i64 %82, %45
br i1 %83, label %84, label %46
84: ; preds = %46
%85 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %69, <2 x double> %49)
%86 = extractelement <2 x double> %69, i64 0
br label %87
87: ; preds = %84, %32
%88 = phi double [ %41, %32 ], [ %86, %84 ]
%89 = phi <2 x double> [ %34, %32 ], [ %85, %84 ]
%90 = icmp sgt i32 %17, %36
br i1 %90, label %91, label %111
91: ; preds = %87
%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 = %87
%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 = tail call double @llvm.fmuladd.f64(double %15, double %120, double %88)
%128 = sext i32 %16 to i64
%129 = getelementptr inbounds double, double* %1, i64 %128
%130 = load double, double* %129
%131 = fmul double %127, %130
store double %131, double* %129
ret void
}