void ddct(int n, int isgn, double *a, int *ip, double *w) {
  void makewt(int nw, int *ip, double *w);
  void makect(int nc, int *ip, double *c);
  void bitrv2(int n, int *ip, double *a);
  void cftfsub(int n, double *a, double *w);
  void cftbsub(int n, double *a, double *w);
  void rftfsub(int n, double *a, int nc, double *c);
  void rftbsub(int n, double *a, int nc, double *c);
  void dctsub(int n, double *a, int nc, double *c);
  int j, nw, nc;
  double xr;
  nw = ip[0];
  if (n > (nw << 2)) {
    nw = n >> 2;
    makewt(nw, ip, w);
  }
  nc = ip[1];
  if (n > nc) {
    nc = n;
    makect(nc, ip, w + nw);
  }
  if (isgn < 0) {
    xr = a[n - 1];
    for (j = n - 2; j >= 2; j -= 2) {
      a[j + 1] = a[j] - a[j - 1];
      a[j] += a[j - 1];
    }
    a[1] = a[0] - xr;
    a[0] += xr;
    if (n > 4) {
      rftbsub(n, a, nc, w + nw);
      bitrv2(n, ip + 2, a);
      cftbsub(n, a, w);
    } else if (n == 4) {
      cftfsub(n, a, w);
    }
  }
  dctsub(n, a, nc, w + nw);
  if (isgn >= 0) {
    if (n > 4) {
      bitrv2(n, ip + 2, a);
      cftfsub(n, a, w);
      rftfsub(n, a, nc, w + nw);
    } else if (n == 4) {
      cftfsub(n, a, w);
    }
    xr = a[0] - a[1];
    a[0] += a[1];
    for (j = 2; j < n; j += 2) {
      a[j - 1] = a[j] - a[j + 1];
      a[j] += a[j + 1];
    }
    a[n - 1] = xr;
  }
}


