#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sortdi1(double *, int, int *);
int /*<<< orphan*/ stderr;
double lagra(double xx[], double yy[], int n, double xi) {
  int flag, i, j, *jun, *k;
  double *p, *q, *r, *s, w, w1, w2, w3, *x, *y;
  x = (double *)malloc(n * sizeof(double));
  if (x == NULL) {
    fprintf(stderr, "Error : Out of memory  in lagra()\n");
    return 0.;
  }
  y = (double *)malloc(n * sizeof(double));
  if (y == NULL) {
    fprintf(stderr, "Error : Out of memory  in lagra()\n");
    free((char *)x);
    return 0.;
  }
  for (i = 0, p = xx, flag = 0; i < n - 1; i++, p++) {
    if (*p >= *(p + 1)) {
      flag = 1;
      break;
    }
  }
  if (flag) {
    jun = (int *)malloc(n * sizeof(int));
    if (jun == NULL) {
      fprintf(stderr, "Error : Out of memory  in lagra()\n");
      free((char *)x);
      free((char *)y);
      return 0.;
    }
    sortdi1(xx, n, jun);
    for (i = 0, p = x, q = y, k = jun; i < n; i++) {
      *p++ = *(xx + *k);
      *q++ = *(yy + *k++);
    }
    free((char *)jun);
  } else {
    for (i = 0, p = x, q = y, r = xx, s = yy; i < n; i++) {
      *p++ = *r++;
      *q++ = *s++;
    }
  }
  if (n < 2 || xi < *x || xi > *(x + n - 1)) {
    fprintf(stderr, "Error : Illegal parameter  in lagra()\n");
    free((char *)x);
    free((char *)y);
    return 0.;
  }
  for (i = 0, p = x; i < n; i++) {
    if (*p++ == xi) {
      free((char *)x);
      free((char *)y);
      return *(y + i);
    }
  }
  w = 0.;
  for (i = 0, p = x, q = y; i < n; i++) {
    w1 = 1.;
    w2 = *p++;
    for (j = 0, r = x; j < n; j++) {
      w3 = *r++;
      if (i != j)
        w1 *= (xi - w3) / (w2 - w3);
    }
    w += w1 * *q++;
  }
  free((char *)x);
  free((char *)y);
  return w;
}


