// File: /workspace/github_cpp_makefile_star2_O3/micahcc[P]polygon_skeleton/voronoi.cpp
// Function: Voronoi::Voronoi(std::vector<Vector, std::allocator<Vector>> const&)
Voronoi::Voronoi(const std::vector<Point>& points)
{
    using std::unordered_map;
    using std::tuple;
    using std::make_tuple;

    Implementation impl;
    impl.compute(points);

    std::cerr << "Done with computation" << std::endl;
    m_nodes.clear();
    m_nodes.reserve(impl.m_nodes.size());
    for(const auto& tup_node: impl.m_nodes) {
        assert(tup_node.second != nullptr);
        m_nodes.push_back(tup_node.second);
        std::cerr << m_nodes.back()->x << ", " << m_nodes.back()->y << std::endl;
    }
    m_edges = impl.m_edges;

    // add edge's neighbors by copying the neighbors of
    for(Edge::Ptr edge : m_edges) {
        std::cerr << edge->nodes[0]->x << ", " << edge->nodes[0]->y << " -- "
            << edge->nodes[1]->x << ", " << edge->nodes[1]->y << std::endl;
        for(const auto& neighbor : edge->nodes[0]->edges) {
            if(neighbor != edge)
                edge->neighbors.insert(neighbor);
        }
        for(const auto& neighbor : edge->nodes[1]->edges) {
            if(neighbor != edge)
                edge->neighbors.insert(neighbor);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %r13
leaq 0x18(%rdi), %rax
movq %rax, -0x38(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq -0x130(%rbp), %rdi
movq %rdi, 0x8(%rdi)
movq %rdi, 0x10(%rdi)
leaq -0x118(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0xe8(%rbp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movabsq $0x7ff0000000000000, %rdx # imm = 0x7FF0000000000000
movq %rdx, 0x28(%rax)
movabsq $-0x10000000000000, %r8 # imm = 0xFFF0000000000000
movq %r8, 0x30(%rax)
movq %rdx, 0x38(%rax)
movq %r8, 0x40(%rax)
leaq -0x70(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movq %rcx, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movups %xmm0, -0x8(%rax)
callq 0x9214
movq 0x9f6d(%rip), %r14      # 0x13ff0
leaq 0x5a46(%rip), %rsi      # 0xfad0
movl $0x15, %edx
movq %r14, %rdi
callq 0x3270
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq 0x9f3b(%rip), %rdi      # 0x13ff0
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0xb2e8
movq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0xb32a
movq -0x90(%rbp), %rbx
testq %rbx, %rbx
je 0xa18b
movq 0x9efc(%rip), %r15      # 0x13ff0
leaq 0x4f40(%rip), %r12      # 0xf03b
cmpq $0x0, 0x20(%rbx)
je 0xa36f
leaq 0x20(%rbx), %rsi
movq -0x38(%rbp), %rdi
callq 0xb3ea
movq 0x20(%r13), %rax
movq -0x10(%rax), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %r15, %rdi
callq 0x3320
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3270
movq 0x20(%r13), %rax
movq -0x10(%rax), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0xa0fb
leaq -0x68(%rbp), %rsi
movq %r13, %rdi
callq 0xb438
movq (%r13), %r15
movq 0x8(%r13), %rax
movq %rax, -0x48(%rbp)
cmpq %rax, %r15
je 0xa32a
movq %r13, -0x30(%rbp)
movq (%r15), %rbx
movq 0x8(%r15), %r12
testq %r12, %r12
je 0xa1d5
movq 0x9e0d(%rip), %rax      # 0x13fd0
cmpb $0x0, (%rax)
je 0xa1cf
incl 0x8(%r12)
jmp 0xa1d5
lock
incl 0x8(%r12)
movq 0x30(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq 0x9e09(%rip), %rdi      # 0x13ff0
callq 0x3320
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x4e3d(%rip), %rsi      # 0xf03b
callq 0x3270
movq 0x30(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movl $0x4, %edx
movq %rax, %rdi
leaq 0x5345(%rip), %rsi      # 0xf56e
callq 0x3270
movq 0x40(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x4de8(%rip), %rsi      # 0xf03b
callq 0x3270
movq 0x40(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq %r12, -0x40(%rbp)
movq 0x30(%rbx), %r12
movq 0x50(%r12), %r13
addq $0x40, %r12
cmpq %r12, %r13
je 0xa2d2
leaq 0x50(%rbx), %r14
cmpq %rbx, 0x20(%r13)
je 0xa2c2
leaq 0x20(%r13), %rsi
movq %r14, %rdi
callq 0xe688
movq %r13, %rdi
callq 0x3280
movq %rax, %r13
cmpq %r12, %rax
jne 0xa2b0
movq 0x40(%rbx), %r12
movq 0x50(%r12), %r13
addq $0x40, %r12
cmpq %r12, %r13
je 0xa30a
leaq 0x50(%rbx), %r14
cmpq %rbx, 0x20(%r13)
je 0xa2fa
leaq 0x20(%r13), %rsi
movq %r14, %rdi
callq 0xe688
movq %r13, %rdi
callq 0x3280
movq %rax, %r13
cmpq %r12, %rax
jne 0xa2e8
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0xa318
callq 0x4f9a
addq $0x10, %r15
cmpq -0x48(%rbp), %r15
movq -0x30(%rbp), %r13
jne 0xa1b0
leaq -0x120(%rbp), %rbx
leaq -0xa0(%rbp), %r14
leaq -0x68(%rbp), %rdi
callq 0x3c6e
movq %r14, %rdi
callq 0xbb44
leaq -0xf0(%rbp), %rdi
callq 0xbbe0
movq %rbx, %rdi
callq 0xbc38
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x53d1(%rip), %rdi      # 0xf747
leaq 0x4f7d(%rip), %rsi      # 0xf2fa
leaq 0x5762(%rip), %rcx      # 0xfae6
movl $0x445, %edx            # imm = 0x445
callq 0x3140
jmp 0xa390
movq %rax, %r15
jmp 0xa3b4
movq %rax, %r15
jmp 0xa3a7
jmp 0xa39c
movq %rax, %r15
movq -0x30(%rbp), %r13
movq -0x40(%rbp), %r12
testq %r12, %r12
je 0xa3b4
movq %r12, %rdi
callq 0x4f9a
leaq -0x130(%rbp), %rdi
callq 0xb60e
movq -0x38(%rbp), %rdi
callq 0x633e
movq %r13, %rdi
callq 0x3c6e
movq %r15, %rdi
callq 0x3380