#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*/ rfftf(int, double *, double *);
void cost(int n, double x[], double wsave[]) {
  int modn, i, k;
  double c1, t1, t2;
  int kc;
  double xi;
  int nm1;
  double x1h;
  int ns2;
  double tx2, x1p3, xim2;
  nm1 = n - 1;
  ns2 = n / 2;
  if (n - 2 < 0)
    return;
  else if (n == 2) {
    x1h = x[0] + x[1];
    x[1] = x[0] - x[1];
    x[0] = x1h;
  } else if (n == 3) {
    x1p3 = x[0] + x[2];
    tx2 = x[1] + x[1];
    x[1] = x[0] - x[2];
    x[0] = x1p3 + tx2;
    x[2] = x1p3 - tx2;
  } else {
    c1 = x[0] - x[n - 1];
    x[0] += x[n - 1];
    for (k = 1; k < ns2; k++) {
      kc = nm1 - k;
      t1 = x[k] + x[kc];
      t2 = x[k] - x[kc];
      c1 += wsave[kc] * t2;
      t2 = wsave[k] * t2;
      x[k] = t1 - t2;
      x[kc] = t1 + t2;
    }
    modn = n % 2;
    if (modn != 0)
      x[ns2] += x[ns2];
    rfftf(nm1, x, &wsave[n]);
    xim2 = x[1];
    x[1] = c1;
    for (i = 3; i < n; i += 2) {
      xi = x[i];
      x[i] = x[i - 2] - x[i - 1];
      x[i - 1] = xim2;
      xim2 = xi;
    }
    if (modn != 0)
      x[n - 1] = xim2;
  }
}


