// File: /workspace/github_cpp_makefile_star2_O3/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 $0x278, %rsp            # imm = 0x278
movsd %xmm0, -0xb0(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x298(%rbp), %r15
movq %r15, %rdi
callq 0x32a0
leaq 0x3bd3(%rip), %rsi      # 0xfccb
movl $0x6, %edx
movq %r15, %rdi
callq 0x3270
movq -0x298(%rbp), %rax
movq -0x18(%rax), %rcx
leaq (%rcx,%rbp), %r15
addq $-0x298, %r15           # imm = 0xFD68
cmpb $0x0, 0xe1(%r15)
jne 0xc141
movq %r15, %rdi
movl $0x20, %esi
callq 0x3220
movb $0x1, 0xe1(%r15)
movq -0x298(%rbp), %rax
movb $0x30, 0xe0(%r15)
movq -0x18(%rax), %rax
movq $0x5, -0x288(%rbp,%rax)
movl 0x809d(%rip), %esi      # 0x141fc
leal 0x1(%rsi), %eax
movl %eax, 0x8094(%rip)      # 0x141fc
leaq -0x298(%rbp), %rdi
callq 0x3370
leaq 0x2ebb(%rip), %rsi      # 0xf036
movl $0x4, %edx
movq %rax, %rdi
callq 0x3270
leaq -0x290(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3310
leaq -0x110(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x3dee
movabsq $0x4092c00000000000, %rax # imm = 0x4092C00000000000
leaq -0xc0(%rbp), %r12
movq %rax, -0x40(%r12)
movq %rax, -0x38(%r12)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x30(%r12)
movl $0x1, -0x28(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, -0x20(%r12)
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc229
callq 0x3210
cmpq $0x0, 0x28(%r14)
je 0xc4ce
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0xc2ff
movsd 0x3013(%rip), %xmm3     # 0xf260
movsd 0x3013(%rip), %xmm2     # 0xf268
movq %r15, %rax
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0xc2ae
xorps %xmm0, %xmm0
cvtss2sd (%rcx), %xmm0
movaps %xmm0, %xmm1
minsd %xmm2, %xmm1
addsd 0x2ff9(%rip), %xmm1     # 0xf270
movsd %xmm1, -0x38(%rbp)
maxsd %xmm3, %xmm0
addsd 0x2ff0(%rip), %xmm0     # 0xf278
movsd %xmm0, -0x30(%rbp)
movq %rax, %rdi
callq 0x3280
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
cmpq %r14, %rax
jne 0xc258
jmp 0xc2b6
movapd %xmm3, %xmm1
movapd %xmm2, %xmm0
cmpq %r14, %r15
je 0xc2ff
leaq -0x120(%rbp), %r12
movsd %xmm1, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq 0x28(%r15), %rsi
testq %rsi, %rsi
je 0xc2ff
movq %r12, %rdi
movsd -0xb0(%rbp), %xmm2
callq 0xc57e
movq %r15, %rdi
callq 0x3280
movq %rax, %r15
cmpq %r14, %rax
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
jne 0xc2cc
movq 0x18(%rbx), %rsi
addq $0x8, %rbx
movq %rbx, -0x30(%rbp)
cmpq %rbx, %rsi
je 0xc4b4
leaq -0x64(%rbp), %r12
leaq 0x7741(%rip), %rax      # 0x13a60
leaq 0x778a(%rip), %rcx      # 0x13ab0
xorl %r14d, %r14d
leaq -0x120(%rbp), %r15
leaq -0xa8(%rbp), %r9
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rsi), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%rsi), %xmm1
movq %rax, -0xa0(%rbp)
movq %rcx, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movq $0xff, -0x8c(%rbp)
movl $0x0, -0x84(%rbp)
leaq 0x7778(%rip), %rdx      # 0x13af0
movq %rdx, -0x80(%rbp)
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq %rdx, -0x78(%rbp)
movq %rcx, -0x70(%rbp)
movb $0x1, -0x68(%rbp)
movq %r14, 0x5(%r12)
movq %r14, (%r12)
leaq 0x778e(%rip), %rdx      # 0x13b30
movq %rdx, -0xa8(%rbp)
movsd %xmm0, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
movabsq $0x4004000000000000, %rdx # imm = 0x4004000000000000
movq %rdx, -0x40(%rbp)
movq %r15, %r13
movq %rsi, %rbx
movq %r15, %rdi
movq %r9, %r14
movq %r9, %rsi
movq %rax, %r12
movq %rcx, %r15
callq 0x3bec
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%rbx), %xmm1
movss 0x48(%rbx), %xmm2
addss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
movq %r12, -0xa0(%rbp)
movq %r15, -0x98(%rbp)
movb $0x1, -0x90(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x8c(%rbp)
movl $0x0, -0x84(%rbp)
leaq 0x76c9(%rip), %rax      # 0x13af0
movq %rax, -0x80(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x78(%rbp)
movq %r15, -0x70(%rbp)
movb %cl, -0x68(%rbp)
movl $0xff, -0x64(%rbp)
leaq -0x64(%rbp), %r12
movb %cl, 0xc(%r12)
movq %rcx, 0x4(%r12)
leaq 0x76d4(%rip), %rax      # 0x13b30
movq %rax, -0xa8(%rbp)
movsd %xmm0, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
mulsd 0x2dcb(%rip), %xmm2     # 0xf240
movsd %xmm2, -0x40(%rbp)
movq %r13, %r15
movq %r13, %rdi
movq %r14, %r13
movq %r14, %rsi
callq 0x3bec
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x3280
movq %rax, %rsi
cmpq -0x30(%rbp), %rax
leaq 0x75bc(%rip), %rax      # 0x13a60
leaq 0x7605(%rip), %rcx      # 0x13ab0
movq %r13, %r9
jne 0xc337
leaq -0x120(%rbp), %rdi
callq 0x3cc4
leaq -0x110(%rbp), %r15
leaq -0xc0(%rbp), %r12
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0xc4df
callq 0x3210
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
je 0xc4f0
callq 0x3210
movq 0x7ad1(%rip), %rsi      # 0x13fc8
leaq -0x298(%rbp), %rdi
callq 0x3100
leaq -0x228(%rbp), %rdi
callq 0x3090
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc548
movq %rax, %rbx
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc557
callq 0x3210
jmp 0xc557
jmp 0xc53f
movq %rax, %rbx
jmp 0xc557
jmp 0xc548
jmp 0xc548
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x3db8
movq 0x7a6a(%rip), %rsi      # 0x13fc8
leaq -0x298(%rbp), %rdi
callq 0x3100
leaq -0x228(%rbp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3380