// File: 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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x99590
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xfb0b5
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x99890
jmp 0xfb094
jmp 0xfb096
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0xfb07e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xfb3ef
leaq -0x68(%rbp), %rdi
callq 0x99590
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
callq 0x1be50
movq %rax, -0xb0(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x14c70
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x14c90
jmp 0xfb111
leaq -0x89(%rbp), %rdi
callq 0x14d00
movl $0x0, -0x90(%rbp)
movslq -0x90(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
callq 0x1be50
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0xfb2de
movl $0x38, %edi
callq 0xa450
movq %rax, -0xc0(%rbp)
jmp 0xfb170
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movslq -0x90(%rbp), %rsi
callq 0x145d0
movslq (%rax), %rsi
leaq -0x38(%rbp), %rdi
callq 0xa19e0
movq -0xc0(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
xorl %eax, %eax
movl %eax, %edx
xorps %xmm0, %xmm0
callq 0xc5fe0
jmp 0xfb1b4
movq -0xc0(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x10, %edi
callq 0xa450
movq %rax, -0xc8(%rbp)
jmp 0xfb1d5
movq -0xc8(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xc5f70
jmp 0xfb1ea
movq -0xc8(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rax
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x99890
jmp 0xfb219
movl -0x90(%rbp), %eax
movl %eax, -0xcc(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movslq -0x90(%rbp), %rsi
callq 0x145d0
movslq (%rax), %rsi
leaq -0x88(%rbp), %rdi
callq 0x145d0
movl -0xcc(%rbp), %ecx
movl %ecx, (%rax)
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0xfb127
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x14d00
jmp 0xfb3e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xfb3da
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl $0x38, %esi
callq 0xa460
jmp 0xfb3da
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl $0x10, %esi
callq 0xa460
jmp 0xfb3da
movl $0x1, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movslq -0xa0(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9f690
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0xfb3a1
movslq -0xa0(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xa19e0
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
movslq -0xa0(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x145d0
movslq (%rax), %rsi
leaq -0x68(%rbp), %rdi
callq 0xa19e0
movq -0xe8(%rbp), %rdi
movq (%rax), %rsi
movl -0x14(%rbp), %edx
movl -0x9c(%rbp), %eax
addl %eax, %edx
movq -0x20(%rbp), %rcx
callq 0xfb050
movl %eax, -0xdc(%rbp)
jmp 0xfb37b
movl -0xdc(%rbp), %eax
addl -0x9c(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0xfb2f2
movl -0x9c(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x14b50
leaq -0x68(%rbp), %rdi
callq 0xffe0
leaq -0x38(%rbp), %rdi
callq 0xffe0
movl -0xec(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0x14b50
leaq -0x68(%rbp), %rdi
callq 0xffe0
leaq -0x38(%rbp), %rdi
callq 0xffe0
movq -0x48(%rbp), %rdi
callq 0xa7c0
nopw %cs:(%rax,%rax)