// File: /workspace/github_cpp_makefile_star2_O1/redpony[P]libpopt/./lbfgs.h
// Function: scitbx::lbfgs::minimizer<double, unsigned long>::generic_run(double*, double, double const*, bool, double const*)
bool minimizer<FloatType, SizeType>::generic_run(
    FloatType* x,
    FloatType f,
    const FloatType* g,
    bool diagco,
    const FloatType* diag)
  {
    bool execute_entire_while_loop = false;
    if (!(requests_f_and_g_ || requests_diag_)) {
      execute_entire_while_loop = true;
    }
    requests_f_and_g_ = false;
    requests_diag_ = false;
    FloatType* w = &(*(w_.begin()));
    if (iflag_ == 0) { // Initialize.
      nfun_ = 1;
      if (diagco) {
        for (SizeType i = 0; i < n_; i++) {
          if (diag[i] <= FloatType(0)) {
            throw_diagonal_element_not_positive(i);
          }
        }
      }
      else {
        std::fill_n(scratch_array_.begin(), n_, FloatType(1));
        diag = &(*(scratch_array_.begin()));
      }
      for (SizeType i = 0; i < n_; i++) {
        w[ispt + i] = -g[i] * diag[i];
      }
      FloatType gnorm = std::sqrt(detail::ddot(n_, g, g));
      if (gnorm == FloatType(0)) return false;
      stp1 = FloatType(1) / gnorm;
      execute_entire_while_loop = true;
    }
    if (execute_entire_while_loop) {
      bound = iter_;
      iter_++;
      info = 0;
      if (iter_ != 1) {
        if (iter_ > m_) bound = m_;
        ys = detail::ddot(
          n_, w, iypt + npt, SizeType(1), w, ispt + npt, SizeType(1));
        if (!diagco) {
          FloatType yy = detail::ddot(
            n_, w, iypt + npt, SizeType(1), w, iypt + npt, SizeType(1));
          std::fill_n(scratch_array_.begin(), n_, ys / yy);
          diag = &(*(scratch_array_.begin()));
        }
        else {
          iflag_ = 2;
          requests_diag_ = true;
          return true;
        }
      }
    }
    if (execute_entire_while_loop || iflag_ == 2) {
      if (iter_ != 1) {
        if (diag == 0) {
          throw error_internal_error(__FILE__, __LINE__);
        }
        if (diagco) {
          for (SizeType i = 0; i < n_; i++) {
            if (diag[i] <= FloatType(0)) {
              throw_diagonal_element_not_positive(i);
            }
          }
        }
        SizeType cp = point;
        if (point == 0) cp = m_;
        w[n_ + cp -1] = 1 / ys;
        SizeType i;
        for (i = 0; i < n_; i++) {
          w[i] = -g[i];
        }
        cp = point;
        for (i = 0; i < bound; i++) {
          if (cp == 0) cp = m_;
          cp--;
          FloatType sq = detail::ddot(
            n_, w, ispt + cp * n_, SizeType(1), w, SizeType(0), SizeType(1));
          SizeType inmc=n_+m_+cp;
          SizeType iycn=iypt+cp*n_;
          w[inmc] = w[n_ + cp] * sq;
          detail::daxpy(n_, -w[inmc], w, iycn, w);
        }
        for (i = 0; i < n_; i++) {
          w[i] *= diag[i];
        }
        for (i = 0; i < bound; i++) {
          FloatType yr = detail::ddot(
            n_, w, iypt + cp * n_, SizeType(1), w, SizeType(0), SizeType(1));
          FloatType beta = w[n_ + cp] * yr;
          SizeType inmc=n_+m_+cp;
          beta = w[inmc] - beta;
          SizeType iscn=ispt+cp*n_;
          detail::daxpy(n_, beta, w, iscn, w);
          cp++;
          if (cp == m_) cp = 0;
        }
        std::copy(w, w+n_, w+(ispt + point * n_));
      }
      stp_ = FloatType(1);
      if (iter_ == 1) stp_ = stp1;
      std::copy(g, g+n_, w);
    }
    mcsrch_instance.run(
      gtol_, stpmin_, stpmax_, n_, x, f, g, w, ispt + point * n_,
      stp_, ftol, xtol_, maxfev_, info, nfev, &(*(scratch_array_.begin())));
    if (info == -1) {
      iflag_ = 1;
      requests_f_and_g_ = true;
      return true;
    }
    if (info != 1) {
      throw error_internal_error(__FILE__, __LINE__);
    }
    nfun_ += nfev;
    npt = point*n_;
    for (SizeType i = 0; i < n_; i++) {
      w[ispt + npt + i] = stp_ * w[ispt + npt + i];
      w[iypt + npt + i] = g[i] - w[i];
    }
    point++;
    if (point == m_) point = 0;
    return false;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r13
movl %ecx, %r12d
movq %rdx, %r14
movsd %xmm0, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
movb 0xb5(%rdi), %al
xorb $0x1, %al
movzbl %al, %eax
xorl %ebp, %ebp
cmpb $0x0, 0xb4(%rdi)
cmovel %eax, %ebp
movw $0x0, 0xb4(%rdi)
movq 0x120(%rdi), %r15
cmpl $0x0, 0xb0(%rdi)
jne 0x646e
movq $0x1, 0xc0(%rbx)
testb %r12b, %r12b
movl %r12d, 0x8(%rsp)
je 0x6309
cmpq $0x0, 0x78(%rbx)
je 0x63c6
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
ucomisd (%r13,%r12,8), %xmm0
jb 0x62fb
movq %r12, %rdi
callq 0x6a82
xorpd %xmm0, %xmm0
incq %r12
cmpq 0x78(%rbx), %r12
jb 0x62e6
jmp 0x63c6
movq 0x78(%rbx), %rax
movq 0x138(%rbx), %r13
testq %rax, %rax
je 0x63c6
movabsq $0x1fffffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFFFF
addq %rcx, %rax
andq %rax, %rcx
andl $0x1, %eax
negq %rax
addq %rcx, %rax
addq $0x2, %rax
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa 0x2cf2(%rip), %xmm1     # 0x9040
movdqa 0x2cfa(%rip), %xmm2     # 0x9050
pxor %xmm2, %xmm0
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
pcmpeqd %xmm3, %xmm3
movq %rcx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %esi
notl %esi
testb $0x1, %sil
je 0x63a9
movq %rdx, (%r13,%rcx,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x63bd
movq %rdx, 0x8(%r13,%rcx,8)
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0x6368
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x6402
movq 0xf8(%rbx), %rax
leaq (%r15,%rax,8), %rax
xorl %ecx, %ecx
movapd 0x2c4c(%rip), %xmm0     # 0x9030
movsd (%r14,%rcx,8), %xmm1
xorpd %xmm0, %xmm1
mulsd (%r13,%rcx,8), %xmm1
movsd %xmm1, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %rdi
jne 0x63e4
subq $0x8, %rsp
movl $0x1, %ecx
movq %r14, %rsi
xorl %edx, %edx
movq %r14, %r8
xorl %r9d, %r9d
pushq $0x1
callq 0x4b49
addq $0x10, %rsp
pxor %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6431
sqrtsd %xmm0, %xmm0
jmp 0x643a
callq 0x3170
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6442
jnp 0x6459
movsd 0x2c6e(%rip), %xmm1     # 0x90b8
divsd %xmm0, %xmm1
movsd %xmm1, 0xd0(%rbx)
movb $0x1, %bpl
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0x8(%rsp), %r12d
jne 0x646e
jnp 0x6510
testb $0x1, %bpl
je 0x6607
movq 0xb8(%rbx), %rcx
movq %rcx, 0x110(%rbx)
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%rbx)
movl $0x0, 0x108(%rbx)
testq %rcx, %rcx
je 0x6607
movq 0x80(%rbx), %rcx
cmpq %rcx, %rax
jbe 0x64b7
movq %rcx, 0x110(%rbx)
movq 0x78(%rbx), %rdi
movq 0xf0(%rbx), %r9
movq 0x100(%rbx), %rdx
addq %r9, %rdx
addq 0xf8(%rbx), %r9
subq $0x8, %rsp
movl $0x1, %ecx
movq %r15, %rsi
movq %r15, %r8
pushq $0x1
callq 0x4b49
addq $0x10, %rsp
movsd %xmm0, 0xe0(%rbx)
testb %r12b, %r12b
je 0x6517
movl $0x2, 0xb0(%rbx)
movb $0x1, 0xb5(%rbx)
jmp 0x6985
xorl %eax, %eax
jmp 0x6a21
movq 0x78(%rbx), %rdi
movq 0xf0(%rbx), %rdx
addq 0x100(%rbx), %rdx
subq $0x8, %rsp
movl $0x1, %ecx
movq %r15, %rsi
movq %r15, %r8
movq %rdx, %r9
pushq $0x1
callq 0x4b49
addq $0x10, %rsp
movq 0x138(%rbx), %r13
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x6607
movsd 0xe0(%rbx), %xmm1
divsd %xmm0, %xmm1
movabsq $0x1fffffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFFFF
addq %rcx, %rax
andq %rax, %rcx
andl $0x1, %eax
negq %rax
addq %rcx, %rax
addq $0x2, %rax
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa 0x2aa9(%rip), %xmm2     # 0x9040
movdqa 0x2ab1(%rip), %xmm3     # 0x9050
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rcx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
por %xmm2, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x65e9
movsd %xmm1, (%r13,%rcx,8)
pxor %xmm4, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x65fe
movsd %xmm1, 0x8(%r13,%rcx,8)
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0x65a7
testb $0x1, %bpl
jne 0x661a
cmpl $0x2, 0xb0(%rbx)
jne 0x68e2
cmpq $0x1, 0xb8(%rbx)
je 0x689f
testq %r13, %r13
je 0x6a4b
testb %r12b, %r12b
movq %r13, 0x8(%rsp)
je 0x666b
cmpq $0x0, 0x78(%rbx)
je 0x666b
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd (%r13,%rbp,8), %xmm0
jb 0x6662
movq %rbp, %rdi
callq 0x6a82
xorpd %xmm0, %xmm0
movq 0x8(%rsp), %r13
incq %rbp
cmpq 0x78(%rbx), %rbp
jb 0x6648
movq 0x78(%rbx), %rax
movq 0xe8(%rbx), %rbp
movq %rbp, %rcx
testq %rbp, %rbp
jne 0x6685
movq 0x80(%rbx), %rcx
movsd 0x2a2b(%rip), %xmm0     # 0x90b8
divsd 0xe0(%rbx), %xmm0
leaq (%r15,%rax,8), %rdx
movsd %xmm0, -0x8(%rdx,%rcx,8)
testq %rax, %rax
je 0x66c6
xorl %ecx, %ecx
movapd 0x2982(%rip), %xmm0     # 0x9030
movsd (%r14,%rcx,8), %xmm1
xorpd %xmm0, %xmm1
movlpd %xmm1, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x66ae
movq %r14, 0x10(%rsp)
cmpq $0x0, 0x110(%rbx)
je 0x6789
xorl %r13d, %r13d
movl $0x1, %r14d
testq %rbp, %rbp
jne 0x66ee
movq 0x80(%rbx), %rbp
leaq -0x1(%rbp), %r12
movq 0x78(%rbx), %rdi
movq %r12, %rdx
imulq %rdi, %rdx
addq 0xf8(%rbx), %rdx
subq $0x8, %rsp
movl $0x1, %ecx
movq %r15, %rsi
movq %r15, %r8
xorl %r9d, %r9d
pushq %r14
callq 0x4b49
addq $0x10, %rsp
movq 0x78(%rbx), %rdi
movq 0x80(%rbx), %rax
movq %rdi, %rdx
imulq %r12, %rdx
addq 0x100(%rbx), %rdx
leaq (%r15,%rdi,8), %rcx
leaq (%rcx,%rbp,8), %rcx
addq $-0x8, %rcx
mulsd (%rcx), %xmm0
movsd %xmm0, (%rcx,%rax,8)
xorpd 0x28d9(%rip), %xmm0     # 0x9030
subq $0x8, %rsp
movl $0x1, %ecx
movq %r15, %rsi
movq %r15, %r8
xorl %r9d, %r9d
pushq %r14
callq 0x7965
addq $0x10, %rsp
incq %r13
movq %r12, %rbp
cmpq 0x110(%rbx), %r13
jb 0x66e2
jmp 0x678c
movq %rbp, %r12
movq 0x78(%rbx), %rax
testq %rax, %rax
movq 0x8(%rsp), %rdx
je 0x67b5
xorl %ecx, %ecx
movsd (%rdx,%rcx,8), %xmm0
mulsd (%r15,%rcx,8), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x679c
cmpq $0x0, 0x110(%rbx)
movq 0x10(%rsp), %r14
je 0x686f
movl $0x1, %ebp
xorl %r13d, %r13d
movq 0x78(%rbx), %rdi
movq %rdi, %rdx
imulq %r12, %rdx
addq 0x100(%rbx), %rdx
subq $0x8, %rsp
movl $0x1, %ecx
movq %r15, %rsi
movq %r15, %r8
xorl %r9d, %r9d
pushq %rbp
callq 0x4b49
addq $0x10, %rsp
movq 0x78(%rbx), %rdi
movq 0x80(%rbx), %rax
leaq (%r15,%rdi,8), %rcx
leaq (%rcx,%r12,8), %rcx
mulsd (%rcx), %xmm0
movsd (%rcx,%rax,8), %xmm1
subsd %xmm0, %xmm1
movq %rdi, %rdx
imulq %r12, %rdx
addq 0xf8(%rbx), %rdx
subq $0x8, %rsp
movl $0x1, %ecx
movapd %xmm1, %xmm0
movq %r15, %rsi
movq %r15, %r8
xorl %r9d, %r9d
pushq %rbp
callq 0x7965
addq $0x10, %rsp
incq %r12
cmpq 0x80(%rbx), %r12
movl $0x0, %eax
cmoveq %rax, %r12
incq %r13
cmpq 0x110(%rbx), %r13
jb 0x67d0
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x689f
leaq (,%rax,8), %rdx
movq 0xf8(%rbx), %rcx
leaq (%r15,%rcx,8), %rcx
imulq 0xe8(%rbx), %rax
leaq (%rcx,%rax,8), %rdi
movq %r15, %rsi
callq 0x32a0
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xc8(%rbx)
cmpq $0x1, 0xb8(%rbx)
jne 0x68ca
movsd 0xd0(%rbx), %xmm0
movsd %xmm0, 0xc8(%rbx)
movq 0x78(%rbx), %rdx
testq %rdx, %rdx
je 0x68e2
shlq $0x3, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x32a0
leaq 0x90(%rbx), %rsi
leaq 0xa0(%rbx), %rdx
leaq 0xa8(%rbx), %rcx
movq 0x78(%rbx), %r8
movq 0xe8(%rbx), %rax
imulq %r8, %rax
addq 0xf8(%rbx), %rax
leaq 0xc8(%rbx), %r12
movsd 0xd8(%rbx), %xmm1
movq 0x98(%rbx), %xmm2
leaq 0x108(%rbx), %r10
leaq 0x118(%rbx), %r11
movq %rbx, %rdi
movq 0x18(%rsp), %r9
movsd 0x20(%rsp), %xmm0
pushq 0x138(%rbx)
pushq %r11
pushq %r10
pushq 0x88(%rbx)
pushq %r12
pushq %rax
pushq %r15
pushq %r14
callq 0x6ec8
addq $0x40, %rsp
movl 0x108(%rbx), %eax
cmpl $0x1, %eax
je 0x698c
cmpl $-0x1, %eax
jne 0x6a30
movl $0x1, 0xb0(%rbx)
movb $0x1, 0xb4(%rbx)
movb $0x1, %al
jmp 0x6a21
movq 0x118(%rbx), %rax
addq %rax, 0xc0(%rbx)
movq 0x78(%rbx), %rax
movq 0xe8(%rbx), %rcx
movq %rax, %rsi
imulq %rcx, %rsi
movq %rsi, 0xf0(%rbx)
testq %rax, %rax
je 0x6a05
movq 0xf8(%rbx), %rdx
movq 0x100(%rbx), %rdi
shlq $0x3, %rdx
leaq (%rdx,%rsi,8), %rdx
shlq $0x3, %rdi
leaq (%rdi,%rsi,8), %rsi
movsd (%r12), %xmm0
mulsd (%r15,%rdx), %xmm0
movsd %xmm0, (%r15,%rdx)
movsd (%r14), %xmm0
subsd (%r15), %xmm0
movsd %xmm0, (%r15,%rsi)
addq $0x8, %r15
addq $0x8, %r14
decq %rax
jne 0x69d6
incq %rcx
xorl %eax, %eax
cmpq 0x80(%rbx), %rcx
movl $0x0, %edx
cmovneq %rcx, %rdx
movq %rdx, 0xe8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x30d0
movq %rax, %rbx
leaq 0x2b22(%rip), %rsi      # 0x9566
movl $0x557, %edx            # imm = 0x557
jmp 0x6a64
movl $0x28, %edi
callq 0x30d0
movq %rax, %rbx
leaq 0x2b07(%rip), %rsi      # 0x9566
movl $0x51f, %edx            # imm = 0x51F
movq %rax, %rdi
callq 0x6bfe
leaq 0x61f5(%rip), %rsi      # 0xcc68
leaq -0x20e2(%rip), %rdx     # 0x4998
movq %rbx, %rdi
callq 0x32e0