// File: /workspace/github_cpp_makefile_star2_O1/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, 0x20(%rsp)
movq %rdx, 0x48(%rsp)
movq %rsi, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq (%rdi), %r12
testq %r12, %r12
je 0x55504
movq %rsp, %r13
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x554ef
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x554fa
movq %r13, %rdi
movq %r12, %rdx
callq 0x3177a
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x554d4
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movslq 0x48(%rsp), %r14
movq 0x20(%rsp), %r12
movq (%r12), %rax
leaq (%r14,%r14,2), %rbx
movq 0x8(%rax,%rbx,8), %rsi
subq (%rax,%rbx,8), %rsi
sarq $0x2, %rsi
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0xf540
movq (%r12), %rax
movq 0x8(%rax,%rbx,8), %rcx
cmpq (%rax,%rbx,8), %rcx
je 0x5561d
leaq (%rax,%rbx,8), %rbx
xorl %r13d, %r13d
shlq $0x3, %r14
leaq (%r14,%r14,2), %r14
movl $0x38, %edi
callq 0x9330
movq %rax, %r12
movq (%rbx), %rax
movslq (%rax,%r13,4), %rax
movq (%rsp), %rcx
movq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
xorps %xmm0, %xmm0
movq %r12, %rdi
xorl %edx, %edx
callq 0x3d18e
movq %r12, 0x28(%rsp)
movl $0x10, %edi
callq 0x9330
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
callq 0x3d160
movq %rbp, (%r15)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x555ce
movq 0x28(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x38(%rsp)
jmp 0x555dd
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x3177a
addq $0x8, %rbp
movq 0x20(%rsp), %rdx
movq (%rdx), %rax
movq (%rax,%r14), %rax
movslq (%rax,%r13,4), %rax
movq 0x50(%rsp), %rcx
movl %r13d, (%rcx,%rax,4)
incq %r13
movq (%rdx), %rax
movq 0x8(%rax,%r14), %rcx
subq (%rax,%r14), %rcx
leaq (%rax,%r14), %rbx
sarq $0x2, %rcx
movq %rbp, %r15
cmpq %r13, %rcx
ja 0x55565
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x5567b
movl $0x1, %ebx
xorl %r14d, %r14d
movq 0x20(%rsp), %r15
movq (%rax,%r14,8), %rdi
movq 0x50(%rsp), %rax
movslq (%rax,%r14,4), %rax
movq 0x30(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq 0x48(%rsp), %rax
leal (%rbx,%rax), %edx
movq %r15, %rcx
callq 0x5549e
movl %eax, %ebp
addl %ebx, %ebp
incq %r14
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movl %ebp, %ebx
cmpq %r14, %rcx
ja 0x55635
jmp 0x55680
movl $0x1, %ebp
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x55697
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x556ae
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x556c4
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5571a
movq %rax, %rbx
jmp 0x55731
movq %rax, %rbx
movl $0x38, %esi
movq %r12, %rdi
jmp 0x556f7
movq %rax, %rbx
movl $0x10, %esi
movq %rbp, %rdi
callq 0x9340
jmp 0x55703
jmp 0x55700
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5571a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x55731
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x55747
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9670