#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bitrv2(int, int *, double *);
int /*<<< orphan*/ cftbsub(int, double *, double *);
int /*<<< orphan*/ cftfsub(int, double *, double *);
int /*<<< orphan*/ dstsub(int, double *, int, double *);
int /*<<< orphan*/ makect(int, int *, double *);
int /*<<< orphan*/ makewt(int, int *, double *);
int /*<<< orphan*/ rftbsub(int, double *, int, double *);
int /*<<< orphan*/ rftfsub(int, double *, int, double *);
void lsx_ddst(int n, int isgn, double *a, int *ip, double *w) {
  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):
<lsx_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 <lsx_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 <lsx_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 <lsx_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 <lsx_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 <lsx_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 <lsx_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 <lsx_ddst+0x1d1>
cmpl   $0x4,-0x4(%rbp)
jne    134c <lsx_ddst+0x1cc>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
jmp    1351 <lsx_ddst+0x1d1>
jmp    1356 <lsx_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 <lsx_ddst+0x358>
cmpl   $0x4,-0x4(%rbp)
jle    13cf <lsx_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 <lsx_ddst+0x26e>
cmpl   $0x4,-0x4(%rbp)
jne    13e9 <lsx_ddst+0x269>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <cftfsub@plt>
jmp    13ee <lsx_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 <lsx_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 <lsx_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):
<lsx_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 <lsx_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 <lsx_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 <lsx_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 <lsx_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 <lsx_ddst+0x1c2>
movsd  -0x8(%rbx,%rbp,8),%xmm0
cmp    $0x4,%r14d
jl     1516 <lsx_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 <lsx_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 <lsx_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 <lsx_ddst+0x427>
cmp    $0x4,%r14d
jne    154f <lsx_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 <lsx_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 <lsx_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 <lsx_ddst+0x240>
add    $0xfffffffffffffffc,%rsi
test   $0x1,%bpl
je     149a <lsx_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 <lsx_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 <lsx_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 <lsx_ddst+0x1db>
jmp    14f9 <lsx_ddst+0x379>
mov    $0x2,%esi
test   $0x1,%bpl
jne    1457 <lsx_ddst+0x2d7>
jmp    149a <lsx_ddst+0x31a>
cmp    $0x4,%r14d
mov    0x10(%rsp),%rbp
jne    15a7 <lsx_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 <lsx_ddst+0x8e>
jmp    1507 <lsx_ddst+0x387>

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

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