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, nw, w);
    } else if (n == 4) {
      cftbsub(n, a, ip, nw, w);
    }
  }
  dstsub(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):
<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    1340 <ddst+0x1d0>
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    1315 <ddst+0x1a5>
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
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1050 <cftbsub@plt>
jmp    133b <ddst+0x1cb>
cmpl   $0x4,-0x4(%rbp)
jne    1336 <ddst+0x1c6>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1050 <cftbsub@plt>
jmp    133b <ddst+0x1cb>
jmp    1340 <ddst+0x1d0>
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     14bc <ddst+0x34c>
cmpl   $0x4,-0x4(%rbp)
jle    13ac <ddst+0x23c>
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   1040 <rftfsub@plt>
jmp    13d2 <ddst+0x262>
cmpl   $0x4,-0x4(%rbp)
jne    13cd <ddst+0x25d>
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    13d2 <ddst+0x262>
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    148e <ddst+0x31e>
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    1404 <ddst+0x294>
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    11e8 <ddst+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 <ddst+0xd3>
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>
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    132b <ddst+0x1bb>
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 0xd7e(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
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>
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 0xc57(%rip),%xmm1
nopl   0x0(%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    1344 <ddst+0x1d4>
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    1595 <ddst+0x425>
mov    %rbx,%rsi
mov    %r12,%rdx
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    120d <ddst+0x9d>
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 %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 %120
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 = load i32, i32* %12
%119 = load double*, double** %10
br label %130
120: ; preds = %92
%121 = load i32, i32* %6
%122 = icmp eq i32 %121, 4
br i1 %122, label %123, label %129
123: ; preds = %120
%124 = load i32, i32* %6
%125 = load double*, double** %8
%126 = load i32*, i32** %9
%127 = load i32, i32* %12
%128 = load double*, double** %10
br label %129
129: ; preds = %123, %120
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 %157
144: ; preds = %141
%145 = load i32, i32* %6
%146 = load double*, double** %8
%147 = load i32*, i32** %9
%148 = load i32, i32* %12
%149 = load double*, double** %10
%150 = load i32, i32* %6
%151 = load double*, double** %8
%152 = load i32, i32* %13
%153 = load double*, double** %10
%154 = load i32, i32* %12
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %153, i64 %155
br label %167
157: ; preds = %141
%158 = load i32, i32* %6
%159 = icmp eq i32 %158, 4
br i1 %159, label %160, label %166
160: ; preds = %157
%161 = load i32, i32* %6
%162 = load double*, double** %8
%163 = load i32*, i32** %9
%164 = load i32, i32* %12
%165 = load double*, double** %10
br label %166
166: ; preds = %160, %157
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 %189
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 %68
66: ; preds = %64, %61
%67 = phi i32 [ %0, %61 ], [ 4, %64 ]
tail call void @cftbsub(i32 %67, double* %2, i32* %3, i32 %12, double* %4)
br label %68
68: ; preds = %66, %64
%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 %189
72: ; preds = %22, %68
%73 = phi double* [ %24, %22 ], [ %70, %68 ]
%74 = icmp sgt i32 %0, 4
br i1 %74, label %75, label %76
75: ; preds = %72
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* %73)
br label %79
76: ; preds = %72
%77 = icmp eq i32 %0, 4
br i1 %77, label %78, label %85
78: ; preds = %76
tail call void @cftfsub(i32 4, double* %2, i32* %3, i32 %12, double* %4)
br label %79
79: ; preds = %78, %75
%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 %183
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 %163, 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 %146, label %109
109: ; preds = %100
%110 = and i64 %106, -2
br label %111
111: ; preds = %111, %109
%112 = phi i64 [ 0, %109 ], [ %140, %111 ]
%113 = phi i64 [ 0, %109 ], [ %141, %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 = fneg <2 x double> %119
%122 = fsub <2 x double> %121, %120
%123 = fsub <2 x double> %119, %120
%124 = getelementptr inbounds double, double* %116, i64 -1
%125 = bitcast double* %124 to <4 x double>*
%126 = shufflevector <2 x double> %122, <2 x double> %123, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %126, <4 x double>* %125
%127 = shl i64 %112, 1
%128 = or i64 %127, 6
%129 = getelementptr inbounds double, double* %2, i64 %128
%130 = bitcast double* %129 to <4 x double>*
%131 = load <4 x double>, <4 x double>* %130
%132 = shufflevector <4 x double> %131, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%133 = shufflevector <4 x double> %131, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%134 = fneg <2 x double> %132
%135 = fsub <2 x double> %134, %133
%136 = fsub <2 x double> %132, %133
%137 = getelementptr inbounds double, double* %129, i64 -1
%138 = bitcast double* %137 to <4 x double>*
%139 = shufflevector <2 x double> %135, <2 x double> %136, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %139, <4 x double>* %138
%140 = add nuw i64 %112, 4
%141 = add nuw i64 %113, 2
%142 = icmp eq i64 %141, %110
br i1 %142, label %143, label %111
143: ; preds = %111
%144 = shl i64 %140, 1
%145 = or i64 %144, 2
br label %146
146: ; preds = %143, %100
%147 = phi i64 [ 2, %100 ], [ %145, %143 ]
%148 = icmp eq i64 %107, 0
br i1 %148, label %161, label %149
149: ; preds = %146
%150 = getelementptr inbounds double, double* %2, i64 %147
%151 = bitcast double* %150 to <4 x double>*
%152 = load <4 x double>, <4 x double>* %151
%153 = shufflevector <4 x double> %152, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%154 = shufflevector <4 x double> %152, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%155 = fneg <2 x double> %153
%156 = fsub <2 x double> %155, %154
%157 = fsub <2 x double> %153, %154
%158 = getelementptr inbounds double, double* %150, i64 -1
%159 = bitcast double* %158 to <4 x double>*
%160 = shufflevector <2 x double> %156, <2 x double> %157, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %160, <4 x double>* %159
br label %161
161: ; preds = %146, %149
%162 = icmp eq i64 %98, %101
br i1 %162, label %183, label %163
163: ; preds = %92, %161
%164 = phi i64 [ 2, %92 ], [ %103, %161 ]
br label %165
165: ; preds = %163, %165
%166 = phi i64 [ %181, %165 ], [ %164, %163 ]
%167 = getelementptr inbounds double, double* %2, i64 %166
%168 = load double, double* %167
%169 = fneg double %168
%170 = or i64 %166, 1
%171 = getelementptr inbounds double, double* %2, i64 %170
%172 = load double, double* %171
%173 = add nsw i64 %166, -1
%174 = getelementptr inbounds double, double* %2, i64 %173
%175 = insertelement <2 x double> poison, double %169, i64 0
%176 = insertelement <2 x double> %175, double %168, i64 1
%177 = insertelement <2 x double> poison, double %172, i64 0
%178 = shufflevector <2 x double> %177, <2 x double> poison, <2 x i32> zeroinitializer
%179 = fsub <2 x double> %176, %178
%180 = bitcast double* %174 to <2 x double>*
store <2 x double> %179, <2 x double>* %180
%181 = add nuw nsw i64 %166, 2
%182 = icmp ult i64 %181, %94
br i1 %182, label %165, label %183
183: ; preds = %165, %161, %85
%184 = phi double [ %89, %85 ], [ %93, %161 ], [ %93, %165 ]
%185 = fneg double %184
%186 = add nsw i32 %0, -1
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %2, i64 %187
store double %185, double* %188
br label %189
189: ; preds = %31, %183, %68
ret void
}