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 cftfsub(int n, double *a, int *ip, int nw, double *w);
  void cftbsub(int n, double *a, int *ip, int nw, 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);
      cftbsub(n, a, ip, nw, w);
    } else if (n == 4) {
      cftbsub(n, a, ip, nw, w);
    }
  }
  dctsub(n, a, nc, w + nw);
  if (isgn >= 0) {
    if (n > 4) {
      cftfsub(n, a, ip, nw, w);
      rftfsub(n, a, nc, w + nw);
    } else if (n == 4) {
      cftfsub(n, a, ip, nw, 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    11bd <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    11f4 <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   1080 <makect@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1321 <ddct+0x1b1>
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     128b <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    121e <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    12f6 <ddct+0x186>
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   1070 <rftbsub@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1060 <cftbsub@plt>
jmp    131c <ddct+0x1ac>
cmpl   $0x4,-0x4(%rbp)
jne    1317 <ddct+0x1a7>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1060 <cftbsub@plt>
jmp    131c <ddct+0x1ac>
jmp    1321 <ddct+0x1b1>
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     146b <ddct+0x2fb>
cmpl   $0x4,-0x4(%rbp)
jle    138d <ddct+0x21d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1090 <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    13b3 <ddct+0x243>
cmpl   $0x4,-0x4(%rbp)
jne    13ae <ddct+0x23e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1090 <cftfsub@plt>
jmp    13b3 <ddct+0x243>
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    1454 <ddct+0x2e4>
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    13e5 <ddct+0x275>
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    %r8,%rbp
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %edi,%r14d
mov    (%rcx),%r13d
lea    0x0(,%r13,4),%eax
cmp    %edi,%eax
jge    11b4 <ddct+0x44>
mov    %r14d,%r13d
sar    $0x2,%r13d
mov    %r13d,%edi
mov    %esi,%r15d
mov    %r12,%rsi
mov    %rbp,%rdx
call   1040 <makewt@plt>
mov    %r15d,%esi
mov    0x4(%r12),%edx
movslq %r13d,%r15
cmp    %r14d,%edx
jge    11e8 <ddct+0x78>
lea    0x0(,%r15,8),%rdx
add    %rbp,%rdx
mov    %r14d,%edi
mov    %r15,(%rsp)
mov    %esi,%r15d
mov    %r12,%rsi
call   1080 <makect@plt>
mov    %r15d,%esi
mov    (%rsp),%r15
mov    %r14d,%edx
mov    %rbp,(%rsp)
movslq %r14d,%rbp
test   %esi,%esi
js     1243 <ddct+0xd3>
mov    (%rsp),%rax
lea    (%rax,%r15,8),%r15
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %edx,0x8(%rsp)
mov    %r15,%rcx
call   1030 <dctsub@plt>
cmp    $0x5,%r14d
jl     12f6 <ddct+0x186>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r13d,%ecx
mov    (%rsp),%r8
call   1090 <cftfsub@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    0x8(%rsp),%edx
mov    %r15,%rcx
call   1050 <rftfsub@plt>
jmp    1317 <ddct+0x1a7>
movsd  -0x8(%rbx,%rbp,8),%xmm0
cmp    $0x4,%r14d
jl     14bb <ddct+0x34b>
mov    %esi,0xc(%rsp)
mov    %rbp,0x10(%rsp)
lea    0x2(%r14),%r8d
lea    -0x2(%r14),%ecx
lea    (%rbx,%rcx,8),%rcx
lea    -0x3(%r14),%eax
lea    (%rbx,%rax,8),%rax
lea    -0x1(%r14),%esi
lea    (%rbx,%rsi,8),%rsi
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rdi,8),%xmm1
movsd  (%rax,%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    (%r8,%rdi,1),%ebp
cmp    $0x5,%ebp
ja     1280 <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    (%rsp),%rbp
mov    %edx,0x8(%rsp)
jl     152e <ddct+0x3be>
lea    0x0(,%r15,8),%rcx
add    %rbp,%rcx
mov    %r14d,%edi
mov    %rbx,%rsi
call   1070 <rftbsub@plt>
mov    %r14d,%edi
jmp    1539 <ddct+0x3c9>
cmp    $0x4,%r14d
jne    14f5 <ddct+0x385>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r13d,%ecx
mov    (%rsp),%r8
call   1090 <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     1470 <ddct+0x300>
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     151a <ddct+0x3aa>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0x6,%esi
nopl   (%rax)
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    1390 <ddct+0x220>
add    $0xfffffffffffffffc,%rsi
test   $0x1,%bpl
je     145a <ddct+0x2ea>
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     14a6 <ddct+0x336>
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     1470 <ddct+0x300>
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)
mov    (%rsp),%rax
lea    (%rax,%r15,8),%rcx
mov    %r14d,%edi
mov    %rbx,%rsi
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    1330 <ddct+0x1c0>
jmp    14a6 <ddct+0x336>
mov    $0x2,%esi
test   $0x1,%bpl
jne    141f <ddct+0x2af>
jmp    145a <ddct+0x2ea>
mov    $0x4,%edi
cmp    $0x4,%r14d
jne    154a <ddct+0x3da>
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r13d,%ecx
mov    %rbp,%r8
call   1060 <cftbsub@plt>
lea    0x0(,%r15,8),%r15
add    %rbp,%r15
mov    %r14d,%edi
mov    %rbx,%rsi
mov    0x8(%rsp),%edx
mov    %r15,%rcx
call   1030 <dctsub@plt>
cmpl   $0x0,0xc(%rsp)
mov    0x10(%rsp),%rbp
jns    120d <ddct+0x9d>
jmp    14ac <ddct+0x33c>

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 %119
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 double*, double** %8
%116 = load i32*, i32** %9
%117 = load i32, i32* %12
%118 = load double*, double** %10
br label %129
119: ; preds = %91
%120 = load i32, i32* %6
%121 = icmp eq i32 %120, 4
br i1 %121, label %122, label %128
122: ; preds = %119
%123 = load i32, i32* %6
%124 = load double*, double** %8
%125 = load i32*, i32** %9
%126 = load i32, i32* %12
%127 = load double*, double** %10
br label %128
128: ; preds = %122, %119
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 %156
143: ; preds = %140
%144 = load i32, i32* %6
%145 = load double*, double** %8
%146 = load i32*, i32** %9
%147 = load i32, i32* %12
%148 = load double*, double** %10
%149 = load i32, i32* %6
%150 = load double*, double** %8
%151 = load i32, i32* %13
%152 = load double*, double** %10
%153 = load i32, i32* %12
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %152, i64 %154
br label %166
156: ; preds = %140
%157 = load i32, i32* %6
%158 = icmp eq i32 %157, 4
br i1 %158, label %159, label %165
159: ; preds = %156
%160 = load i32, i32* %6
%161 = load double*, double** %8
%162 = load i32*, i32** %9
%163 = load i32, i32* %12
%164 = load double*, double** %10
br label %165
165: ; preds = %159, %156
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 %179
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 %63
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)
br label %65
63: ; preds = %54
%64 = icmp eq i32 %0, 4
br i1 %64, label %65, label %67
65: ; preds = %63, %60
%66 = phi i32 [ %0, %60 ], [ 4, %63 ]
tail call void @cftbsub(i32 %66, double* %2, i32* %3, i32 %12, double* %4)
br label %67
67: ; preds = %65, %63
%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 %179
71: ; preds = %22, %67
%72 = phi double* [ %24, %22 ], [ %69, %67 ]
%73 = icmp sgt i32 %0, 4
br i1 %73, label %74, label %75
74: ; preds = %71
tail call void @cftfsub(i32 %0, double* %2, i32* %3, i32 %12, double* %4)
tail call void @rftfsub(i32 %0, double* %2, i32 %20, double* %72)
br label %78
75: ; preds = %71
%76 = icmp eq i32 %0, 4
br i1 %76, label %77, label %84
77: ; preds = %75
tail call void @cftfsub(i32 4, double* %2, i32* %3, i32 %12, double* %4)
br label %78
78: ; preds = %77, %74
%79 = load double, double* %2
%80 = getelementptr inbounds double, double* %2, i64 1
%81 = load double, double* %80
%82 = fsub double %79, %81
%83 = fadd double %79, %81
store double %83, double* %2
br label %91
84: ; preds = %75
%85 = load double, double* %2
%86 = getelementptr inbounds double, double* %2, i64 1
%87 = load double, double* %86
%88 = fsub double %85, %87
%89 = fadd double %85, %87
store double %89, double* %2
%90 = icmp sgt i32 %0, 2
br i1 %90, label %91, label %174
91: ; preds = %78, %84
%92 = phi double [ %82, %78 ], [ %88, %84 ]
%93 = zext i32 %0 to i64
%94 = call i64 @llvm.umax.i64(i64 %93, i64 4)
%95 = add nsw i64 %94, -3
%96 = lshr i64 %95, 1
%97 = add nuw nsw i64 %96, 1
%98 = icmp ult i64 %95, 2
br i1 %98, label %159, label %99
99: ; preds = %91
%100 = and i64 %97, 9223372036854775806
%101 = shl nuw i64 %97, 1
%102 = or i64 %101, 2
%103 = add nsw i64 %100, -2
%104 = lshr exact i64 %103, 1
%105 = add nuw i64 %104, 1
%106 = and i64 %105, 1
%107 = icmp eq i64 %103, 0
br i1 %107, label %143, label %108
108: ; preds = %99
%109 = and i64 %105, -2
br label %110
110: ; preds = %110, %108
%111 = phi i64 [ 0, %108 ], [ %137, %110 ]
%112 = phi i64 [ 0, %108 ], [ %138, %110 ]
%113 = shl i64 %111, 1
%114 = or i64 %113, 2
%115 = getelementptr inbounds double, double* %2, i64 %114
%116 = bitcast double* %115 to <4 x double>*
%117 = load <4 x double>, <4 x double>* %116
%118 = shufflevector <4 x double> %117, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%119 = shufflevector <4 x double> %117, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%120 = fsub <2 x double> %118, %119
%121 = fadd <2 x double> %119, %118
%122 = getelementptr inbounds double, double* %115, i64 -1
%123 = bitcast double* %122 to <4 x double>*
%124 = shufflevector <2 x double> %120, <2 x double> %121, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %124, <4 x double>* %123
%125 = shl i64 %111, 1
%126 = or i64 %125, 6
%127 = getelementptr inbounds double, double* %2, i64 %126
%128 = bitcast double* %127 to <4 x double>*
%129 = load <4 x double>, <4 x double>* %128
%130 = shufflevector <4 x double> %129, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%131 = shufflevector <4 x double> %129, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%132 = fsub <2 x double> %130, %131
%133 = fadd <2 x double> %131, %130
%134 = getelementptr inbounds double, double* %127, i64 -1
%135 = bitcast double* %134 to <4 x double>*
%136 = shufflevector <2 x double> %132, <2 x double> %133, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %136, <4 x double>* %135
%137 = add nuw i64 %111, 4
%138 = add nuw i64 %112, 2
%139 = icmp eq i64 %138, %109
br i1 %139, label %140, label %110
140: ; preds = %110
%141 = shl i64 %137, 1
%142 = or i64 %141, 2
br label %143
143: ; preds = %140, %99
%144 = phi i64 [ 2, %99 ], [ %142, %140 ]
%145 = icmp eq i64 %106, 0
br i1 %145, label %157, label %146
146: ; preds = %143
%147 = getelementptr inbounds double, double* %2, i64 %144
%148 = bitcast double* %147 to <4 x double>*
%149 = load <4 x double>, <4 x double>* %148
%150 = shufflevector <4 x double> %149, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%151 = shufflevector <4 x double> %149, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%152 = fsub <2 x double> %150, %151
%153 = fadd <2 x double> %151, %150
%154 = getelementptr inbounds double, double* %147, i64 -1
%155 = bitcast double* %154 to <4 x double>*
%156 = shufflevector <2 x double> %152, <2 x double> %153, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %156, <4 x double>* %155
br label %157
157: ; preds = %143, %146
%158 = icmp eq i64 %97, %100
br i1 %158, label %174, label %159
159: ; preds = %91, %157
%160 = phi i64 [ 2, %91 ], [ %102, %157 ]
br label %161
161: ; preds = %159, %161
%162 = phi i64 [ %172, %161 ], [ %160, %159 ]
%163 = getelementptr inbounds double, double* %2, i64 %162
%164 = load double, double* %163
%165 = or i64 %162, 1
%166 = getelementptr inbounds double, double* %2, i64 %165
%167 = load double, double* %166
%168 = fsub double %164, %167
%169 = add nsw i64 %162, -1
%170 = getelementptr inbounds double, double* %2, i64 %169
store double %168, double* %170
%171 = fadd double %167, %164
store double %171, double* %163
%172 = add nuw nsw i64 %162, 2
%173 = icmp ult i64 %172, %93
br i1 %173, label %161, label %174
174: ; preds = %161, %157, %84
%175 = phi double [ %88, %84 ], [ %92, %157 ], [ %92, %161 ]
%176 = add nsw i32 %0, -1
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %2, i64 %177
store double %175, double* %178
br label %179
179: ; preds = %31, %174, %67
ret void
}