x86 assembly (clang, -O0):
<cost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x64(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cmp    $0x0,%eax
jge    1151 <cost+0x41>
jmp    1449 <cost+0x339>
cmpl   $0x2,-0x4(%rbp)
jne    119d <cost+0x8d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1444 <cost+0x334>
cmpl   $0x3,-0x4(%rbp)
jne    1218 <cost+0x108>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x78(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    143f <cost+0x32f>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1326 <cost+0x216>
mov    -0x54(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    125c <cost+0x14c>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     135d <cost+0x24d>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <rfftf@plt>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x3,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1419 <cost+0x309>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x20(%rbp)
jmp    139b <cost+0x28b>
cmpl   $0x0,-0x1c(%rbp)
je     143a <cost+0x32a>
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    143f <cost+0x32f>
jmp    1444 <cost+0x334>
jmp    1449 <cost+0x339>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cost>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     129f <cost+0x18f>
mov    %rsi,%rbx
mov    %edi,%r14d
cmp    $0x3,%edi
je     1155 <cost+0x45>
cmp    $0x2,%r14d
jne    118d <cost+0x7d>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  %xmm2,(%rbx)
jmp    129f <cost+0x18f>
movsd  0x10(%rbx),%xmm0
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
movapd %xmm1,%xmm3
addsd  %xmm0,%xmm3
addsd  %xmm2,%xmm2
unpcklpd %xmm3,%xmm1
addsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx)
unpcklpd %xmm2,%xmm0
subpd  %xmm0,%xmm1
movupd %xmm1,0x8(%rbx)
jmp    129f <cost+0x18f>
lea    -0x1(%r14),%edi
mov    %r14d,%r8d
shr    $0x1f,%r8d
add    %r14d,%r8d
sar    %r8d
movsd  (%rbx),%xmm0
mov    %edi,%r15d
movsd  (%rbx,%r15,8),%xmm1
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
cmp    $0x3,%r8d
mov    $0x2,%ecx
cmovge %r8d,%ecx
lea    -0x1(%r15),%rsi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm0
movsd  (%rbx,%rsi,8),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm1,%xmm0
movsd  (%rdx,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%rdx,%rax,8),%xmm0
addsd  %xmm1,%xmm3
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx,%rsi,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
cmp    %rax,%rcx
jne    11e0 <cost+0xd0>
movsd  %xmm3,(%rsp)
test   $0x1,%r14b
je     1247 <cost+0x137>
movslq %r8d,%rax
movsd  (%rbx,%rax,8),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movslq %r14d,%r12
lea    (%rdx,%r12,8),%rdx
mov    %rbx,%rsi
call   1030 <rfftf@plt>
movsd  0x8(%rbx),%xmm0
movsd  (%rsp),%xmm2
movsd  %xmm2,0x8(%rbx)
mov    $0x3,%eax
nopw   0x0(%rax,%rax,1)
movapd %xmm0,%xmm1
movsd  (%rbx,%rax,8),%xmm0
subsd  -0x8(%rbx,%rax,8),%xmm2
movsd  %xmm2,(%rbx,%rax,8)
movsd  %xmm1,-0x8(%rbx,%rax,8)
add    $0x2,%rax
cmp    %r12,%rax
jl     1270 <cost+0x160>
test   $0x1,%r14b
je     129f <cost+0x18f>
movsd  %xmm0,(%rbx,%r15,8)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @cost(i32 %0, double* %1, double* %2) {
%4 = add nsw i32 %0, -1
%5 = sdiv i32 %0, 2
%6 = icmp slt i32 %0, 2
br i1 %6, label %87, label %7
7: ; preds = %3
switch i32 %0, label %29 [
i32 2, label %8
i32 3, label %14
]
8: ; preds = %7
%9 = load double, double* %1
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = fadd double %9, %11
%13 = fsub double %9, %11
store double %13, double* %10
store double %12, double* %1
br label %87
14: ; preds = %7
%15 = load double, double* %1
%16 = getelementptr inbounds double, double* %1, i64 2
%17 = load double, double* %16
%18 = fadd double %15, %17
%19 = getelementptr inbounds double, double* %1, i64 1
%20 = load double, double* %19
%21 = fadd double %20, %20
%22 = fadd double %18, %21
store double %22, double* %1
%23 = insertelement <2 x double> poison, double %15, i64 0
%24 = insertelement <2 x double> %23, double %18, i64 1
%25 = insertelement <2 x double> poison, double %17, i64 0
%26 = insertelement <2 x double> %25, double %21, i64 1
%27 = fsub <2 x double> %24, %26
%28 = bitcast double* %19 to <2 x double>*
store <2 x double> %27, <2 x double>* %28
br label %87
29: ; preds = %7
%30 = load double, double* %1
%31 = zext i32 %4 to i64
%32 = getelementptr inbounds double, double* %1, i64 %31
%33 = load double, double* %32
%34 = fsub double %30, %33
%35 = fadd double %30, %33
store double %35, double* %1
%36 = zext i32 %4 to i64
%37 = call i32 @llvm.smax.i32(i32 %5, i32 2)
%38 = zext i32 %37 to i64
br label %39
39: ; preds = %29, %39
%40 = phi i64 [ 1, %29 ], [ %57, %39 ]
%41 = phi double [ %34, %29 ], [ %51, %39 ]
%42 = sub nsw i64 %36, %40
%43 = getelementptr inbounds double, double* %1, i64 %40
%44 = load double, double* %43
%45 = getelementptr inbounds double, double* %1, i64 %42
%46 = load double, double* %45
%47 = fadd double %44, %46
%48 = fsub double %44, %46
%49 = getelementptr inbounds double, double* %2, i64 %42
%50 = load double, double* %49
%51 = tail call double @llvm.fmuladd.f64(double %50, double %48, double %41)
%52 = getelementptr inbounds double, double* %2, i64 %40
%53 = load double, double* %52
%54 = fmul double %48, %53
%55 = fsub double %47, %54
store double %55, double* %43
%56 = fadd double %47, %54
store double %56, double* %45
%57 = add nuw nsw i64 %40, 1
%58 = icmp eq i64 %57, %38
br i1 %58, label %59, label %39
59: ; preds = %39
%60 = and i32 %0, 1
%61 = icmp eq i32 %60, 0
br i1 %61, label %67, label %62
62: ; preds = %59
%63 = sext i32 %5 to i64
%64 = getelementptr inbounds double, double* %1, i64 %63
%65 = load double, double* %64
%66 = fadd double %65, %65
store double %66, double* %64
br label %67
67: ; preds = %59, %62
%68 = sext i32 %0 to i64
%69 = getelementptr inbounds double, double* %2, i64 %68
%70 = tail call i32 @rfftf(i32 %4, double* %1, double* %69)
%71 = getelementptr inbounds double, double* %1, i64 1
%72 = load double, double* %71
store double %51, double* %71
br label %73
73: ; preds = %67, %73
%74 = phi double [ %51, %67 ], [ %82, %73 ]
%75 = phi i64 [ 3, %67 ], [ %83, %73 ]
%76 = phi double [ %72, %67 ], [ %78, %73 ]
%77 = getelementptr inbounds double, double* %1, i64 %75
%78 = load double, double* %77
%79 = add nsw i64 %75, -1
%80 = getelementptr inbounds double, double* %1, i64 %79
%81 = load double, double* %80
%82 = fsub double %74, %81
store double %82, double* %77
store double %76, double* %80
%83 = add nuw nsw i64 %75, 2
%84 = icmp slt i64 %83, %68
br i1 %84, label %73, label %85
85: ; preds = %73
br i1 %61, label %87, label %86
86: ; preds = %85
store double %78, double* %32
br label %87
87: ; preds = %14, %86, %85, %8, %3
ret void
}