#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*/ rfftb(int, double *, double *);
void cosqb1(int n, double x[], double w[], double xh[]) {
  int modn, i, k;
  int kc, ns2;
  double xim1;
  ns2 = (n + 1) / 2;
  for (i = 2; i < n; i += 2) {
    xim1 = x[i - 1] + x[i];
    x[i] -= x[i - 1];
    x[i - 1] = xim1;
  }
  x[0] += x[0];
  modn = n % 2;
  if (modn == 0)
    x[n - 1] += x[n - 1];
  rfftb(n, x, xh);
  for (k = 1; k < ns2; k++) {
    kc = n - k;
    xh[k] = w[k - 1] * x[kc] + w[kc - 1] * x[k];
    xh[kc] = w[k - 1] * x[k] - w[kc - 1] * x[kc];
  }
  if (modn == 0)
    x[ns2] = w[ns2 - 1] * (x[ns2] + x[ns2]);
  for (k = 1; k < ns2; k++) {
    kc = n - k;
    x[k] = xh[k] + xh[kc];
    x[kc] = xh[k] - xh[kc];
  }
  x[0] += x[0];
}


x86 assembly (clang, -O0):
<cosqb1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11bc <cosqb1+0xac>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    113f <cosqb1+0x2f>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1211 <cosqb1+0x101>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <rfftb@plt>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1308 <cosqb1+0x1f8>
mov    -0x4(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1228 <cosqb1+0x118>
cmpl   $0x0,-0x24(%rbp)
jne    134f <cosqb1+0x23f>
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    13c7 <cosqb1+0x2b7>
mov    -0x4(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1356 <cosqb1+0x246>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosqb1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
lea    0x1(%rdi),%eax
shr    $0x1f,%eax
mov    %edi,%r13d
cmp    $0x3,%edi
jl     128b <cosqb1+0x17b>
cmp    $0x5,%r13
mov    $0x4,%ecx
cmovae %r13,%rcx
add    $0xfffffffffffffffd,%rcx
mov    $0x2,%edx
cmp    $0x2,%rcx
jb     1260 <cosqb1+0x150>
shr    %rcx
add    $0x1,%rcx
movabs $0x7ffffffffffffffe,%r8
ff ff 7f
and    %rcx,%r8
lea    -0x2(%r8),%rsi
mov    %rsi,%rdx
shr    %rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     1455 <cosqb1+0x345>
mov    %rdx,%rbp
and    $0xfffffffffffffffe,%rbp
mov    $0x1,%esi
nopl   (%rax)
movupd (%rbx,%rsi,8),%xmm0
movupd 0x10(%rbx,%rsi,8),%xmm1
movupd 0x20(%rbx,%rsi,8),%xmm2
movupd 0x30(%rbx,%rsi,8),%xmm3
movapd %xmm0,%xmm4
unpcklpd %xmm1,%xmm4
unpckhpd %xmm1,%xmm0
movapd %xmm4,%xmm1
addpd  %xmm0,%xmm1
subpd  %xmm4,%xmm0
movapd %xmm1,%xmm4
unpckhpd %xmm0,%xmm4
unpcklpd %xmm0,%xmm1
movupd %xmm1,(%rbx,%rsi,8)
movupd %xmm4,0x10(%rbx,%rsi,8)
movapd %xmm2,%xmm0
unpcklpd %xmm3,%xmm0
unpckhpd %xmm3,%xmm2
movapd %xmm0,%xmm1
addpd  %xmm2,%xmm1
subpd  %xmm0,%xmm2
movapd %xmm1,%xmm0
unpckhpd %xmm2,%xmm0
unpcklpd %xmm2,%xmm1
movupd %xmm1,0x20(%rbx,%rsi,8)
movupd %xmm0,0x30(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rbp
jne    1190 <cosqb1+0x80>
test   $0x1,%dl
je     124f <cosqb1+0x13f>
movupd (%rbx,%rsi,8),%xmm0
movupd 0x10(%rbx,%rsi,8),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm1,%xmm2
unpckhpd %xmm1,%xmm0
movapd %xmm2,%xmm1
addpd  %xmm0,%xmm1
subpd  %xmm2,%xmm0
movapd %xmm1,%xmm2
unpckhpd %xmm0,%xmm2
unpcklpd %xmm0,%xmm1
movupd %xmm1,(%rbx,%rsi,8)
movupd %xmm2,0x10(%rbx,%rsi,8)
cmp    %r8,%rcx
je     128b <cosqb1+0x17b>
add    %rcx,%rcx
or     $0x2,%rcx
mov    %rcx,%rdx
xchg   %ax,%ax
movsd  -0x8(%rbx,%rdx,8),%xmm0
movsd  (%rbx,%rdx,8),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rdx,8)
movsd  %xmm2,-0x8(%rbx,%rdx,8)
add    $0x2,%rdx
cmp    %r13,%rdx
jb     1260 <cosqb1+0x150>
lea    (%rdi,%rax,1),%r15d
add    $0x1,%r15d
movsd  (%rbx),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rbx)
test   $0x1,%dil
jne    12b8 <cosqb1+0x1a8>
movslq %edi,%rax
movsd  -0x8(%rbx,%rax,8),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbx,%rax,8)
sar    %r15d
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %rdi,%rbp
call   1030 <rfftb@plt>
mov    %rbp,%r9
cmp    $0x3,%r9d
jl     1350 <cosqb1+0x240>
cmp    $0x3,%r15d
mov    $0x2,%esi
cmovge %r15d,%esi
lea    -0x10(%r12,%r13,8),%rax
lea    -0x8(%rbx,%r13,8),%rcx
lea    (%r14,%r13,8),%r8
add    $0xfffffffffffffff8,%r8
lea    -0x8(,%rsi,8),%rdx
ff
mov    $0x1,%edi
xor    %ebp,%ebp
movsd  (%rax,%rbp,1),%xmm0
mulsd  (%rbx,%rdi,8),%xmm0
movsd  -0x8(%r12,%rdi,8),%xmm1
mulsd  (%rcx,%rbp,1),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rdi,8)
movsd  (%rcx,%rbp,1),%xmm0
mulsd  (%rax,%rbp,1),%xmm0
movsd  -0x8(%r12,%rdi,8),%xmm1
mulsd  (%rbx,%rdi,8),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r8,%rbp,1)
add    $0x1,%rdi
add    $0xfffffffffffffff8,%rbp
mov    %rdx,%rsi
add    %rbp,%rsi
jne    1300 <cosqb1+0x1f0>
test   $0x1,%r9b
jne    136e <cosqb1+0x25e>
movslq %r15d,%rax
movsd  (%rbx,%rax,8),%xmm0
addsd  %xmm0,%xmm0
mulsd  -0x8(%r12,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
cmp    $0x3,%r9d
jl     143a <cosqb1+0x32a>
cmp    $0x3,%r15d
mov    $0x2,%eax
cmovge %r15d,%eax
add    $0xffffffffffffffff,%rax
mov    $0x1,%ecx
cmp    $0x5,%r9d
jl     1410 <cosqb1+0x300>
lea    -0x1(%r13),%rdx
mov    %rax,%rsi
and    $0xfffffffffffffffe,%rsi
neg    %rsi
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm0
addsd  (%r14,%rdx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
movsd  (%r14,%rcx,8),%xmm0
subsd  (%r14,%rdx,8),%xmm0
movsd  %xmm0,(%rbx,%rdx,8)
movsd  0x8(%r14,%rcx,8),%xmm0
addsd  -0x8(%r14,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm0
subsd  -0x8(%r14,%rdx,8),%xmm0
movsd  %xmm0,-0x8(%rbx,%rdx,8)
add    $0xfffffffffffffffe,%rdx
lea    (%rsi,%rcx,1),%rdi
add    $0x2,%rdi
add    $0x2,%rcx
cmp    $0x1,%rdi
jne    13b0 <cosqb1+0x2a0>
test   $0x1,%al
je     143a <cosqb1+0x32a>
sub    %rcx,%r13
movsd  (%r14,%rcx,8),%xmm0
addsd  (%r14,%r13,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
movsd  (%r14,%rcx,8),%xmm0
subsd  (%r14,%r13,8),%xmm0
movsd  %xmm0,(%rbx,%r13,8)
movsd  (%rbx),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%esi
test   $0x1,%dl
jne    1215 <cosqb1+0x105>
jmp    124f <cosqb1+0x13f>

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

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