x86 assembly (clang, -O0):
<lagra>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x90(%rbp)
jne    11a1 <lagra+0x61>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
call   1040 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1635 <lagra+0x4f5>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    11f3 <lagra+0xb3>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
lea    0xe33(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1635 <lagra+0x4f5>
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    125c <lagra+0x11c>
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
jb     123d <lagra+0xfd>
movl   $0x1,-0x2c(%rbp)
jmp    125c <lagra+0x11c>
jmp    1242 <lagra+0x102>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x50(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x50(%rbp)
jmp    1209 <lagra+0xc9>
cmpl   $0x0,-0x2c(%rbp)
je     136c <lagra+0x22c>
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    12be <lagra+0x17e>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
lea    0xd74(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1635 <lagra+0x4f5>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x40(%rbp),%rdx
call   1060 <sortdi1@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    135e <lagra+0x21e>
mov    -0x10(%rbp),%rax
mov    -0x48(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x50(%rbp)
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x48(%rbp)
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x58(%rbp)
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12f3 <lagra+0x1b3>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    1404 <lagra+0x2c4>
movl   $0x0,-0x30(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13ff <lagra+0x2bf>
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x60(%rbp)
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x50(%rbp)
movsd  %xmm0,(%rax)
mov    -0x68(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x68(%rbp)
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x58(%rbp)
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1399 <lagra+0x259>
jmp    1404 <lagra+0x2c4>
cmpl   $0x2,-0x1c(%rbp)
jl     1444 <lagra+0x304>
movsd  -0x28(%rbp),%xmm1
mov    -0x90(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
ja     1444 <lagra+0x304>
movsd  -0x28(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x1c(%rbp),%rcx
ucomisd -0x8(%rax,%rcx,8),%xmm0
jbe    147e <lagra+0x33e>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
lea    0xbd7(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1635 <lagra+0x4f5>
movl   $0x0,-0x30(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1505 <lagra+0x3c5>
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x50(%rbp)
movsd  (%rax),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    14f2 <lagra+0x3b2>
jp     14f2 <lagra+0x3b2>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1635 <lagra+0x4f5>
jmp    14f7 <lagra+0x3b7>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1490 <lagra+0x350>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1613 <lagra+0x4d3>
movsd  0xac2(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x50(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    15db <lagra+0x49b>
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x60(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     15c8 <lagra+0x488>
movsd  -0x28(%rbp),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    15cd <lagra+0x48d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    156d <lagra+0x42d>
movsd  -0x78(%rbp),%xmm0
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x58(%rbp)
movsd  (%rax),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    152a <lagra+0x3ea>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lagra>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %edx,%ebx
mov    %rsi,%r13
mov    %rdi,%r15
lea    0x0(,%rbx,8),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     11d7 <lagra+0x97>
mov    %rax,%r12
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     11f1 <lagra+0xb1>
mov    %rax,%r14
lea    -0x1(%rbx),%r10d
cmp    $0x2,%ebx
movsd  0x10(%rsp),%xmm6
jl     11b8 <lagra+0x78>
mov    %ebx,%ebp
movsd  (%r15),%xmm0
mov    $0x1,%eax
nopl   0x0(%rax)
movapd %xmm0,%xmm1
movsd  (%r15,%rax,8),%xmm0
ucomisd %xmm0,%xmm1
jae    120e <lagra+0xce>
add    $0x1,%rax
cmp    %eax,%ebp
jne    11a0 <lagra+0x60>
test   %ebx,%ebx
jle    1624 <lagra+0x4e4>
xor    %eax,%eax
cmp    $0x3,%r10d
jae    1264 <lagra+0x124>
mov    %r14,%rcx
mov    %r12,%rdx
jmp    140c <lagra+0x2cc>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1649 <lagra+0x509>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
lea    0xe07(%rip),%rsi
call   1040 <fprintf@plt>
mov    %r12,%rdi
jmp    1644 <lagra+0x504>
mov    %r10d,(%rsp)
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     14eb <lagra+0x3ab>
mov    %r15,%rdi
mov    %rbx,0x8(%rsp)
mov    %ebx,%esi
mov    %rax,%rdx
mov    %rax,%rbx
call   1060 <sortdi1@plt>
mov    %rbx,%rdi
test   %ebp,%ebp
jle    15f3 <lagra+0x4b3>
cmpl   $0x3,(%rsp)
jae    1500 <lagra+0x3c0>
mov    %r14,%rcx
mov    %r12,%rsi
mov    %rdi,%rax
mov    0x8(%rsp),%rbx
jmp    15b9 <lagra+0x479>
mov    %r10d,(%rsp)
mov    %r10d,%r11d
lea    (%r12,%r11,8),%rsi
add    $0x8,%rsi
lea    (%r14,%r11,8),%rbp
add    $0x8,%rbp
lea    (%r15,%r11,8),%rdi
add    $0x8,%rdi
lea    0x8(,%r11,8),%r10
add    %r13,%r10
cmp    %rbp,%r12
setb   0x8(%rsp)
cmp    %rsi,%r14
setb   %r9b
cmp    %rdi,%r12
setb   %dl
cmp    %r15,%rsi
seta   %r8b
cmp    %r10,%r12
setb   %cl
cmp    %r13,%rsi
seta   0x7(%rsp)
cmp    %rdi,%r14
setb   %sil
cmp    %r15,%rbp
seta   0x6(%rsp)
cmp    %r10,%r14
setb   %dil
cmp    %r13,%rbp
seta   %bpl
test   %r9b,0x8(%rsp)
jne    1402 <lagra+0x2c2>
and    %r8b,%dl
jne    1402 <lagra+0x2c2>
and    0x7(%rsp),%cl
jne    1402 <lagra+0x2c2>
and    0x6(%rsp),%sil
jne    1402 <lagra+0x2c2>
and    %bpl,%dil
jne    1402 <lagra+0x2c2>
add    $0x1,%r11
mov    %r11,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rcx
mov    %rcx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
test   %rcx,%rcx
je     1668 <lagra+0x528>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups (%r15,%rdx,8),%xmm0
movups 0x10(%r15,%rdx,8),%xmm1
movups %xmm0,(%r12,%rdx,8)
movups %xmm1,0x10(%r12,%rdx,8)
movups 0x0(%r13,%rdx,8),%xmm0
movups 0x10(%r13,%rdx,8),%xmm1
movups %xmm0,(%r14,%rdx,8)
movups %xmm1,0x10(%r14,%rdx,8)
movups 0x20(%r15,%rdx,8),%xmm0
movups 0x30(%r15,%rdx,8),%xmm1
movups %xmm0,0x20(%r12,%rdx,8)
movups %xmm1,0x30(%r12,%rdx,8)
movupd 0x20(%r13,%rdx,8),%xmm0
movupd 0x30(%r13,%rdx,8),%xmm1
movupd %xmm0,0x20(%r14,%rdx,8)
movupd %xmm1,0x30(%r14,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rdi
jne    1340 <lagra+0x200>
test   $0x1,%sil
je     13e2 <lagra+0x2a2>
movups (%r15,%rdx,8),%xmm0
movups 0x10(%r15,%rdx,8),%xmm1
movups %xmm0,(%r12,%rdx,8)
movups %xmm1,0x10(%r12,%rdx,8)
movupd 0x0(%r13,%rdx,8),%xmm0
movupd 0x10(%r13,%rdx,8),%xmm1
movupd %xmm0,(%r14,%rdx,8)
movupd %xmm1,0x10(%r14,%rdx,8)
cmp    %rax,%r11
mov    (%rsp),%r10d
je     14dd <lagra+0x39d>
lea    0x0(%r13,%rax,8),%r13
lea    (%r15,%rax,8),%r15
lea    (%r14,%rax,8),%rcx
lea    (%r12,%rax,8),%rdx
jmp    140c <lagra+0x2cc>
mov    %r14,%rcx
mov    %r12,%rdx
mov    (%rsp),%r10d
mov    %ebx,%edi
sub    %eax,%edi
mov    %eax,%esi
not    %esi
add    %ebx,%esi
test   $0x3,%dil
je     1461 <lagra+0x321>
mov    %rbx,%r8
sub    %al,%bl
movzbl %bl,%ebp
and    $0x3,%ebp
shl    $0x3,%rbp
xor    %edi,%edi
nopl   (%rax)
movsd  (%r15,%rdi,1),%xmm0
movsd  %xmm0,(%rdx,%rdi,1)
movsd  0x0(%r13,%rdi,1),%xmm0
movsd  %xmm0,(%rcx,%rdi,1)
add    $0x1,%eax
add    $0x8,%rdi
cmp    %edi,%ebp
jne    1430 <lagra+0x2f0>
add    %rdi,%r13
add    %rdi,%r15
add    %rdi,%rcx
add    %rdi,%rdx
mov    %r8,%rbx
cmp    $0x3,%esi
jb     14dd <lagra+0x39d>
mov    %ebx,%esi
sub    %eax,%esi
xor    %eax,%eax
nopl   0x0(%rax)
movsd  (%r15,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rax,8)
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
movsd  0x8(%r15,%rax,8),%xmm0
movsd  %xmm0,0x8(%rdx,%rax,8)
movsd  0x8(%r13,%rax,8),%xmm0
movsd  %xmm0,0x8(%rcx,%rax,8)
movsd  0x10(%r15,%rax,8),%xmm0
movsd  %xmm0,0x10(%rdx,%rax,8)
movsd  0x10(%r13,%rax,8),%xmm0
movsd  %xmm0,0x10(%rcx,%rax,8)
movsd  0x18(%r15,%rax,8),%xmm0
movsd  %xmm0,0x18(%rdx,%rax,8)
movsd  0x18(%r13,%rax,8),%xmm0
movsd  %xmm0,0x18(%rcx,%rax,8)
add    $0x4,%rax
cmp    %eax,%esi
jne    1470 <lagra+0x330>
cmp    $0x2,%ebx
jge    160c <lagra+0x4cc>
jmp    1624 <lagra+0x4e4>
mov    0x2aee(%rip),%rax
mov    (%rax),%edi
lea    0xb0d(%rip),%rsi
jmp    1634 <lagra+0x4f4>
mov    0x8(%rsp),%rbx
mov    %ebx,%ecx
and    $0xfffffffc,%ecx
xor    %esi,%esi
xor    %edx,%edx
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq (%rax),%rbp
movsd  (%r15,%rbp,8),%xmm0
movsd  %xmm0,(%r12,%rsi,8)
movsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,(%r14,%rsi,8)
movslq 0x4(%rax),%rbp
movsd  (%r15,%rbp,8),%xmm0
movsd  %xmm0,0x8(%r12,%rsi,8)
movsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x8(%r14,%rsi,8)
movslq 0x8(%rax),%rbp
movsd  (%r15,%rbp,8),%xmm0
movsd  %xmm0,0x10(%r12,%rsi,8)
movsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x10(%r14,%rsi,8)
movslq 0xc(%rax),%rbp
movsd  (%r15,%rbp,8),%xmm0
movsd  %xmm0,0x18(%r12,%rsi,8)
add    $0x10,%rax
movsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x18(%r14,%rsi,8)
add    $0xffffffffffffffe0,%rdx
add    $0x4,%rsi
cmp    %esi,%ecx
jne    1520 <lagra+0x3e0>
mov    %r14,%rcx
sub    %rdx,%rcx
mov    %r12,%rsi
sub    %rdx,%rsi
test   $0x3,%bl
je     15f3 <lagra+0x4b3>
mov    0x8(%rsp),%rdx
and    $0x3,%edx
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movslq (%rax,%rbx,4),%rbp
movsd  (%r15,%rbp,8),%xmm0
movsd  %xmm0,(%rsi,%rbx,8)
movsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,(%rcx,%rbx,8)
add    $0x1,%rbx
cmp    %ebx,%edx
jne    15d0 <lagra+0x490>
call   1030 <free@plt>
movsd  0x10(%rsp),%xmm6
mov    (%rsp),%r10d
mov    0x8(%rsp),%rbx
cmp    $0x2,%ebx
jl     1624 <lagra+0x4e4>
movsd  (%r12),%xmm0
ucomisd %xmm6,%xmm0
ja     1624 <lagra+0x4e4>
movslq %ebx,%rax
ucomisd -0x8(%r12,%rax,8),%xmm6
jbe    165c <lagra+0x51c>
mov    0x29b5(%rip),%rax
mov    (%rax),%edi
lea    0x9f7(%rip),%rsi
call   1040 <fprintf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xorpd  %xmm0,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
ucomisd %xmm6,%xmm0
jne    1679 <lagra+0x539>
jp     1679 <lagra+0x539>
xor    %ebx,%ebx
jmp    1698 <lagra+0x558>
xor    %edx,%edx
test   $0x1,%sil
jne    13b1 <lagra+0x271>
jmp    13e2 <lagra+0x2a2>
mov    %rbx,%r9
mov    %r10d,%eax
xor    %ebx,%ebx
cmp    %ebx,%eax
je     16b0 <lagra+0x570>
movsd  0x8(%r12,%rbx,8),%xmm1
add    $0x1,%rbx
ucomisd %xmm6,%xmm1
jne    1681 <lagra+0x541>
jp     1681 <lagra+0x541>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
movsd  (%r14,%rbx,8),%xmm0
jmp    164d <lagra+0x50d>
mov    %r9,%rdi
mov    %edi,%eax
and    $0xfffffffe,%eax
xorpd  %xmm7,%xmm7
xor    %ecx,%ecx
movsd  0x93a(%rip),%xmm1
mov    %r14,%rdx
mov    %r12,%r8
test   %r10d,%r10d
jne    16ec <lagra+0x5ac>
jmp    1768 <lagra+0x628>
add    $0x8,%r8
add    $0x8,%rdx
movsd  (%r8),%xmm0
test   %r10d,%r10d
je     1768 <lagra+0x628>
xor    %ebx,%ebx
movapd %xmm1,%xmm2
mov    %r12,%rdi
jmp    170b <lagra+0x5cb>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
lea    0x10(%rsi),%rdi
cmp    %eax,%ebx
je     1756 <lagra+0x616>
mov    %rdi,%rsi
mov    %ebx,%ebp
cmp    %ebx,%ecx
je     1730 <lagra+0x5f0>
movsd  (%rsi),%xmm3
movapd %xmm6,%xmm4
subsd  %xmm3,%xmm4
movapd %xmm0,%xmm5
subsd  %xmm3,%xmm5
divsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
lea    0x1(%rbp),%ebx
cmp    %ebx,%ecx
je     1700 <lagra+0x5c0>
movsd  0x8(%rsi),%xmm3
movapd %xmm6,%xmm4
subsd  %xmm3,%xmm4
movapd %xmm0,%xmm5
subsd  %xmm3,%xmm5
divsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
jmp    1700 <lagra+0x5c0>
add    $0x10,%rsi
add    $0x2,%ebp
mov    %r9,%rdi
test   $0x1,%dil
jne    1777 <lagra+0x637>
jmp    1793 <lagra+0x653>
xor    %ebp,%ebp
movapd %xmm1,%xmm2
mov    %r12,%rsi
test   $0x1,%dil
je     1793 <lagra+0x653>
cmp    %ebp,%ecx
je     1793 <lagra+0x653>
movsd  (%rsi),%xmm3
movapd %xmm6,%xmm4
subsd  %xmm3,%xmm4
subsd  %xmm3,%xmm0
divsd  %xmm0,%xmm4
mulsd  %xmm4,%xmm2
mulsd  (%rdx),%xmm2
addsd  %xmm2,%xmm7
add    $0x1,%ecx
cmp    %edi,%ecx
jne    16d6 <lagra+0x596>
mov    %r12,%rdi
movsd  %xmm7,0x10(%rsp)
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
movsd  0x10(%rsp),%xmm0
jmp    164d <lagra+0x50d>

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

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