x86 assembly (clang, -O0):
<ddct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
jle    11cd <ddct+0x4d>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <makewt@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    1204 <ddct+0x84>
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1090 <makect@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1337 <ddct+0x1b7>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jl     129b <ddct+0x11b>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    122e <ddct+0xae>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
cmpl   $0x4,-0x4(%rbp)
jle    1313 <ddct+0x193>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
call   1080 <rftbsub@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rdx
call   1060 <bitrv2@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <cftbsub@plt>
jmp    1332 <ddct+0x1b2>
cmpl   $0x4,-0x4(%rbp)
jne    132d <ddct+0x1ad>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
jmp    1332 <ddct+0x1b2>
jmp    1337 <ddct+0x1b7>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
call   1030 <dctsub@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1487 <ddct+0x307>
cmpl   $0x4,-0x4(%rbp)
jle    13b0 <ddct+0x230>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rdx
call   1060 <bitrv2@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
call   1050 <rftfsub@plt>
jmp    13cf <ddct+0x24f>
cmpl   $0x4,-0x4(%rbp)
jne    13ca <ddct+0x24a>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
jmp    13cf <ddct+0x24f>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1470 <ddct+0x2f0>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1401 <ddct+0x281>
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddct>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %esi,%r9d
mov    %edi,%r14d
mov    (%rcx),%ebp
lea    0x0(,%rbp,4),%eax
cmp    %edi,%eax
mov    %r8,(%rsp)
jge    11c8 <ddct+0x48>
mov    %r14d,%ebp
sar    $0x2,%ebp
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r8,%rdx
mov    %r9d,%r15d
call   1040 <makewt@plt>
mov    %r15d,%r9d
mov    (%rsp),%r8
mov    0x4(%r12),%r15d
movslq %ebp,%r13
cmp    %r14d,%r15d
jge    11f1 <ddct+0x71>
lea    (%r8,%r13,8),%rdx
mov    %r14d,%edi
mov    %r12,%rsi
mov    %r9d,%ebp
call   1090 <makect@plt>
mov    %ebp,%r9d
mov    (%rsp),%r8
mov    %r14d,%r15d
movslq %r14d,%rbp
test   %r9d,%r9d
js     124f <ddct+0xcf>
lea    (%r8,%r13,8),%r13
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13,%rcx
call   1030 <dctsub@plt>
cmp    $0x5,%r14d
jl     1323 <ddct+0x1a3>
add    $0x8,%r12
mov    %r14d,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <bitrv2@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   10a0 <cftfsub@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13,%rcx
call   1050 <rftfsub@plt>
jmp    133e <ddct+0x1be>
movsd  -0x8(%rbx,%rbp,8),%xmm0
cmp    $0x4,%r14d
jl     14eb <ddct+0x36b>
mov    %rbp,0x10(%rsp)
lea    0x2(%r14),%eax
lea    -0x2(%r14),%ecx
lea    (%rbx,%rcx,8),%rcx
lea    -0x3(%r14),%edx
lea    (%rbx,%rdx,8),%rdx
lea    -0x1(%r14),%esi
lea    (%rbx,%rsi,8),%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rcx,%rdi,8),%xmm1
movsd  (%rdx,%rdi,8),%xmm2
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,(%rsi,%rdi,8)
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rcx,%rdi,8)
add    $0xfffffffffffffffe,%rdi
lea    (%rax,%rdi,1),%ebp
cmp    $0x5,%ebp
ja     1290 <ddct+0x110>
movsd  (%rbx),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rbx)
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
cmp    $0x5,%r14d
mov    %r9d,0xc(%rsp)
jl     155d <ddct+0x3dd>
lea    (%r8,%r13,8),%rcx
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1080 <rftbsub@plt>
lea    0x8(%r12),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
call   1060 <bitrv2@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   1070 <cftbsub@plt>
mov    (%rsp),%r8
mov    0x10(%rsp),%rbp
jmp    157c <ddct+0x3fc>
cmp    $0x4,%r14d
jne    1524 <ddct+0x3a4>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   10a0 <cftfsub@plt>
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
mov    %r14d,%eax
cmp    $0x5,%rax
mov    $0x4,%ecx
cmovae %rax,%rcx
add    $0xfffffffffffffffd,%rcx
mov    $0x2,%edx
cmp    $0x2,%rcx
jb     14a0 <ddct+0x320>
mov    %rbp,%r8
shr    %rcx
add    $0x1,%rcx
movabs $0x7ffffffffffffffe,%rdx
ff ff 7f
and    %rcx,%rdx
lea    -0x2(%rdx),%rsi
mov    %rsi,%rbp
shr    %rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     1549 <ddct+0x3c9>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0x6,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd -0x20(%rbx,%rsi,8),%xmm1
movupd -0x10(%rbx,%rsi,8),%xmm2
movupd (%rbx,%rsi,8),%xmm3
movupd 0x10(%rbx,%rsi,8),%xmm4
movapd %xmm1,%xmm5
unpcklpd %xmm2,%xmm5
unpckhpd %xmm2,%xmm1
movapd %xmm5,%xmm2
subpd  %xmm1,%xmm2
addpd  %xmm5,%xmm1
movapd %xmm2,%xmm5
unpckhpd %xmm1,%xmm5
unpcklpd %xmm1,%xmm2
movupd %xmm2,-0x28(%rbx,%rsi,8)
movupd %xmm5,-0x18(%rbx,%rsi,8)
movapd %xmm3,%xmm1
unpcklpd %xmm4,%xmm1
unpckhpd %xmm4,%xmm3
movapd %xmm1,%xmm2
subpd  %xmm3,%xmm2
addpd  %xmm1,%xmm3
movapd %xmm2,%xmm1
unpckhpd %xmm3,%xmm1
unpcklpd %xmm3,%xmm2
movupd %xmm2,-0x8(%rbx,%rsi,8)
movupd %xmm1,0x8(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    13c0 <ddct+0x240>
add    $0xfffffffffffffffc,%rsi
test   $0x1,%bpl
je     148a <ddct+0x30a>
movupd (%rbx,%rsi,8),%xmm1
movupd 0x10(%rbx,%rsi,8),%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm2,%xmm3
unpckhpd %xmm2,%xmm1
movapd %xmm3,%xmm2
subpd  %xmm1,%xmm2
addpd  %xmm3,%xmm1
movapd %xmm2,%xmm3
unpckhpd %xmm1,%xmm3
unpcklpd %xmm1,%xmm2
movupd %xmm2,-0x8(%rbx,%rsi,8)
movupd %xmm3,0x8(%rbx,%rsi,8)
cmp    %rdx,%rcx
mov    %r8,%rbp
je     14d6 <ddct+0x356>
add    %rcx,%rcx
or     $0x2,%rcx
mov    %rcx,%rdx
nopl   0x0(%rax)
lea    0x0(,%rdx,8),%rcx
movsd  (%rbx,%rdx,8),%xmm1
or     $0x8,%rcx
movsd  (%rbx,%rcx,1),%xmm2
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,-0x8(%rbx,%rdx,8)
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx,%rdx,8)
add    $0x2,%rdx
cmp    %rax,%rdx
jb     14a0 <ddct+0x320>
movsd  %xmm0,-0x8(%rbx,%rbp,8)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movsd  (%rbx),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rbx)
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
lea    (%r8,%r13,8),%rcx
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <dctsub@plt>
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
cmp    $0x3,%r14d
jge    1357 <ddct+0x1d7>
jmp    14d6 <ddct+0x356>
mov    $0x2,%esi
test   $0x1,%bpl
jne    144f <ddct+0x2cf>
jmp    148a <ddct+0x30a>
cmp    $0x4,%r14d
mov    0x10(%rsp),%rbp
jne    157c <ddct+0x3fc>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    %r8,%rdx
call   10a0 <cftfsub@plt>
mov    (%rsp),%r8
lea    (%r8,%r13,8),%r13
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13,%rcx
call   1030 <dctsub@plt>
cmpl   $0x0,0xc(%rsp)
jns    120e <ddct+0x8e>
jmp    14dc <ddct+0x35c>

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

