// File: /workspace/github_cpp_makefile_star2_O1/canzarlab[P]Trajan/src/generator.cpp
// Function: uniform(int)
newick_node* uniform(int n)
{
    unsigned random[n], size = 2;
    iota(random, random + n, 1);
    random_shuffle(random, random + n);

    newick_node* leaf1 = new newick_node(to_string(random[0]));
    newick_node* leaf2 = new newick_node(to_string(random[1]));
    newick_child* child = new newick_child(leaf1);
    child->next = new newick_child(leaf2);

    newick_node* root = new newick_node("", 0, child);
    vector<pair<newick_node*, newick_node*>> E;
    E.emplace_back(root, leaf1);
    E.emplace_back(root, leaf2);

    for (int k = 0; k < n - 2; k++)
    {
        int i = rand() % E.size();
        leaf1 = new newick_node(to_string(random[size++]));
        leaf2 = new newick_node("", 0, new newick_child(E[i].second));
        leaf2->child->next = new newick_child(leaf1);

        newick_child* pchild = E[i].first->child;
        if (pchild->node == E[i].second)
            pchild->node = leaf2;
        else
            pchild->next->node = leaf2;

        E.emplace_back(leaf2, leaf1);
        E.emplace_back(leaf2, E[i].second);
        E[i].second = leaf2;
    }
    return root;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %ebx
movl %edi, %eax
movq %rsp, %r12
movq %rax, -0x80(%rbp)
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
testl %edi, %edi
je 0x2a3b
movslq %ebx, %r14
shlq $0x2, %r14
movl $0x1, %eax
xorl %ecx, %ecx
movl %eax, (%r12,%rcx)
incl %eax
addq $0x4, %rcx
cmpq %rcx, %r14
jne 0x29e5
cmpl $0x1, %ebx
je 0x2a3b
movl $0x4, %r15d
callq 0x2090
cltq
movq %r15, %rcx
sarq $0x2, %rcx
incq %rcx
cqto
idivq %rcx
leaq (,%rdx,4), %rax
cmpq %rax, %r15
je 0x2a32
leaq (%r12,%r15), %rax
leaq (%r12,%rdx,4), %rcx
movl (%rax), %edx
movl (%rcx), %esi
movl %esi, (%rax)
movl %edx, (%rcx)
addq $0x4, %r15
cmpq %r15, %r14
jne 0x29ff
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
movl (%r12), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x2a9c
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r15d, %edx
cmpl $0x63, %edx
jbe 0x2a95
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x2a9a
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x2a9c
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x2a64
addl $-0x3, %eax
jmp 0x2a9c
addl $-0x2, %eax
jmp 0x2a9c
decl %eax
movl %eax, %esi
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x2260
leaq -0x48(%rbp), %r13
movq (%r13), %rdi
movl 0x8(%r13), %esi
movl %r15d, %edx
callq 0x3895
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3c52
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2aee
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r14, -0x58(%rbp)
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
movl 0x4(%r12), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x2b54
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r15d, %edx
cmpl $0x63, %edx
jbe 0x2b4d
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x2b52
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x2b54
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x2b1c
addl $-0x3, %eax
jmp 0x2b54
addl $-0x2, %eax
jmp 0x2b54
decl %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
xorl %edx, %edx
callq 0x2260
leaq -0x48(%rbp), %r13
movq (%r13), %rdi
movl 0x8(%r13), %esi
movl %r15d, %edx
callq 0x3895
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3c52
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2ba5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r14, -0x50(%rbp)
movl $0x10, %edi
callq 0x2200
movq %rax, %r15
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x3c24
movl $0x10, %edi
callq 0x2200
movq %rax, %r14
movq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x3c24
movq %r14, 0x8(%r15)
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
leaq 0x35b1(%rip), %rdx      # 0x61af
movq %rdx, %rsi
callq 0x3902
leaq -0x48(%rbp), %rsi
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rdx
callq 0x3c52
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2c31
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r12, -0x88(%rbp)
leaq -0x78(%rbp), %rsi
movq %r14, (%rsi)
xorps %xmm0, %xmm0
leaq -0x70(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq -0x58(%rbp), %rdx
callq 0x3858
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3858
cmpl $0x3, %ebx
jl 0x2e55
movl $0x2, %r12d
callq 0x2090
cltq
movq -0x68(%rbp), %rcx
subq -0x70(%rbp), %rcx
sarq $0x4, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r13
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
movq -0x88(%rbp), %rax
movl (%rax,%r12,4), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x2cfd
movl $0x4, %eax
movl %r15d, %ecx
movl $0xd1b71759, %esi       # imm = 0xD1B71759
cmpl $0x63, %ecx
jbe 0x2cf6
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2cfb
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2cfd
movl %ecx, %edx
imulq %rsi, %rdx
shrq $0x2d, %rdx
addl $0x4, %eax
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2cc5
addl $-0x3, %eax
jmp 0x2cfd
addl $-0x2, %eax
jmp 0x2cfd
decl %eax
movl %eax, %esi
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2260
movq -0x48(%rbp), %rdi
movl -0x40(%rbp), %esi
movl %r15d, %edx
callq 0x3895
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3c52
movq %r14, -0x58(%rbp)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d51
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
leaq 0x343e(%rip), %rdx      # 0x61af
movq %rdx, %rsi
callq 0x3902
movl $0x10, %edi
callq 0x2200
movq %rax, %r15
movslq %r13d, %r13
movq -0x70(%rbp), %rax
shlq $0x4, %r13
movq 0x8(%rax,%r13), %rsi
movq %r15, %rdi
callq 0x3c24
xorps %xmm0, %xmm0
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r15, %rdx
callq 0x3c52
movq %r14, -0x50(%rbp)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2dcd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x10, %edi
callq 0x2200
movq %rax, %r14
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x3c24
movq -0x50(%rbp), %rax
movq (%rax), %rcx
movq %r14, 0x8(%rcx)
movq -0x70(%rbp), %rdx
movq (%rdx,%r13), %rcx
movq (%rcx), %rcx
movq (%rcx), %rsi
cmpq 0x8(%rdx,%r13), %rsi
je 0x2e0a
movq 0x8(%rcx), %rcx
leaq -0x70(%rbp), %rbx
leaq -0x50(%rbp), %r14
movq %rax, (%rcx)
movq %rbx, %rdi
movq %r14, %rsi
leaq -0x58(%rbp), %rdx
callq 0x3858
movq -0x70(%rbp), %rax
leaq (%rax,%r13), %rdx
addq $0x8, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3858
incq %r12
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rax, 0x8(%rcx,%r13)
cmpq -0x80(%rbp), %r12
jne 0x2c7a
movq -0x78(%rbp), %rbx
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x2e6e
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ea2
jmp 0x2ec0
movq %rax, %rbx
movl $0x10, %esi
jmp 0x2ec8
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
jmp 0x2f34
jmp 0x2ea2
jmp 0x2ec0
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2ec3
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x2ec3
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
jmp 0x2f34
jmp 0x2f21
jmp 0x2ed3
jmp 0x2ef6
movq %rax, %rbx
jmp 0x2f12
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
callq 0x2210
jmp 0x2ef9
movq %rax, %rbx
movl $0x10, %esi
jmp 0x2f17
jmp 0x2f21
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2f12
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x38, %esi
movq %r14, %rdi
callq 0x2210
jmp 0x2f24
movq %rax, %rbx
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x2f39
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2370