// File: /workspace/github_cpp_makefile_star2_O3/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 $0x158, %rsp            # imm = 0x158
movaps 0xba39(%rip), %xmm0     # 0xf010
leaq -0xa0(%rbp), %rsi
movups %xmm0, (%rsi)
movaps 0xba38(%rip), %xmm0     # 0xf020
movups %xmm0, 0x10(%rsi)
leaq -0xd8(%rbp), %rbx
leaq -0x178(%rbp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x3bae
leaq -0x108(%rbp), %rdi
movq %rbx, %rsi
callq 0x9fbc
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xba08(%rip), %rsi      # 0xf030
leaq 0xba0b(%rip), %rdx      # 0xf03a
leaq -0xa0(%rbp), %rdi
callq 0x6394
leaq -0x168(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0x178(%rbp), %rdi
callq 0x3dee
movabsq $0x4092c00000000000, %rax # imm = 0x4092C00000000000
leaq -0x118(%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)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x36b8
callq 0x3210
movq -0xd8(%rbp), %r12
movq -0xd0(%rbp), %r13
cmpq %r13, %r12
je 0x3818
leaq 0x103da(%rip), %r14     # 0x13ab0
xorl %ebx, %ebx
movl $0x1, %edx
movq 0x1090c(%rip), %rdi     # 0x13ff0
leaq 0xc2b8(%rip), %rsi      # 0xf9a3
callq 0x3270
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
movq 0x108f0(%rip), %rdi     # 0x13ff0
callq 0x3320
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb924(%rip), %rsi      # 0xf03b
callq 0x3270
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r12), %xmm0
movq %r15, %rdi
callq 0x3320
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc2a5(%rip), %rsi      # 0xf9e5
callq 0x3270
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
cvtss2sd 0x4(%r12), %xmm1
leaq 0x102dd(%rip), %rax     # 0x13a60
movq %rax, -0x98(%rbp)
movq %r14, -0x90(%rbp)
movb $0x0, -0x88(%rbp)
movq %rbx, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
leaq 0x10343(%rip), %rax     # 0x13af0
movq %rax, -0x78(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x70(%rbp)
movq %r14, -0x68(%rbp)
movb $0x1, -0x60(%rbp)
leaq -0x5c(%rbp), %rax
movq %rbx, 0x5(%rax)
movq %rbx, (%rax)
leaq 0x10357(%rip), %rax     # 0x13b30
movq %rax, -0xa0(%rbp)
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movabsq $0x4004000000000000, %rax # imm = 0x4004000000000000
movq %rax, -0x38(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3bec
addq $0x8, %r12
cmpq %r13, %r12
jne 0x36d8
leaq -0xc0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4ed4
movq -0xc0(%rbp), %r13
movq -0xb8(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpq %rax, %r13
je 0x3a05
xorl %r12d, %r12d
movq (%r13), %rax
movq 0x30(%rax), %rbx
movq 0x40(%rax), %r15
movl $0x1, %edx
movq 0x1078c(%rip), %rdi     # 0x13ff0
leaq 0xc138(%rip), %rsi      # 0xf9a3
callq 0x3270
xorps %xmm0, %xmm0
cvtss2sd (%rbx), %xmm0
movq 0x10772(%rip), %rdi     # 0x13ff0
callq 0x3320
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb7a6(%rip), %rsi      # 0xf03b
callq 0x3270
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rbx), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc129(%rip), %rsi      # 0xf9e5
callq 0x3270
movl $0x5, %edx
movq %r14, %rdi
leaq 0xb76e(%rip), %rsi      # 0xf03e
callq 0x3270
xorps %xmm0, %xmm0
cvtss2sd (%r15), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb744(%rip), %rsi      # 0xf03b
callq 0x3270
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r15), %xmm0
movq %r14, %rdi
callq 0x3320
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc0c6(%rip), %rsi      # 0xf9e5
callq 0x3270
movq (%r14), %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
xorps %xmm0, %xmm0
cvtss2sd (%rbx), %xmm0
cvtss2sd 0x4(%rbx), %xmm1
cvtss2sd (%r15), %xmm2
cvtss2sd 0x4(%r15), %xmm3
leaq 0x100f7(%rip), %rax     # 0x13a60
movq %rax, -0x98(%rbp)
leaq 0x10139(%rip), %rax     # 0x13ab0
movq %rax, -0x90(%rbp)
movb $0x1, -0x88(%rbp)
movq %r12, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
leaq 0x10156(%rip), %rcx     # 0x13af0
movq %rcx, -0x78(%rbp)
movabsq $0x4000000000000000, %rcx # imm = 0x4000000000000000
movq %rcx, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
leaq -0x5c(%rbp), %rax
movq %r12, 0x5(%rax)
movq %r12, (%rax)
leaq 0x101ca(%rip), %rax     # 0x13b90
movq %rax, -0xa0(%rbp)
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movsd %xmm2, -0x38(%rbp)
movsd %xmm3, -0x30(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3bec
addq $0x10, %r13
cmpq -0xa8(%rbp), %r13
jne 0x384c
leaq -0xc0(%rbp), %rdi
callq 0x3c6e
leaq -0x178(%rbp), %rdi
callq 0x3cc4
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
leaq -0x168(%rbp), %rbx
je 0x3a3c
callq 0x3210
movq -0x178(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3a4d
callq 0x3210
leaq -0xf0(%rbp), %rdi
callq 0x633e
leaq -0x108(%rbp), %rdi
callq 0x3c6e
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x3a76
callq 0x3210
xorl %eax, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3ab2
jmp 0x3ab2
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3ad2
callq 0x3210
jmp 0x3ad2
movq %rax, %rbx
jmp 0x3ad2
movq %rax, %rbx
jmp 0x3aea
jmp 0x3ab7
jmp 0x3ab2
movq %rax, %rbx
jmp 0x3ac6
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3c6e
leaq -0x178(%rbp), %rdi
callq 0x3db8
leaq -0xf0(%rbp), %rdi
callq 0x633e
leaq -0x108(%rbp), %rdi
callq 0x3c6e
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x3afb
callq 0x3210
movq %rbx, %rdi
callq 0x3380