// File: /workspace/github_cpp_makefile_star2_O1/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::CwiseBinaryOp<Eigen::internal::scalar_product_op<std::complex<double>, std::complex<double>>, Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::complex<double>>, Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1> const> const, Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1> const> 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::CwiseBinaryOp<Eigen::internal::scalar_product_op<std::complex<double>, std::complex<double>>, Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::complex<double>>, Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1> const> const, Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1> const> 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 %rax
movq 0x50(%rdi), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x1082e
movq 0x30(%rdi), %rcx
movapd (%rcx), %xmm4
movupd 0x18(%rdi), %xmm1
movapd %xmm1, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
movapd %xmm4, %xmm0
mulpd %xmm3, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
mulpd %xmm1, %xmm4
movsd 0xcd76(%rip), %xmm2     # 0x1d3f0
xorpd %xmm2, %xmm4
addpd %xmm0, %xmm4
movq 0x40(%rdi), %rdx
movapd (%rdx), %xmm0
movapd %xmm4, %xmm5
unpcklpd %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
mulpd %xmm0, %xmm5
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
shufpd $0x1, %xmm0, %xmm0      # xmm0 = xmm0[1,0]
mulpd %xmm4, %xmm0
xorpd %xmm2, %xmm0
addpd %xmm5, %xmm0
cmpq $0x2, %rax
jl 0x10824
movq %rax, %rsi
shrq $0x3f, %rsi
addq %rax, %rsi
andq $-0x2, %rsi
movapd 0x10(%rcx), %xmm5
movapd %xmm5, %xmm4
mulpd %xmm3, %xmm4
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
mulpd %xmm1, %xmm5
xorpd %xmm2, %xmm5
addpd %xmm4, %xmm5
movapd 0x10(%rdx), %xmm4
movapd %xmm5, %xmm6
unpcklpd %xmm5, %xmm6            # xmm6 = xmm6[0],xmm5[0]
mulpd %xmm4, %xmm6
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
mulpd %xmm5, %xmm4
xorpd %xmm2, %xmm4
addpd %xmm6, %xmm4
cmpq $0x4, %rax
jl 0x107cb
movl $0x2, %edi
movl $0x30, %r8d
movapd -0x10(%rcx,%r8), %xmm7
movapd (%rcx,%r8), %xmm5
movapd %xmm7, %xmm6
mulpd %xmm3, %xmm6
shufpd $0x1, %xmm7, %xmm7      # xmm7 = xmm7[1,0]
mulpd %xmm1, %xmm7
xorpd %xmm2, %xmm7
addpd %xmm6, %xmm7
movapd %xmm7, %xmm8
unpcklpd %xmm7, %xmm8            # xmm8 = xmm8[0],xmm7[0]
movapd -0x10(%rdx,%r8), %xmm9
movapd (%rdx,%r8), %xmm6
mulpd %xmm9, %xmm8
unpckhpd %xmm7, %xmm7            # xmm7 = xmm7[1,1]
shufpd $0x1, %xmm9, %xmm9      # xmm9 = xmm9[1,0]
mulpd %xmm7, %xmm9
xorpd %xmm2, %xmm9
addpd %xmm8, %xmm9
addpd %xmm9, %xmm0
movapd %xmm5, %xmm7
mulpd %xmm3, %xmm7
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
mulpd %xmm1, %xmm5
xorpd %xmm2, %xmm5
addpd %xmm7, %xmm5
movapd %xmm5, %xmm7
unpcklpd %xmm5, %xmm7            # xmm7 = xmm7[0],xmm5[0]
mulpd %xmm6, %xmm7
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
shufpd $0x1, %xmm6, %xmm6      # xmm6 = xmm6[1,0]
mulpd %xmm5, %xmm6
xorpd %xmm2, %xmm6
addpd %xmm7, %xmm6
addpd %xmm6, %xmm4
addq $0x2, %rdi
addq $0x20, %r8
cmpq %rsi, %rdi
jl 0x1071c
movapd %xmm0, %xmm5
movapd %xmm4, %xmm0
addpd %xmm5, %xmm0
cmpq %rsi, %rax
jle 0x10824
shlq $0x4, %rsi
movapd (%rcx,%rsi), %xmm4
mulpd %xmm4, %xmm3
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
mulpd %xmm4, %xmm1
xorpd %xmm2, %xmm1
addpd %xmm3, %xmm1
movapd (%rdx,%rsi), %xmm3
movapd %xmm1, %xmm4
unpcklpd %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
mulpd %xmm3, %xmm4
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
shufpd $0x1, %xmm3, %xmm3      # xmm3 = xmm3[1,0]
mulpd %xmm1, %xmm3
xorpd %xmm2, %xmm3
addpd %xmm4, %xmm3
addpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
jmp 0x10835
xorl %esi, %esi
callq 0x10838
popq %rax
retq
nop