#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 fabs(double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double sqrt(double);
int spline_tangents_set(int ndata, double tdata[], double ydata[],
                        double ypd[]) {
  int i, mono;
  double d, *del = 0;
  if (ndata < 2)
    return 0;
  d = (tdata[ndata - 1] - tdata[0]) / (ndata - 1);
  if (fabs(d) < 1.e-11)
    return 0;
  if (d < 0) {
    for (i = 1; i < ndata; i++)
      if (tdata[i] - tdata[i - 1] >= 0)
        return 0;
  } else {
    for (i = 1; i < ndata; i++)
      if (tdata[i] - tdata[i - 1] <= 0)
        return 0;
  }
  del = (double *)malloc(ndata * sizeof(double));
  if (!del)
    return 0;
  mono = 1;
  d = 0;
  for (i = 1; i < ndata; i++) {
    register double yd = ydata[i] - ydata[i - 1];
    if (yd * d < 0)
      mono = 0;
    d = yd;
    del[i] = yd / (tdata[i] - tdata[i - 1]);
  }
  if (mono) {
    if (fabs(ydata[ndata - 1] - ydata[0]) < ndata * 1.e-11) {
      mono = 0;
    }
  }
  ypd[0] = del[1];
  ypd[ndata - 1] = del[ndata - 1];
  for (i = 1; i < ndata - 1; i++) {
    ypd[i] = 0.5 * (del[i] + del[i + 1]);
  }
  if (mono) {
    register double a, b, c;
    for (i = 1; i < ndata; i++) {
      if (fabs(del[i]) < 1.e-11) {
        ypd[i - 1] = ypd[i] = 0;
      } else {
        a = ypd[i - 1] / del[i];
        b = ypd[i] / del[i];
        c = a * a + b * b;
        if (c > 9.0) {
          c = 3.0 / sqrt(c);
          ypd[i - 1] *= c;
          ypd[i] *= c;
        }
      }
    }
  }
  free(del);
  return (mono ? 1 : -1);
}


