#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 floor(double);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void thin(double *x, double *y, double *w, int n, int k, double **xt,
          double **yt, double **wt, int *nt_ptr, double tol) {
  int i, j, jj;
  int m;
  int nt;
  double r;
  double mindx;
  int *intvl;
  int intvl_xj;
  int lo;
  int hi;
  int cur_intvl;
  r = x[n - 1] - x[0];
  mindx = r;
  for (i = 0; i < n - 1; i++)
    mindx = (((x[i + 1] - x[i]) < (mindx)) ? (x[i + 1] - x[i]) : (mindx));
  *xt = *yt = *wt = NULL;
  if (mindx >= tol)
    return;
  m = (int)(((1) > (floor(r / tol))) ? (1) : (floor(r / tol)));
  tol = r / m;
  intvl = (int *)malloc(n * sizeof(int));
  nt = 0;
  for (j = 0; j < n; j++) {
    intvl_xj = (int)floor((x[j] - x[0]) / tol) + 1;
    intvl[j] = (((1) > ((((intvl_xj) < (m)) ? (intvl_xj) : (m))))
                    ? (1)
                    : ((((intvl_xj) < (m)) ? (intvl_xj) : (m))));
    if (j == 0 || intvl[j] != intvl[j - 1])
      nt++;
  }
  *nt_ptr = nt;
  *xt = (double *)malloc(nt * sizeof(double));
  *yt = (double *)malloc(nt * sizeof(double));
  *wt = (double *)malloc(nt * sizeof(double));
  lo = 0;
  hi = 0;
  i = 0;
  cur_intvl = 1;
  for (j = 0; j < n; j++) {
    if (intvl[j] > cur_intvl) {
      hi = j - 1;
      (*xt)[i] = x[0] + (cur_intvl - 0.5) * tol;
      (*wt)[i] = (*yt)[i] = 0.;
      for (jj = lo; jj <= hi; jj++) {
        (*wt)[i] += w[jj];
        (*yt)[i] += w[jj] * y[jj];
      }
      (*yt)[i] /= (*wt)[i];
      i++;
      cur_intvl = intvl[j];
      lo = j;
    }
    if (i >= nt - 1) {
      i = nt - 1;
      hi = n - 1;
      (*xt)[i] = x[0] + (m - 0.5) * tol;
      (*wt)[i] = (*yt)[i] = 0.;
      for (jj = lo; jj <= hi; jj++) {
        (*wt)[i] += w[jj];
        (*yt)[i] += w[jj] * y[jj];
      }
      (*yt)[i] /= (*wt)[i];
      break;
    }
  }
  free(intvl);
}


