#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 amotry(double **, double *, double *, int, double (*)(double *, void *),
              int, int *, double, void *);
double fabs(double);
int /*<<< orphan*/ free_vector(double *, int, int);
double stub1(double *, void *);
double *vector(int, int);
int amoeba(double **p, double y[], int ndim, double ftol,
           double (*funk)(double p[], void *data), int *nfunk, void *data) {
  int i, j, ilo, ihi, inhi, mpts = ndim + 1;
  double ytry, ysave, sum, rtol, *psum;
  double yihilo;
  psum = vector(1, ndim);
  *nfunk = 0;
  for (j = 1; j <= ndim; j++) {
    for (i = 1, sum = 0.0; i <= mpts; i++)
      sum += p[i][j];
    psum[j] = sum;
  }
  for (;;) {
    ilo = 1;
    ihi = y[1] > y[2] ? (inhi = 2, 1) : (inhi = 1, 2);
    for (i = 1; i <= mpts; i++) {
      if (y[i] < y[ilo])
        ilo = i;
      if (y[i] > y[ihi]) {
        inhi = ihi;
        ihi = i;
      } else if (y[i] > y[inhi])
        if (i != ihi)
          inhi = i;
    }
    yihilo = fabs(y[ihi]) + fabs(y[ilo]);
    if (yihilo == 0)
      break;
    rtol = 2.0 * fabs(y[ihi] - y[ilo]) / yihilo;
    if (rtol < ftol)
      break;
    if (*nfunk >= 5000) {
      free_vector(psum, 1, ndim);
      return (-1);
    }
    ytry = amotry(p, y, psum, ndim, funk, ihi, nfunk, -1.0, data);
    if (ytry <= y[ilo])
      ytry = amotry(p, y, psum, ndim, funk, ihi, nfunk, 2.0, data);
    else if (ytry >= y[inhi]) {
      ysave = y[ihi];
      ytry = amotry(p, y, psum, ndim, funk, ihi, nfunk, 0.5, data);
      if (ytry >= ysave) {
        for (i = 1; i <= mpts; i++) {
          if (i != ilo) {
            for (j = 1; j <= ndim; j++) {
              psum[j] = 0.5 * (p[i][j] + p[ilo][j]);
              p[i][j] = psum[j];
            }
            y[i] = (*funk)(psum, data);
          }
        }
        *nfunk += ndim;
        for (j = 1; j <= ndim; j++) {
          for (i = 1, sum = 0.0; i <= mpts; i++)
            sum += p[i][j];
          psum[j] = sum;
        }
      }
    }
  }
  free_vector(psum, 1, ndim);
  return (0);
}


