// File: /workspace/github_cpp_makefile_star2_O3/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, -0x88(%rbp)
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
testl %edi, %edi
je 0x2c25
movslq %ebx, %r14
shlq $0x2, %r14
leaq -0x4(%r14), %rax
movq %rax, %xmm0
shrq $0x2, %rax
addq $0x4, %rax
andq $-0x4, %rax
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x2, %xmm0
xorl %ecx, %ecx
movdqa 0x4504(%rip), %xmm1     # 0x7010
movdqa 0x450c(%rip), %xmm2     # 0x7020
movdqa 0x4514(%rip), %xmm3     # 0x7030
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rcx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x2b6d
leal 0x1(%rcx), %edx
movl %edx, (%r12,%rcx,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x2b83
leal 0x2(%rcx), %edx
movl %edx, 0x4(%r12,%rcx,4)
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %edx
testb $0x1, %dl
je 0x2bbf
leal 0x3(%rcx), %edx
movl %edx, 0x8(%r12,%rcx,4)
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x2bd1
leal 0x4(%rcx), %edx
movl %edx, 0xc(%r12,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x2b24
cmpl $0x1, %ebx
je 0x2c25
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 0x2c1c
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 0x2be9
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
movl (%r12), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x2c86
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r15d, %edx
cmpl $0x63, %edx
jbe 0x2c7f
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x2c84
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x2c86
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x2c4e
addl $-0x3, %eax
jmp 0x2c86
addl $-0x2, %eax
jmp 0x2c86
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 0x3a86
pxor %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3e48
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2cd9
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 0x2d3f
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r15d, %edx
cmpl $0x63, %edx
jbe 0x2d38
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x2d3d
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x2d3f
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x2d07
addl $-0x3, %eax
jmp 0x2d3f
addl $-0x2, %eax
jmp 0x2d3f
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 0x3a86
pxor %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3e48
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d91
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 0x3e1c
movl $0x10, %edi
callq 0x2200
movq %rax, %r14
movq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x3e1c
movq %r14, 0x8(%r15)
movl $0x38, %edi
callq 0x2200
movq %rax, %r14
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
leaq 0x43f5(%rip), %rdx      # 0x71df
movq %rdx, %rsi
callq 0x3af4
leaq -0x48(%rbp), %rsi
pxor %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rdx
callq 0x3e48
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2e1e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x78(%rbp), %rsi
movq %r14, (%rsi)
pxor %xmm0, %xmm0
leaq -0x70(%rbp), %rdi
movdqa %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq -0x58(%rbp), %rdx
callq 0x3a46
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3a46
cmpl $0x3, %ebx
jl 0x3049
movq %r12, -0x80(%rbp)
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 -0x80(%rbp), %rax
movl (%rax,%r12,4), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x2ee6
movl $0x4, %eax
movl %r15d, %ecx
movl $0xd1b71759, %esi       # imm = 0xD1B71759
cmpl $0x63, %ecx
jbe 0x2edf
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2ee4
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2ee6
movl %ecx, %edx
imulq %rsi, %rdx
shrq $0x2d, %rdx
addl $0x4, %eax
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2eae
addl $-0x3, %eax
jmp 0x2ee6
addl $-0x2, %eax
jmp 0x2ee6
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 0x3a86
pxor %xmm0, %xmm0
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3e48
movq %r14, -0x58(%rbp)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2f3b
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 0x4284(%rip), %rdx      # 0x71df
movq %rdx, %rsi
callq 0x3af4
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 0x3e1c
pxor %xmm0, %xmm0
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r15, %rdx
callq 0x3e48
movq %r14, -0x50(%rbp)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2fb8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x10, %edi
callq 0x2200
movq %rax, %r14
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x3e1c
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 0x2ff5
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 0x3a46
movq -0x70(%rbp), %rax
leaq (%rax,%r13), %rdx
addq $0x8, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3a46
incq %r12
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rdi
movq %rax, 0x8(%rdi,%r13)
cmpq -0x88(%rbp), %r12
jne 0x2e66
movq -0x78(%rbp), %rbx
jmp 0x3056
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rbx
testq %rdi, %rdi
je 0x3062
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 0x3096
jmp 0x30b4
movq %rax, %rbx
movl $0x10, %esi
jmp 0x30bc
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
jmp 0x3128
jmp 0x3096
jmp 0x30b4
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x30b7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x30b7
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
jmp 0x3128
jmp 0x3115
jmp 0x30c7
jmp 0x30ea
movq %rax, %rbx
jmp 0x3106
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
callq 0x2210
jmp 0x30ed
movq %rax, %rbx
movl $0x10, %esi
jmp 0x310b
jmp 0x3115
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3106
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x38, %esi
movq %r14, %rdi
callq 0x2210
jmp 0x3118
movq %rax, %rbx
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x312d
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2370