#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 array_max_abs(double *, int);
double fabs(double);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ madd(double *, double *, double *, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ mmult(double *, double *, double *, int, int, int);
int /*<<< orphan*/ scale(double *, int, int, double);
double sqrt(double);
int lnsrch(double (*funcpt)(double *, int), double *xi, double *jac, double *p,
           int N, double maxstep, double *dx, double stol, double *x) {
  int retval, i, j;
  double alpha, lambda, lambdamin, funcf, funci, lambdaprev, lambdatemp,
      funcprev;
  double lambda2, lambdaprev2, ll, den, rell;
  double *slopei, *temp1, *temp2, *ab, *rcheck;
  slopei = (double *)malloc(sizeof(double) * 1);
  temp1 = (double *)malloc(sizeof(double) * 4);
  temp2 = (double *)malloc(sizeof(double) * 2);
  ab = (double *)malloc(sizeof(double) * 2);
  rcheck = (double *)malloc(sizeof(double) * N);
  retval = 100;
  alpha = 1e-04;
  lambda = 1.0;
  mmult(jac, p, slopei, 1, N, 1);
  for (i = 0; i < N; ++i) {
    if (fabs(xi[i]) > 1.0 / fabs(dx[i])) {
      den = fabs(xi[i]);
    } else {
      den = 1.0 / fabs(dx[i]);
    }
    rcheck[i] = p[i] / den;
  }
  rell = array_max_abs(rcheck, N);
  lambdamin = stol / rell;
  while (retval > 1) {
    scale(p, 1, N, lambda);
    madd(xi, p, x, 1, N);
    funcf = funcpt(x, N);
    funci = funcpt(xi, N);
    if (funcf <= funci + alpha * lambda * slopei[0]) {
      retval = 0;
    } else if (lambda < lambdamin) {
      retval = 1;
      for (i = 0; i < N; ++i) {
        x[i] = xi[i];
      }
    } else {
      if (lambda == 1.0) {
        lambdatemp = -slopei[0] / (funcf - funci - slopei[0]);
      } else {
        lambda2 = lambda * lambda;
        lambdaprev2 = lambdaprev * lambdaprev;
        ll = lambda - lambdaprev;
        temp1[0] = 1.0 / lambda2;
        temp1[1] = -1.0 / lambdaprev2;
        temp1[2] = -lambdaprev / lambda2;
        temp1[3] = lambda / lambdaprev2;
        temp2[0] = funcf - funci - lambda * slopei[0];
        temp2[1] = funcprev - funci - lambdaprev * slopei[0];
        mmult(temp1, temp2, ab, 2, 2, 1);
        scale(ab, 1, 2, ll);
        if (ab[0] == 0.0) {
          lambdatemp = -slopei[0] / (2.0 * ab[1]);
        } else {
          lambdatemp =
              (-ab[1] + sqrt(ab[1] * ab[1] - 3.0 * ab[0] * slopei[0])) /
              (3.0 * ab[0]);
        }
        if (lambdatemp > 0.5 * lambda) {
          lambdatemp = 0.5 * lambda;
        }
      }
      lambdaprev = lambda;
      funcprev = funcf;
      if (lambdatemp <= 0.1 * lambda) {
        lambda = 0.1 * lambda;
      } else {
        lambda = lambdatemp;
      }
    }
  }
  free(slopei);
  free(temp1);
  free(temp2);
  free(ab);
  free(rcheck);
  return retval;
}


x86 assembly (clang, -O0):
<lnsrch>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0xc0(%rbp)
mov    $0x20,%edi
call   1050 <malloc@plt>
mov    %rax,-0xc8(%rbp)
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0xd0(%rbp)
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0xd8(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xe0(%rbp)
movl   $0x64,-0x44(%rbp)
movsd  0xdfe(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xde9(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0xc0(%rbp),%rdx
mov    -0x24(%rbp),%r8d
mov    $0x1,%r9d
mov    %r9d,%ecx
call   1040 <mmult@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    131a <lnsrch+0x1aa>
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xddc(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xdc4(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xd78(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    12bb <lnsrch+0x14b>
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd96(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    12e7 <lnsrch+0x177>
mov    -0x38(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xd71(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd25(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0xb0(%rbp),%xmm0
ff
mov    -0xe0(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1244 <lnsrch+0xd4>
mov    -0xe0(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1090 <array_max_abs@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
divsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x1,-0x44(%rbp)
jle    17e1 <lnsrch+0x671>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
movsd  -0x60(%rbp),%xmm0
mov    $0x1,%esi
call   1060 <scale@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    -0x24(%rbp),%r8d
mov    $0x1,%ecx
call   1070 <madd@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   *%rax
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   *%rax
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     13de <lnsrch+0x26e>
movl   $0x0,-0x44(%rbp)
jmp    17dc <lnsrch+0x66c>
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1439 <lnsrch+0x2c9>
movl   $0x1,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1434 <lnsrch+0x2c4>
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1400 <lnsrch+0x290>
jmp    17d7 <lnsrch+0x667>
movsd  -0x60(%rbp),%xmm0
movsd  0xbba(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    149e <lnsrch+0x32e>
jp     149e <lnsrch+0x32e>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x70(%rbp),%xmm1
subsd  -0x78(%rbp),%xmm1
mov    -0xc0(%rbp),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1778 <lnsrch+0x608>
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xb24(%rip),%xmm0
divsd  -0x98(%rbp),%xmm0
ff
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xb19(%rip),%xmm0
divsd  -0xa0(%rbp),%xmm0
ff
mov    -0xc8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x98(%rbp),%xmm0
ff
mov    -0xc8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x60(%rbp),%xmm0
divsd  -0xa0(%rbp),%xmm0
ff
mov    -0xc8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x70(%rbp),%xmm1
subsd  -0x78(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xd0(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm1
ff
subsd  -0x78(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xd0(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0xc8(%rbp),%rdi
mov    -0xd0(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
mov    $0x2,%r8d
mov    $0x1,%r9d
mov    %r8d,%ecx
call   1040 <mmult@plt>
mov    -0xd8(%rbp),%rdi
movsd  -0xa8(%rbp),%xmm0
ff
mov    $0x1,%esi
mov    $0x2,%edx
call   1060 <scale@plt>
mov    -0xd8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    168c <lnsrch+0x51c>
jp     168c <lnsrch+0x51c>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0xd8(%rbp),%rax
movsd  0x9aa(%rip),%xmm1
mulsd  0x8(%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    173f <lnsrch+0x5cf>
mov    -0xd8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0xd8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0xd8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0xd8(%rbp),%rax
movsd  0x93a(%rip),%xmm1
mulsd  (%rax),%xmm1
mov    -0xc0(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mov    -0xd8(%rbp),%rax
movsd  0x8e9(%rip),%xmm1
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0x8d9(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1773 <lnsrch+0x603>
movsd  0x8c2(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1778 <lnsrch+0x608>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  0x891(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     17c5 <lnsrch+0x655>
movsd  0x87a(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    17d2 <lnsrch+0x662>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
jmp    17d7 <lnsrch+0x667>
jmp    17dc <lnsrch+0x66c>
jmp    1343 <lnsrch+0x1d3>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x44(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnsrch>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movsd  %xmm1,0x20(%rsp)
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %rcx,%r12
mov    %rdx,0x30(%rsp)
mov    %rsi,%r13
mov    %rdi,0x8(%rsp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    $0x20,%edi
call   1050 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
lea    0x0(,%r14,8),%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    0x30(%rsp),%rdi
mov    %r12,%rsi
mov    %rbp,0x70(%rsp)
mov    %rbp,%rdx
mov    $0x1,%ecx
mov    %r14d,%r8d
mov    $0x1,%r9d
call   1040 <mmult@plt>
test   %r14d,%r14d
jle    1269 <lnsrch+0xf9>
mov    %r14d,%eax
cmp    $0x1,%r14d
jne    15f2 <lnsrch+0x482>
xor    %ecx,%ecx
movapd 0xddd(%rip),%xmm0
movsd  0xe15(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rcx,8),%xmm2
andpd  %xmm0,%xmm2
movsd  (%rbx,%rcx,8),%xmm3
andpd  %xmm0,%xmm3
movapd %xmm1,%xmm4
divsd  %xmm3,%xmm4
maxsd  %xmm4,%xmm2
movsd  (%r12,%rcx,8),%xmm3
divsd  %xmm2,%xmm3
movsd  %xmm3,(%r15,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1230 <lnsrch+0xc0>
mov    0xb0(%rsp),%rbp
mov    %r15,0x60(%rsp)
mov    %r15,%rdi
mov    %r14d,%esi
call   1090 <array_max_abs@plt>
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mov    0x10(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x48(%rsp)
movsd  0xd99(%rip),%xmm0
mov    0x8(%rsp),%rbx
mov    0x10(%rsp),%r15
jmp    1307 <lnsrch+0x197>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm6,%xmm2
subsd  %xmm1,%xmm2
subsd  %xmm0,%xmm2
xorpd  0xd5c(%rip),%xmm0
divsd  %xmm2,%xmm0
movapd %xmm4,%xmm1
mulsd  0xd8c(%rip),%xmm1
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
unpcklpd %xmm4,%xmm2
movsd  %xmm6,0x28(%rsp)
movapd %xmm2,%xmm0
movapd %xmm0,0x30(%rsp)
mov    %r12,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
call   1060 <scale@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    $0x1,%ecx
mov    %r14d,%r8d
call   1070 <madd@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   *%rbx
movsd  %xmm0,0x18(%rsp)
mov    %r13,%rdi
mov    %r14d,%esi
call   *%rbx
movsd  0x18(%rsp),%xmm6
movapd 0x30(%rsp),%xmm4
movapd %xmm0,%xmm1
movapd %xmm4,%xmm2
mulsd  0xce3(%rip),%xmm2
mov    0x70(%rsp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm6,%xmm2
jae    1520 <lnsrch+0x3b0>
movsd  0x20(%rsp),%xmm2
ucomisd %xmm4,%xmm2
ja     1528 <lnsrch+0x3b8>
ucomisd 0xca8(%rip),%xmm4
jne    13a0 <lnsrch+0x230>
jnp    12c0 <lnsrch+0x150>
movapd %xmm4,%xmm0
mulpd  %xmm4,%xmm0
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
movapd %xmm4,%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,0x68(%rsp)
movapd 0xc5a(%rip),%xmm3
divpd  %xmm0,%xmm3
mov    0x58(%rsp),%rdi
movupd %xmm3,(%rdi)
movapd %xmm2,%xmm3
movapd 0xc51(%rip),%xmm5
xorpd  %xmm5,%xmm3
unpcklpd %xmm4,%xmm3
divpd  %xmm0,%xmm3
movupd %xmm3,0x10(%rdi)
movapd %xmm6,%xmm0
subsd  %xmm1,%xmm0
movsd  (%rax),%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm3,%xmm0
mov    0x50(%rsp),%rsi
movsd  %xmm0,(%rsi)
movsd  0x28(%rsp),%xmm3
subsd  %xmm1,%xmm3
movsd  (%rax),%xmm0
mulsd  %xmm2,%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,0x8(%rsi)
mov    %r15,%rdx
mov    $0x2,%ecx
mov    %rax,%rbx
mov    $0x2,%r8d
mov    $0x1,%r9d
call   1040 <mmult@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
movsd  0x68(%rsp),%xmm0
call   1060 <scale@plt>
movsd  (%r15),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1499 <lnsrch+0x329>
jp     1499 <lnsrch+0x329>
movsd  (%rbx),%xmm0
xorpd  0xbb7(%rip),%xmm0
mov    0x48(%rsp),%rax
movsd  0xbda(%rip),%xmm1
mov    0x8(%rsp),%rbx
movapd 0x30(%rsp),%xmm4
movsd  0x18(%rsp),%xmm6
jmp    14f9 <lnsrch+0x389>
mov    0x48(%rsp),%rax
movsd  (%rax),%xmm3
mulsd  0xba6(%rip),%xmm1
mulsd  (%rbx),%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     14c6 <lnsrch+0x356>
sqrtsd %xmm0,%xmm0
jmp    14d7 <lnsrch+0x367>
movsd  %xmm3,0x28(%rsp)
call   1080 <sqrt@plt>
movsd  0x28(%rsp),%xmm3
mov    0x8(%rsp),%rbx
movapd 0x30(%rsp),%xmm4
movsd  0x18(%rsp),%xmm6
subsd  %xmm3,%xmm0
mov    0x10(%rsp),%rax
movsd  0xb5f(%rip),%xmm1
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm4,%xmm1
mulsd  0xb5b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12d8 <lnsrch+0x168>
movapd %xmm1,%xmm0
jmp    12d8 <lnsrch+0x168>
xor    %r12d,%r12d
jmp    17a8 <lnsrch+0x638>
mov    $0x1,%r12d
test   %r14d,%r14d
jle    17a8 <lnsrch+0x638>
mov    %r14d,%edx
cmp    $0x4,%r14d
jb     1568 <lnsrch+0x3f8>
lea    0x0(,%rdx,8),%rcx
add    %r13,%rcx
cmp    %rbp,%rcx
jbe    16b7 <lnsrch+0x547>
lea    0x0(,%rdx,8),%rcx
add    %rbp,%rcx
cmp    %r13,%rcx
jbe    16b7 <lnsrch+0x547>
xor    %ecx,%ecx
mov    %rcx,%rdi
not    %rdi
add    %rdx,%rdi
mov    %rdx,%rsi
and    $0x3,%rsi
je     1597 <lnsrch+0x427>
nopl   0x0(%rax)
movsd  0x0(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1580 <lnsrch+0x410>
cmp    $0x3,%rdi
jb     17a8 <lnsrch+0x638>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
movsd  0x8(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rbp,%rcx,8)
movsd  0x10(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rbp,%rcx,8)
movsd  0x18(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x18(%rbp,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    15b0 <lnsrch+0x440>
jmp    17a8 <lnsrch+0x638>
lea    (%r15,%rax,8),%rcx
lea    0x0(,%rax,8),%rdx
add    %r13,%rdx
lea    (%rbx,%rax,8),%rsi
cmp    %rdx,%r15
setb   %r9b
cmp    %r13,%rcx
seta   %r10b
cmp    %rsi,%r15
setb   %dl
cmp    %rbx,%rcx
seta   %r11b
lea    (%r12,%rax,8),%rsi
cmp    %rsi,%r15
setb   %sil
cmp    %r12,%rcx
seta   %r8b
xor    %ecx,%ecx
test   %r10b,%r9b
jne    121b <lnsrch+0xab>
and    %r11b,%dl
jne    121b <lnsrch+0xab>
and    %r8b,%sil
jne    121b <lnsrch+0xab>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
xor    %edx,%edx
movapd 0x9a2(%rip),%xmm0
movapd 0x9aa(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movupd 0x0(%r13,%rdx,8),%xmm2
andpd  %xmm0,%xmm2
movupd (%rbx,%rdx,8),%xmm3
andpd  %xmm0,%xmm3
movapd %xmm1,%xmm4
divpd  %xmm3,%xmm4
maxpd  %xmm4,%xmm2
movupd (%r12,%rdx,8),%xmm3
divpd  %xmm2,%xmm3
movupd %xmm3,(%r15,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%rcx
jne    1670 <lnsrch+0x500>
cmp    %rax,%rcx
jne    121b <lnsrch+0xab>
jmp    1269 <lnsrch+0xf9>
mov    %edx,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x3,%r8d
cmp    $0xc,%rdi
jae    16dc <lnsrch+0x56c>
xor    %edi,%edi
jmp    1756 <lnsrch+0x5e6>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups 0x0(%r13,%rdi,8),%xmm0
movups 0x10(%r13,%rdi,8),%xmm1
movups %xmm0,0x0(%rbp,%rdi,8)
movups %xmm1,0x10(%rbp,%rdi,8)
movups 0x20(%r13,%rdi,8),%xmm0
movups 0x30(%r13,%rdi,8),%xmm1
movups %xmm0,0x20(%rbp,%rdi,8)
movups %xmm1,0x30(%rbp,%rdi,8)
movups 0x40(%r13,%rdi,8),%xmm0
movups 0x50(%r13,%rdi,8),%xmm1
movups %xmm0,0x40(%rbp,%rdi,8)
movups %xmm1,0x50(%rbp,%rdi,8)
movupd 0x60(%r13,%rdi,8),%xmm0
movupd 0x70(%r13,%rdi,8),%xmm1
movupd %xmm0,0x60(%rbp,%rdi,8)
movupd %xmm1,0x70(%rbp,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    16f0 <lnsrch+0x580>
test   %r8,%r8
je     179f <lnsrch+0x62f>
lea    0x10(,%rdi,8),%rsi
add    %rbp,%rsi
lea    0x10(,%rdi,8),%rdi
add    %r13,%rdi
shl    $0x5,%r8
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movupd -0x10(%rdi,%rbx,1),%xmm0
movupd (%rdi,%rbx,1),%xmm1
movupd %xmm0,-0x10(%rsi,%rbx,1)
movupd %xmm1,(%rsi,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%r8
jne    1780 <lnsrch+0x610>
cmp    %rdx,%rcx
jne    156a <lnsrch+0x3fa>
mov    %rax,%rdi
call   1030 <free@plt>
mov    0x58(%rsp),%rdi
call   1030 <free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x60(%rsp),%rdi
call   1030 <free@plt>
mov    %r12d,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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