#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 */
double cos(double);
double lspdf_odd(double x, double *f, const int m, double *d) {
  int i;
  int mh1;
  double *d1, *d2, *lsp, x1, x2;
  mh1 = (m + 1) / 2;
  d1 = d + 1;
  d2 = d1 + (mh1 + mh1 - 1);
  lsp = f + 1;
  x1 = x2 = d[0];
  for (i = 0; i < m - 1; i += 2) {
    d1[i] -= 2.0 * x1 * cos(lsp[i]);
    d2[i] -= 2.0 * x2 * cos(lsp[i + 1]);
    d1[i + 1] += x1;
    d2[i + 1] += x2;
    x += d1[i] + d2[i];
    x1 = d1[i + 1];
    x2 = d2[i + 1];
  }
  d1[i] -= 2.0 * x1 * cos(lsp[i]);
  x += d1[i] - d2[i];
  for (i = m - 1; i > 0; i--) {
    d1[i] = d1[i - 1];
    d2[i] = d2[i - 1];
  }
  d1[0] = d2[0] = d[0];
  d[0] = -0.5 * x;
  return (x);
}


x86 assembly (clang, -O0):
<lspdf_odd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12ed <lspdf_odd+0x1dd>
movsd  0xe62(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xe05(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1185 <lspdf_odd+0x75>
movsd  0xd0b(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    13cd <lspdf_odd+0x2bd>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1377 <lspdf_odd+0x267>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xc1b(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lspdf_odd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0x1(%r15),%eax
shr    $0x1f,%eax
add    %r15d,%eax
add    $0x1,%eax
and    $0xfffffffe,%eax
lea    0x8(%rdx),%r13
cltq
mov    %rax,0x28(%rsp)
lea    (%rdx,%rax,8),%r12
movsd  (%rdx),%xmm2
lea    -0x1(%r15),%eax
cmp    $0x2,%esi
mov    %eax,0x34(%rsp)
jl     1246 <lspdf_odd+0x136>
mov    %r14,0x18(%rsp)
mov    %eax,%r14d
xor    %ebp,%ebp
movsd  %xmm2,0x10(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  0x8(%rbx,%rbp,8),%xmm0
call   1030 <cos@plt>
movsd  0x10(%rsp),%xmm1
movsd  0xe6b(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x0(%r13,%rbp,8),%xmm1
movsd  %xmm1,0x0(%r13,%rbp,8)
movsd  0x10(%rbx,%rbp,8),%xmm0
call   1030 <cos@plt>
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  0xe38(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r12,%rbp,8),%xmm1
movsd  %xmm1,(%r12,%rbp,8)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  %xmm0,0x8(%r13,%rbp,8)
addsd  0x8(%r12,%rbp,8),%xmm2
movsd  %xmm2,0x8(%r12,%rbp,8)
movsd  0x0(%r13,%rbp,8),%xmm0
addsd  (%r12,%rbp,8),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0x2,%rbp
cmp    %r14,%rbp
jb     1170 <lspdf_odd+0x60>
and    $0xfffffffe,%ebp
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0x18(%rsp),%r14
jmp    1254 <lspdf_odd+0x144>
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
movsd  %xmm2,0x20(%rsp)
movsd  0x8(%rbx,%rbp,8),%xmm0
call   1030 <cos@plt>
movsd  0x20(%rsp),%xmm1
mulsd  0xd93(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x0(%r13,%rbp,8),%xmm1
movsd  %xmm1,0x0(%r13,%rbp,8)
subsd  (%r12,%rbp,8),%xmm1
addsd  0x8(%rsp),%xmm1
cmp    $0x2,%r15d
jl     12e2 <lspdf_odd+0x1d2>
mov    0x34(%rsp),%ebx
mov    %ebx,%esi
cmp    $0x1,%ebx
mov    %rsi,%r11
adc    $0xffffffffffffffff,%r11
add    $0x1,%r11
cmp    $0x2,%r11
jae    1317 <lspdf_odd+0x207>
add    $0xffffffffffffffff,%rsi
nop
mov    %esi,%eax
shl    $0x3,%rax
movsd  0x0(%r13,%rax,1),%xmm0
movsd  %xmm0,0x8(%r13,%rsi,8)
movsd  (%r12,%rax,1),%xmm0
movsd  %xmm0,0x8(%r12,%rsi,8)
lea    -0x1(%rsi),%rax
add    $0x1,%rsi
cmp    $0x1,%rsi
mov    %rax,%rsi
ja     12b0 <lspdf_odd+0x1a0>
movsd  (%r14),%xmm0
movsd  %xmm0,(%r12)
movsd  %xmm0,0x8(%r14)
movsd  0xd0d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
movapd %xmm1,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x1,%ebx
mov    %rsi,%rcx
adc    $0xffffffffffffffff,%rcx
add    $0xfffffffe,%r15d
mov    $0x8,%edx
mov    %rcx,%rax
mul    %rdx
seto   %dl
cmp    %ecx,%r15d
jb     12ab <lspdf_odd+0x19b>
shr    $0x20,%rcx
jne    12ab <lspdf_odd+0x19b>
lea    (%r14,%rsi,8),%rcx
add    $0x8,%rcx
mov    %rcx,%rdi
sub    %rax,%rdi
cmp    %rcx,%rdi
ja     12ab <lspdf_odd+0x19b>
test   %dl,%dl
jne    12ab <lspdf_odd+0x19b>
mov    0x28(%rsp),%rcx
add    $0xffffffffffffffff,%rcx
lea    (%rcx,%rsi,1),%r8
add    $0xffffffffffffffff,%r8
lea    (%r14,%r8,8),%rbp
add    $0x10,%rbp
mov    %rbp,%rdi
sub    %rax,%rdi
cmp    %rbp,%rdi
ja     12ab <lspdf_odd+0x19b>
test   %dl,%dl
jne    12ab <lspdf_odd+0x19b>
lea    (%r14,%r15,8),%rbp
add    $0x8,%rbp
mov    %rbp,%rdi
sub    %rax,%rdi
cmp    %rbp,%rdi
ja     12ab <lspdf_odd+0x19b>
test   %dl,%dl
jne    12ab <lspdf_odd+0x19b>
lea    (%rcx,%r15,1),%rdi
add    $0xffffffffffffffff,%rdi
lea    (%r14,%rdi,8),%rbp
add    $0x10,%rbp
mov    %rbp,%rdi
sub    %rax,%rdi
cmp    %rbp,%rdi
ja     12ab <lspdf_odd+0x19b>
test   %dl,%dl
jne    12ab <lspdf_odd+0x19b>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
lea    (%r14,%rdi,8),%rbp
add    $0x8,%rbp
lea    (%r14,%rsi,8),%rbx
add    $0x10,%rbx
lea    -0x1(%rcx),%rax
or     %rdi,%rax
lea    (%r14,%rax,8),%rdx
add    $0x10,%rdx
lea    (%r14,%r8,8),%r9
add    $0x18,%r9
add    %r15,%rdi
sub    %rsi,%rdi
lea    (%r14,%rdi,8),%r10
add    $0x8,%r10
lea    (%r14,%r15,8),%rdi
add    $0x10,%rdi
add    %r15,%rax
sub    %rsi,%rax
mov    %r14,%r8
lea    (%r14,%rax,8),%r14
add    $0x10,%r14
mov    %rcx,0x28(%rsp)
lea    (%rcx,%r15,1),%rax
add    $0xffffffffffffffff,%rax
mov    %r8,0x18(%rsp)
lea    (%r8,%rax,8),%rax
add    $0x18,%rax
cmp    %r9,%rbp
setb   0x8(%rsp)
cmp    %rbx,%rdx
setb   %cl
cmp    %rdi,%rbp
setb   %r15b
cmp    %rbx,%r10
setb   %r8b
cmp    %rax,%rbp
setb   %bpl
cmp    %rbx,%r14
setb   0x10(%rsp)
cmp    %rdi,%rdx
setb   %bl
cmp    %r9,%r10
setb   %r10b
cmp    %rax,%rdx
setb   %dl
cmp    %r9,%r14
setb   %al
test   %cl,0x8(%rsp)
jne    1592 <lspdf_odd+0x482>
and    %r8b,%r15b
mov    0x18(%rsp),%r14
jne    12ab <lspdf_odd+0x19b>
and    0x10(%rsp),%bpl
jne    12ab <lspdf_odd+0x19b>
and    %r10b,%bl
jne    12ab <lspdf_odd+0x19b>
and    %al,%dl
jne    12ab <lspdf_odd+0x19b>
mov    $0xffffffff,%r8d
mov    %r11,%r9
and    $0xfffffffffffffffe,%r9
lea    -0x2(%r9),%rax
mov    %rax,%r10
shr    %r10
add    $0x1,%r10
test   %rax,%rax
je     1588 <lspdf_odd+0x478>
mov    %r10,%rdx
and    $0xfffffffffffffffe,%rdx
mov    0x28(%rsp),%rax
add    %rsi,%rax
lea    (%r14,%rax,8),%rcx
lea    (%r14,%rsi,8),%rax
mov    %r14,%rdi
lea    (%rsi,%r8,1),%r14
add    $0xfffffffffffffffe,%r14
lea    (%rsi,%r8,1),%r15
xor    %ebp,%ebp
nop
lea    (%r15,%rbp,1),%ebx
movups (%rdi,%rbx,8),%xmm0
movups %xmm0,(%rax,%rbp,8)
movups -0x8(%r12,%rbx,8),%xmm0
movups %xmm0,(%rcx,%rbp,8)
lea    (%r14,%rbp,1),%ebx
movups (%rdi,%rbx,8),%xmm0
movups %xmm0,-0x10(%rax,%rbp,8)
movupd -0x8(%r12,%rbx,8),%xmm0
movupd %xmm0,-0x10(%rcx,%rbp,8)
add    $0xfffffffffffffffc,%rbp
add    $0xfffffffffffffffe,%rdx
jne    1510 <lspdf_odd+0x400>
neg    %rbp
mov    %rdi,%r14
test   $0x1,%r10b
je     1577 <lspdf_odd+0x467>
mov    %rsi,%rax
sub    %rbp,%rax
add    %eax,%r8d
movups (%r14,%r8,8),%xmm0
movups %xmm0,(%r14,%rax,8)
movupd -0x8(%r12,%r8,8),%xmm0
movupd %xmm0,-0x8(%r12,%rax,8)
cmp    %r9,%r11
je     12e2 <lspdf_odd+0x1d2>
sub    %r9,%rsi
jmp    12ab <lspdf_odd+0x19b>
xor    %ebp,%ebp
test   $0x1,%r10b
jne    1556 <lspdf_odd+0x446>
jmp    1577 <lspdf_odd+0x467>
mov    0x18(%rsp),%r14
jmp    12ab <lspdf_odd+0x19b>

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

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