x86 assembly (clang, -O0):
<thin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    121d <thin+0xed>
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11fb <thin+0xcb>
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1205 <thin+0xd5>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1193 <thin+0x63>
mov    0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     1253 <thin+0x123>
jmp    16bc <thin+0x58c>
movsd  -0x50(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1050 <floor@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jle    127e <thin+0x14e>
mov    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1290 <thin+0x160>
movsd  -0x50(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1050 <floor@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
cvtsi2sdl -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13bf <thin+0x28f>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1050 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1312 <thin+0x1e2>
mov    -0x64(%rbp),%eax
mov    %eax,-0x80(%rbp)
jmp    1318 <thin+0x1e8>
mov    -0x40(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jle    1338 <thin+0x208>
mov    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1367 <thin+0x237>
mov    -0x64(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1352 <thin+0x222>
mov    -0x64(%rbp),%eax
mov    %eax,-0x88(%rbp)
jmp    135b <thin+0x22b>
mov    -0x40(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%edx
mov    -0x60(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x0,-0x38(%rbp)
je     13a3 <thin+0x273>
mov    -0x60(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x60(%rbp),%rcx
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
je     13ac <thin+0x27c>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13b1 <thin+0x281>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12ca <thin+0x19a>
mov    -0x44(%rbp),%ecx
mov    0x20(%rbp),%rax
mov    %ecx,(%rax)
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x1,-0x70(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    16b3 <thin+0x583>
mov    -0x60(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x70(%rbp),%eax
jle    157a <thin+0x44a>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0x70(%rbp),%xmm0
movsd  0xb8c(%rip),%xmm2
subsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     1534 <thin+0x404>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14c1 <thin+0x391>
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x70(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     16a0 <thin+0x570>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0xa4e(%rip),%xmm2
subsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     1672 <thin+0x542>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    15ff <thin+0x4cf>
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    16b3 <thin+0x583>
jmp    16a5 <thin+0x575>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1436 <thin+0x306>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %ecx,%ebp
mov    %rdx,%r13
mov    %rdi,%r14
mov    0xa8(%rsp),%r8
mov    0xa0(%rsp),%rdi
movslq %ecx,%rbx
lea    -0x1(%rbx),%r12
movsd  -0x8(%r14,%rbx,8),%xmm7
movsd  (%r14),%xmm1
subsd  %xmm1,%xmm7
movapd %xmm7,%xmm3
cmp    $0x2,%ebx
jl     1222 <thin+0xf2>
mov    %r12d,%edx
lea    -0x1(%rdx),%rcx
mov    %r12d,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    1195 <thin+0x65>
xor    %ecx,%ecx
movapd %xmm7,%xmm2
jmp    11ed <thin+0xbd>
and    $0xfffffffc,%edx
xor    %ecx,%ecx
movapd %xmm7,%xmm2
xchg   %ax,%ax
movsd  0x8(%r14,%rcx,8),%xmm3
movsd  0x10(%r14,%rcx,8),%xmm4
movsd  0x18(%r14,%rcx,8),%xmm5
movapd %xmm5,%xmm6
subsd  %xmm4,%xmm6
subsd  %xmm3,%xmm4
subsd  %xmm1,%xmm3
minsd  %xmm2,%xmm3
minsd  %xmm3,%xmm4
minsd  %xmm4,%xmm6
movsd  0x20(%r14,%rcx,8),%xmm1
add    $0x4,%rcx
movapd %xmm1,%xmm2
subsd  %xmm5,%xmm2
minsd  %xmm6,%xmm2
cmp    %rcx,%rdx
jne    11a0 <thin+0x70>
movapd %xmm2,%xmm3
test   %rax,%rax
je     1222 <thin+0xf2>
lea    (%r14,%rcx,8),%rcx
add    $0x8,%rcx
xor    %edx,%edx
movsd  (%rcx,%rdx,8),%xmm4
movapd %xmm4,%xmm3
subsd  %xmm1,%xmm3
minsd  %xmm2,%xmm3
add    $0x1,%rdx
movapd %xmm4,%xmm1
movapd %xmm3,%xmm2
cmp    %rdx,%rax
jne    1200 <thin+0xd0>
mov    0xb0(%rsp),%rax
movq   $0x0,(%r8)
movq   $0x0,(%rdi)
movq   $0x0,(%r9)
ucomisd %xmm0,%xmm3
jae    1290 <thin+0x160>
mov    %rax,0x48(%rsp)
mov    %r8,0x50(%rsp)
mov    %rsi,0x58(%rsp)
mov    %rdi,0x60(%rsp)
mov    %r9,0x20(%rsp)
mov    %rbx,0x28(%rsp)
movsd  %xmm7,0x8(%rsp)
divsd  %xmm0,%xmm7
movsd  %xmm7,0x10(%rsp)
movapd %xmm7,%xmm0
call   1050 <floor@plt>
test   %eax,%eax
jle    129f <thin+0x16f>
movsd  0x10(%rsp),%xmm0
call   1050 <floor@plt>
mov    %eax,%r15d
jmp    12a5 <thin+0x175>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r15d
mov    %r12,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x0(,%rbp,4),%edi
call   1040 <malloc@plt>
mov    %ebp,%ecx
mov    %rcx,0x10(%rsp)
test   %ebp,%ebp
movsd  0x8(%rsp),%xmm1
mov    %rax,%rbx
mov    %rbp,0x18(%rsp)
jle    138d <thin+0x25d>
movsd  (%r14),%xmm0
subsd  %xmm0,%xmm0
divsd  %xmm1,%xmm0
mov    %rax,0x38(%rsp)
call   1050 <floor@plt>
add    $0x1,%eax
cmp    %r15d,%eax
cmovge %r15d,%eax
test   %eax,%eax
mov    $0x1,%r12d
cmovle %r12d,%eax
mov    0x38(%rsp),%rcx
mov    %eax,(%rcx)
cmp    $0x1,%ebp
movsd  0x8(%rsp),%xmm1
je     1390 <thin+0x260>
mov    $0x1,%r12d
mov    $0x1,%ebp
jmp    1360 <thin+0x230>
nopl   (%rax)
mov    %eax,(%rdx,%rbp,4)
xor    %ecx,%ecx
cmp    -0x4(%rdx,%rbp,4),%eax
setne  %cl
add    %ecx,%r12d
add    $0x1,%rbp
cmp    %rbp,0x10(%rsp)
movsd  0x8(%rsp),%xmm1
je     1390 <thin+0x260>
movsd  (%r14,%rbp,8),%xmm0
subsd  (%r14),%xmm0
divsd  %xmm1,%xmm0
call   1050 <floor@plt>
add    $0x1,%eax
cmp    %r15d,%eax
jl     137f <thin+0x24f>
mov    %r15d,%eax
test   %eax,%eax
mov    %rbx,%rdx
jg     1340 <thin+0x210>
mov    $0x1,%eax
jmp    1340 <thin+0x210>
xor    %r12d,%r12d
mov    0x48(%rsp),%rax
mov    %r12d,(%rax)
lea    0x0(,%r12,8),%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    0x20(%rsp),%rcx
mov    %rax,(%rcx)
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    0x60(%rsp),%r15
mov    %rax,(%r15)
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    0x20(%rsp),%r11
movsd  0x8(%rsp),%xmm4
mov    0x50(%rsp),%rcx
mov    %rax,(%rcx)
cmpl   $0x0,0x18(%rsp)
mov    %rbx,%rdi
mov    0x58(%rsp),%r10
jle    1643 <thin+0x513>
add    $0xffffffff,%r12d
xor    %ecx,%ecx
mov    $0x1,%esi
movsd  0xc02(%rip),%xmm0
xorpd  %xmm1,%xmm1
xor    %r8d,%r8d
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    (%rdi,%rcx,4),%ebx
cmp    %esi,%ebx
jle    14ec <thin+0x3bc>
xorps  %xmm2,%xmm2
cvtsi2sd %esi,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm2
addsd  (%r14),%xmm2
mov    (%r11),%rsi
movslq %edx,%rdx
movsd  %xmm2,(%rsi,%rdx,8)
mov    (%r15),%rbp
movq   $0x0,0x0(%rbp,%rdx,8)
movq   $0x0,(%rax,%rdx,8)
movslq %r8d,%rsi
cmp    %rsi,%rcx
jle    14d0 <thin+0x3a0>
movsd  0x0(%r13,%rsi,8),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rax,%rdx,8)
movsd  0x0(%r13,%rsi,8),%xmm2
mulsd  (%r10,%rsi,8),%xmm2
addsd  0x0(%rbp,%rdx,8),%xmm2
movsd  %xmm2,0x0(%rbp,%rdx,8)
add    $0x1,%rsi
cmp    %rcx,%rsi
je     14c3 <thin+0x393>
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rsi,8),%xmm2
addsd  (%rax,%rdx,8),%xmm2
movsd  %xmm2,(%rax,%rdx,8)
movsd  0x0(%r13,%rsi,8),%xmm2
mulsd  (%r10,%rsi,8),%xmm2
addsd  0x0(%rbp,%rdx,8),%xmm2
movsd  %xmm2,0x0(%rbp,%rdx,8)
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1490 <thin+0x360>
movsd  (%rax,%rdx,8),%xmm3
jmp    14da <thin+0x3aa>
nopw   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rdx,8),%xmm2
xorpd  %xmm3,%xmm3
divsd  %xmm3,%xmm2
movsd  %xmm2,0x0(%rbp,%rdx,8)
add    $0x1,%edx
mov    %ecx,%r8d
mov    %ebx,%esi
cmp    %r12d,%edx
jge    1505 <thin+0x3d5>
add    $0x1,%rcx
cmp    0x10(%rsp),%rcx
jne    1410 <thin+0x2e0>
jmp    1643 <thin+0x513>
movsd  0x40(%rsp),%xmm0
addsd  0xaed(%rip),%xmm0
mulsd  %xmm4,%xmm0
addsd  (%r14),%xmm0
mov    (%r11),%rdx
movslq %r12d,%rcx
movsd  %xmm0,(%rdx,%rcx,8)
mov    (%r15),%rdx
movq   $0x0,(%rdx,%rcx,8)
movq   $0x0,(%rax,%rcx,8)
cmp    0x18(%rsp),%r8d
jge    1631 <thin+0x501>
movslq %r8d,%rsi
xorpd  %xmm0,%xmm0
addsd  0x0(%r13,%rsi,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x0(%r13,%rsi,8),%xmm0
mulsd  (%r10,%rsi,8),%xmm0
addsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
lea    0x1(%rsi),%rbp
cmp    0x28(%rsp),%rbp
mov    0x30(%rsp),%rbx
je     162a <thin+0x4fa>
mov    %ebx,%r9d
sub    %r8d,%r9d
mov    %rsi,%r8
not    %r8
test   $0x1,%r9b
je     15c5 <thin+0x495>
movsd  0x8(%r13,%rsi,8),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x8(%r13,%rsi,8),%xmm0
mulsd  0x8(%r10,%rsi,8),%xmm0
addsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
add    $0x2,%rsi
mov    %rsi,%rbp
add    %rbx,%r8
je     162a <thin+0x4fa>
add    $0x1,%rbx
xchg   %ax,%ax
movsd  0x0(%r13,%rbp,8),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  (%r10,%rbp,8),%xmm0
addsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
movsd  0x8(%r13,%rbp,8),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x8(%r13,%rbp,8),%xmm0
mulsd  0x8(%r10,%rbp,8),%xmm0
addsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
add    $0x2,%rbp
cmp    %rbp,%rbx
jne    15d0 <thin+0x4a0>
movsd  (%rax,%rcx,8),%xmm1
jmp    163a <thin+0x50a>
movsd  (%rdx,%rcx,8),%xmm0
xorpd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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