x86 assembly (clang, -O0):
<amoeba>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x1c(%rbp),%esi
mov    $0x1,%edi
call   1040 <vector@plt>
mov    %rax,-0x80(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11f6 <amoeba+0xc6>
movl   $0x1,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x58(%rbp),%eax
jg     11d6 <amoeba+0xa6>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    119d <amoeba+0x6d>
movsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1182 <amoeba+0x52>
jmp    11fb <amoeba+0xcb>
movl   $0x1,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd 0x10(%rax),%xmm0
jbe    1231 <amoeba+0x101>
movl   $0x2,-0x54(%rbp)
mov    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1243 <amoeba+0x113>
movl   $0x1,-0x54(%rbp)
mov    $0x2,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x50(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x58(%rbp),%eax
jg     1309 <amoeba+0x1d9>
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1289 <amoeba+0x159>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    12ba <amoeba+0x18a>
mov    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    12f6 <amoeba+0x1c6>
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    12f1 <amoeba+0x1c1>
mov    -0x44(%rbp),%eax
cmp    -0x50(%rbp),%eax
je     12ec <amoeba+0x1bc>
mov    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    12f1 <amoeba+0x1c1>
jmp    12f6 <amoeba+0x1c6>
jmp    12fb <amoeba+0x1cb>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1253 <amoeba+0x123>
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xce3(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xccb(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1365 <amoeba+0x235>
jp     1365 <amoeba+0x235>
jmp    165f <amoeba+0x52f>
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movaps 0xc7a(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    13bc <amoeba+0x28c>
jmp    165f <amoeba+0x52f>
mov    -0x38(%rbp),%rax
cmpl   $0x1388,(%rax)
jl     13e9 <amoeba+0x2b9>
mov    -0x80(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    $0x1,%esi
call   1030 <free_vector@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1677 <amoeba+0x547>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x50(%rbp),%r9d
mov    -0x38(%rbp),%r10
mov    -0x40(%rbp),%rax
movsd  0xc08(%rip),%xmm0
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <amotry@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     147e <amoeba+0x34e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x50(%rbp),%r9d
mov    -0x38(%rbp),%r10
mov    -0x40(%rbp),%rax
movsd  0xbaa(%rip),%xmm0
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <amotry@plt>
movsd  %xmm0,-0x60(%rbp)
jmp    165a <amoeba+0x52a>
movsd  -0x60(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jb     1655 <amoeba+0x525>
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x50(%rbp),%r9d
mov    -0x38(%rbp),%r10
mov    -0x40(%rbp),%rax
movsd  0xb51(%rip),%xmm0
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <amotry@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jb     1650 <amoeba+0x520>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x58(%rbp),%eax
jg     15c5 <amoeba+0x495>
mov    -0x44(%rbp),%eax
cmp    -0x4c(%rbp),%eax
je     15b2 <amoeba+0x482>
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1597 <amoeba+0x467>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xaca(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1518 <amoeba+0x3e8>
mov    -0x30(%rbp),%rax
mov    -0x80(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   *%rax
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15b7 <amoeba+0x487>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    14f9 <amoeba+0x3c9>
mov    -0x1c(%rbp),%ecx
mov    -0x38(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     164b <amoeba+0x51b>
movl   $0x1,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x58(%rbp),%eax
jg     162b <amoeba+0x4fb>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15f2 <amoeba+0x4c2>
movsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    15d7 <amoeba+0x4a7>
jmp    1650 <amoeba+0x520>
jmp    1655 <amoeba+0x525>
jmp    165a <amoeba+0x52a>
jmp    11fb <amoeba+0xcb>
mov    -0x80(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    $0x1,%esi
call   1030 <free_vector@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<amoeba>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%rbp
mov    %r8,0x40(%rsp)
mov    %rcx,0x38(%rsp)
movsd  %xmm0,0x90(%rsp)
mov    %edx,%ebx
mov    %rsi,%r13
mov    %rdi,%r14
mov    $0x1,%edi
mov    %edx,%esi
call   1040 <vector@plt>
mov    %rbx,%rcx
mov    %rax,%r11
mov    %rax,%r15
movl   $0x0,0x0(%rbp)
test   %ecx,%ecx
jle    1238 <amoeba+0x108>
lea    0x2(%rcx),%r8d
lea    0x1(%rcx),%r9d
mov    %ecx,%r10d
lea    0x1(%r10),%rsi
mov    %esi,%edi
and    $0x3,%edi
and    $0xfffffffffffffffc,%rsi
mov    $0x1,%ebx
jmp    11c3 <amoeba+0x93>
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%r11,%rbx,8)
add    $0x1,%rbx
cmp    %r9,%rbx
je     1240 <amoeba+0x110>
xorpd  %xmm0,%xmm0
mov    $0x1,%ebp
cmp    $0x3,%r10d
jb     1215 <amoeba+0xe5>
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x8(%r14,%rbp,8),%rax
mov    0x10(%r14,%rbp,8),%rdx
addsd  (%rax,%rbx,8),%xmm0
addsd  (%rdx,%rbx,8),%xmm0
mov    0x18(%r14,%rbp,8),%rax
addsd  (%rax,%rbx,8),%xmm0
mov    0x20(%r14,%rbp,8),%rax
addsd  (%rax,%rbx,8),%xmm0
add    $0x4,%rbp
cmp    %rbp,%rsi
jne    11e0 <amoeba+0xb0>
add    $0x1,%rbp
test   %rdi,%rdi
je     11b0 <amoeba+0x80>
lea    (%r14,%rbp,8),%rbp
xor    %eax,%eax
mov    0x0(%rbp,%rax,8),%rdx
addsd  (%rdx,%rbx,8),%xmm0
add    $0x1,%rax
cmp    %rax,%rdi
jne    1220 <amoeba+0xf0>
jmp    11b0 <amoeba+0x80>
lea    0x1(%rcx),%r9d
lea    0x2(%rcx),%r8d
cmp    $0x2,%r9d
mov    $0x1,%eax
cmovge %r9d,%eax
mov    %rax,0x80(%rsp)
mov    %r8d,%eax
mov    %r9d,%r9d
lea    (%r15,%r9,8),%rdx
mov    %rdx,0x68(%rsp)
add    $0x8,%r15
mov    %r15,0x70(%rsp)
lea    -0x1(%r9),%rdx
lea    -0x1(%rax),%rsi
mov    %rax,0xa0(%rsp)
add    $0xfffffffffffffffe,%rax
mov    %rax,0x98(%rsp)
mov    %rdx,0x48(%rsp)
and    $0xfffffffffffffffc,%rdx
mov    %rdx,0x60(%rsp)
lea    0x1(%rdx),%rax
mov    %rax,0x58(%rsp)
mov    %r9,%rax
neg    %rax
mov    %rax,0x78(%rsp)
mov    %esi,%ebp
and    $0x3,%ebp
and    $0xfffffffffffffffc,%rsi
mov    %rsi,0x88(%rsp)
mov    %rcx,0x30(%rsp)
mov    %r11,0x10(%rsp)
mov    %r9,0x28(%rsp)
mov    %rbp,0x50(%rsp)
jmp    1319 <amoeba+0x1e9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
mov    0x10(%rsp),%r12
mov    %r12,%rdx
mov    0x30(%rsp),%rbx
mov    %ebx,%ecx
mov    0x38(%rsp),%r8
mov    %r15d,%r9d
movsd  0xd23(%rip),%xmm0
push   0x8(%rsp)
push   %rbp
call   1050 <amotry@plt>
add    $0x10,%rsp
mov    %rbx,%rcx
mov    %r12,%r11
movsd  0x8(%r13),%xmm0
xor    %r12d,%r12d
ucomisd 0x10(%r13),%xmm0
seta   %r12b
mov    $0x2,%r15d
sub    %r12d,%r15d
add    $0x1,%r12d
test   %ecx,%ecx
js     13d0 <amoeba+0x2a0>
mov    $0x1,%edx
mov    $0x1,%eax
movapd %xmm0,%xmm1
mov    0x80(%rsp),%rdi
nopw   0x0(%rax,%rax,1)
ucomisd %xmm1,%xmm0
mov    %eax,%ebx
ja     136a <amoeba+0x23a>
mov    %edx,%ebx
movslq %r15d,%rdx
ucomisd 0x0(%r13,%rdx,8),%xmm1
jbe    1380 <amoeba+0x250>
mov    %r15d,%r12d
mov    %eax,%r15d
jmp    139a <amoeba+0x26a>
xchg   %ax,%ax
movslq %r12d,%rdx
mov    %r15d,%esi
cmp    %rsi,%rax
mov    %edx,%esi
cmovne %eax,%esi
ucomisd 0x0(%r13,%rdx,8),%xmm1
jbe    139a <amoeba+0x26a>
mov    %esi,%r12d
cmp    %rax,%rdi
je     13c0 <amoeba+0x290>
movsd  0x8(%r13,%rax,8),%xmm1
movslq %ebx,%rdx
movsd  0x0(%r13,%rdx,8),%xmm0
add    $0x1,%rax
mov    %ebx,%edx
jmp    1360 <amoeba+0x230>
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rax
movsd  0x0(%r13,%rax,8),%xmm0
jmp    13d5 <amoeba+0x2a5>
nopl   0x0(%rax)
mov    $0x1,%ebx
movslq %r15d,%rax
movsd  0x0(%r13,%rax,8),%xmm1
movapd %xmm1,%xmm3
movapd 0xc15(%rip),%xmm4
andpd  %xmm4,%xmm3
movapd %xmm0,%xmm2
andpd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
xor    %ebp,%ebp
ucomisd 0xc33(%rip),%xmm2
jne    140d <amoeba+0x2dd>
jnp    180c <amoeba+0x6dc>
subsd  %xmm0,%xmm1
andpd  0xbe7(%rip),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm2,%xmm1
movsd  0x90(%rsp),%xmm0
ucomisd %xmm1,%xmm0
ja     180c <amoeba+0x6dc>
mov    0x40(%rsp),%rbp
cmpl   $0x1387,0x0(%rbp)
jg     1807 <amoeba+0x6d7>
mov    %rax,0x18(%rsp)
movslq %ebx,%rax
mov    %rax,0x20(%rsp)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r11,%rdx
mov    0x38(%rsp),%r8
mov    %r15d,%r9d
movsd  0xbb4(%rip),%xmm0
push   0x8(%rsp)
push   %rbp
call   1050 <amotry@plt>
mov    0x30(%rsp),%rax
add    $0x10,%rsp
movsd  0x0(%r13,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
jae    12e0 <amoeba+0x1b0>
movslq %r12d,%rax
ucomisd 0x0(%r13,%rax,8),%xmm0
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%r8
mov    0x10(%rsp),%r11
mov    0x28(%rsp),%r9
movsd  0xb7a(%rip),%xmm0
jb     1319 <amoeba+0x1e9>
mov    0x18(%rsp),%rax
movsd  0x0(%r13,%rax,8),%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r11,%rdx
mov    %r9,%r12
mov    %r15d,%r9d
push   0x8(%rsp)
push   0x48(%rsp)
call   1050 <amotry@plt>
movapd 0xb1e(%rip),%xmm4
movsd  0xb36(%rip),%xmm3
mov    0x20(%rsp),%r11
mov    0x40(%rsp),%rcx
add    $0x10,%rsp
ucomisd 0x18(%rsp),%xmm0
jb     1319 <amoeba+0x1e9>
mov    %r12,%r9
test   %ecx,%ecx
mov    0x8(%rsp),%r15
mov    0x20(%rsp),%rbp
js     1734 <amoeba+0x604>
mov    %ebx,%eax
mov    $0x1,%r12d
mov    %rax,0x18(%rsp)
jmp    1588 <amoeba+0x458>
nopl   0x0(%rax,%rax,1)
mov    %r11,%rdi
mov    %r15,%rsi
mov    %r9,%rbx
call   *0x38(%rsp)
mov    %rbx,%r9
movapd 0xab8(%rip),%xmm4
movsd  0xad0(%rip),%xmm3
mov    0x10(%rsp),%r11
mov    0x30(%rsp),%rcx
movsd  %xmm0,0x0(%r13,%r12,8)
mov    0x18(%rsp),%rax
add    $0x1,%r12
cmp    0xa0(%rsp),%r12
je     1734 <amoeba+0x604>
cmp    %rax,%r12
je     1576 <amoeba+0x446>
test   %ecx,%ecx
jle    1540 <amoeba+0x410>
mov    (%r14,%r12,8),%rax
mov    (%r14,%rbp,8),%rcx
mov    $0x1,%edx
cmpq   $0x4,0x48(%rsp)
jb     16b0 <amoeba+0x580>
lea    0x8(%rax),%rsi
lea    (%rax,%r9,8),%r8
lea    0x8(%rcx),%rbx
lea    (%rcx,%r9,8),%rdi
mov    0x70(%rsp),%rbp
cmp    %r8,%rbp
setb   %r11b
mov    0x68(%rsp),%r9
cmp    %r9,%rsi
setb   %r15b
cmp    %rdi,%rbp
setb   %r10b
cmp    %r9,%rbx
setb   %r9b
cmp    %rdi,%rsi
setb   %sil
cmp    %r8,%rbx
setb   %r8b
test   %r15b,%r11b
jne    168d <amoeba+0x55d>
and    %r9b,%r10b
mov    0x8(%rsp),%r15
mov    0x10(%rsp),%r11
jne    1697 <amoeba+0x567>
and    %r8b,%sil
mov    0x28(%rsp),%r9
mov    0x20(%rsp),%rbp
jne    16b0 <amoeba+0x580>
xor    %edx,%edx
mov    0x60(%rsp),%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd 0x8(%rax,%rdx,8),%xmm0
movupd 0x18(%rax,%rdx,8),%xmm1
movupd 0x8(%rcx,%rdx,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x18(%rcx,%rdx,8),%xmm0
addpd  %xmm1,%xmm0
mulpd  %xmm4,%xmm2
mulpd  %xmm4,%xmm0
movupd %xmm2,0x8(%r11,%rdx,8)
movupd %xmm0,0x18(%r11,%rdx,8)
movupd %xmm2,0x8(%rax,%rdx,8)
movupd %xmm0,0x18(%rax,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    1630 <amoeba+0x500>
mov    0x58(%rsp),%rdx
cmp    %rsi,0x48(%rsp)
je     1540 <amoeba+0x410>
jmp    16b0 <amoeba+0x580>
mov    0x8(%rsp),%r15
mov    0x10(%rsp),%r11
mov    0x28(%rsp),%r9
mov    0x20(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rsi
test   $0x1,%r9b
jne    16d6 <amoeba+0x5a6>
movsd  (%rax,%rdx,8),%xmm0
addsd  (%rcx,%rdx,8),%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,(%r11,%rdx,8)
movsd  %xmm0,(%rax,%rdx,8)
lea    0x1(%rdx),%rsi
not    %rdx
cmp    0x78(%rsp),%rdx
je     1540 <amoeba+0x410>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rax,%rsi,8),%xmm0
addsd  (%rcx,%rsi,8),%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,(%r11,%rsi,8)
movsd  %xmm0,(%rax,%rsi,8)
movsd  0x8(%rax,%rsi,8),%xmm0
addsd  0x8(%rcx,%rsi,8),%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%r11,%rsi,8)
movsd  %xmm0,0x8(%rax,%rsi,8)
add    $0x2,%rsi
cmp    %rsi,%r9
jne    16f0 <amoeba+0x5c0>
jmp    1540 <amoeba+0x410>
mov    0x40(%rsp),%rax
add    %ecx,(%rax)
test   %ecx,%ecx
mov    0x50(%rsp),%rbp
jle    1319 <amoeba+0x1e9>
mov    $0x1,%eax
jmp    1767 <amoeba+0x637>
nop
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%r11,%rax,8)
add    $0x1,%rax
cmp    %r9,%rax
je     1319 <amoeba+0x1e9>
test   %ecx,%ecx
js     1750 <amoeba+0x620>
cmpq   $0x3,0x98(%rsp)
jae    1790 <amoeba+0x660>
xorpd  %xmm0,%xmm0
mov    $0x1,%edi
test   %rbp,%rbp
jne    17de <amoeba+0x6ae>
jmp    1754 <amoeba+0x624>
cs nopw 0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xor    %edi,%edi
mov    0x88(%rsp),%rbx
xchg   %ax,%ax
mov    0x8(%r14,%rdi,8),%rdx
mov    0x10(%r14,%rdi,8),%rsi
addsd  (%rdx,%rax,8),%xmm0
addsd  (%rsi,%rax,8),%xmm0
mov    0x18(%r14,%rdi,8),%rdx
addsd  (%rdx,%rax,8),%xmm0
mov    0x20(%r14,%rdi,8),%rdx
addsd  (%rdx,%rax,8),%xmm0
add    $0x4,%rdi
cmp    %rdi,%rbx
jne    17a0 <amoeba+0x670>
add    $0x1,%rdi
test   %rbp,%rbp
je     1754 <amoeba+0x624>
lea    (%r14,%rdi,8),%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rdi,%rdx,8),%rsi
addsd  (%rsi,%rax,8),%xmm0
add    $0x1,%rdx
cmp    %rdx,%rbp
jne    17f0 <amoeba+0x6c0>
jmp    1754 <amoeba+0x624>
mov    $0xffffffff,%ebp
mov    %r11,%rdi
mov    $0x1,%esi
mov    %ecx,%edx
call   1030 <free_vector@plt>
mov    %ebp,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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