// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
movq %rdx, %r14
movsd %xmm0, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
movb 0xb4(%rdi), %dl
movb 0xb5(%rdi), %al
movw $0x0, 0xb4(%rdi)
movq 0x120(%rdi), %r15
movl 0xb0(%rdi), %ecx
testl %ecx, %ecx
je 0x62ac
testb %dl, %dl
jne 0x629e
testb $0x1, %al
je 0x6448
cmpl $0x2, %ecx
je 0x65d0
jmp 0x68a4
movq $0x1, 0xc0(%rbx)
testb %bpl, %bpl
je 0x62f6
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x63ee
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
ucomisd (%r13,%r12,8), %xmm0
jb 0x62e9
movq %r12, %rdi
callq 0x6a44
xorpd %xmm0, %xmm0
movq 0x78(%rbx), %rdi
incq %r12
cmpq %rdi, %r12
jb 0x62d0
jmp 0x63b4
movq 0x78(%rbx), %rdi
movq 0x138(%rbx), %r13
testq %rdi, %rdi
je 0x63ee
movabsq $0x1fffffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFFFF
leaq (%rdi,%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 0x2d04(%rip), %xmm1     # 0x9040
movdqa 0x2d0c(%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 0x6397
movq %rdx, (%r13,%rcx,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x63ab
movq %rdx, 0x8(%r13,%rcx,8)
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0x6356
testq %rdi, %rdi
je 0x63ee
movq 0xf8(%rbx), %rax
leaq (%r15,%rax,8), %rax
xorl %ecx, %ecx
movapd 0x2c62(%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 0x63ce
jmp 0x63f0
xorl %edi, %edi
subq $0x8, %rsp
movl $0x1, %ecx
movq %r14, %rsi
xorl %edx, %edx
movq %r14, %r8
xorl %r9d, %r9d
pushq $0x1
callq 0x4b25
addq $0x10, %rsp
pxor %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x641f
sqrtsd %xmm0, %xmm0
jmp 0x6428
callq 0x3170
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6434
jnp 0x661e
movsd 0x2c7c(%rip), %xmm1     # 0x90b8
divsd %xmm0, %xmm1
movsd %xmm1, 0xd0(%rbx)
movq 0xb8(%rbx), %rcx
movq %rcx, 0x110(%rbx)
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%rbx)
movl $0x0, 0x108(%rbx)
testq %rcx, %rcx
je 0x65d0
movq 0x80(%rbx), %rcx
cmpq %rcx, %rax
jbe 0x6487
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 0x4b25
addq $0x10, %rsp
movsd %xmm0, 0xe0(%rbx)
testb %bpl, %bpl
je 0x64e0
movl $0x2, 0xb0(%rbx)
movb $0x1, 0xb5(%rbx)
jmp 0x6947
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 0x4b25
addq $0x10, %rsp
movq 0x138(%rbx), %r13
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x65d0
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 0x2ae0(%rip), %xmm2     # 0x9040
movdqa 0x2ae8(%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 0x65b2
movsd %xmm1, (%r13,%rcx,8)
pxor %xmm4, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x65c7
movsd %xmm1, 0x8(%r13,%rcx,8)
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0x6570
cmpq $0x1, 0xb8(%rbx)
je 0x687c
testq %r13, %r13
je 0x6a0d
movq 0x78(%rbx), %rax
testb %bpl, %bpl
je 0x6627
testq %rax, %rax
je 0x6625
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd (%r13,%rbp,8), %xmm0
jb 0x6614
movq %rbp, %rdi
callq 0x6a44
xorpd %xmm0, %xmm0
movq 0x78(%rbx), %rax
incq %rbp
cmpq %rax, %rbp
jb 0x65fb
jmp 0x6627
xorl %eax, %eax
jmp 0x69e3
xorl %eax, %eax
movq 0xe8(%rbx), %r12
movq %r12, %rcx
testq %r12, %r12
jne 0x663d
movq 0x80(%rbx), %rcx
movsd 0x2a73(%rip), %xmm0     # 0x90b8
divsd 0xe0(%rbx), %xmm0
leaq (%r15,%rax,8), %rdx
movsd %xmm0, -0x8(%rdx,%rcx,8)
testq %rax, %rax
je 0x667e
xorl %ecx, %ecx
movapd 0x29ca(%rip), %xmm0     # 0x9030
movsd (%r14,%rcx,8), %xmm1
xorpd %xmm0, %xmm1
movlpd %xmm1, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x6666
cmpq $0x0, 0x110(%rbx)
je 0x675b
movq %r14, 0x8(%rsp)
movq %r13, 0x10(%rsp)
xorl %ebp, %ebp
movl $0x1, %r14d
testq %r12, %r12
jne 0x66aa
movq 0x80(%rbx), %r12
movq %r12, %r13
decq %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 0x4b25
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,%r13,8), %rcx
addq $-0x8, %rcx
mulsd (%rcx), %xmm0
movsd %xmm0, (%rcx,%rax,8)
xorpd 0x291b(%rip), %xmm0     # 0x9030
subq $0x8, %rsp
movl $0x1, %ecx
movq %r15, %rsi
movq %r15, %r8
xorl %r9d, %r9d
pushq %r14
callq 0x7913
addq $0x10, %rsp
incq %rbp
movq 0x110(%rbx), %rcx
cmpq %rcx, %rbp
jb 0x669e
movq 0x78(%rbx), %rax
testq %rcx, %rcx
sete %cl
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %r14
jmp 0x675d
movb $0x1, %cl
testq %rax, %rax
je 0x677f
xorl %edx, %edx
movsd (%r13,%rdx,8), %xmm0
mulsd (%r15,%rdx,8), %xmm0
movsd %xmm0, (%r15,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x6764
testb %cl, %cl
jne 0x6832
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 0x4b25
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 0x7913
addq $0x10, %rsp
incq %r12
cmpq 0x80(%rbx), %r12
movl $0x0, %eax
cmoveq %rax, %r12
incq %r13
cmpq 0x110(%rbx), %r13
jb 0x678f
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x685e
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
movq 0xb8(%rbx), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0xc8(%rbx)
cmpq $0x1, %rax
jne 0x688c
movsd 0xd0(%rbx), %xmm0
movsd %xmm0, 0xc8(%rbx)
movq 0x78(%rbx), %rdx
testq %rdx, %rdx
je 0x68a4
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 0x6e9a
addq $0x40, %rsp
movl 0x108(%rbx), %eax
cmpl $0x1, %eax
je 0x694e
cmpl $-0x1, %eax
jne 0x69f2
movl $0x1, 0xb0(%rbx)
movb $0x1, 0xb4(%rbx)
movb $0x1, %al
jmp 0x69e3
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 0x69c7
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 0x6998
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 0x2b60(%rip), %rsi      # 0x9566
movl $0x557, %edx            # imm = 0x557
jmp 0x6a26
movl $0x28, %edi
callq 0x30d0
movq %rax, %rbx
leaq 0x2b45(%rip), %rsi      # 0x9566
movl $0x51f, %edx            # imm = 0x51F
movq %rax, %rdi
callq 0x6bd4
leaq 0x6233(%rip), %rsi      # 0xcc68
leaq -0x20cc(%rip), %rdx     # 0x4970
movq %rbx, %rdi
callq 0x32e0