x86 assembly (clang, -O0):
<spline_tangents_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1165 <spline_tangents_set+0x35>
movl   $0x0,-0x4(%rbp)
jmp    15d1 <spline_tangents_set+0x4a1>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movaps 0xe82(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c0 <spline_tangents_set+0x90>
movl   $0x0,-0x4(%rbp)
jmp    15d1 <spline_tangents_set+0x4a1>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1231 <spline_tangents_set+0x101>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122c <spline_tangents_set+0xfc>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1219 <spline_tangents_set+0xe9>
movl   $0x0,-0x4(%rbp)
jmp    15d1 <spline_tangents_set+0x4a1>
jmp    121e <spline_tangents_set+0xee>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d5 <spline_tangents_set+0xa5>
jmp    1294 <spline_tangents_set+0x164>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128f <spline_tangents_set+0x15f>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     127c <spline_tangents_set+0x14c>
movl   $0x0,-0x4(%rbp)
jmp    15d1 <spline_tangents_set+0x4a1>
jmp    1281 <spline_tangents_set+0x151>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1238 <spline_tangents_set+0x108>
jmp    1294 <spline_tangents_set+0x164>
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12be <spline_tangents_set+0x18e>
movl   $0x0,-0x4(%rbp)
jmp    15d1 <spline_tangents_set+0x4a1>
movl   $0x1,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    136f <spline_tangents_set+0x23f>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1322 <spline_tangents_set+0x1f2>
movl   $0x0,-0x28(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12d4 <spline_tangents_set+0x1a4>
cmpl   $0x0,-0x28(%rbp)
je     13c5 <spline_tangents_set+0x295>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm1
movaps 0xc86(%rip),%xmm0
pand   %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xc55(%rip),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    13c0 <spline_tangents_set+0x290>
movl   $0x0,-0x28(%rbp)
jmp    13c5 <spline_tangents_set+0x295>
mov    -0x38(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1458 <spline_tangents_set+0x328>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xbdf(%rip),%xmm0
mulsd  %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    1401 <spline_tangents_set+0x2d1>
cmpl   $0x0,-0x28(%rbp)
je     15b2 <spline_tangents_set+0x482>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15ad <spline_tangents_set+0x47d>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xb97(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xb6b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14c9 <spline_tangents_set+0x399>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    159a <spline_tangents_set+0x46a>
mov    -0x20(%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
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xace(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1595 <spline_tangents_set+0x465>
movsd  -0x58(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xab7(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    159a <spline_tangents_set+0x46a>
jmp    159f <spline_tangents_set+0x46f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1469 <spline_tangents_set+0x339>
jmp    15b2 <spline_tangents_set+0x482>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline_tangents_set>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1718 <spline_tangents_set+0x5e8>
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %edi,%ecx
lea    -0x1(%rcx),%edx
movsd  (%rsi,%rdx,8),%xmm2
movsd  (%rsi),%xmm0
subsd  %xmm0,%xmm2
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm2
movapd 0xe8c(%rip),%xmm1
andpd  %xmm2,%xmm1
movsd  0xeb0(%rip),%xmm3
ucomisd %xmm1,%xmm3
ja     1718 <spline_tangents_set+0x5e8>
xorpd  %xmm1,%xmm1
ucomisd %xmm2,%xmm1
mov    %ecx,%r15d
mov    $0x1,%eax
jbe    11d0 <spline_tangents_set+0xa0>
nopl   0x0(%rax)
movapd %xmm0,%xmm2
movsd  (%rbx,%rax,8),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
ucomisd %xmm1,%xmm3
jae    1718 <spline_tangents_set+0x5e8>
add    $0x1,%rax
cmp    %rax,%r15
jne    11a0 <spline_tangents_set+0x70>
jmp    11f4 <spline_tangents_set+0xc4>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm0,%xmm2
movsd  (%rbx,%rax,8),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
jae    1718 <spline_tangents_set+0x5e8>
add    $0x1,%rax
cmp    %rax,%r15
jne    11d0 <spline_tangents_set+0xa0>
mov    %rdx,0x8(%rsp)
lea    0x0(,%rcx,8),%edi
mov    %rcx,0x10(%rsp)
call   1040 <malloc@plt>
test   %rax,%rax
je     1718 <spline_tangents_set+0x5e8>
mov    %rax,%r12
mov    0x10(%rsp),%r11
cmp    $0x2,%r11d
jl     1294 <spline_tangents_set+0x164>
lea    -0x1(%r15),%r8
xorpd  %xmm8,%xmm8
mov    $0x1,%edx
mov    $0x1,%eax
cmp    $0x4,%r8
jae    13df <spline_tangents_set+0x2af>
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x0(%r13,%rax,8),%xmm0
subsd  -0x8(%r13,%rax,8),%xmm0
mulsd  %xmm0,%xmm1
ucomisd %xmm1,%xmm8
cmova  %ecx,%edx
movsd  (%rbx,%rax,8),%xmm2
subsd  -0x8(%rbx,%rax,8),%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm0
movsd  %xmm0,(%r12,%rax,8)
add    $0x1,%rax
cmp    %rax,%r15
jne    1250 <spline_tangents_set+0x120>
test   %edx,%edx
je     1533 <spline_tangents_set+0x403>
mov    0x8(%rsp),%rbx
movsd  0x0(%r13,%rbx,8),%xmm0
subsd  0x0(%r13),%xmm0
andpd  0xd52(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r11d,%xmm1
mulsd  0xd72(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    12c8 <spline_tangents_set+0x198>
mov    $0x1,%al
jmp    12ca <spline_tangents_set+0x19a>
xor    %eax,%eax
movsd  0xd5e(%rip),%xmm4
movsd  0x8(%r12),%xmm0
movsd  %xmm0,(%r14)
movsd  (%r12,%rbx,8),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
cmp    $0x3,%r11d
jl     161c <spline_tangents_set+0x4ec>
lea    -0x1(%rbx),%rdx
mov    $0x1,%ecx
cmp    $0x4,%rdx
jb     15a6 <spline_tangents_set+0x476>
lea    0x8(%r14),%rsi
lea    (%r12,%rbx,8),%rdi
add    $0x8,%rdi
cmp    %rdi,%rsi
jae    132c <spline_tangents_set+0x1fc>
lea    (%r14,%rbx,8),%rsi
mov    %r12,%rdi
add    $0x8,%rdi
cmp    %rsi,%rdi
jb     15a6 <spline_tangents_set+0x476>
mov    %rdx,%rcx
and    $0xfffffffffffffffc,%rcx
lea    -0x4(%rcx),%rsi
mov    %rsi,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     1547 <spline_tangents_set+0x417>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
movapd 0xcc4(%rip),%xmm0
movupd 0x8(%r12,%rsi,8),%xmm1
movupd 0x10(%r12,%rsi,8),%xmm2
addpd  %xmm1,%xmm2
movupd 0x18(%r12,%rsi,8),%xmm1
movupd 0x20(%r12,%rsi,8),%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,0x8(%r14,%rsi,8)
movupd %xmm3,0x18(%r14,%rsi,8)
movupd 0x28(%r12,%rsi,8),%xmm1
movupd 0x30(%r12,%rsi,8),%xmm2
addpd  %xmm1,%xmm2
movupd 0x38(%r12,%rsi,8),%xmm1
movupd 0x40(%r12,%rsi,8),%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,0x28(%r14,%rsi,8)
movupd %xmm3,0x38(%r14,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    135c <spline_tangents_set+0x22c>
jmp    1549 <spline_tangents_set+0x419>
lea    0x8(%r12),%rcx
lea    (%r12,%r15,8),%rsi
lea    0x0(,%r15,8),%rbp
add    %r13,%rbp
lea    (%rbx,%r15,8),%rdi
cmp    %rbp,%rcx
setb   %r9b
cmp    %r13,%rsi
seta   %r10b
cmp    %rdi,%rcx
setb   %cl
cmp    %rbx,%rsi
seta   %sil
xorpd  %xmm1,%xmm1
test   %r10b,%r9b
jne    1242 <spline_tangents_set+0x112>
and    %sil,%cl
jne    1242 <spline_tangents_set+0x112>
mov    %r8,%rsi
and    $0xfffffffffffffffc,%rsi
lea    0x1(%rsi),%rax
xorpd  %xmm2,%xmm2
movaps 0xbd2(%rip),%xmm3
xor    %edx,%edx
movaps %xmm3,%xmm4
xorpd  %xmm1,%xmm1
nopw   0x0(%rax,%rax,1)
movaps %xmm3,%xmm6
movapd %xmm1,%xmm3
movaps %xmm4,%xmm7
movupd 0x0(%r13,%rdx,8),%xmm1
movupd 0x8(%r13,%rdx,8),%xmm5
subpd  %xmm1,%xmm5
movupd 0x10(%r13,%rdx,8),%xmm4
shufpd $0x1,%xmm5,%xmm3
mulpd  %xmm5,%xmm3
cmpltpd %xmm2,%xmm3
shufps $0xe8,%xmm3,%xmm3
movupd 0x18(%r13,%rdx,8),%xmm1
subpd  %xmm4,%xmm1
movapd %xmm5,%xmm4
shufpd $0x1,%xmm1,%xmm4
mulpd  %xmm1,%xmm4
andnps %xmm6,%xmm3
cmpltpd %xmm2,%xmm4
shufps $0xe8,%xmm4,%xmm4
andnps %xmm7,%xmm4
movupd (%rbx,%rdx,8),%xmm6
movupd 0x8(%rbx,%rdx,8),%xmm7
subpd  %xmm6,%xmm7
movupd 0x10(%rbx,%rdx,8),%xmm6
movupd 0x18(%rbx,%rdx,8),%xmm0
subpd  %xmm6,%xmm0
divpd  %xmm7,%xmm5
movapd %xmm1,%xmm6
divpd  %xmm0,%xmm6
movupd %xmm5,0x8(%r12,%rdx,8)
movupd %xmm6,0x18(%r12,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    1450 <spline_tangents_set+0x320>
movdqa 0xb16(%rip),%xmm0
pcmpeqd %xmm3,%xmm0
pand   %xmm0,%xmm4
pandn  %xmm3,%xmm0
por    %xmm4,%xmm0
movq   %xmm0,%rcx
movabs $0x100000001,%rdi
xor    %edx,%edx
cmp    %rdi,%rcx
sete   %dl
cmp    %rsi,%r8
je     128c <spline_tangents_set+0x15c>
unpckhpd %xmm1,%xmm1
jmp    1242 <spline_tangents_set+0x112>
mov    $0x1,%al
movsd  0xaf3(%rip),%xmm4
mov    0x8(%rsp),%rbx
jmp    12d2 <spline_tangents_set+0x1a2>
xor    %esi,%esi
test   $0x1,%bpl
je     159d <spline_tangents_set+0x46d>
shl    $0x3,%rsi
mov    %rsi,%rdi
or     $0x8,%rdi
movupd (%r12,%rdi,1),%xmm0
movupd 0x10(%r12,%rdi,1),%xmm1
or     $0x10,%rsi
movupd (%r12,%rsi,1),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%r12,%rsi,1),%xmm0
addpd  %xmm1,%xmm0
movapd 0xa98(%rip),%xmm1
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm0
movupd %xmm2,(%r14,%rdi,1)
movupd %xmm0,0x10(%r14,%rdi,1)
cmp    %rcx,%rdx
je     161c <spline_tangents_set+0x4ec>
or     $0x1,%rcx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%bl
jne    15d0 <spline_tangents_set+0x4a0>
movsd  (%r12,%rcx,8),%xmm0
addsd  0x8(%r12,%rcx,8),%xmm0
mulsd  0xa72(%rip),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
add    $0x1,%rcx
add    %rbx,%rdx
je     161c <spline_tangents_set+0x4ec>
movsd  0xa5b(%rip),%xmm0
nopl   (%rax)
movsd  (%r12,%rcx,8),%xmm1
addsd  0x8(%r12,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rcx,8)
movsd  0x8(%r12,%rcx,8),%xmm1
addsd  0x10(%r12,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14,%rcx,8)
lea    0x2(%rcx),%rdx
mov    %rdx,%rcx
cmp    %rdx,%rbx
jne    15e0 <spline_tangents_set+0x4b0>
cmp    $0x2,%r11d
setl   %cl
or     %al,%cl
je     1637 <spline_tangents_set+0x507>
xor    $0x1,%al
movzbl %al,%eax
lea    (%rax,%rax,1),%ebp
add    $0xffffffff,%ebp
jmp    1710 <spline_tangents_set+0x5e0>
add    $0xffffffffffffffff,%r15
xor    %ebx,%ebx
movapd 0x9bb(%rip),%xmm3
xorpd  %xmm5,%xmm5
movsd  0x9ef(%rip),%xmm6
xorpd  %xmm8,%xmm8
movsd  0x9ea(%rip),%xmm7
jmp    1673 <spline_tangents_set+0x543>
movupd %xmm5,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
je     170b <spline_tangents_set+0x5db>
movsd  0x8(%r12,%rbx,8),%xmm1
movapd %xmm1,%xmm0
andpd  %xmm3,%xmm0
ucomisd %xmm0,%xmm4
ja     1660 <spline_tangents_set+0x530>
movsd  (%r14,%rbx,8),%xmm0
movsd  0x8(%r14,%rbx,8),%xmm2
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm6,%xmm0
jbe    1666 <spline_tangents_set+0x536>
ucomisd %xmm8,%xmm0
jb     16bc <spline_tangents_set+0x58c>
sqrtsd %xmm0,%xmm0
jmp    16ea <spline_tangents_set+0x5ba>
call   1050 <sqrt@plt>
movsd  0x97f(%rip),%xmm7
xorpd  %xmm8,%xmm8
movsd  0x96a(%rip),%xmm6
xorpd  %xmm5,%xmm5
movapd 0x91e(%rip),%xmm3
movsd  0x946(%rip),%xmm4
movapd %xmm7,%xmm1
divsd  %xmm0,%xmm1
movupd (%r14,%rbx,8),%xmm0
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,(%r14,%rbx,8)
jmp    1666 <spline_tangents_set+0x536>
mov    $0x1,%ebp
mov    %r12,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @spline_tangents_set(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca double*
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* null, double** %13
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 2
br i1 %19, label %20, label %21
20: ; preds = %4
store i32 0, i32* %5
br label %303
21: ; preds = %4
%22 = load double*, double** %7
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %22, i64 %25
%27 = load double, double* %26
%28 = load double*, double** %7
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load i32, i32* %6
%33 = sub nsw i32 %32, 1
%34 = sitofp i32 %33 to double
%35 = fdiv double %31, %34
store double %35, double* %12
%36 = load double, double* %12
%37 = call double @llvm.fabs.f64(double %36)
%38 = fcmp olt double %37, 0x3DA5FD7FE1796495
br i1 %38, label %39, label %40
39: ; preds = %21
store i32 0, i32* %5
br label %303
40: ; preds = %21
%41 = load double, double* %12
%42 = fcmp olt double %41, 0.000000e+00
br i1 %42, label %43, label %68
43: ; preds = %40
store i32 1, i32* %10
br label %44
44: ; preds = %64, %43
%45 = load i32, i32* %10
%46 = load i32, i32* %6
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %67
48: ; preds = %44
%49 = load double*, double** %7
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = load double*, double** %7
%55 = load i32, i32* %10
%56 = sub nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %54, i64 %57
%59 = load double, double* %58
%60 = fsub double %53, %59
%61 = fcmp oge double %60, 0.000000e+00
br i1 %61, label %62, label %63
62: ; preds = %48
store i32 0, i32* %5
br label %303
63: ; preds = %48
br label %64
64: ; preds = %63
%65 = load i32, i32* %10
%66 = add nsw i32 %65, 1
store i32 %66, i32* %10
br label %44
67: ; preds = %44
br label %93
68: ; preds = %40
store i32 1, i32* %10
br label %69
69: ; preds = %89, %68
%70 = load i32, i32* %10
%71 = load i32, i32* %6
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %92
73: ; preds = %69
%74 = load double*, double** %7
%75 = load i32, i32* %10
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
%78 = load double, double* %77
%79 = load double*, double** %7
%80 = load i32, i32* %10
%81 = sub nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %79, i64 %82
%84 = load double, double* %83
%85 = fsub double %78, %84
%86 = fcmp ole double %85, 0.000000e+00
br i1 %86, label %87, label %88
87: ; preds = %73
store i32 0, i32* %5
br label %303
88: ; preds = %73
br label %89
89: ; preds = %88
%90 = load i32, i32* %10
%91 = add nsw i32 %90, 1
store i32 %91, i32* %10
br label %69
92: ; preds = %69
br label %93
93: ; preds = %92, %67
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = mul i64 %95, 8
%97 = trunc i64 %96 to i32
%98 = call i64 @malloc(i32 %97)
%99 = inttoptr i64 %98 to double*
store double* %99, double** %13
%100 = load double*, double** %13
%101 = icmp ne double* %100, null
br i1 %101, label %103, label %102
102: ; preds = %93
store i32 0, i32* %5
br label %303
103: ; preds = %93
store i32 1, i32* %11
store double 0.000000e+00, double* %12
store i32 1, i32* %10
br label %104
104: ; preds = %146, %103
%105 = load i32, i32* %10
%106 = load i32, i32* %6
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %149
108: ; preds = %104
%109 = load double*, double** %8
%110 = load i32, i32* %10
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %109, i64 %111
%113 = load double, double* %112
%114 = load double*, double** %8
%115 = load i32, i32* %10
%116 = sub nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %114, i64 %117
%119 = load double, double* %118
%120 = fsub double %113, %119
store double %120, double* %14
%121 = load double, double* %14
%122 = load double, double* %12
%123 = fmul double %121, %122
%124 = fcmp olt double %123, 0.000000e+00
br i1 %124, label %125, label %126
125: ; preds = %108
store i32 0, i32* %11
br label %126
126: ; preds = %125, %108
%127 = load double, double* %14
store double %127, double* %12
%128 = load double, double* %14
%129 = load double*, double** %7
%130 = load i32, i32* %10
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %129, i64 %131
%133 = load double, double* %132
%134 = load double*, double** %7
%135 = load i32, i32* %10
%136 = sub nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %134, i64 %137
%139 = load double, double* %138
%140 = fsub double %133, %139
%141 = fdiv double %128, %140
%142 = load double*, double** %13
%143 = load i32, i32* %10
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
store double %141, double* %145
br label %146
146: ; preds = %126
%147 = load i32, i32* %10
%148 = add nsw i32 %147, 1
store i32 %148, i32* %10
br label %104
149: ; preds = %104
%150 = load i32, i32* %11
%151 = icmp ne i32 %150, 0
br i1 %151, label %152, label %170
152: ; preds = %149
%153 = load double*, double** %8
%154 = load i32, i32* %6
%155 = sub nsw i32 %154, 1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %153, i64 %156
%158 = load double, double* %157
%159 = load double*, double** %8
%160 = getelementptr inbounds double, double* %159, i64 0
%161 = load double, double* %160
%162 = fsub double %158, %161
%163 = call double @llvm.fabs.f64(double %162)
%164 = load i32, i32* %6
%165 = sitofp i32 %164 to double
%166 = fmul double %165, 0x3DA5FD7FE1796495
%167 = fcmp olt double %163, %166
br i1 %167, label %168, label %169
168: ; preds = %152
store i32 0, i32* %11
br label %169
169: ; preds = %168, %152
br label %170
170: ; preds = %169, %149
%171 = load double*, double** %13
%172 = getelementptr inbounds double, double* %171, i64 1
%173 = load double, double* %172
%174 = load double*, double** %9
%175 = getelementptr inbounds double, double* %174, i64 0
store double %173, double* %175
%176 = load double*, double** %13
%177 = load i32, i32* %6
%178 = sub nsw i32 %177, 1
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %176, i64 %179
%181 = load double, double* %180
%182 = load double*, double** %9
%183 = load i32, i32* %6
%184 = sub nsw i32 %183, 1
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double, double* %182, i64 %185
store double %181, double* %186
store i32 1, i32* %10
br label %187
187: ; preds = %210, %170
%188 = load i32, i32* %10
%189 = load i32, i32* %6
%190 = sub nsw i32 %189, 1
%191 = icmp slt i32 %188, %190
br i1 %191, label %192, label %213
192: ; preds = %187
%193 = load double*, double** %13
%194 = load i32, i32* %10
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds double, double* %193, i64 %195
%197 = load double, double* %196
%198 = load double*, double** %13
%199 = load i32, i32* %10
%200 = add nsw i32 %199, 1
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %198, i64 %201
%203 = load double, double* %202
%204 = fadd double %197, %203
%205 = fmul double 5.000000e-01, %204
%206 = load double*, double** %9
%207 = load i32, i32* %10
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %206, i64 %208
store double %205, double* %209
br label %210
210: ; preds = %192
%211 = load i32, i32* %10
%212 = add nsw i32 %211, 1
store i32 %212, i32* %10
br label %187
213: ; preds = %187
%214 = load i32, i32* %11
%215 = icmp ne i32 %214, 0
br i1 %215, label %216, label %296
216: ; preds = %213
store i32 1, i32* %10
br label %217
217: ; preds = %292, %216
%218 = load i32, i32* %10
%219 = load i32, i32* %6
%220 = icmp slt i32 %218, %219
br i1 %220, label %221, label %295
221: ; preds = %217
%222 = load double*, double** %13
%223 = load i32, i32* %10
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %222, i64 %224
%226 = load double, double* %225
%227 = call double @llvm.fabs.f64(double %226)
%228 = fcmp olt double %227, 0x3DA5FD7FE1796495
br i1 %228, label %229, label %239
229: ; preds = %221
%230 = load double*, double** %9
%231 = load i32, i32* %10
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %230, i64 %232
store double 0.000000e+00, double* %233
%234 = load double*, double** %9
%235 = load i32, i32* %10
%236 = sub nsw i32 %235, 1
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds double, double* %234, i64 %237
store double 0.000000e+00, double* %238
br label %291
239: ; preds = %221
%240 = load double*, double** %9
%241 = load i32, i32* %10
%242 = sub nsw i32 %241, 1
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %240, i64 %243
%245 = load double, double* %244
%246 = load double*, double** %13
%247 = load i32, i32* %10
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds double, double* %246, i64 %248
%250 = load double, double* %249
%251 = fdiv double %245, %250
store double %251, double* %15
%252 = load double*, double** %9
%253 = load i32, i32* %10
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds double, double* %252, i64 %254
%256 = load double, double* %255
%257 = load double*, double** %13
%258 = load i32, i32* %10
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %257, i64 %259
%261 = load double, double* %260
%262 = fdiv double %256, %261
store double %262, double* %16
%263 = load double, double* %15
%264 = load double, double* %15
%265 = load double, double* %16
%266 = load double, double* %16
%267 = fmul double %265, %266
%268 = call double @llvm.fmuladd.f64(double %263, double %264, double %267)
store double %268, double* %17
%269 = load double, double* %17
%270 = fcmp ogt double %269, 9.000000e+00
br i1 %270, label %271, label %290
271: ; preds = %239
%272 = load double, double* %17
%273 = call double @sqrt(double %272)
%274 = fdiv double 3.000000e+00, %273
store double %274, double* %17
%275 = load double, double* %17
%276 = load double*, double** %9
%277 = load i32, i32* %10
%278 = sub nsw i32 %277, 1
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds double, double* %276, i64 %279
%281 = load double, double* %280
%282 = fmul double %281, %275
store double %282, double* %280
%283 = load double, double* %17
%284 = load double*, double** %9
%285 = load i32, i32* %10
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %284, i64 %286
%288 = load double, double* %287
%289 = fmul double %288, %283
store double %289, double* %287
br label %290
290: ; preds = %271, %239
br label %291
291: ; preds = %290, %229
br label %292
292: ; preds = %291
%293 = load i32, i32* %10
%294 = add nsw i32 %293, 1
store i32 %294, i32* %10
br label %217
295: ; preds = %217
br label %296
296: ; preds = %295, %213
%297 = load double*, double** %13
%298 = call i32 @free(double* %297)
%299 = load i32, i32* %11
%300 = icmp ne i32 %299, 0
%301 = zext i1 %300 to i64
%302 = select i1 %300, i32 1, i32 -1
store i32 %302, i32* %5
br label %303
303: ; preds = %296, %102, %87, %62, %39, %20
%304 = load i32, i32* %5
ret i32 %304
}

LLVM IR (-O2):
define i32 @spline_tangents_set(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = icmp slt i32 %0, 2
br i1 %5, label %350, label %6
6: ; preds = %4
%7 = add nsw i32 %0, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = load double, double* %1
%12 = fsub double %10, %11
%13 = sitofp i32 %7 to double
%14 = fdiv double %12, %13
%15 = tail call double @llvm.fabs.f64(double %14)
%16 = fcmp olt double %15, 0x3DA5FD7FE1796495
br i1 %16, label %350, label %17
17: ; preds = %6
%18 = fcmp olt double %14, 0.000000e+00
%19 = zext i32 %0 to i64
br i1 %18, label %22, label %32
20: ; preds = %22
%21 = icmp eq i64 %29, %19
br i1 %21, label %40, label %22
22: ; preds = %17, %20
%23 = phi double [ %26, %20 ], [ %11, %17 ]
%24 = phi i64 [ %29, %20 ], [ 1, %17 ]
%25 = getelementptr inbounds double, double* %1, i64 %24
%26 = load double, double* %25
%27 = fsub double %26, %23
%28 = fcmp ult double %27, 0.000000e+00
%29 = add nuw nsw i64 %24, 1
br i1 %28, label %20, label %350
30: ; preds = %32
%31 = icmp eq i64 %39, %19
br i1 %31, label %40, label %32
32: ; preds = %17, %30
%33 = phi double [ %36, %30 ], [ %11, %17 ]
%34 = phi i64 [ %39, %30 ], [ 1, %17 ]
%35 = getelementptr inbounds double, double* %1, i64 %34
%36 = load double, double* %35
%37 = fsub double %36, %33
%38 = fcmp ugt double %37, 0.000000e+00
%39 = add nuw nsw i64 %34, 1
br i1 %38, label %30, label %350
40: ; preds = %30, %20
%41 = shl i32 %0, 3
%42 = tail call i64 @malloc(i32 %41)
%43 = inttoptr i64 %42 to double*
%44 = icmp eq i64 %42, 0
br i1 %44, label %350, label %45
45: ; preds = %40
%46 = icmp sgt i32 %0, 1
br i1 %46, label %47, label %153
47: ; preds = %45
%48 = zext i32 %0 to i64
%49 = add nsw i64 %19, -1
%50 = icmp ult i64 %49, 4
br i1 %50, label %124, label %51
51: ; preds = %47
%52 = getelementptr double, double* %43, i64 1
%53 = getelementptr double, double* %43, i64 %19
%54 = getelementptr double, double* %2, i64 %19
%55 = getelementptr double, double* %1, i64 %19
%56 = icmp ult double* %52, %54
%57 = icmp ugt double* %53, %2
%58 = and i1 %56, %57
%59 = icmp ult double* %52, %55
%60 = icmp ugt double* %53, %1
%61 = and i1 %59, %60
%62 = or i1 %58, %61
br i1 %62, label %124, label %63
63: ; preds = %51
%64 = and i64 %49, -4
%65 = or i64 %64, 1
br label %66
66: ; preds = %66, %63
%67 = phi i64 [ 0, %63 ], [ %114, %66 ]
%68 = phi <2 x i32> [ <i32 1, i32 1>, %63 ], [ %92, %66 ]
%69 = phi <2 x i32> [ <i32 1, i32 1>, %63 ], [ %93, %66 ]
%70 = phi <2 x double> [ <double poison, double 0.000000e+00>, %63 ], [ %85, %66 ]
%71 = or i64 %67, 1
%72 = getelementptr inbounds double, double* %2, i64 %71
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = getelementptr inbounds double, double* %72, i64 2
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = getelementptr inbounds double, double* %2, i64 %67
%79 = bitcast double* %78 to <2 x double>*
%80 = load <2 x double>, <2 x double>* %79
%81 = getelementptr inbounds double, double* %78, i64 2
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = fsub <2 x double> %74, %80
%85 = fsub <2 x double> %77, %83
%86 = shufflevector <2 x double> %70, <2 x double> %84, <2 x i32> <i32 1, i32 2>
%87 = shufflevector <2 x double> %84, <2 x double> %85, <2 x i32> <i32 1, i32 2>
%88 = fmul <2 x double> %86, %84
%89 = fmul <2 x double> %87, %85
%90 = fcmp olt <2 x double> %88, zeroinitializer
%91 = fcmp olt <2 x double> %89, zeroinitializer
%92 = select <2 x i1> %90, <2 x i32> zeroinitializer, <2 x i32> %68
%93 = select <2 x i1> %91, <2 x i32> zeroinitializer, <2 x i32> %69
%94 = getelementptr inbounds double, double* %1, i64 %71
%95 = bitcast double* %94 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = getelementptr inbounds double, double* %94, i64 2
%98 = bitcast double* %97 to <2 x double>*
%99 = load <2 x double>, <2 x double>* %98
%100 = getelementptr inbounds double, double* %1, i64 %67
%101 = bitcast double* %100 to <2 x double>*
%102 = load <2 x double>, <2 x double>* %101
%103 = getelementptr inbounds double, double* %100, i64 2
%104 = bitcast double* %103 to <2 x double>*
%105 = load <2 x double>, <2 x double>* %104
%106 = fsub <2 x double> %96, %102
%107 = fsub <2 x double> %99, %105
%108 = fdiv <2 x double> %84, %106
%109 = fdiv <2 x double> %85, %107
%110 = getelementptr inbounds double, double* %43, i64 %71
%111 = bitcast double* %110 to <2 x double>*
store <2 x double> %108, <2 x double>* %111
%112 = getelementptr inbounds double, double* %110, i64 2
%113 = bitcast double* %112 to <2 x double>*
store <2 x double> %109, <2 x double>* %113
%114 = add nuw i64 %67, 4
%115 = icmp eq i64 %114, %64
br i1 %115, label %116, label %66
116: ; preds = %66
%117 = icmp eq <2 x i32> %92, <i32 1, i32 1>
%118 = select <2 x i1> %117, <2 x i32> %93, <2 x i32> %92
%119 = bitcast <2 x i32> %118 to i64
%120 = icmp eq i64 %119, 4294967297
%121 = zext i1 %120 to i32
%122 = icmp eq i64 %49, %64
%123 = extractelement <2 x double> %85, i64 1
br i1 %122, label %150, label %124
124: ; preds = %51, %47, %116
%125 = phi i64 [ %65, %116 ], [ 1, %47 ], [ 1, %51 ]
%126 = phi i32 [ %121, %116 ], [ 1, %47 ], [ 1, %51 ]
%127 = phi double [ %123, %116 ], [ 0.000000e+00, %47 ], [ 0.000000e+00, %51 ]
br label %128
128: ; preds = %124, %128
%129 = phi i64 [ %148, %128 ], [ %125, %124 ]
%130 = phi i32 [ %140, %128 ], [ %126, %124 ]
%131 = phi double [ %137, %128 ], [ %127, %124 ]
%132 = getelementptr inbounds double, double* %2, i64 %129
%133 = load double, double* %132
%134 = add nsw i64 %129, -1
%135 = getelementptr inbounds double, double* %2, i64 %134
%136 = load double, double* %135
%137 = fsub double %133, %136
%138 = fmul double %131, %137
%139 = fcmp olt double %138, 0.000000e+00
%140 = select i1 %139, i32 0, i32 %130
%141 = getelementptr inbounds double, double* %1, i64 %129
%142 = load double, double* %141
%143 = getelementptr inbounds double, double* %1, i64 %134
%144 = load double, double* %143
%145 = fsub double %142, %144
%146 = fdiv double %137, %145
%147 = getelementptr inbounds double, double* %43, i64 %129
store double %146, double* %147
%148 = add nuw nsw i64 %129, 1
%149 = icmp eq i64 %148, %48
br i1 %149, label %150, label %128
150: ; preds = %128, %116
%151 = phi i32 [ %121, %116 ], [ %140, %128 ]
%152 = icmp eq i32 %151, 0
br i1 %152, label %163, label %153
153: ; preds = %45, %150
%154 = getelementptr inbounds double, double* %2, i64 %8
%155 = load double, double* %154
%156 = load double, double* %2
%157 = fsub double %155, %156
%158 = tail call double @llvm.fabs.f64(double %157)
%159 = sitofp i32 %0 to double
%160 = fmul double %159, 0x3DA5FD7FE1796495
%161 = fcmp olt double %158, %160
br i1 %161, label %162, label %163
162: ; preds = %153
br label %163
163: ; preds = %153, %162, %150
%164 = phi i1 [ false, %153 ], [ true, %162 ], [ true, %150 ]
%165 = getelementptr inbounds double, double* %43, i64 1
%166 = load double, double* %165
store double %166, double* %3
%167 = getelementptr inbounds double, double* %43, i64 %8
%168 = load double, double* %167
%169 = getelementptr inbounds double, double* %3, i64 %8
store double %168, double* %169
%170 = icmp sgt i32 %0, 2
br i1 %170, label %171, label %308
171: ; preds = %163
%172 = add nsw i64 %8, -1
%173 = icmp ult i64 %172, 4
br i1 %173, label %271, label %174
174: ; preds = %171
%175 = getelementptr double, double* %3, i64 1
%176 = getelementptr double, double* %3, i64 %8
%177 = getelementptr double, double* %43, i64 1
%178 = add nuw nsw i64 %8, 1
%179 = getelementptr double, double* %43, i64 %178
%180 = icmp ult double* %175, %179
%181 = icmp ult double* %177, %176
%182 = and i1 %180, %181
br i1 %182, label %271, label %183
183: ; preds = %174
%184 = and i64 %172, -4
%185 = or i64 %184, 1
%186 = add nsw i64 %184, -4
%187 = lshr exact i64 %186, 2
%188 = add nuw nsw i64 %187, 1
%189 = and i64 %188, 1
%190 = icmp eq i64 %186, 0
br i1 %190, label %243, label %191
191: ; preds = %183
%192 = and i64 %188, 9223372036854775806
br label %193
193: ; preds = %193, %191
%194 = phi i64 [ 0, %191 ], [ %240, %193 ]
%195 = phi i64 [ 0, %191 ], [ %241, %193 ]
%196 = or i64 %194, 1
%197 = getelementptr inbounds double, double* %43, i64 %196
%198 = bitcast double* %197 to <2 x double>*
%199 = load <2 x double>, <2 x double>* %198
%200 = getelementptr inbounds double, double* %197, i64 2
%201 = bitcast double* %200 to <2 x double>*
%202 = load <2 x double>, <2 x double>* %201
%203 = or i64 %194, 2
%204 = getelementptr inbounds double, double* %43, i64 %203
%205 = bitcast double* %204 to <2 x double>*
%206 = load <2 x double>, <2 x double>* %205
%207 = getelementptr inbounds double, double* %204, i64 2
%208 = bitcast double* %207 to <2 x double>*
%209 = load <2 x double>, <2 x double>* %208
%210 = fadd <2 x double> %199, %206
%211 = fadd <2 x double> %202, %209
%212 = fmul <2 x double> %210, <double 5.000000e-01, double 5.000000e-01>
%213 = fmul <2 x double> %211, <double 5.000000e-01, double 5.000000e-01>
%214 = getelementptr inbounds double, double* %3, i64 %196
%215 = bitcast double* %214 to <2 x double>*
store <2 x double> %212, <2 x double>* %215
%216 = getelementptr inbounds double, double* %214, i64 2
%217 = bitcast double* %216 to <2 x double>*
store <2 x double> %213, <2 x double>* %217
%218 = or i64 %194, 5
%219 = getelementptr inbounds double, double* %43, i64 %218
%220 = bitcast double* %219 to <2 x double>*
%221 = load <2 x double>, <2 x double>* %220
%222 = getelementptr inbounds double, double* %219, i64 2
%223 = bitcast double* %222 to <2 x double>*
%224 = load <2 x double>, <2 x double>* %223
%225 = or i64 %194, 6
%226 = getelementptr inbounds double, double* %43, i64 %225
%227 = bitcast double* %226 to <2 x double>*
%228 = load <2 x double>, <2 x double>* %227
%229 = getelementptr inbounds double, double* %226, i64 2
%230 = bitcast double* %229 to <2 x double>*
%231 = load <2 x double>, <2 x double>* %230
%232 = fadd <2 x double> %221, %228
%233 = fadd <2 x double> %224, %231
%234 = fmul <2 x double> %232, <double 5.000000e-01, double 5.000000e-01>
%235 = fmul <2 x double> %233, <double 5.000000e-01, double 5.000000e-01>
%236 = getelementptr inbounds double, double* %3, i64 %218
%237 = bitcast double* %236 to <2 x double>*
store <2 x double> %234, <2 x double>* %237
%238 = getelementptr inbounds double, double* %236, i64 2
%239 = bitcast double* %238 to <2 x double>*
store <2 x double> %235, <2 x double>* %239
%240 = add nuw i64 %194, 8
%241 = add i64 %195, 2
%242 = icmp eq i64 %241, %192
br i1 %242, label %243, label %193
243: ; preds = %193, %183
%244 = phi i64 [ 0, %183 ], [ %240, %193 ]
%245 = icmp eq i64 %189, 0
br i1 %245, label %269, label %246
246: ; preds = %243
%247 = or i64 %244, 1
%248 = getelementptr inbounds double, double* %43, i64 %247
%249 = bitcast double* %248 to <2 x double>*
%250 = load <2 x double>, <2 x double>* %249
%251 = getelementptr inbounds double, double* %248, i64 2
%252 = bitcast double* %251 to <2 x double>*
%253 = load <2 x double>, <2 x double>* %252
%254 = or i64 %244, 2
%255 = getelementptr inbounds double, double* %43, i64 %254
%256 = bitcast double* %255 to <2 x double>*
%257 = load <2 x double>, <2 x double>* %256
%258 = getelementptr inbounds double, double* %255, i64 2
%259 = bitcast double* %258 to <2 x double>*
%260 = load <2 x double>, <2 x double>* %259
%261 = fadd <2 x double> %250, %257
%262 = fadd <2 x double> %253, %260
%263 = fmul <2 x double> %261, <double 5.000000e-01, double 5.000000e-01>
%264 = fmul <2 x double> %262, <double 5.000000e-01, double 5.000000e-01>
%265 = getelementptr inbounds double, double* %3, i64 %247
%266 = bitcast double* %265 to <2 x double>*
store <2 x double> %263, <2 x double>* %266
%267 = getelementptr inbounds double, double* %265, i64 2
%268 = bitcast double* %267 to <2 x double>*
store <2 x double> %264, <2 x double>* %268
br label %269
269: ; preds = %243, %246
%270 = icmp eq i64 %172, %184
br i1 %270, label %308, label %271
271: ; preds = %174, %171, %269
%272 = phi i64 [ 1, %174 ], [ 1, %171 ], [ %185, %269 ]
%273 = xor i64 %272, -1
%274 = and i64 %8, 1
%275 = icmp eq i64 %274, 0
br i1 %275, label %276, label %285
276: ; preds = %271
%277 = getelementptr inbounds double, double* %43, i64 %272
%278 = load double, double* %277
%279 = add nuw nsw i64 %272, 1
%280 = getelementptr inbounds double, double* %43, i64 %279
%281 = load double, double* %280
%282 = fadd double %278, %281
%283 = fmul double %282, 5.000000e-01
%284 = getelementptr inbounds double, double* %3, i64 %272
store double %283, double* %284
br label %285
285: ; preds = %276, %271
%286 = phi i64 [ %272, %271 ], [ %279, %276 ]
%287 = sub nsw i64 0, %8
%288 = icmp eq i64 %273, %287
br i1 %288, label %308, label %289
289: ; preds = %285, %289
%290 = phi i64 [ %301, %289 ], [ %286, %285 ]
%291 = getelementptr inbounds double, double* %43, i64 %290
%292 = load double, double* %291
%293 = add nuw nsw i64 %290, 1
%294 = getelementptr inbounds double, double* %43, i64 %293
%295 = load double, double* %294
%296 = fadd double %292, %295
%297 = fmul double %296, 5.000000e-01
%298 = getelementptr inbounds double, double* %3, i64 %290
store double %297, double* %298
%299 = getelementptr inbounds double, double* %43, i64 %293
%300 = load double, double* %299
%301 = add nuw nsw i64 %290, 2
%302 = getelementptr inbounds double, double* %43, i64 %301
%303 = load double, double* %302
%304 = fadd double %300, %303
%305 = fmul double %304, 5.000000e-01
%306 = getelementptr inbounds double, double* %3, i64 %293
store double %305, double* %306
%307 = icmp eq i64 %301, %8
br i1 %307, label %308, label %289
308: ; preds = %285, %289, %269, %163
%309 = xor i1 %46, true
%310 = or i1 %164, %309
%311 = select i1 %164, i32 -1, i32 1
br i1 %310, label %347, label %312
312: ; preds = %308
%313 = zext i32 %0 to i64
br label %314
314: ; preds = %312, %344
%315 = phi i64 [ 1, %312 ], [ %345, %344 ]
%316 = getelementptr inbounds double, double* %43, i64 %315
%317 = load double, double* %316
%318 = tail call double @llvm.fabs.f64(double %317)
%319 = fcmp olt double %318, 0x3DA5FD7FE1796495
br i1 %319, label %320, label %324
320: ; preds = %314
%321 = add nsw i64 %315, -1
%322 = getelementptr inbounds double, double* %3, i64 %321
%323 = bitcast double* %322 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %323
br label %344
324: ; preds = %314
%325 = add nsw i64 %315, -1
%326 = getelementptr inbounds double, double* %3, i64 %325
%327 = load double, double* %326
%328 = fdiv double %327, %317
%329 = getelementptr inbounds double, double* %3, i64 %315
%330 = load double, double* %329
%331 = fdiv double %330, %317
%332 = fmul double %331, %331
%333 = tail call double @llvm.fmuladd.f64(double %328, double %328, double %332)
%334 = fcmp ogt double %333, 9.000000e+00
br i1 %334, label %335, label %344
335: ; preds = %324
%336 = tail call double @sqrt(double %333)
%337 = fdiv double 3.000000e+00, %336
%338 = bitcast double* %326 to <2 x double>*
%339 = load <2 x double>, <2 x double>* %338
%340 = insertelement <2 x double> poison, double %337, i64 0
%341 = shufflevector <2 x double> %340, <2 x double> poison, <2 x i32> zeroinitializer
%342 = fmul <2 x double> %339, %341
%343 = bitcast double* %326 to <2 x double>*
store <2 x double> %342, <2 x double>* %343
br label %344
344: ; preds = %320, %335, %324
%345 = add nuw nsw i64 %315, 1
%346 = icmp eq i64 %345, %313
br i1 %346, label %347, label %314
347: ; preds = %344, %308
%348 = phi i32 [ %311, %308 ], [ 1, %344 ]
%349 = tail call i32 @free(double* %43)
br label %350
350: ; preds = %32, %22, %40, %6, %4, %347
%351 = phi i32 [ %348, %347 ], [ 0, %4 ], [ 0, %6 ], [ 0, %40 ], [ 0, %22 ], [ 0, %32 ]
ret i32 %351
}