// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %rcx, %rbx
movq %rdx, 0x48(%rsp)
movq %rsi, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq (%rdi), %r12
testq %r12, %r12
je 0x54f87
movq %rsp, %r13
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x54f72
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x54f7d
movq %r13, %rdi
movq %r12, %rdx
callq 0x30c50
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x54f57
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movslq 0x48(%rsp), %rax
movq (%rbx), %rcx
leaq (%rax,%rax,2), %r14
movq 0x8(%rcx,%r14,8), %rsi
subq (%rcx,%r14,8), %rsi
sarq $0x2, %rsi
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xf480
movq (%rbx), %rax
movq 0x8(%rax,%r14,8), %rcx
movq %r14, 0x40(%rsp)
cmpq (%rax,%r14,8), %rcx
je 0x55098
movq 0x40(%rsp), %rcx
leaq (%rax,%rcx,8), %r13
xorl %r14d, %r14d
movl $0x38, %edi
callq 0x9340
movq %rax, %r12
movq (%r13), %rax
movslq (%rax,%r14,4), %rax
movq (%rsp), %rcx
movq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
xorps %xmm0, %xmm0
movq %r12, %rdi
xorl %edx, %edx
callq 0x3c894
movq %r12, 0x18(%rsp)
movl $0x10, %edi
callq 0x9340
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
callq 0x3c868
movq %rbp, (%r15)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x5504d
movq 0x18(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x28(%rsp)
jmp 0x5505c
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x30c50
addq $0x8, %rbp
movq (%rbx), %rax
movq 0x40(%rsp), %rcx
leaq (%rax,%rcx,8), %r13
movq (%r13), %rax
movslq (%rax,%r14,4), %rax
movq 0x50(%rsp), %rcx
movl %r14d, (%rcx,%rax,4)
movq 0x8(%r13), %rax
subq (%r13), %rax
incq %r14
sarq $0x2, %rax
movq %rbp, %r15
cmpq %r14, %rax
ja 0x54fe3
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x550f5
movl $0x1, %r15d
xorl %r14d, %r14d
movq (%rax,%r14,8), %rdi
movq 0x50(%rsp), %rax
movslq (%rax,%r14,4), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq 0x48(%rsp), %rax
leal (%r15,%rax), %edx
movq %rbx, %rcx
callq 0x54f23
movl %eax, %ebp
addl %r15d, %ebp
incq %r14
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movl %ebp, %r15d
cmpq %r14, %rcx
ja 0x550ac
jmp 0x550fa
movl $0x1, %ebp
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x55111
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x55128
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5513e
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x55194
movq %rax, %rbx
jmp 0x551ab
movq %rax, %rbx
movl $0x38, %esi
movq %r12, %rdi
jmp 0x55171
movq %rax, %rbx
movl $0x10, %esi
movq %rbp, %rdi
callq 0x9350
jmp 0x5517d
jmp 0x5517a
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x55194
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x551ab
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x551c1
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq %rbx, %rdi
callq 0x9680