// File: 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
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rcx, -0x110(%rbp)
movq %rsi, %rax
movq -0x110(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0xa190
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
movq -0xf0(%rbp), %rcx
movsd -0x28(%rbp), %xmm0
xorl %r8d, %r8d
callq 0xabe00
jmp 0xa5935
leaq -0x58(%rbp), %rdi
callq 0xa8d8
movq -0x108(%rbp), %rax
leaq 0xf9a4c(%rip), %rcx     # 0x19f398
movq %rcx, (%rax)
addq $0x88, %rax
movq %rax, -0x120(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa8e00
movl %eax, -0x114(%rbp)
jmp 0xa596d
movl -0x114(%rbp), %eax
cltq
movq %rax, -0x130(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa8e00
movl %eax, -0x124(%rbp)
jmp 0xa598d
movl -0x124(%rbp), %eax
cltq
movq %rax, -0x140(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x992a0
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x992c0
jmp 0xa59c8
leaq -0x82(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x9a900
movq -0x120(%rbp), %rdi
movq -0x130(%rbp), %rsi
movq -0x148(%rbp), %rcx
leaq -0x80(%rbp), %rdx
callq 0xa8e20
jmp 0xa59fb
leaq -0x82(%rbp), %rdi
callq 0x9ac40
leaq -0x80(%rbp), %rdi
callq 0x99330
leaq -0x81(%rbp), %rdi
callq 0x99390
movq -0x108(%rbp), %rdi
addq $0xa0, %rdi
movq %rdi, -0x160(%rbp)
callq 0xa8ea0
movq -0x108(%rbp), %rdi
addq $0xb8, %rdi
movq %rdi, -0x158(%rbp)
callq 0xa8ea0
movq -0x10(%rbp), %rdi
callq 0xa8e00
movl %eax, -0x14c(%rbp)
jmp 0xa5a61
movl -0x14c(%rbp), %eax
cltq
movq %rax, -0x170(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x995b0
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0x995d0
jmp 0xa5a9f
leaq -0xb1(%rbp), %rdi
callq 0x99610
movq -0x10(%rbp), %rdi
callq 0xa8ec0
movq %rax, -0x178(%rbp)
jmp 0xa5abd
movq -0x178(%rbp), %rsi
movq -0x108(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0xd0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xb0(%rbp), %rdx
callq 0xa5c50
jmp 0xa5b0e
movq -0x108(%rbp), %rdi
addq $0xa0, %rdi
movq %rdi, -0x180(%rbp)
callq 0xa8ee0
movq -0x180(%rbp), %rdi
movq %rax, -0xd8(%rbp)
callq 0xa8f10
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0xa5e70
jmp 0xa5b57
leaq -0xb0(%rbp), %rdi
callq 0x10160
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xa8d8
jmp 0xa5c44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa5c38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa5bc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x82(%rbp), %rdi
callq 0x9ac40
leaq -0x80(%rbp), %rdi
callq 0x99330
leaq -0x81(%rbp), %rdi
callq 0x99390
jmp 0xa5c38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa5c14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x99610
jmp 0xa5c14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x10160
movq -0x158(%rbp), %rdi
callq 0xa8f40
movq -0x160(%rbp), %rdi
callq 0xa8f40
movq -0x120(%rbp), %rdi
callq 0x994d0
movq -0x108(%rbp), %rdi
callq 0xa93f0
movq -0x60(%rbp), %rdi
callq 0xa7c0
nopl (%rax)