// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
leaq 0x18(%rdi), %rax
movq %rax, -0x40(%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
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0xe8(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
movq %rcx, 0x28(%rax)
movabsq $-0x10000000000000, %rdx # imm = 0xFFF0000000000000
movq %rdx, 0x30(%rax)
movq %rcx, 0x38(%rax)
movq %rdx, 0x40(%rax)
leaq -0x70(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, 0x8(%rax)
movups %xmm0, -0x8(%rax)
andq $0x0, 0x18(%rax)
callq 0x7b74
movq 0xbac8(%rip), %rdi      # 0x13ff0
leaq 0x55b1(%rip), %rsi      # 0xdae0
callq 0x31f0
movq %rax, %rdi
callq 0x30d0
movq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x94a2
movq -0x88(%rbp), %rsi
movq %r14, %rdi
callq 0x94b0
movq -0x90(%rbp), %r14
movq 0xba8b(%rip), %r15      # 0x13ff0
leaq 0x4b1b(%rip), %r12      # 0xd087
testq %r14, %r14
je 0x85ca
cmpq $0x0, 0x20(%r14)
je 0x8723
leaq 0x20(%r14), %rsi
movq -0x40(%rbp), %rdi
callq 0x953c
movq 0x20(%rbx), %rax
movq -0x10(%rax), %rax
movss (%rax), %xmm0
movq %r15, %rdi
callq 0x3170
movq %rax, %rdi
movq %r12, %rsi
callq 0x31f0
movq 0x20(%rbx), %rcx
movq -0x10(%rcx), %rcx
movss 0x4(%rcx), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
callq 0x30d0
movq (%r14), %r14
jmp 0x856c
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x9578
movq (%rbx), %r12
movq 0x8(%rbx), %rax
movq %rax, -0x48(%rbp)
leaq 0x4a9f(%rip), %r14      # 0xd087
cmpq -0x48(%rbp), %r12
je 0x8705
leaq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x4ac0
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movss (%rax), %xmm0
movq 0xb9df(%rip), %rdi      # 0x13ff0
callq 0x3170
movq %rax, %rdi
movq %r14, %rsi
callq 0x31f0
movq -0x38(%rbp), %rcx
movq 0x30(%rcx), %rcx
movss 0x4(%rcx), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0x4f3e(%rip), %rsi      # 0xd57e
callq 0x31f0
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rcx
movss (%rcx), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
movq %r14, %rsi
callq 0x31f0
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rcx
movss 0x4(%rcx), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
callq 0x30d0
movq -0x38(%rbp), %rax
movq 0x30(%rax), %r13
movq 0x50(%r13), %r15
addq $0x40, %r13
cmpq %r13, %r15
je 0x86ba
movq -0x38(%rbp), %rdi
cmpq %rdi, 0x20(%r15)
je 0x86ad
leaq 0x20(%r15), %rsi
addq $0x50, %rdi
callq 0xc7c4
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
jmp 0x8691
movq -0x38(%rbp), %rax
movq 0x40(%rax), %r13
movq 0x50(%r13), %r15
addq $0x40, %r13
cmpq %r13, %r15
je 0x86f3
movq -0x38(%rbp), %rdi
cmpq %rdi, 0x20(%r15)
je 0x86e6
leaq 0x20(%r15), %rsi
addq $0x50, %rdi
callq 0xc7c4
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
jmp 0x86ca
leaq -0x30(%rbp), %rdi
callq 0x4b24
addq $0x10, %r12
jmp 0x85e8
leaq -0x130(%rbp), %rdi
callq 0x9642
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x502d(%rip), %rdi      # 0xd757
leaq 0x4bd9(%rip), %rsi      # 0xd30a
leaq 0x53be(%rip), %rcx      # 0xdaf6
movl $0x445, %edx            # imm = 0x445
callq 0x3130
jmp 0x8744
movq %rax, %r15
jmp 0x8759
jmp 0x874d
jmp 0x874d
movq %rax, %r15
leaq -0x30(%rbp), %rdi
callq 0x4b24
leaq -0x130(%rbp), %rdi
callq 0x9642
movq -0x40(%rbp), %rdi
callq 0x588e
movq %rbx, %rdi
callq 0x3c5a
movq %r15, %rdi
callq 0x3360