// File: /workspace/github_cpp_makefile_star2_O2/Pyboon[P]sage/./Eigen/src/Core/Redux.h
// Function: Eigen::internal::redux_impl<Eigen::internal::scalar_sum_op<std::complex<double>, std::complex<double>>, Eigen::internal::redux_evaluator<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<std::complex<double>, std::complex<double>>, Eigen::Transpose<Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1> const> const, Eigen::Matrix<std::complex<double>, -1, 1, 0, -1, 1> const>>, 3, 0>::run(Eigen::internal::redux_evaluator<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<std::complex<double>, std::complex<double>>, Eigen::Transpose<Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1> const> const, Eigen::Matrix<std::complex<double>, -1, 1, 0, -1, 1> const>> const&, Eigen::internal::scalar_sum_op<std::complex<double>, std::complex<double>> const&)
static Scalar run(const Derived &mat, const Func& func)
  {
    const Index size = mat.size();
    
    const Index packetSize = redux_traits<Func, Derived>::PacketSize;
    const int packetAlignment = unpacket_traits<PacketScalar>::alignment;
    enum {
      alignment0 = (bool(Derived::Flags & DirectAccessBit) && bool(packet_traits<Scalar>::AlignedOnScalar)) ? int(packetAlignment) : int(Unaligned),
      alignment = EIGEN_PLAIN_ENUM_MAX(alignment0, Derived::Alignment)
    };
    const Index alignedStart = internal::first_default_aligned(mat.nestedExpression());
    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,PacketScalar>(alignedStart);
      if(alignedSize>packetSize) // we have at least two packets to partly unroll the loop
      {
        PacketScalar packet_res1 = mat.template packet<alignment,PacketScalar>(alignedStart+packetSize);
        for(Index index = alignedStart + 2*packetSize; index < alignedEnd2; index += 2*packetSize)
        {
          packet_res0 = func.packetOp(packet_res0, mat.template packet<alignment,PacketScalar>(index));
          packet_res1 = func.packetOp(packet_res1, mat.template packet<alignment,PacketScalar>(index+packetSize));
        }

        packet_res0 = func.packetOp(packet_res0,packet_res1);
        if(alignedEnd>alignedEnd2)
          packet_res0 = func.packetOp(packet_res0, mat.template packet<alignment,PacketScalar>(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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r14
pushq $0x2
popq %rcx
movq %r14, %rax
cqto
idivq %rcx
testq %r14, %r14
je 0xcf8b
movq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
callq 0xcfdc
cmpq $0x2, %r14
jl 0xcfc8
movapd %xmm0, (%rsp)
addq %r15, %r15
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xcfdc
movapd %xmm0, %xmm1
pushq $0x3
popq %r12
leaq -0x1(%r12), %rsi
cmpq %r15, %rsi
jge 0xcf97
movq %rbx, %rdi
movapd %xmm1, 0x10(%rsp)
callq 0xcfdc
movapd (%rsp), %xmm1
addpd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xcfdc
movapd 0x10(%rsp), %xmm1
addpd %xmm0, %xmm1
addq $0x2, %r12
jmp 0xcf4a
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd046
jmp 0xcfd0
movapd (%rsp), %xmm0
addpd %xmm1, %xmm0
cmpq %r15, %r14
jle 0xcfc8
movq %rbx, %rdi
movq %r15, %rsi
movapd %xmm0, (%rsp)
callq 0xcfdc
movapd (%rsp), %xmm1
addpd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movapd (%rsp), %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq