#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*/ solve_tridiagonal_matrix(double *, double *, double *,
                                            double *, int);
void compute_bezier_influence_points(double *p, int n_p, double *ip1,
                                     double *ip2) {
  int i;
  int n_ip = (n_p - 1);
  double a[n_ip], b[n_ip], c[n_ip];
  a[0] = 0;
  b[0] = 2;
  c[0] = 1;
  ip1[0] = p[0] + 2 * p[1];
  for (i = 1; i < n_ip - 1; ++i) {
    a[i] = 1;
    b[i] = 4;
    c[i] = 1;
    ip1[i] = 4 * p[i] + 2 * p[i + 1];
  }
  a[n_ip - 1] = 2;
  b[n_ip - 1] = 7;
  c[n_ip - 1] = 0;
  ip1[n_ip - 1] = 8 * p[n_p - 2] + p[n_p - 1];
  solve_tridiagonal_matrix(a, b, c, ip1, n_ip);
  for (i = 0; i < n_ip - 1; ++i)
    ip2[i] = 2 * p[i + 1] - ip1[i + 1];
  ip2[n_ip - 1] = 0.5 * (p[n_p - 1] + ip1[n_ip - 1]);
}


x86 assembly (clang, -O0):
<compute_bezier_influence_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x60(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
lea    0xf(,%rax,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rcx
sub    %rsi,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%esi
lea    0xf(,%rsi,8),%rdi
and    $0xfffffffffffffff0,%rdi
mov    %rsp,%rax
sub    %rdi,%rax
mov    %rax,-0x50(%rbp)
mov    %rax,%rsp
mov    %rsi,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rdx)
movsd  0xe60(%rip),%xmm0
movsd  %xmm0,(%rcx)
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1282 <compute_bezier_influence_points+0x172>
mov    -0x50(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%rdx
movslq -0x24(%rbp),%rsi
movsd  0xdf7(%rip),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
movslq -0x24(%rbp),%rdx
movsd  0xe0e(%rip),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
movslq -0x24(%rbp),%rcx
movsd  0xdd5(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xdb6(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
movsd  0xdc9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e0 <compute_bezier_influence_points+0xd0>
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdi
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  0xd6a(%rip),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  0xd65(%rip),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cltq
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rdx,%rax,8)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd1c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r8d
call   1030 <solve_tridiagonal_matrix@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1391 <compute_bezier_influence_points+0x281>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1322 <compute_bezier_influence_points+0x212>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xc63(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_bezier_influence_points>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,-0x48(%rbp)
mov    %rdx,%r15
mov    %esi,%ecx
mov    %rdi,%r14
lea    -0x1(%rcx),%eax
mov    %rsp,%rdi
mov    %rax,-0x38(%rbp)
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rsp,%rsi
sub    %rax,%rsi
mov    %rsi,%rsp
mov    %rsp,%rdx
sub    %rax,%rdx
mov    %rdx,%rsp
movq   $0x0,(%rdi)
movabs $0x4000000000000000,%rax
mov    %rax,(%rsi)
movabs $0x3ff0000000000000,%r12
mov    %r12,(%rdx)
movsd  0x8(%r14),%xmm0
addsd  %xmm0,%xmm0
addsd  (%r14),%xmm0
movsd  %xmm0,(%r15)
lea    -0x2(%rcx),%eax
mov    %eax,-0x2c(%rbp)
mov    %rcx,-0x40(%rbp)
cmp    $0x4,%ecx
jl     1352 <compute_bezier_influence_points+0x242>
mov    -0x2c(%rbp),%r8d
lea    -0x1(%r8),%r10
mov    $0x1,%r13d
cmp    $0x2,%r10
jb     12e9 <compute_bezier_influence_points+0x1d9>
lea    0x8(%r15),%rax
lea    (%r14,%r8,8),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
jae    11dd <compute_bezier_influence_points+0xcd>
lea    (%r15,%r8,8),%rax
lea    0x8(%r14),%rcx
cmp    %rax,%rcx
jb     12e9 <compute_bezier_influence_points+0x1d9>
mov    %r10,%rbx
and    $0xfffffffffffffffe,%rbx
lea    -0x2(%rbx),%rax
mov    %rax,%r11
shr    %r11
add    $0x1,%r11
test   %rax,%rax
je     14f2 <compute_bezier_influence_points+0x3e2>
mov    %r11,%r13
and    $0xfffffffffffffffe,%r13
xor    %ecx,%ecx
movapd 0xdf4(%rip),%xmm0
movapd 0xdfc(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd %xmm0,0x8(%rdi,%rcx,8)
movupd %xmm1,0x8(%rsi,%rcx,8)
movupd %xmm0,0x8(%rdx,%rcx,8)
movupd 0x8(%r14,%rcx,8),%xmm2
movupd 0x10(%r14,%rcx,8),%xmm3
addpd  %xmm3,%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm3,%xmm2
movupd %xmm2,0x8(%r15,%rcx,8)
movupd %xmm0,0x18(%rdi,%rcx,8)
movupd %xmm1,0x18(%rsi,%rcx,8)
movupd %xmm0,0x18(%rdx,%rcx,8)
movupd 0x18(%r14,%rcx,8),%xmm2
movupd 0x20(%r14,%rcx,8),%xmm3
addpd  %xmm3,%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm3,%xmm2
movupd %xmm2,0x18(%r15,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%r13
jne    1220 <compute_bezier_influence_points+0x110>
test   $0x1,%r11b
je     12dd <compute_bezier_influence_points+0x1cd>
lea    0x0(,%rcx,8),%rax
or     $0x8,%rax
movaps 0xd57(%rip),%xmm0
movups %xmm0,(%rdi,%rax,1)
movapd 0xd5b(%rip),%xmm1
movupd %xmm1,(%rsi,%rax,1)
movups %xmm0,(%rdx,%rax,1)
movupd (%r14,%rax,1),%xmm0
movupd 0x10(%r14,%rcx,8),%xmm2
addpd  %xmm2,%xmm2
mulpd  %xmm1,%xmm0
addpd  %xmm2,%xmm0
movupd %xmm0,(%r15,%rax,1)
cmp    %rbx,%r10
je     1352 <compute_bezier_influence_points+0x242>
or     $0x1,%r10
mov    %r10,%r13
lea    (%r15,%r13,8),%r10
lea    (%r14,%r13,8),%rax
add    $0x8,%rax
lea    (%rdx,%r13,8),%r11
lea    (%rsi,%r13,8),%r9
lea    (%rdi,%r13,8),%rbx
sub    %r13,%r8
xor    %ecx,%ecx
movabs $0x4010000000000000,%r13
movsd  0xd08(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
mov    %r12,(%rbx,%rcx,8)
mov    %r13,(%r9,%rcx,8)
mov    %r12,(%r11,%rcx,8)
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm1,%xmm1
movsd  -0x8(%rax,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r10,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%r8
jne    1320 <compute_bezier_influence_points+0x210>
mov    -0x2c(%rbp),%ebx
movslq %ebx,%r12
movabs $0x4000000000000000,%rax
mov    %rax,(%rdi,%r12,8)
movabs $0x401c000000000000,%rax
mov    %rax,(%rsi,%r12,8)
movq   $0x0,(%rdx,%r12,8)
movsd  (%r14,%r12,8),%xmm0
mulsd  0xc9e(%rip),%xmm0
movslq -0x38(%rbp),%r13
addsd  (%r14,%r13,8),%xmm0
movsd  %xmm0,(%r15,%r12,8)
mov    %r15,%rcx
mov    %r13d,%r8d
call   1030 <solve_tridiagonal_matrix@plt>
cmpl   $0x3,-0x40(%rbp)
mov    -0x48(%rbp),%rdi
jl     14c9 <compute_bezier_influence_points+0x3b9>
mov    %ebx,%eax
cmp    $0x4,%ebx
jae    1430 <compute_bezier_influence_points+0x320>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
je     13e5 <compute_bezier_influence_points+0x2d5>
mov    %rcx,%rsi
or     $0x1,%rsi
movsd  (%r14,%rsi,8),%xmm0
addsd  %xmm0,%xmm0
subsd  (%r15,%rsi,8),%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
mov    %rsi,%rcx
add    %rax,%rdx
je     14c9 <compute_bezier_influence_points+0x3b9>
xchg   %ax,%ax
movsd  0x8(%r14,%rcx,8),%xmm0
addsd  %xmm0,%xmm0
subsd  0x8(%r15,%rcx,8),%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
movsd  0x10(%r14,%rcx,8),%xmm0
addsd  %xmm0,%xmm0
subsd  0x10(%r15,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rdi,%rcx,8)
lea    0x2(%rcx),%rdx
mov    %rdx,%rcx
cmp    %rdx,%rax
jne    13f0 <compute_bezier_influence_points+0x2e0>
jmp    14c9 <compute_bezier_influence_points+0x3b9>
lea    (%rdi,%rax,8),%rcx
lea    0x8(%r14),%rdx
lea    (%r14,%rax,8),%rsi
add    $0x8,%rsi
lea    0x8(%r15),%r9
lea    (%r15,%rax,8),%rbx
add    $0x8,%rbx
cmp    %rdi,%rsi
seta   %sil
cmp    %rcx,%rdx
setb   %r8b
cmp    %rdi,%rbx
seta   %dl
cmp    %rcx,%r9
setb   %bl
xor    %ecx,%ecx
test   %r8b,%sil
jne    13bc <compute_bezier_influence_points+0x2ac>
and    %bl,%dl
jne    13bc <compute_bezier_influence_points+0x2ac>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
xor    %edx,%edx
movupd 0x8(%r14,%rdx,8),%xmm0
movupd 0x18(%r14,%rdx,8),%xmm1
movupd 0x8(%r15,%rdx,8),%xmm2
movupd 0x18(%r15,%rdx,8),%xmm3
addpd  %xmm0,%xmm0
subpd  %xmm2,%xmm0
addpd  %xmm1,%xmm1
subpd  %xmm3,%xmm1
movupd %xmm0,(%rdi,%rdx,8)
movupd %xmm1,0x10(%rdi,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rcx
jne    1480 <compute_bezier_influence_points+0x370>
cmp    %rax,%rcx
jne    13bc <compute_bezier_influence_points+0x2ac>
movsd  (%r14,%r13,8),%xmm0
addsd  (%r15,%r12,8),%xmm0
mulsd  0xb53(%rip),%xmm0
movsd  %xmm0,(%rdi,%r12,8)
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%r11b
jne    1296 <compute_bezier_influence_points+0x186>
jmp    12dd <compute_bezier_influence_points+0x1cd>

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

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