#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_even(double x, double *f, const int m, double *d) {
  double *d1, *d2, *lsp, x1, x2;
  int i;
  d1 = d + 1;
  d2 = d1 + m;
  lsp = f + 1;
  x1 = x2 = d[0];
  for (i = 0; i < m; 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];
  }
  x -= d2[m - 1] - d1[m - 1];
  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_even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12cf <lspdf_even+0x1bf>
movsd  0xe88(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4c(%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  0xe2b(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x4c(%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    -0x30(%rbp),%rax
movslq -0x4c(%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  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4c(%rbp)
jmp    116c <lspdf_even+0x5c>
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jle    1360 <lspdf_even+0x250>
mov    -0x28(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    130a <lspdf_even+0x1fa>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xc80(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lspdf_even>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r15
movapd %xmm0,%xmm1
lea    0x8(%rdx),%rbp
mov    %rsi,0x8(%rsp)
movslq %esi,%r13
lea    (%rdx,%r13,8),%r12
add    $0x8,%r12
test   %r13d,%r13d
jle    1213 <lspdf_even+0x103>
mov    %rdi,%rbx
movsd  (%r15),%xmm2
xor    %r14d,%r14d
movsd  %xmm2,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rbx,%r14,8),%xmm0
call   1030 <cos@plt>
movsd  (%rsp),%xmm1
movsd  0xe7b(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x0(%rbp,%r14,8),%xmm1
movsd  %xmm1,0x0(%rbp,%r14,8)
movsd  0x10(%rbx,%r14,8),%xmm0
call   1030 <cos@plt>
movsd  0x10(%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  0xe47(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r12,%r14,8),%xmm1
movsd  %xmm1,(%r12,%r14,8)
movsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm0
addsd  0x8(%rbp,%r14,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  %xmm0,0x8(%rbp,%r14,8)
addsd  0x8(%r12,%r14,8),%xmm2
movsd  %xmm2,0x8(%r12,%r14,8)
movsd  0x0(%rbp,%r14,8),%xmm0
addsd  (%r12,%r14,8),%xmm0
addsd  %xmm0,%xmm1
add    $0x2,%r14
cmp    %r13,%r14
jl     1160 <lspdf_even+0x50>
movsd  -0x8(%r12,%r13,8),%xmm0
subsd  -0x8(%rbp,%r13,8),%xmm0
subsd  %xmm0,%xmm1
mov    0x8(%rsp),%rbp
cmp    $0x2,%ebp
jl     1285 <lspdf_even+0x175>
lea    -0x1(%rbp),%r8d
mov    %r8d,%esi
cmp    $0x1,%r8d
mov    %rsi,%r11
adc    $0xffffffffffffffff,%r11
add    $0x1,%r11
cmp    $0x2,%r11
jae    12ba <lspdf_even+0x1aa>
add    $0x1,%rsi
lea    (%r15,%r13,8),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rsi),%ecx
movsd  0x8(%r15,%rcx,8),%xmm0
movsd  %xmm0,(%r15,%rsi,8)
movsd  (%r12,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rsi,8)
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     1260 <lspdf_even+0x150>
movsd  (%r15),%xmm0
movsd  %xmm0,(%r12)
movsd  %xmm0,0x8(%r15)
movsd  0xd6a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
movapd %xmm1,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x1,%r8d
mov    %rsi,%rcx
adc    $0xffffffffffffffff,%rcx
add    $0xfffffffe,%ebp
mov    $0x8,%edx
mov    %rcx,%rax
mul    %rdx
seto   %dl
cmp    %ecx,%ebp
jb     124b <lspdf_even+0x13b>
shr    $0x20,%rcx
jne    124b <lspdf_even+0x13b>
lea    (%r15,%rsi,8),%rcx
add    $0x8,%rcx
mov    %rcx,%rdi
sub    %rax,%rdi
cmp    %rcx,%rdi
ja     124b <lspdf_even+0x13b>
test   %dl,%dl
jne    124b <lspdf_even+0x13b>
lea    (%rsi,%r13,1),%rdi
lea    (%r15,%rdi,8),%rbx
add    $0x8,%rbx
mov    %rbx,%rcx
sub    %rax,%rcx
cmp    %rbx,%rcx
ja     124b <lspdf_even+0x13b>
test   %dl,%dl
jne    124b <lspdf_even+0x13b>
lea    (%r15,%rbp,8),%rbx
add    $0x8,%rbx
mov    %rbx,%rcx
sub    %rax,%rcx
cmp    %rbx,%rcx
ja     124b <lspdf_even+0x13b>
test   %dl,%dl
jne    124b <lspdf_even+0x13b>
mov    %r13,%rcx
add    %rbp,%rcx
lea    (%r15,%rcx,8),%rbx
add    $0x8,%rbx
mov    %rbx,%rcx
sub    %rax,%rcx
cmp    %rbx,%rcx
ja     124b <lspdf_even+0x13b>
test   %dl,%dl
jne    124b <lspdf_even+0x13b>
xor    %ecx,%ecx
test   %r8d,%r8d
setne  %cl
lea    (%r15,%rcx,8),%rax
add    $0x8,%rax
lea    0x10(%r15,%rsi,8),%rdx
lea    (%rcx,%r13,1),%rbx
lea    (%r15,%rbx,8),%r8
add    $0x8,%r8
mov    %rdi,0x20(%rsp)
lea    (%r15,%rdi,8),%rdi
add    $0x10,%rdi
add    %rbp,%rcx
sub    %rsi,%rcx
lea    (%r15,%rcx,8),%rcx
add    $0x8,%rcx
lea    (%r15,%rbp,8),%r10
add    $0x10,%r10
add    %rbp,%rbx
sub    %rsi,%rbx
lea    (%r15,%rbx,8),%r14
add    $0x8,%r14
add    %r13,%rbp
lea    (%r15,%rbp,8),%r9
add    $0x10,%r9
cmp    %rdi,%rax
setb   (%rsp)
cmp    %rdx,%r8
setb   0x18(%rsp)
cmp    %r10,%rax
setb   %bl
cmp    %rdx,%rcx
mov    %rcx,%rbp
setb   0x10(%rsp)
cmp    %r9,%rax
setb   %cl
cmp    %rdx,%r14
setb   0x8(%rsp)
cmp    %r10,%r8
setb   %al
cmp    %rdi,%rbp
setb   %r10b
cmp    %r9,%r8
setb   %r9b
cmp    %rdi,%r14
setb   %r8b
mov    0x18(%rsp),%dl
test   %dl,(%rsp)
jne    124b <lspdf_even+0x13b>
and    0x10(%rsp),%bl
jne    124b <lspdf_even+0x13b>
and    0x8(%rsp),%cl
jne    124b <lspdf_even+0x13b>
and    %r10b,%al
jne    124b <lspdf_even+0x13b>
and    %r8b,%r9b
jne    124b <lspdf_even+0x13b>
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     1506 <lspdf_even+0x3f6>
mov    %r10,%rbp
and    $0xfffffffffffffffe,%rbp
mov    0x20(%rsp),%rax
lea    (%r15,%rax,8),%rdx
lea    (%r15,%rsi,8),%rax
lea    (%rsi,%r8,1),%r14
add    $0xfffffffffffffffe,%r14
lea    (%rsi,%r8,1),%rdi
xor    %ecx,%ecx
nopl   (%rax)
lea    (%rdi,%rcx,1),%ebx
movups (%r15,%rbx,8),%xmm0
movups %xmm0,(%rax,%rcx,8)
movups -0x8(%r12,%rbx,8),%xmm0
movups %xmm0,(%rdx,%rcx,8)
lea    (%r14,%rcx,1),%ebx
movups (%r15,%rbx,8),%xmm0
movups %xmm0,-0x10(%rax,%rcx,8)
movupd -0x8(%r12,%rbx,8),%xmm0
movupd %xmm0,-0x10(%rdx,%rcx,8)
add    $0xfffffffffffffffc,%rcx
add    $0xfffffffffffffffe,%rbp
jne    1490 <lspdf_even+0x380>
neg    %rcx
test   $0x1,%r10b
je     14f5 <lspdf_even+0x3e5>
mov    %rsi,%rax
sub    %rcx,%rax
add    %eax,%r8d
movups (%r15,%r8,8),%xmm0
movups %xmm0,(%r15,%rax,8)
movupd -0x8(%r12,%r8,8),%xmm0
movupd %xmm0,-0x8(%r12,%rax,8)
cmp    %r9,%r11
je     1285 <lspdf_even+0x175>
sub    %r9,%rsi
jmp    124b <lspdf_even+0x13b>
xor    %ecx,%ecx
test   $0x1,%r10b
jne    14d4 <lspdf_even+0x3c4>
jmp    14f5 <lspdf_even+0x3e5>

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

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