// File: /workspace/github_cpp_makefile_star2_O1/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 0xba29(%rip), %xmm0     # 0xf010
leaq -0xa0(%rbp), %rsi
movups %xmm0, (%rsi)
movaps 0xba28(%rip), %xmm0     # 0xf020
movups %xmm0, 0x10(%rsi)
leaq -0xd8(%rbp), %rbx
leaq -0x178(%rbp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x3bdc
leaq -0x108(%rbp), %rdi
movq %rbx, %rsi
callq 0x9ecc
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xb9f8(%rip), %rsi      # 0xf030
leaq 0xb9fb(%rip), %rdx      # 0xf03a
leaq -0xa0(%rbp), %rdi
callq 0x63aa
leaq -0x168(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0x178(%rbp), %rdi
callq 0x3e12
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 0x36c8
callq 0x3220
movq -0xd8(%rbp), %r12
movq -0xd0(%rbp), %r13
cmpq %r13, %r12
je 0x3836
leaq 0x10392(%rip), %r14     # 0x13a78
xorl %ebx, %ebx
movl $0x1, %edx
movq 0x108fc(%rip), %rdi     # 0x13ff0
leaq 0xc2b8(%rip), %rsi      # 0xf9b3
callq 0x3280
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
movq 0x108e0(%rip), %rdi     # 0x13ff0
callq 0x3330
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb914(%rip), %rsi      # 0xf03b
callq 0x3280
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r12), %xmm0
movq %r15, %rdi
callq 0x3330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc2a5(%rip), %rsi      # 0xf9f5
callq 0x3280
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
cvtss2sd 0x4(%r12), %xmm1
leaq 0x103c5(%rip), %rax     # 0x13b58
movq %rax, -0xa0(%rbp)
leaq 0x10287(%rip), %rax     # 0x13a28
movq %rax, -0x98(%rbp)
movq %r14, -0x90(%rbp)
movb $0x0, -0x88(%rbp)
movq %rbx, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
leaq 0x102ed(%rip), %rax     # 0x13ab8
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 0x10301(%rip), %rax     # 0x13af8
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 0x3c1a
addq $0x8, %r12
cmpq %r13, %r12
jne 0x36e8
leaq -0xc0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4ef4
movq -0xc0(%rbp), %r13
movq -0xb8(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpq %rax, %r13
je 0x3a31
xorl %r12d, %r12d
movq (%r13), %rax
movq 0x30(%rax), %rbx
movq 0x40(%rax), %r15
movl $0x1, %edx
movq 0x1076e(%rip), %rdi     # 0x13ff0
leaq 0xc12a(%rip), %rsi      # 0xf9b3
callq 0x3280
xorps %xmm0, %xmm0
cvtss2sd (%rbx), %xmm0
movq 0x10754(%rip), %rdi     # 0x13ff0
callq 0x3330
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb788(%rip), %rsi      # 0xf03b
callq 0x3280
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rbx), %xmm0
movq %r14, %rdi
callq 0x3330
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc11b(%rip), %rsi      # 0xf9f5
callq 0x3280
movl $0x5, %edx
movq %r14, %rdi
leaq 0xb750(%rip), %rsi      # 0xf03e
callq 0x3280
xorps %xmm0, %xmm0
cvtss2sd (%r15), %xmm0
movq %r14, %rdi
callq 0x3330
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb726(%rip), %rsi      # 0xf03b
callq 0x3280
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r15), %xmm0
movq %r14, %rdi
callq 0x3330
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc0b8(%rip), %rsi      # 0xf9f5
callq 0x3280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3230
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 0x101d1(%rip), %rax     # 0x13b58
movq %rax, -0xa0(%rbp)
leaq 0x10093(%rip), %rax     # 0x13a28
movq %rax, -0x98(%rbp)
leaq 0x100d5(%rip), %rax     # 0x13a78
movq %rax, -0x90(%rbp)
movb $0x1, -0x88(%rbp)
movq %r12, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
leaq 0x100f2(%rip), %rcx     # 0x13ab8
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 0x10196(%rip), %rax     # 0x13b88
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 0x3c1a
addq $0x10, %r13
cmpq -0xa8(%rbp), %r13
jne 0x386a
leaq -0xc0(%rbp), %rdi
callq 0x3c9c
leaq -0x178(%rbp), %rdi
callq 0x3ce8
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
leaq -0x168(%rbp), %rbx
je 0x3a68
callq 0x3220
movq -0x178(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3a79
callq 0x3220
leaq -0xf0(%rbp), %rdi
callq 0x635e
leaq -0x108(%rbp), %rdi
callq 0x3c9c
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x3aa2
callq 0x3220
xorl %eax, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3ade
jmp 0x3ade
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3afe
callq 0x3220
jmp 0x3afe
movq %rax, %rbx
jmp 0x3afe
movq %rax, %rbx
jmp 0x3b16
jmp 0x3ae3
jmp 0x3ade
movq %rax, %rbx
jmp 0x3af2
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3c9c
leaq -0x178(%rbp), %rdi
callq 0x3ddc
leaq -0xf0(%rbp), %rdi
callq 0x635e
leaq -0x108(%rbp), %rdi
callq 0x3c9c
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x3b27
callq 0x3220
movq %rbx, %rdi
callq 0x3390