// File: /workspace/github_cpp_makefile_star2_O1/canzarlab[P]Trajan/src/Greedy.cpp
// Function: Greedy::Greedy(Graph&, Graph&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::map<unsigned long, bool, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, bool>>>&)
Greedy::Greedy(Graph& t1, Graph& t2, string d, double k, vvi& K, map<size_t, bool>& N) : Solver(t1, t2, d, k, false), A(t1.GetNumNodes(), vd(t2.GetNumNodes()))
{
    vb P(t1.GetNumNodes());
    DFSLeft(t1.GetRoot(), P, [&](newick_node* nodel, newick_node* noder, double w)
    {
        if (w != 0.0 && (dag || nodel->parent) && (dag || nodel->child) && (dag || noder->parent) && (dag || noder->child))
        {
            auto e = N.find(K[nodel->taxoni][noder->taxoni]);
            if (e == N.end())
                E.emplace_back(nodel->taxoni, noder->taxoni, w);
            else if (e->second)
            {
                this->M.emplace_back(nodel->taxoni, noder->taxoni, w);
                A[nodel->taxoni][noder->taxoni] = w;
            }
        }
    });
    sort(E.begin(), E.end(), [](const iid& a, const iid& b){return get<2>(a) > get<2>(b);});
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r12
movq %r8, 0x50(%rsp)
movsd %xmm0, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rbp
movq %rbp, %rdi
callq 0xda94
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movsd 0x58(%rsp), %xmm0
xorl %r8d, %r8d
callq 0x34214
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x32565
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x9340
leaq 0x53e54(%rip), %rax     # 0x863c0
movq %rax, (%rbx)
movq 0x70(%r13), %r15
movslq 0x70(%r14), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x27(%rsp), %rdx
callq 0x3004c
leaq 0x88(%rbx), %r14
movslq %r15d, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x26(%rsp), %rcx
movq %r14, %rdi
callq 0x33c22
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x325b9
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
xorps %xmm0, %xmm0
movups %xmm0, 0xc0(%rbx)
movups %xmm0, 0xb0(%rbx)
movups %xmm0, 0xa0(%rbx)
movslq 0x70(%r13), %rsi
leaq 0x27(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x26(%rsp), %rcx
callq 0x311d8
movq 0x68(%r13), %rsi
movq %rbx, 0x60(%rsp)
movq %r12, 0x68(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x60(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x32784
movq 0xa0(%rbx), %r14
movq 0xa8(%rbx), %rbx
cmpq %rbx, %r14
je 0x32695
movq %rbx, %r15
subq %r14, %r15
movq %r15, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x337c6
cmpq $0x101, %r15            # imm = 0x101
jl 0x3268a
leaq 0x100(%r14), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x33b42
cmpq %rbx, %r15
je 0x32695
movq %r15, %rdi
callq 0x33bea
addq $0x10, %r15
jmp 0x32677
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33b42
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x326c5
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
xorl %eax, %eax
movq %rax, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movl %eax, 0x40(%rsp)
movq %rax, 0x48(%rsp)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x326f3
leaq 0x28(%rsp), %rdi
callq 0x98e6
jmp 0x326f3
movq %rax, %r12
leaq 0xa0(%rbx), %r15
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x32715
movq 0xc8(%rbx), %rsi
subq %rdi, %rsi
callq 0x9340
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3272c
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x9340
movq %r14, %rdi
callq 0x30124
jmp 0x32755
movq %rax, %r12
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x32755
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
jmp 0x32755
movq %rax, %r12
movq %rbx, %rdi
callq 0x33d7a
movq %r12, %rdi
callq 0x9670
movq %rax, %r12
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x3275d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x9340
jmp 0x3275d