// File: /workspace/github_cpp_makefile_star2_O2/Kingsford-Group[P]ghost2/include/Eigen/src/Core/Redux.h
// Function: Eigen::internal::redux_impl<Eigen::internal::scalar_sum_op<double>, Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, Eigen::Transpose<Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<double, -1, 1, 0, -1, 1>>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 4> const> const, Eigen::Matrix<double, -1, 1, 0, -1, 1> const>, 3, 0>::run(Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, Eigen::Transpose<Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<double, -1, 1, 0, -1, 1>>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 4> const> const, Eigen::Matrix<double, -1, 1, 0, -1, 1> const> const&, Eigen::internal::scalar_sum_op<double> const&)
static Scalar run(const Derived& mat, const Func& func)
  {
    const Index size = mat.size();
    eigen_assert(size && "you are using an empty matrix");
    const Index packetSize = packet_traits<Scalar>::size;
    const Index alignedStart = internal::first_aligned(mat);
    enum {
      alignment = bool(Derived::Flags & DirectAccessBit) || bool(Derived::Flags & AlignedBit)
                ? Aligned : Unaligned
    };
    const Index alignedSize2 = ((size-alignedStart)/(2*packetSize))*(2*packetSize);
    const Index alignedSize = ((size-alignedStart)/(packetSize))*(packetSize);
    const Index alignedEnd2 = alignedStart + alignedSize2;
    const Index alignedEnd  = alignedStart + alignedSize;
    Scalar res;
    if(alignedSize)
    {
      PacketScalar packet_res0 = mat.template packet<alignment>(alignedStart);
      if(alignedSize>packetSize) // we have at least two packets to partly unroll the loop
      {
        PacketScalar packet_res1 = mat.template packet<alignment>(alignedStart+packetSize);
        for(Index index = alignedStart + 2*packetSize; index < alignedEnd2; index += 2*packetSize)
        {
          packet_res0 = func.packetOp(packet_res0, mat.template packet<alignment>(index));
          packet_res1 = func.packetOp(packet_res1, mat.template packet<alignment>(index+packetSize));
        }

        packet_res0 = func.packetOp(packet_res0,packet_res1);
        if(alignedEnd>alignedEnd2)
          packet_res0 = func.packetOp(packet_res0, mat.template packet<alignment>(alignedEnd2));
      }
      res = func.predux(packet_res0);

      for(Index index = 0; index < alignedStart; ++index)
        res = func(res,mat.coeff(index));

      for(Index index = alignedEnd; index < size; ++index)
        res = func(res,mat.coeff(index));
    }
    else // too small to vectorize anything.
         // since this is dynamic-size hence inefficient anyway for such small sizes, don't try to optimize.
    {
      res = mat.coeff(0);
      for(Index index = 1; index < size; ++index)
        res = func(res,mat.coeff(index));
    }

    return res;
  }

// Assembly:
pushq %rax
movq 0x8(%rdi), %r9
movq 0x8(%r9), %rcx
testq %rcx, %rcx
je 0x28204
pushq $0x4
popq %r8
movq %rcx, %rax
cqto
idivq %r8
movq %rax, %rsi
pushq $0x2
popq %r10
movq %rcx, %rax
cqto
idivq %r10
leaq 0x1(%rcx), %r10
movq (%rdi), %rdx
movq (%rdx), %rdx
movq (%r9), %rdi
cmpq $0x3, %r10
jae 0x2817b
movsd (%rdx), %xmm0
mulsd (%rdi), %xmm0
pushq $0x1
popq %rax
cmpq %rcx, %rax
jge 0x28202
movsd (%rdx,%rax,8), %xmm1
mulsd (%rdi,%rax,8), %xmm1
addsd %xmm1, %xmm0
incq %rax
jmp 0x2815f
addq %rax, %rax
movapd (%rdx), %xmm1
mulpd (%rdi), %xmm1
cmpq $0x4, %rcx
jl 0x281de
shlq $0x2, %rsi
movapd 0x10(%rdx), %xmm0
mulpd 0x10(%rdi), %xmm0
cmpq %rsi, %r8
jge 0x281c7
movapd (%rdx,%r8,8), %xmm2
movapd 0x10(%rdx,%r8,8), %xmm3
mulpd (%rdi,%r8,8), %xmm2
addpd %xmm2, %xmm1
mulpd 0x10(%rdi,%r8,8), %xmm3
addpd %xmm3, %xmm0
addq $0x4, %r8
jmp 0x2819a
addpd %xmm0, %xmm1
cmpq %rsi, %rax
jle 0x281de
movapd (%rdx,%rsi,8), %xmm0
mulpd (%rdi,%rsi,8), %xmm0
addpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
cmpq %rcx, %rax
jge 0x28202
movsd (%rdx,%rax,8), %xmm1
mulsd (%rdi,%rax,8), %xmm1
addsd %xmm1, %xmm0
incq %rax
jmp 0x281ea
popq %rax
retq
leaq 0x1c8e5(%rip), %rdi     # 0x44af0
leaq 0x1c906(%rip), %rsi     # 0x44b18
leaq 0x22267(%rip), %rcx     # 0x4a480
movl $0xca, %edx
callq 0xe380
nop