// File: /workspace/github_cpp_makefile_star2_O2/micahcc[P]polygon_skeleton/./debug.h
// Function: void draw_state<std::set<Intersection, BeachCompare, std::allocator<Intersection>>, CircleQueue>(std::set<Intersection, BeachCompare, std::allocator<Intersection>> const&, CircleQueue const&, double)
void draw_state(const IntersectionContainer& intersections,
        const EventContainer& events, double sweep_y)
{
    svg::Dimensions dimensions(1200, 1200);

    static int count = 0;
    std::ostringstream oss;
    oss << "state_" << std::setfill('0') << std::setw(5) << count++ << ".svg";
    svg::Document doc(oss.str(), svg::Layout(dimensions, svg::Layout::BottomLeft));

    if(intersections.empty())
        return;

    auto it = intersections.end();
    it--;

    double min_x = std::numeric_limits<double>::infinity();
    double max_x = -std::numeric_limits<double>::infinity();
    for(const auto& curr_int : intersections) {
        if(!curr_int.pt_right)
            break;

        min_x = std::min<double>(min_x, curr_int.pt_right->x) - 100;
        max_x = std::max<double>(max_x, curr_int.pt_right->x) + 100;
    }

    for(const auto& curr_int : intersections) {
        if(!curr_int.pt_right)
            break;

       draw_parabola(doc, min_x, max_x, *curr_int.pt_right, sweep_y);
    }

    for(auto it = events.cbegin(); it != events.cend(); ++it) {
        doc << svg::Circle(svg::Point(it->circle.center.x, it->circle.center.y),
                5, svg::Fill(svg::Color::Red));

        doc << svg::Circle(svg::Point(it->circle.center.x, it->circle.center.y),
                2*it->circle.radius, svg::Fill(svg::Color::Transparent),
                svg::Stroke(1, svg::Color::Red));
    }

    doc.save();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movsd %xmm0, -0x50(%rbp)
movq %rsi, %r15
movq %rdi, %r14
leaq -0x2f8(%rbp), %rbx
movq %rbx, %rdi
callq 0x3260
leaq 0x3843(%rip), %rsi      # 0xdcdb
movq %rbx, %rdi
callq 0x31f0
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x32e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x5, 0x10(%rax,%rcx)
movl 0x9d2b(%rip), %esi      # 0x141ec
leal 0x1(%rsi), %ecx
movl %ecx, 0x9d22(%rip)      # 0x141ec
movq %rax, %rdi
callq 0x3350
leaq 0x2ba9(%rip), %rsi      # 0xd082
movq %rax, %rdi
callq 0x31f0
leaq -0x2f0(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x32f0
leaq -0xf0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x3270
movabsq $0x4092c00000000000, %rax # imm = 0x4092C00000000000
leaq -0x90(%rbp), %rcx
movq %rax, -0x40(%rcx)
movq %rax, -0x38(%rcx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x30(%rcx)
movl $0x1, -0x28(%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, -0x20(%rcx)
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq -0x160(%rbp), %rdi
callq 0x30c0
cmpq $0x0, 0x28(%r14)
je 0xa75d
movq 0x18(%r14), %rbx
addq $0x8, %r14
movsd 0x2d07(%rip), %xmm0     # 0xd278
movsd 0x2d07(%rip), %xmm1     # 0xd280
movq %rbx, %rax
cmpq %r14, %rax
je 0xa600
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0xa600
cvtss2sd (%rcx), %xmm3
movaps %xmm3, %xmm2
minsd %xmm0, %xmm2
addsd 0x2ceb(%rip), %xmm2     # 0xd288
movsd %xmm2, -0x38(%rbp)
maxsd %xmm1, %xmm3
addsd 0x2ce2(%rip), %xmm3     # 0xd290
movsd %xmm3, -0x30(%rbp)
movq %rax, %rdi
callq 0x3230
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
jmp 0xa57c
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0xa605
leaq -0xf0(%rbp), %rdi
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x38(%rbp)
movsd -0x50(%rbp), %xmm2
callq 0xa7cc
movq %rbx, %rdi
callq 0x3230
movq %rax, %rbx
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm0
cmpq %r14, %rbx
jne 0xa5c7
movq 0x18(%r15), %r14
addq $0x8, %r15
movq %r15, -0x30(%rbp)
leaq -0x64(%rbp), %r12
leaq -0x180(%rbp), %r15
leaq -0x160(%rbp), %r13
xorl %ebx, %ebx
cmpq -0x30(%rbp), %r14
je 0xa751
cvtss2sd 0x40(%r14), %xmm0
cvtss2sd 0x44(%r14), %xmm1
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movq %r15, %rdi
pushq $0xb
popq %rsi
callq 0x3a74
leaq 0x94a1(%rip), %rax      # 0x13af8
movq %rax, -0x80(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x78(%rbp)
leaq 0x9448(%rip), %rax      # 0x13ab8
movq %rax, -0x70(%rbp)
movb $0x1, -0x68(%rbp)
andq $0x0, 0x5(%r12)
andq $0x0, (%r12)
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
movsd 0x299e(%rip), %xmm0     # 0xd030
movq %r15, %rdx
leaq -0x80(%rbp), %rcx
callq 0x3b88
leaq -0xf0(%rbp), %rdi
movq %r13, %rsi
callq 0x3a20
cvtss2sd 0x40(%r14), %xmm0
cvtss2sd 0x44(%r14), %xmm1
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movss 0x48(%r14), %xmm0
movss %xmm0, -0x38(%rbp)
movq %r15, %rdi
pushq $-0x1
popq %rsi
callq 0x3a74
movss -0x38(%rbp), %xmm0
addss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x940b(%rip), %rax      # 0x13af8
movq %rax, -0x80(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x78(%rbp)
leaq 0x93b2(%rip), %rax      # 0x13ab8
movq %rax, -0x70(%rbp)
movb %bl, -0x68(%rbp)
movl $0xff, -0x64(%rbp)
movb %bl, 0xc(%r12)
andq $0x0, 0x4(%r12)
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
movq %r15, %rdx
leaq -0x80(%rbp), %rcx
callq 0x3b88
leaq -0xf0(%rbp), %rdi
movq %r13, %rsi
callq 0x3a20
movq %r14, %rdi
callq 0x3230
movq %rax, %r14
jmp 0xa625
leaq -0xf0(%rbp), %rdi
callq 0x3c86
leaq -0xf0(%rbp), %rdi
callq 0x3d38
leaq -0x2f8(%rbp), %rdi
callq 0x3060
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa7a9
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x30c0
jmp 0xa7b8
jmp 0xa79c
movq %rax, %rbx
jmp 0xa7b8
jmp 0xa7a9
jmp 0xa7a9
jmp 0xa7a9
jmp 0xa7a9
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x3d38
leaq -0x2f8(%rbp), %rdi
callq 0x3060
movq %rbx, %rdi
callq 0x3360