// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/EditDist.cpp
// Function: MakeTree(newick_node*, newick_node*, int, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&)
int MakeTree(newick_node* root, newick_node* nroot, int k, vvi& I)
{
    vn c;
    for (newick_child* child = root->child; child; child = child->next)
        c.push_back(child->node);

    vn nc;
    newick_child** childptr = &nroot->child;
    vi J(I[k].size());
    for (int i = 0; i < I[k].size(); ++i)
    {
        newick_node* croot = new newick_node(c[I[k][i]]->taxon);
        *childptr = new newick_child(croot);
        childptr = &(*childptr)->next;
        nc.push_back(croot);
        J[I[k][i]] = i;
    }
    int s = 1;
    for (int i = 0; i < c.size(); ++i)
        s += MakeTree(c[i], nc[J[i]], k + s, I);
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %rbp
movq %rdi, %r15
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r12
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
movq (%r15), %r15
testq %r15, %r15
je 0x4b906
movq %r12, %rdi
movq %r15, %rsi
callq 0x2dde8
addq $0x8, %r15
jmp 0x4b8ed
xorps %xmm0, %xmm0
andq $0x0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movslq 0x10(%rsp), %rax
movq 0x8(%rsp), %rbx
movq (%rbx), %rcx
imulq $0x18, %rax, %r12
movq 0x8(%rcx,%r12), %rsi
subq (%rcx,%r12), %rsi
sarq $0x2, %rsi
leaq 0x60(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xd4b4
movq (%rbx), %rbx
xorl %r14d, %r14d
movq 0x8(%rbx,%r12), %rax
subq (%rbx,%r12), %rax
sarq $0x2, %rax
cmpq %r14, %rax
jbe 0x4b9e2
pushq $0x38
popq %rdi
callq 0x9340
movq %rax, %r13
addq %r12, %rbx
movq (%rbx), %rax
movslq (%rax,%r14,4), %rax
movq 0x40(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
xorps %xmm0, %xmm0
movq %r13, %rdi
xorl %edx, %edx
callq 0x38f34
movq %r13, 0x18(%rsp)
pushq $0x10
popq %rdi
callq 0x9340
movq %rax, %r15
movq %rax, %rdi
movq %r13, %rsi
callq 0x38f0c
movq %r15, (%rbp)
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2dde8
addq $0x8, %r15
movq 0x8(%rsp), %rax
movq (%rax), %rbx
movq (%rbx,%r12), %rax
movslq (%rax,%r14,4), %rax
movq 0x60(%rsp), %rcx
movl %r14d, (%rcx,%rax,4)
incq %r14
movq %r15, %rbp
jmp 0x4b947
pushq $0x1
popq %r15
xorl %ebx, %ebx
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
jbe 0x4ba32
movq (%rax,%rbx,8), %rdi
movq 0x60(%rsp), %rax
movslq (%rax,%rbx,4), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq 0x10(%rsp), %rax
leal (%r15,%rax), %edx
movq 0x8(%rsp), %rcx
callq 0x4b8bc
addl %r15d, %eax
incq %rbx
movl %eax, %r15d
jmp 0x4b9e8
leaq 0x60(%rsp), %rdi
callq 0xd85a
leaq 0x20(%rsp), %rdi
callq 0xbeac
leaq 0x40(%rsp), %rdi
callq 0xbeac
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4ba96
jmp 0x4ba89
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r15, %rdi
jmp 0x4ba7d
movq %rax, %rbx
pushq $0x38
popq %rsi
movq %r13, %rdi
callq 0x9350
jmp 0x4ba8c
movq %rax, %rbx
jmp 0x4baa0
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xd85a
leaq 0x20(%rsp), %rdi
callq 0xbeac
leaq 0x40(%rsp), %rdi
callq 0xbeac
movq %rbx, %rdi
callq 0x9640