void ddst(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 dstsub(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);
    }
  }
  dstsub(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):
<ddst>:
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 <ddst+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   1030 <makewt@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    1204 <ddst+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    1356 <ddst+0x1d6>
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     12b6 <ddst+0x136>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%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),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    122e <ddst+0xae>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
cmpl   $0x4,-0x4(%rbp)
jle    1332 <ddst+0x1b2>
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    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rdx
call   1050 <bitrv2@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1060 <cftbsub@plt>
jmp    1351 <ddst+0x1d1>
cmpl   $0x4,-0x4(%rbp)
jne    134c <ddst+0x1cc>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
jmp    1351 <ddst+0x1d1>
jmp    1356 <ddst+0x1d6>
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 <dstsub@plt>
cmpl   $0x0,-0x8(%rbp)
jl     14d8 <ddst+0x358>
cmpl   $0x4,-0x4(%rbp)
jle    13cf <ddst+0x24f>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rdx
call   1050 <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   1040 <rftfsub@plt>
jmp    13ee <ddst+0x26e>
cmpl   $0x4,-0x4(%rbp)
jne    13e9 <ddst+0x269>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
jmp    13ee <ddst+0x26e>
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    14aa <ddst+0x32a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%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),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1420 <ddst+0x2a0>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%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):
<ddst>:
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 <ddst+0x48>
mov    %r14d,%ebp
sar    $0x2,%ebp
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r8,%rdx
mov    %r9d,%r15d
call   1030 <makewt@plt>
mov    %r15d,%r9d
mov    (%rsp),%r8
mov    0x4(%r12),%r15d
movslq %ebp,%r13
cmp    %r14d,%r15d
jge    11f1 <ddst+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 <ddst+0xcf>
lea    (%r8,%r13,8),%r13
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13,%rcx
call   1080 <dstsub@plt>
cmp    $0x5,%r14d
jl     1327 <ddst+0x1a7>
add    $0x8,%r12
mov    %r14d,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <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   1040 <rftfsub@plt>
jmp    1342 <ddst+0x1c2>
movsd  -0x8(%rbx,%rbp,8),%xmm0
cmp    $0x4,%r14d
jl     1516 <ddst+0x396>
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
movapd 0xd76(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rdi,8),%xmm2
movapd %xmm2,%xmm3
xorpd  %xmm1,%xmm3
movsd  (%rdx,%rdi,8),%xmm4
subsd  %xmm4,%xmm3
movsd  %xmm3,(%rsi,%rdi,8)
subsd  %xmm4,%xmm2
movsd  %xmm2,(%rcx,%rdi,8)
add    $0xfffffffffffffffe,%rdi
lea    (%rax,%rdi,1),%ebp
cmp    $0x5,%ebp
ja     1290 <ddst+0x110>
movsd  (%rbx),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rbx)
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
cmp    $0x5,%r14d
mov    %r9d,0xc(%rsp)
jl     1588 <ddst+0x408>
lea    (%r8,%r13,8),%rcx
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1070 <rftbsub@plt>
lea    0x8(%r12),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
call   1050 <bitrv2@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   1060 <cftbsub@plt>
mov    (%rsp),%r8
mov    0x10(%rsp),%rbp
jmp    15a7 <ddst+0x427>
cmp    $0x4,%r14d
jne    154f <ddst+0x3cf>
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     14ac <ddst+0x32c>
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     1574 <ddst+0x3f4>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0x6,%esi
movapd 0xc40(%rip),%xmm1
movupd -0x20(%rbx,%rsi,8),%xmm2
movupd -0x10(%rbx,%rsi,8),%xmm3
movupd (%rbx,%rsi,8),%xmm4
movupd 0x10(%rbx,%rsi,8),%xmm5
movapd %xmm2,%xmm6
unpcklpd %xmm3,%xmm6
unpckhpd %xmm3,%xmm2
movapd %xmm6,%xmm3
xorpd  %xmm1,%xmm3
subpd  %xmm2,%xmm3
subpd  %xmm2,%xmm6
movapd %xmm3,%xmm2
unpckhpd %xmm6,%xmm2
unpcklpd %xmm6,%xmm3
movupd %xmm3,-0x28(%rbx,%rsi,8)
movupd %xmm2,-0x18(%rbx,%rsi,8)
movapd %xmm4,%xmm2
unpcklpd %xmm5,%xmm2
unpckhpd %xmm5,%xmm4
movapd %xmm2,%xmm3
xorpd  %xmm1,%xmm3
subpd  %xmm4,%xmm3
subpd  %xmm4,%xmm2
movapd %xmm3,%xmm4
unpckhpd %xmm2,%xmm4
unpcklpd %xmm2,%xmm3
movupd %xmm3,-0x8(%rbx,%rsi,8)
movupd %xmm4,0x8(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    13c0 <ddst+0x240>
add    $0xfffffffffffffffc,%rsi
test   $0x1,%bpl
je     149a <ddst+0x31a>
movupd (%rbx,%rsi,8),%xmm1
movupd 0x10(%rbx,%rsi,8),%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm2,%xmm3
unpckhpd %xmm2,%xmm1
movapd 0xb8a(%rip),%xmm2
xorpd  %xmm3,%xmm2
subpd  %xmm1,%xmm2
subpd  %xmm1,%xmm3
movapd %xmm2,%xmm1
unpckhpd %xmm3,%xmm1
unpcklpd %xmm3,%xmm2
movupd %xmm2,-0x8(%rbx,%rsi,8)
movupd %xmm1,0x8(%rbx,%rsi,8)
cmp    %rdx,%rcx
mov    %r8,%rbp
je     14f9 <ddst+0x379>
add    %rcx,%rcx
or     $0x2,%rcx
mov    %rcx,%rdx
movapd 0xb4c(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x0(,%rdx,8),%rcx
movsd  (%rbx,%rdx,8),%xmm2
movapd %xmm2,%xmm3
xorpd  %xmm1,%xmm3
or     $0x8,%rcx
unpcklpd %xmm2,%xmm3
movsd  (%rbx,%rcx,1),%xmm2
unpcklpd %xmm2,%xmm2
subpd  %xmm2,%xmm3
movupd %xmm3,-0x8(%rbx,%rdx,8)
add    $0x2,%rdx
cmp    %rax,%rdx
jb     14c0 <ddst+0x340>
xorpd  0xaff(%rip),%xmm0
movlpd %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 %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rbx)
subsd  %xmm0,%xmm1
movsd  %xmm1,(%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    1080 <dstsub@plt>
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
cmp    $0x3,%r14d
jge    135b <ddst+0x1db>
jmp    14f9 <ddst+0x379>
mov    $0x2,%esi
test   $0x1,%bpl
jne    1457 <ddst+0x2d7>
jmp    149a <ddst+0x31a>
cmp    $0x4,%r14d
mov    0x10(%rsp),%rbp
jne    15a7 <ddst+0x427>
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   1080 <dstsub@plt>
cmpl   $0x0,0xc(%rsp)
jns    120e <ddst+0x8e>
jmp    1507 <ddst+0x387>

LLVM IR (-O0):
define void @ddst(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 %131
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 = %89, %46
%56 = load i32, i32* %11
%57 = icmp sge i32 %56, 2
br i1 %57, label %58, label %92
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 = fneg double %63
%65 = load double*, double** %8
%66 = load i32, i32* %11
%67 = sub nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %65, i64 %68
%70 = load double, double* %69
%71 = fsub double %64, %70
%72 = load double*, double** %8
%73 = load i32, i32* %11
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
store double %71, double* %76
%77 = load double*, double** %8
%78 = load i32, i32* %11
%79 = sub nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %77, i64 %80
%82 = load double, double* %81
%83 = load double*, double** %8
%84 = load i32, i32* %11
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = fsub double %87, %82
store double %88, double* %86
br label %89
89: ; preds = %58
%90 = load i32, i32* %11
%91 = sub nsw i32 %90, 2
store i32 %91, i32* %11
br label %55
92: ; preds = %55
%93 = load double*, double** %8
%94 = getelementptr inbounds double, double* %93, i64 0
%95 = load double, double* %94
%96 = load double, double* %14
%97 = fadd double %95, %96
%98 = load double*, double** %8
%99 = getelementptr inbounds double, double* %98, i64 1
store double %97, double* %99
%100 = load double, double* %14
%101 = load double*, double** %8
%102 = getelementptr inbounds double, double* %101, i64 0
%103 = load double, double* %102
%104 = fsub double %103, %100
store double %104, double* %102
%105 = load i32, i32* %6
%106 = icmp sgt i32 %105, 4
br i1 %106, label %107, label %122
107: ; preds = %92
%108 = load i32, i32* %6
%109 = load double*, double** %8
%110 = load i32, i32* %13
%111 = load double*, double** %10
%112 = load i32, i32* %12
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %111, i64 %113
%115 = load i32, i32* %6
%116 = load i32*, i32** %9
%117 = getelementptr inbounds i32, i32* %116, i64 2
%118 = load double*, double** %8
%119 = load i32, i32* %6
%120 = load double*, double** %8
%121 = load double*, double** %10
br label %130
122: ; preds = %92
%123 = load i32, i32* %6
%124 = icmp eq i32 %123, 4
br i1 %124, label %125, label %129
125: ; preds = %122
%126 = load i32, i32* %6
%127 = load double*, double** %8
%128 = load double*, double** %10
br label %129
129: ; preds = %125, %122
br label %130
130: ; preds = %129, %107
br label %131
131: ; preds = %130, %43
%132 = load i32, i32* %6
%133 = load double*, double** %8
%134 = load i32, i32* %13
%135 = load double*, double** %10
%136 = load i32, i32* %12
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
%139 = load i32, i32* %7
%140 = icmp sge i32 %139, 0
br i1 %140, label %141, label %228
141: ; preds = %131
%142 = load i32, i32* %6
%143 = icmp sgt i32 %142, 4
br i1 %143, label %144, label %159
144: ; preds = %141
%145 = load i32, i32* %6
%146 = load i32*, i32** %9
%147 = getelementptr inbounds i32, i32* %146, i64 2
%148 = load double*, double** %8
%149 = load i32, i32* %6
%150 = load double*, double** %8
%151 = load double*, double** %10
%152 = load i32, i32* %6
%153 = load double*, double** %8
%154 = load i32, i32* %13
%155 = load double*, double** %10
%156 = load i32, i32* %12
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
br label %167
159: ; preds = %141
%160 = load i32, i32* %6
%161 = icmp eq i32 %160, 4
br i1 %161, label %162, label %166
162: ; preds = %159
%163 = load i32, i32* %6
%164 = load double*, double** %8
%165 = load double*, double** %10
br label %166
166: ; preds = %162, %159
br label %167
167: ; preds = %166, %144
%168 = load double*, double** %8
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
%171 = load double*, double** %8
%172 = getelementptr inbounds double, double* %171, i64 1
%173 = load double, double* %172
%174 = fsub double %170, %173
store double %174, double* %14
%175 = load double*, double** %8
%176 = getelementptr inbounds double, double* %175, i64 1
%177 = load double, double* %176
%178 = load double*, double** %8
%179 = getelementptr inbounds double, double* %178, i64 0
%180 = load double, double* %179
%181 = fadd double %180, %177
store double %181, double* %179
store i32 2, i32* %11
br label %182
182: ; preds = %217, %167
%183 = load i32, i32* %11
%184 = load i32, i32* %6
%185 = icmp slt i32 %183, %184
br i1 %185, label %186, label %220
186: ; preds = %182
%187 = load double*, double** %8
%188 = load i32, i32* %11
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
%191 = load double, double* %190
%192 = fneg double %191
%193 = load double*, double** %8
%194 = load i32, i32* %11
%195 = add nsw i32 %194, 1
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %193, i64 %196
%198 = load double, double* %197
%199 = fsub double %192, %198
%200 = load double*, double** %8
%201 = load i32, i32* %11
%202 = sub nsw i32 %201, 1
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds double, double* %200, i64 %203
store double %199, double* %204
%205 = load double*, double** %8
%206 = load i32, i32* %11
%207 = add nsw i32 %206, 1
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %205, i64 %208
%210 = load double, double* %209
%211 = load double*, double** %8
%212 = load i32, i32* %11
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds double, double* %211, i64 %213
%215 = load double, double* %214
%216 = fsub double %215, %210
store double %216, double* %214
br label %217
217: ; preds = %186
%218 = load i32, i32* %11
%219 = add nsw i32 %218, 2
store i32 %219, i32* %11
br label %182
220: ; preds = %182
%221 = load double, double* %14
%222 = fneg double %221
%223 = load double*, double** %8
%224 = load i32, i32* %6
%225 = sub nsw i32 %224, 1
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds double, double* %223, i64 %226
store double %222, double* %227
br label %228
228: ; preds = %220, %131
ret void
}

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