// File: /workspace/github_cpp_makefile_star2_O3/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 0xda46
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movsd 0x58(%rsp), %xmm0
xorl %r8d, %r8d
callq 0x33784
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x319f5
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x9350
leaq 0x52a54(%rip), %rax     # 0x84450
movq %rax, (%rbx)
movq 0x70(%r13), %r15
movslq 0x70(%r14), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x27(%rsp), %rdx
callq 0x2f578
leaq 0x88(%rbx), %r14
movslq %r15d, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x26(%rsp), %rcx
movq %r14, %rdi
callq 0x331a2
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x31a49
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
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 0x306d4
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 0x31bfc
movq 0xa0(%rbx), %r14
movq 0xa8(%rbx), %rbx
cmpq %rbx, %r14
je 0x31b25
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 0x32d84
cmpq $0x101, %r15            # imm = 0x101
jl 0x31b1a
leaq 0x100(%r14), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x330ce
cmpq %rbx, %r15
je 0x31b25
movq %r15, %rdi
callq 0x3316d
addq $0x10, %r15
jmp 0x31b07
movq %r14, %rdi
movq %rbx, %rsi
callq 0x330ce
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x31b3c
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
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 0x31b6a
leaq 0x28(%rsp), %rdi
callq 0x98d4
jmp 0x31b6a
movq %rax, %r12
leaq 0xa0(%rbx), %r15
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x31b8c
movq 0xc8(%rbx), %rsi
subq %rdi, %rsi
callq 0x9350
movq (%r15), %rdi
testq %rdi, %rdi
je 0x31ba3
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x9350
movq %r14, %rdi
callq 0x2f65a
jmp 0x31bcc
movq %rax, %r12
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x31bcc
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
jmp 0x31bcc
movq %rax, %r12
movq %rbx, %rdi
callq 0x332fa
movq %r12, %rdi
callq 0x9680
movq %rax, %r12
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x31bd4
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x9350
jmp 0x31bd4
nop