// File: 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 %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2d750
movq %rax, -0x28(%rbp)
movq $0x1, -0x30(%rbp)
movl $0x10, -0x34(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2d770
movq %rax, %rdi
callq 0x1fbb0
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
subq -0x40(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
shlq %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
subq -0x40(%rbp), %rax
movl $0x1, %ecx
cqto
idivq %rcx
shlq $0x0, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x10(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x14330
cmpq $0x0, -0x50(%rbp)
je 0x2d2cd
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x2d790
movapd %xmm0, -0x70(%rbp)
cmpq $0x1, -0x50(%rbp)
jle 0x2d167
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
callq 0x2d790
movapd %xmm0, -0x80(%rbp)
movq -0x40(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x2d0d7
movq -0x20(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x2d790
movq -0x1a8(%rbp), %rdi
movapd %xmm0, -0xb0(%rbp)
leaq -0x70(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x2d7c0
movapd %xmm0, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq $0x1, %rsi
callq 0x2d790
movq -0x1a0(%rbp), %rdi
movapd %xmm0, -0xd0(%rbp)
leaq -0x80(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x2d7c0
movapd %xmm0, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x88(%rbp)
jmp 0x2cffb
movq -0x20(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x2d7c0
movapd %xmm0, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jle 0x2d165
movq -0x20(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2d790
movq -0x1b0(%rbp), %rdi
movapd %xmm0, -0x100(%rbp)
leaq -0x70(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x2d7c0
movapd %xmm0, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x2d167
movq -0x20(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2d800
movsd %xmm0, -0x110(%rbp)
movsd %xmm1, -0x108(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x8(%rbp)
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
cmpq -0x40(%rbp), %rax
jge 0x2d231
movq -0x20(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x18(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x2d880
movq -0x1b8(%rbp), %rdi
movsd %xmm0, -0x138(%rbp)
movsd %xmm1, -0x130(%rbp)
leaq -0x10(%rbp), %rsi
leaq -0x138(%rbp), %rdx
callq 0x2d840
movsd %xmm0, -0x128(%rbp)
movsd %xmm1, -0x120(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x2d1a5
movq -0x60(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x2d2c8
movq -0x20(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x140(%rbp), %rsi
callq 0x2d880
movq -0x1c0(%rbp), %rdi
movsd %xmm0, -0x160(%rbp)
movsd %xmm1, -0x158(%rbp)
leaq -0x10(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x2d840
movsd %xmm0, -0x150(%rbp)
movsd %xmm1, -0x148(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x140(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x140(%rbp)
jmp 0x2d23c
jmp 0x2d399
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2d880
movsd %xmm0, -0x170(%rbp)
movsd %xmm1, -0x168(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x8(%rbp)
movq $0x1, -0x178(%rbp)
movq -0x178(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x2d397
movq -0x20(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x18(%rbp), %rdi
movq -0x178(%rbp), %rsi
callq 0x2d880
movq -0x1c8(%rbp), %rdi
movsd %xmm0, -0x198(%rbp)
movsd %xmm1, -0x190(%rbp)
leaq -0x10(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x2d840
movsd %xmm0, -0x188(%rbp)
movsd %xmm1, -0x180(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x178(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x178(%rbp)
jmp 0x2d30b
jmp 0x2d399
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopl (%rax)