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 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 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);
      cftbsub(n, a, ip + 2, nw, w);
    } else if (n == 4) {
      cftbsub(n, a, ip + 2, nw, w);
    }
  }
  dstsub(n, a, nc, w + nw);
  if (isgn >= 0) {
    if (n > 4) {
      cftfsub(n, a, ip + 2, nw, w);
      rftfsub(n, a, nc, w + nw);
    } else if (n == 4) {
      cftfsub(n, a, ip + 2, 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):
<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    11bd <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    11f4 <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   1080 <makect@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1348 <ddst+0x1d8>
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     12a6 <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    121e <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    1319 <ddst+0x1a9>
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   1060 <rftbsub@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1050 <cftbsub@plt>
jmp    1343 <ddst+0x1d3>
cmpl   $0x4,-0x4(%rbp)
jne    133e <ddst+0x1ce>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1050 <cftbsub@plt>
jmp    1343 <ddst+0x1d3>
jmp    1348 <ddst+0x1d8>
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 <dstsub@plt>
cmpl   $0x0,-0x8(%rbp)
jl     14cc <ddst+0x35c>
cmpl   $0x4,-0x4(%rbp)
jle    13b8 <ddst+0x248>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%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   1040 <rftfsub@plt>
jmp    13e2 <ddst+0x272>
cmpl   $0x4,-0x4(%rbp)
jne    13dd <ddst+0x26d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1090 <cftfsub@plt>
jmp    13e2 <ddst+0x272>
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    149e <ddst+0x32e>
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    1414 <ddst+0x2a4>
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    %r8,%rbp
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %edi,%r14d
mov    (%rcx),%r13d
lea    0x0(,%r13,4),%eax
cmp    %edi,%eax
jge    11b4 <ddst+0x44>
mov    %r14d,%r13d
sar    $0x2,%r13d
mov    %r13d,%edi
mov    %esi,%r15d
mov    %r12,%rsi
mov    %rbp,%rdx
call   1030 <makewt@plt>
mov    %r15d,%esi
mov    0x4(%r12),%edx
movslq %r13d,%r15
cmp    %r14d,%edx
jge    11ee <ddst+0x7e>
lea    0x0(,%r15,8),%rdx
add    %rbp,%rdx
mov    %r14d,%edi
mov    %r13,(%rsp)
mov    %r15,%r13
mov    %esi,%r15d
mov    %r12,%rsi
call   1080 <makect@plt>
mov    %r15d,%esi
mov    %r13,%r15
mov    (%rsp),%r13
mov    %r14d,%edx
mov    %rbp,(%rsp)
movslq %r14d,%rbp
test   %esi,%esi
js     124d <ddst+0xdd>
mov    (%rsp),%rax
lea    (%rax,%r15,8),%r15
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %edx,0x8(%rsp)
mov    %r15,%rcx
call   1070 <dstsub@plt>
cmp    $0x5,%r14d
jl     130a <ddst+0x19a>
add    $0x8,%r12
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   1040 <rftfsub@plt>
jmp    132f <ddst+0x1bf>
movsd  -0x8(%rbx,%rbp,8),%xmm0
cmp    $0x4,%r14d
jl     1506 <ddst+0x396>
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
movapd 0xd74(%rip),%xmm1
nopl   0x0(%rax)
movsd  (%rcx,%rdi,8),%xmm2
movapd %xmm2,%xmm3
xorpd  %xmm1,%xmm3
movsd  (%rax,%rdi,8),%xmm4
subsd  %xmm4,%xmm3
movsd  %xmm3,(%rsi,%rdi,8)
subsd  %xmm4,%xmm2
movsd  %xmm2,(%rcx,%rdi,8)
add    $0xfffffffffffffffe,%rdi
lea    (%r8,%rdi,1),%ebp
cmp    $0x5,%ebp
ja     1290 <ddst+0x120>
movsd  (%rbx),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rbx)
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
cmp    $0x5,%r14d
mov    (%rsp),%rbp
mov    %edx,0x8(%rsp)
jl     1579 <ddst+0x409>
lea    0x0(,%r15,8),%rcx
add    %rbp,%rcx
mov    %r14d,%edi
mov    %rbx,%rsi
call   1060 <rftbsub@plt>
mov    %r14d,%edi
jmp    1584 <ddst+0x414>
cmp    $0x4,%r14d
jne    1540 <ddst+0x3d0>
add    $0x8,%r12
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     149c <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     1565 <ddst+0x3f5>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0x6,%esi
movapd 0xc53(%rip),%xmm1
nopl   (%rax)
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    13b0 <ddst+0x240>
add    $0xfffffffffffffffc,%rsi
test   $0x1,%bpl
je     148a <ddst+0x31a>
movupd (%rbx,%rsi,8),%xmm1
movupd 0x10(%rbx,%rsi,8),%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm2,%xmm3
unpckhpd %xmm2,%xmm1
movapd 0xb9a(%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     14e9 <ddst+0x379>
add    %rcx,%rcx
or     $0x2,%rcx
mov    %rcx,%rdx
movapd 0xb5c(%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     14b0 <ddst+0x340>
xorpd  0xb0f(%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)
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    1070 <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    1348 <ddst+0x1d8>
jmp    14e9 <ddst+0x379>
mov    $0x2,%esi
test   $0x1,%bpl
jne    1447 <ddst+0x2d7>
jmp    148a <ddst+0x31a>
mov    $0x4,%edi
cmp    $0x4,%r14d
jne    1597 <ddst+0x427>
lea    0x8(%r12),%rdx
mov    %rbx,%rsi
mov    %r13d,%ecx
mov    %rbp,%r8
call   1050 <cftbsub@plt>
lea    0x0(,%r15,8),%r15
add    %rbp,%r15
mov    %r14d,%edi
mov    %rbx,%rsi
mov    0x8(%rsp),%edx
mov    %r15,%rcx
call   1070 <dstsub@plt>
cmpl   $0x0,0xc(%rsp)
mov    0x10(%rsp),%rbp
jns    1213 <ddst+0xa3>
jmp    14f7 <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 %133
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 %121
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 double*, double** %8
%117 = load i32*, i32** %9
%118 = getelementptr inbounds i32, i32* %117, i64 2
%119 = load i32, i32* %12
%120 = load double*, double** %10
br label %132
121: ; preds = %92
%122 = load i32, i32* %6
%123 = icmp eq i32 %122, 4
br i1 %123, label %124, label %131
124: ; preds = %121
%125 = load i32, i32* %6
%126 = load double*, double** %8
%127 = load i32*, i32** %9
%128 = getelementptr inbounds i32, i32* %127, i64 2
%129 = load i32, i32* %12
%130 = load double*, double** %10
br label %131
131: ; preds = %124, %121
br label %132
132: ; preds = %131, %107
br label %133
133: ; preds = %132, %43
%134 = load i32, i32* %6
%135 = load double*, double** %8
%136 = load i32, i32* %13
%137 = load double*, double** %10
%138 = load i32, i32* %12
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %137, i64 %139
%141 = load i32, i32* %7
%142 = icmp sge i32 %141, 0
br i1 %142, label %143, label %232
143: ; preds = %133
%144 = load i32, i32* %6
%145 = icmp sgt i32 %144, 4
br i1 %145, label %146, label %160
146: ; preds = %143
%147 = load i32, i32* %6
%148 = load double*, double** %8
%149 = load i32*, i32** %9
%150 = getelementptr inbounds i32, i32* %149, i64 2
%151 = load i32, i32* %12
%152 = load double*, double** %10
%153 = load i32, i32* %6
%154 = load double*, double** %8
%155 = load i32, i32* %13
%156 = load double*, double** %10
%157 = load i32, i32* %12
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
br label %171
160: ; preds = %143
%161 = load i32, i32* %6
%162 = icmp eq i32 %161, 4
br i1 %162, label %163, label %170
163: ; preds = %160
%164 = load i32, i32* %6
%165 = load double*, double** %8
%166 = load i32*, i32** %9
%167 = getelementptr inbounds i32, i32* %166, i64 2
%168 = load i32, i32* %12
%169 = load double*, double** %10
br label %170
170: ; preds = %163, %160
br label %171
171: ; preds = %170, %146
%172 = load double*, double** %8
%173 = getelementptr inbounds double, double* %172, i64 0
%174 = load double, double* %173
%175 = load double*, double** %8
%176 = getelementptr inbounds double, double* %175, i64 1
%177 = load double, double* %176
%178 = fsub double %174, %177
store double %178, double* %14
%179 = load double*, double** %8
%180 = getelementptr inbounds double, double* %179, i64 1
%181 = load double, double* %180
%182 = load double*, double** %8
%183 = getelementptr inbounds double, double* %182, i64 0
%184 = load double, double* %183
%185 = fadd double %184, %181
store double %185, double* %183
store i32 2, i32* %11
br label %186
186: ; preds = %221, %171
%187 = load i32, i32* %11
%188 = load i32, i32* %6
%189 = icmp slt i32 %187, %188
br i1 %189, label %190, label %224
190: ; preds = %186
%191 = load double*, double** %8
%192 = load i32, i32* %11
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %191, i64 %193
%195 = load double, double* %194
%196 = fneg double %195
%197 = load double*, double** %8
%198 = load i32, i32* %11
%199 = add nsw i32 %198, 1
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds double, double* %197, i64 %200
%202 = load double, double* %201
%203 = fsub double %196, %202
%204 = load double*, double** %8
%205 = load i32, i32* %11
%206 = sub nsw i32 %205, 1
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %204, i64 %207
store double %203, double* %208
%209 = load double*, double** %8
%210 = load i32, i32* %11
%211 = add nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %209, i64 %212
%214 = load double, double* %213
%215 = load double*, double** %8
%216 = load i32, i32* %11
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %215, i64 %217
%219 = load double, double* %218
%220 = fsub double %219, %214
store double %220, double* %218
br label %221
221: ; preds = %190
%222 = load i32, i32* %11
%223 = add nsw i32 %222, 2
store i32 %223, i32* %11
br label %186
224: ; preds = %186
%225 = load double, double* %14
%226 = fneg double %225
%227 = load double*, double** %8
%228 = load i32, i32* %6
%229 = sub nsw i32 %228, 1
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds double, double* %227, i64 %230
store double %226, double* %231
br label %232
232: ; preds = %224, %133
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 %73
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 %192
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 %64
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)
br label %66
64: ; preds = %55
%65 = icmp eq i32 %0, 4
br i1 %65, label %66, label %69
66: ; preds = %64, %61
%67 = phi i32 [ %0, %61 ], [ 4, %64 ]
%68 = getelementptr inbounds i32, i32* %3, i64 2
tail call void @cftbsub(i32 %67, double* %2, i32* %68, i32 %12, double* %4)
br label %69
69: ; preds = %66, %64
%70 = sext i32 %12 to i64
%71 = getelementptr inbounds double, double* %4, i64 %70
tail call void @dstsub(i32 %0, double* %2, i32 %20, double* %71)
%72 = icmp sgt i32 %1, -1
br i1 %72, label %73, label %192
73: ; preds = %22, %69
%74 = phi double* [ %24, %22 ], [ %71, %69 ]
%75 = icmp sgt i32 %0, 4
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = getelementptr inbounds i32, i32* %3, i64 2
tail call void @cftfsub(i32 %0, double* %2, i32* %77, i32 %12, double* %4)
tail call void @rftfsub(i32 %0, double* %2, i32 %20, double* %74)
br label %82
78: ; preds = %73
%79 = icmp eq i32 %0, 4
br i1 %79, label %80, label %88
80: ; preds = %78
%81 = getelementptr inbounds i32, i32* %3, i64 2
tail call void @cftfsub(i32 4, double* %2, i32* %81, i32 %12, double* %4)
br label %82
82: ; preds = %80, %76
%83 = load double, double* %2
%84 = getelementptr inbounds double, double* %2, i64 1
%85 = load double, double* %84
%86 = fsub double %83, %85
%87 = fadd double %83, %85
store double %87, double* %2
br label %95
88: ; preds = %78
%89 = load double, double* %2
%90 = getelementptr inbounds double, double* %2, i64 1
%91 = load double, double* %90
%92 = fsub double %89, %91
%93 = fadd double %89, %91
store double %93, double* %2
%94 = icmp sgt i32 %0, 2
br i1 %94, label %95, label %186
95: ; preds = %82, %88
%96 = phi double [ %86, %82 ], [ %92, %88 ]
%97 = zext i32 %0 to i64
%98 = call i64 @llvm.umax.i64(i64 %97, i64 4)
%99 = add nsw i64 %98, -3
%100 = lshr i64 %99, 1
%101 = add nuw nsw i64 %100, 1
%102 = icmp ult i64 %99, 2
br i1 %102, label %166, label %103
103: ; preds = %95
%104 = and i64 %101, 9223372036854775806
%105 = shl nuw i64 %101, 1
%106 = or i64 %105, 2
%107 = add nsw i64 %104, -2
%108 = lshr exact i64 %107, 1
%109 = add nuw i64 %108, 1
%110 = and i64 %109, 1
%111 = icmp eq i64 %107, 0
br i1 %111, label %149, label %112
112: ; preds = %103
%113 = and i64 %109, -2
br label %114
114: ; preds = %114, %112
%115 = phi i64 [ 0, %112 ], [ %143, %114 ]
%116 = phi i64 [ 0, %112 ], [ %144, %114 ]
%117 = shl i64 %115, 1
%118 = or i64 %117, 2
%119 = getelementptr inbounds double, double* %2, i64 %118
%120 = bitcast double* %119 to <4 x double>*
%121 = load <4 x double>, <4 x double>* %120
%122 = shufflevector <4 x double> %121, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%123 = shufflevector <4 x double> %121, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%124 = fneg <2 x double> %122
%125 = fsub <2 x double> %124, %123
%126 = fsub <2 x double> %122, %123
%127 = getelementptr inbounds double, double* %119, i64 -1
%128 = bitcast double* %127 to <4 x double>*
%129 = shufflevector <2 x double> %125, <2 x double> %126, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %129, <4 x double>* %128
%130 = shl i64 %115, 1
%131 = or i64 %130, 6
%132 = getelementptr inbounds double, double* %2, i64 %131
%133 = bitcast double* %132 to <4 x double>*
%134 = load <4 x double>, <4 x double>* %133
%135 = shufflevector <4 x double> %134, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%136 = shufflevector <4 x double> %134, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%137 = fneg <2 x double> %135
%138 = fsub <2 x double> %137, %136
%139 = fsub <2 x double> %135, %136
%140 = getelementptr inbounds double, double* %132, i64 -1
%141 = bitcast double* %140 to <4 x double>*
%142 = shufflevector <2 x double> %138, <2 x double> %139, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %142, <4 x double>* %141
%143 = add nuw i64 %115, 4
%144 = add nuw i64 %116, 2
%145 = icmp eq i64 %144, %113
br i1 %145, label %146, label %114
146: ; preds = %114
%147 = shl i64 %143, 1
%148 = or i64 %147, 2
br label %149
149: ; preds = %146, %103
%150 = phi i64 [ 2, %103 ], [ %148, %146 ]
%151 = icmp eq i64 %110, 0
br i1 %151, label %164, label %152
152: ; preds = %149
%153 = getelementptr inbounds double, double* %2, i64 %150
%154 = bitcast double* %153 to <4 x double>*
%155 = load <4 x double>, <4 x double>* %154
%156 = shufflevector <4 x double> %155, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%157 = shufflevector <4 x double> %155, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%158 = fneg <2 x double> %156
%159 = fsub <2 x double> %158, %157
%160 = fsub <2 x double> %156, %157
%161 = getelementptr inbounds double, double* %153, i64 -1
%162 = bitcast double* %161 to <4 x double>*
%163 = shufflevector <2 x double> %159, <2 x double> %160, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %163, <4 x double>* %162
br label %164
164: ; preds = %149, %152
%165 = icmp eq i64 %101, %104
br i1 %165, label %186, label %166
166: ; preds = %95, %164
%167 = phi i64 [ 2, %95 ], [ %106, %164 ]
br label %168
168: ; preds = %166, %168
%169 = phi i64 [ %184, %168 ], [ %167, %166 ]
%170 = getelementptr inbounds double, double* %2, i64 %169
%171 = load double, double* %170
%172 = fneg double %171
%173 = or i64 %169, 1
%174 = getelementptr inbounds double, double* %2, i64 %173
%175 = load double, double* %174
%176 = add nsw i64 %169, -1
%177 = getelementptr inbounds double, double* %2, i64 %176
%178 = insertelement <2 x double> poison, double %172, i64 0
%179 = insertelement <2 x double> %178, double %171, i64 1
%180 = insertelement <2 x double> poison, double %175, i64 0
%181 = shufflevector <2 x double> %180, <2 x double> poison, <2 x i32> zeroinitializer
%182 = fsub <2 x double> %179, %181
%183 = bitcast double* %177 to <2 x double>*
store <2 x double> %182, <2 x double>* %183
%184 = add nuw nsw i64 %169, 2
%185 = icmp ult i64 %184, %97
br i1 %185, label %168, label %186
186: ; preds = %168, %164, %88
%187 = phi double [ %92, %88 ], [ %96, %164 ], [ %96, %168 ]
%188 = fneg double %187
%189 = add nsw i32 %0, -1
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds double, double* %2, i64 %190
store double %188, double* %191
br label %192
192: ; preds = %31, %186, %69
ret void
}