// File: /workspace/github_cpp_makefile_star2_O2/micahcc[P]polygon_skeleton/test.cpp
// Function: main
int main()
{
    const size_t POINT_RADIUS = 5;
    std::vector<Point> points{
        {460, 430},
        {490, 450},
        {450, 410},
//        {100, 300},
        {500, 420},
    };

    Voronoi graph(points);
    //auto vpoints = result.getPoints();

    //result.getLines();
    svg::Dimensions dimensions(1200, 1200);
    svg::Document doc("my_svg.svg", svg::Layout(dimensions, svg::Layout::BottomLeft));

    for(const auto& pt: points) {
        std::cerr << "(" << pt.x << ", " << pt.y << ")" << std::endl;
        doc << svg::Circle(svg::Point(pt.x, pt.y), 5, svg::Fill(svg::Color::Black));
    }

    // Condensed notation, parenthesis isolate temporaries that are inserted into parents.
    //doc << svg::LineChart(svg::Dimensions(1000, 1000));
    for(const auto& edge: graph.getEdges()) {
        const auto& pt0 = *edge->nodes[0];
        const auto& pt1 = *edge->nodes[1];
        std::cerr << "(" << pt0.x << ", " << pt0.y << ")"
            << " -- (" << pt1.x << ", " << pt1.y << ")" << std::endl;
        doc << svg::Line(
                svg::Point(pt0.x, pt0.y),
                svg::Point(pt1.x, pt1.y),
                svg::Stroke(2, svg::Color::Black));
    }

    doc.save();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movaps 0x9ae9(%rip), %xmm0     # 0xd010
leaq -0x1d0(%rbp), %rsi
movups %xmm0, (%rsi)
movaps 0x9ae8(%rip), %xmm0     # 0xd020
movups %xmm0, 0x10(%rsi)
leaq -0x88(%rbp), %rbx
pushq $0x4
popq %rdx
leaq -0x158(%rbp), %rcx
movq %rbx, %rdi
callq 0x39ea
leaq -0xe8(%rbp), %rdi
movq %rbx, %rsi
callq 0x845c
leaq 0x9b11(%rip), %rsi      # 0xd07c
leaq -0x1d0(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x3090
leaq -0x158(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x3270
movabsq $0x4092c00000000000, %rax # imm = 0x4092C00000000000
leaq -0xf8(%rbp), %rcx
movq %rax, -0x40(%rcx)
movq %rax, -0x38(%rcx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x30(%rcx)
movl $0x1, -0x28(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rcx)
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq -0x1d0(%rbp), %rbx
movq %rbx, %rdi
callq 0x30c0
movq -0x88(%rbp), %r12
movq -0x80(%rbp), %r15
leaq -0x54(%rbp), %r13
leaq -0xb8(%rbp), %r14
cmpq %r15, %r12
je 0x36da
movq 0x109ec(%rip), %rdi     # 0x13ff0
leaq 0xa3a8(%rip), %rsi      # 0xd9b3
callq 0x31f0
movss (%r12), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0x9a5f(%rip), %rsi      # 0xd087
callq 0x31f0
movss 0x4(%r12), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0xa3af(%rip), %rsi      # 0xd9f5
callq 0x31f0
movq %rax, %rdi
callq 0x30d0
cvtss2sd (%r12), %xmm0
cvtss2sd 0x4(%r12), %xmm1
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x3a74
leaq 0x1047c(%rip), %rax     # 0x13af8
movq %rax, -0x70(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x68(%rbp)
leaq 0x10423(%rip), %rax     # 0x13ab8
movq %rax, -0x60(%rbp)
movb $0x1, -0x58(%rbp)
andq $0x0, 0x5(%r13)
andq $0x0, (%r13)
movq %rbx, %rdi
leaq -0x38(%rbp), %rsi
movsd 0x997a(%rip), %xmm0     # 0xd030
movq %r14, %rdx
leaq -0x70(%rbp), %rcx
callq 0x3b88
leaq -0x158(%rbp), %rdi
movq %rbx, %rsi
callq 0x3a20
addq $0x8, %r12
jmp 0x35f4
leaq -0xb8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x49a8
movq -0xb8(%rbp), %r14
movq -0xb0(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x1d0(%rbp), %r15
cmpq -0x40(%rbp), %r14
je 0x3848
movq (%r14), %rax
movq 0x30(%rax), %rbx
movq 0x40(%rax), %r12
movq 0x108ce(%rip), %rdi     # 0x13ff0
leaq 0xa28a(%rip), %rsi      # 0xd9b3
callq 0x31f0
movss (%rbx), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0x9943(%rip), %rsi      # 0xd087
callq 0x31f0
movss 0x4(%rbx), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0xa295(%rip), %rsi      # 0xd9f5
callq 0x31f0
movq %rax, %rdi
leaq 0x991b(%rip), %rsi      # 0xd08a
callq 0x31f0
movss (%r12), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0x98fb(%rip), %rsi      # 0xd087
callq 0x31f0
movss 0x4(%r12), %xmm0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
leaq 0xa24b(%rip), %rsi      # 0xd9f5
callq 0x31f0
movq %rax, %rdi
callq 0x30d0
cvtss2sd (%rbx), %xmm0
cvtss2sd 0x4(%rbx), %xmm1
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
cvtss2sd (%r12), %xmm0
cvtss2sd 0x4(%r12), %xmm1
movsd %xmm0, -0x98(%rbp)
leaq 0x10312(%rip), %rax     # 0x13af8
movq %rax, -0x70(%rbp)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, -0x68(%rbp)
leaq 0x102b9(%rip), %rax     # 0x13ab8
movq %rax, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
andq $0x0, 0x5(%r13)
movsd %xmm1, -0x90(%rbp)
andq $0x0, (%r13)
movq %r15, %rdi
leaq -0x38(%rbp), %rsi
leaq -0x98(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0x3bea
leaq -0x158(%rbp), %rdi
movq %r15, %rsi
callq 0x3a20
addq $0x10, %r14
jmp 0x3706
leaq -0xb8(%rbp), %rdi
callq 0x3c5a
leaq -0x158(%rbp), %rdi
callq 0x3c86
leaq -0x158(%rbp), %rdi
callq 0x3d38
leaq -0xe8(%rbp), %rdi
callq 0x3d58
leaq -0x88(%rbp), %rdi
callq 0x5954
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x38c1
jmp 0x38c1
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
jmp 0x38e1
movq %rax, %rbx
jmp 0x38e1
movq %rax, %rbx
jmp 0x38ed
jmp 0x38c6
jmp 0x38c6
jmp 0x38c1
jmp 0x38c1
jmp 0x38c1
movq %rax, %rbx
jmp 0x38d5
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3c5a
leaq -0x158(%rbp), %rdi
callq 0x3d38
leaq -0xe8(%rbp), %rdi
callq 0x3d58
leaq -0x88(%rbp), %rdi
callq 0x5954
movq %rbx, %rdi
callq 0x3360