LLVM IR (-O2):
define void @ddct(i32 %0, i32 %1, double* %2, i32* %3, double* %4) {
%6 = load i32, i32* %3
%7 = shl i32 %6, 2
%8 = icmp slt i32 %7, %0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = ashr i32 %0, 2
tail call void @makewt(i32 %10, i32* %3, double* %4)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %10, %9 ], [ %6, %5 ]
%13 = getelementptr inbounds i32, i32* %3, i64 1
%14 = load i32, i32* %13
%15 = icmp slt i32 %14, %0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = sext i32 %12 to i64
%18 = getelementptr inbounds double, double* %4, i64 %17
tail call void @makect(i32 %0, i32* %3, double* %18)
br label %19
19: ; preds = %16, %11
%20 = phi i32 [ %0, %16 ], [ %14, %11 ]
%21 = icmp slt i32 %1, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = sext i32 %12 to i64
%24 = getelementptr inbounds double, double* %4, i64 %23
tail call void @dctsub(i32 %0, double* %2, i32 %20, double* %24)
br label %71
25: ; preds = %19
%26 = add nsw i32 %0, -1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %2, i64 %27
%29 = load double, double* %28
%30 = icmp sgt i32 %0, 3
br i1 %30, label %38, label %31
31: ; preds = %25
%32 = load double, double* %2
%33 = fsub double %32, %29
%34 = getelementptr inbounds double, double* %2, i64 1
store double %33, double* %34
%35 = fadd double %29, %32
store double %35, double* %2
%36 = sext i32 %12 to i64
%37 = getelementptr inbounds double, double* %4, i64 %36
tail call void @dctsub(i32 %0, double* %2, i32 %20, double* %37)
br label %180
38: ; preds = %25, %38
%39 = phi i32 [ %40, %38 ], [ %0, %25 ]
%40 = add nsw i32 %39, -2
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds double, double* %2, i64 %41
%43 = load double, double* %42
%44 = add nsw i32 %39, -3
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds double, double* %2, i64 %45
%47 = load double, double* %46
%48 = fsub double %43, %47
%49 = add nsw i32 %39, -1
%50 = zext i32 %49 to i64
%51 = getelementptr inbounds double, double* %2, i64 %50
store double %48, double* %51
%52 = fadd double %43, %47
store double %52, double* %42
%53 = icmp ugt i32 %39, 5
br i1 %53, label %38, label %54
54: ; preds = %38
%55 = load double, double* %2
%56 = fsub double %55, %29
%57 = getelementptr inbounds double, double* %2, i64 1
store double %56, double* %57
%58 = fadd double %29, %55
store double %58, double* %2
%59 = icmp sgt i32 %0, 4
br i1 %59, label %60, label %64
60: ; preds = %54
%61 = sext i32 %12 to i64
%62 = getelementptr inbounds double, double* %4, i64 %61
tail call void @rftbsub(i32 %0, double* %2, i32 %20, double* %62)
%63 = getelementptr inbounds i32, i32* %3, i64 2
tail call void @bitrv2(i32 %0, i32* %63, double* %2)
tail call void @cftbsub(i32 %0, double* %2, double* %4)
br label %67
64: ; preds = %54
%65 = icmp eq i32 %0, 4
br i1 %65, label %66, label %67
66: ; preds = %64
tail call void @cftfsub(i32 4, double* %2, double* %4)
br label %67
67: ; preds = %60, %66, %64
%68 = sext i32 %12 to i64
%69 = getelementptr inbounds double, double* %4, i64 %68
tail call void @dctsub(i32 %0, double* %2, i32 %20, double* %69)
%70 = icmp sgt i32 %1, -1
br i1 %70, label %71, label %180
71: ; preds = %22, %67
%72 = phi double* [ %24, %22 ], [ %69, %67 ]
%73 = icmp sgt i32 %0, 4
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = getelementptr inbounds i32, i32* %3, i64 2
tail call void @bitrv2(i32 %0, i32* %75, double* %2)
tail call void @cftfsub(i32 %0, double* %2, double* %4)
tail call void @rftfsub(i32 %0, double* %2, i32 %20, double* %72)
br label %79
76: ; preds = %71
%77 = icmp eq i32 %0, 4
br i1 %77, label %78, label %85
78: ; preds = %76
tail call void @cftfsub(i32 4, double* %2, double* %4)
br label %79
79: ; preds = %78, %74
%80 = load double, double* %2
%81 = getelementptr inbounds double, double* %2, i64 1
%82 = load double, double* %81
%83 = fsub double %80, %82
%84 = fadd double %80, %82
store double %84, double* %2
br label %92
85: ; preds = %76
%86 = load double, double* %2
%87 = getelementptr inbounds double, double* %2, i64 1
%88 = load double, double* %87
%89 = fsub double %86, %88
%90 = fadd double %86, %88
store double %90, double* %2
%91 = icmp sgt i32 %0, 2
br i1 %91, label %92, label %175
92: ; preds = %79, %85
%93 = phi double [ %83, %79 ], [ %89, %85 ]
%94 = zext i32 %0 to i64
%95 = call i64 @llvm.umax.i64(i64 %94, i64 4)
%96 = add nsw i64 %95, -3
%97 = lshr i64 %96, 1
%98 = add nuw nsw i64 %97, 1
%99 = icmp ult i64 %96, 2
br i1 %99, label %160, label %100
100: ; preds = %92
%101 = and i64 %98, 9223372036854775806
%102 = shl nuw i64 %98, 1
%103 = or i64 %102, 2
%104 = add nsw i64 %101, -2
%105 = lshr exact i64 %104, 1
%106 = add nuw i64 %105, 1
%107 = and i64 %106, 1
%108 = icmp eq i64 %104, 0
br i1 %108, label %144, label %109
109: ; preds = %100
%110 = and i64 %106, -2
br label %111
111: ; preds = %111, %109
%112 = phi i64 [ 0, %109 ], [ %138, %111 ]
%113 = phi i64 [ 0, %109 ], [ %139, %111 ]
%114 = shl i64 %112, 1
%115 = or i64 %114, 2
%116 = getelementptr inbounds double, double* %2, i64 %115
%117 = bitcast double* %116 to <4 x double>*
%118 = load <4 x double>, <4 x double>* %117
%119 = shufflevector <4 x double> %118, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%120 = shufflevector <4 x double> %118, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%121 = fsub <2 x double> %119, %120
%122 = fadd <2 x double> %120, %119
%123 = getelementptr inbounds double, double* %116, i64 -1
%124 = bitcast double* %123 to <4 x double>*
%125 = shufflevector <2 x double> %121, <2 x double> %122, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %125, <4 x double>* %124
%126 = shl i64 %112, 1
%127 = or i64 %126, 6
%128 = getelementptr inbounds double, double* %2, i64 %127
%129 = bitcast double* %128 to <4 x double>*
%130 = load <4 x double>, <4 x double>* %129
%131 = shufflevector <4 x double> %130, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%132 = shufflevector <4 x double> %130, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%133 = fsub <2 x double> %131, %132
%134 = fadd <2 x double> %132, %131
%135 = getelementptr inbounds double, double* %128, i64 -1
%136 = bitcast double* %135 to <4 x double>*
%137 = shufflevector <2 x double> %133, <2 x double> %134, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %137, <4 x double>* %136
%138 = add nuw i64 %112, 4
%139 = add nuw i64 %113, 2
%140 = icmp eq i64 %139, %110
br i1 %140, label %141, label %111
141: ; preds = %111
%142 = shl i64 %138, 1
%143 = or i64 %142, 2
br label %144
144: ; preds = %141, %100
%145 = phi i64 [ 2, %100 ], [ %143, %141 ]
%146 = icmp eq i64 %107, 0
br i1 %146, label %158, label %147
147: ; preds = %144
%148 = getelementptr inbounds double, double* %2, i64 %145
%149 = bitcast double* %148 to <4 x double>*
%150 = load <4 x double>, <4 x double>* %149
%151 = shufflevector <4 x double> %150, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%152 = shufflevector <4 x double> %150, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%153 = fsub <2 x double> %151, %152
%154 = fadd <2 x double> %152, %151
%155 = getelementptr inbounds double, double* %148, i64 -1
%156 = bitcast double* %155 to <4 x double>*
%157 = shufflevector <2 x double> %153, <2 x double> %154, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %157, <4 x double>* %156
br label %158
158: ; preds = %144, %147
%159 = icmp eq i64 %98, %101
br i1 %159, label %175, label %160
160: ; preds = %92, %158
%161 = phi i64 [ 2, %92 ], [ %103, %158 ]
br label %162
162: ; preds = %160, %162
%163 = phi i64 [ %173, %162 ], [ %161, %160 ]
%164 = getelementptr inbounds double, double* %2, i64 %163
%165 = load double, double* %164
%166 = or i64 %163, 1
%167 = getelementptr inbounds double, double* %2, i64 %166
%168 = load double, double* %167
%169 = fsub double %165, %168
%170 = add nsw i64 %163, -1
%171 = getelementptr inbounds double, double* %2, i64 %170
store double %169, double* %171
%172 = fadd double %168, %165
store double %172, double* %164
%173 = add nuw nsw i64 %163, 2
%174 = icmp ult i64 %173, %94
br i1 %174, label %162, label %175
175: ; preds = %162, %158, %85
%176 = phi double [ %89, %85 ], [ %93, %158 ], [ %93, %162 ]
%177 = add nsw i32 %0, -1
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %2, i64 %178
store double %176, double* %179
br label %180
180: ; preds = %31, %175, %67
ret void
}