// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/generator.cpp
// Function: yule(int)
newick_node* yule(int n)
{
    newick_node* root = new newick_node;
    vector<newick_node*> L;
    L.push_back(root);
    while (L.size() < n)
    {
        newick_node* leaf1 = new newick_node;
        newick_node* leaf2 = new newick_node;
        newick_child* child = new newick_child(leaf1);
        child->next = new newick_child(leaf2);
        int i = rand() % L.size();
        L[i]->child = child;
        L[i] = leaf1;
        L.push_back(leaf2);
    }

    unsigned random[n];
    iota(random, random + n, 1);
    random_shuffle(random, random + n);
    for (int i = 0; i < L.size(); ++i)
        L[i]->taxon = to_string(random[i]);

    return root;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %r14d
pushq $0x38
popq %rdi
callq 0x21e0
movq %rax, %rbx
leaq 0x3cbd(%rip), %rsi      # 0x61af
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x2e2e
leaq -0x80(%rbp), %rsi
xorps %xmm0, %xmm0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3568
leaq -0x80(%rbp), %rdi
callq 0x20e0
leaq -0x88(%rbp), %rsi
movq %rbx, (%rsi)
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x2e6a
movslq %r14d, %r12
pushq $0x38
popq %r14
leaq -0x80(%rbp), %r13
movq %r12, -0x60(%rbp)
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
sarq $0x3, %rax
cmpq %r12, %rax
jae 0x2647
movq %r14, %rdi
callq 0x21e0
movq %rax, %rbx
movq %r13, %rdi
leaq 0x3c3f(%rip), %rsi      # 0x61af
leaq -0x58(%rbp), %rdx
callq 0x2e2e
xorps %xmm0, %xmm0
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3568
movq %r13, %rdi
callq 0x20e0
movq %r13, %r12
movq %r14, %r15
movq %r14, %rdi
callq 0x21e0
movq %rax, %r14
movq %r12, %rdi
leaq 0x3c03(%rip), %rsi      # 0x61af
leaq -0x29(%rbp), %rdx
callq 0x2e2e
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3568
movq %r12, %r13
movq %r12, %rdi
callq 0x20e0
movq %r14, -0x58(%rbp)
pushq $0x10
popq %rdi
callq 0x21e0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3540
pushq $0x10
popq %rdi
callq 0x21e0
movq %rax, %r12
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x3540
movq %r12, 0x8(%r14)
callq 0x2080
cltq
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
xorl %edx, %edx
divq %rsi
movslq %edx, %rax
movq (%rcx,%rax,8), %rdx
movq %r14, (%rdx)
movq %rbx, (%rcx,%rax,8)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2e6a
movq %r15, %r14
movq -0x60(%rbp), %r12
jmp 0x2546
movq %rsp, %r15
movl %r12d, %eax
movq %rsp, %rbx
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
leaq (%rbx,%r12,4), %rsi
shlq $0x2, %r12
pushq $0x1
popq %rax
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x267f
movl %eax, (%rbx,%rcx)
incl %eax
addq $0x4, %rcx
jmp 0x266f
movq %rbx, %rdi
callq 0x2e87
xorl %r12d, %r12d
leaq -0x80(%rbp), %r14
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
sarq $0x3, %rax
cmpq %r12, %rax
jbe 0x26cc
movl (%rbx,%r12,4), %esi
movq %r14, %rdi
callq 0x2ee4
movq -0x50(%rbp), %rax
movq (%rax,%r12,8), %rdi
addq $0x8, %rdi
movq %r14, %rsi
callq 0x2240
movq %r14, %rdi
callq 0x20e0
incq %r12
jmp 0x268e
movq -0x88(%rbp), %rbx
movq %r15, %rsp
leaq -0x50(%rbp), %rdi
callq 0x323e
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0x80(%rbp), %rdi
callq 0x20e0
jmp 0x2702
movq %rax, %r15
pushq $0x38
popq %rsi
movq %rbx, %rdi
callq 0x21f0
jmp 0x276e
jmp 0x2762
jmp 0x2762
movq %rax, %r15
leaq -0x80(%rbp), %rdi
callq 0x20e0
jmp 0x274a
jmp 0x2762
movq %rax, %r15
jmp 0x2734
movq %rax, %r15
leaq -0x80(%rbp), %rdi
callq 0x20e0
pushq $0x38
jmp 0x2757
jmp 0x2762
jmp 0x2762
movq %rax, %r15
pushq $0x10
popq %rsi
movq %r12, %rdi
jmp 0x275b
movq %rax, %r15
pushq $0x38
popq %rsi
movq %rbx, %rdi
jmp 0x275b
movq %rax, %r15
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x21f0
jmp 0x2765
movq %rax, %r15
leaq -0x50(%rbp), %rdi
callq 0x323e
movq %r15, %rdi
callq 0x2330