// File: /workspace/github_cpp_makefile_star2_O1/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 0x32b0
leaq 0x3c65(%rip), %rsi      # 0xfcdb
movl $0x6, %edx
movq %r15, %rdi
callq 0x3280
movq -0x298(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %r15
addq $-0x298, %r15           # imm = 0xFD68
cmpb $0x0, 0xe1(%r15)
jne 0xc0bf
movq %r15, %rdi
movl $0x20, %esi
callq 0x3230
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
leaq -0x298(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x5, -0x288(%rbp,%rax)
movl 0x811d(%rip), %esi      # 0x14204
leal 0x1(%rsi), %eax
movl %eax, 0x8114(%rip)      # 0x14204
callq 0x3380
leaq 0x2f3a(%rip), %rsi      # 0xf036
movl $0x4, %edx
movq %rax, %rdi
callq 0x3280
leaq -0x290(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3320
leaq -0x110(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x3e12
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 0xc1aa
callq 0x3220
cmpq $0x0, 0x28(%r14)
je 0xc47b
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0xc22b
movsd 0x30a6(%rip), %xmm3     # 0xf270
movsd 0x3096(%rip), %xmm2     # 0xf268
movq %r15, %rax
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0xc23d
xorps %xmm0, %xmm0
cvtss2sd (%rcx), %xmm0
movaps %xmm0, %xmm1
minsd %xmm2, %xmm1
addsd 0x3084(%rip), %xmm1     # 0xf278
movsd %xmm1, -0x38(%rbp)
maxsd %xmm3, %xmm0
addsd 0x307b(%rip), %xmm0     # 0xf280
movsd %xmm0, -0x30(%rbp)
movq %rax, %rdi
callq 0x3290
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
cmpq %r14, %rax
jne 0xc1d5
jmp 0xc245
movsd 0x3035(%rip), %xmm0     # 0xf268
movsd 0x3035(%rip), %xmm1     # 0xf270
jmp 0xc245
movapd %xmm3, %xmm1
movapd %xmm2, %xmm0
cmpq %r14, %r15
je 0xc28e
leaq -0x120(%rbp), %r12
movsd %xmm1, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq 0x28(%r15), %rsi
testq %rsi, %rsi
je 0xc28e
movq %r12, %rdi
movsd -0xb0(%rbp), %xmm2
callq 0xc52b
movq %r15, %rdi
callq 0x3290
movq %rax, %r15
cmpq %r14, %rax
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
jne 0xc25b
movq 0x18(%rbx), %rdi
addq $0x8, %rbx
movq %rbx, -0x38(%rbp)
cmpq %rbx, %rdi
je 0xc461
leaq -0x64(%rbp), %r12
leaq 0x78aa(%rip), %rax      # 0x13b58
leaq 0x7773(%rip), %rcx      # 0x13a28
leaq 0x77bc(%rip), %rbx      # 0x13a78
leaq 0x77f5(%rip), %rdx      # 0x13ab8
xorl %r14d, %r14d
leaq 0x782b(%rip), %r8       # 0x13af8
leaq -0xa8(%rbp), %rsi
movq %rdi, -0x30(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rdi), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%rdi), %xmm1
movq %rax, -0xa8(%rbp)
movq %rcx, -0xa0(%rbp)
movq %rbx, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movq $0xff, -0x8c(%rbp)
movl $0x0, -0x84(%rbp)
movq %rdx, -0x80(%rbp)
movabsq $-0x4010000000000000, %rdi # imm = 0xBFF0000000000000
movq %rdi, -0x78(%rbp)
movq %rbx, -0x70(%rbp)
movb $0x1, -0x68(%rbp)
movq %r14, 0x5(%r12)
movq %r14, (%r12)
movq %r8, -0xa8(%rbp)
movsd %xmm0, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
movabsq $0x4004000000000000, %rdi # imm = 0x4004000000000000
movq %rdi, -0x40(%rbp)
leaq -0x120(%rbp), %rdi
movq %rax, %r12
movq %rcx, %r15
movq %rdx, %r14
movq %r8, %r13
callq 0x3c1a
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rax), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%rax), %xmm1
movss 0x48(%rax), %xmm2
addss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
movq %r12, -0xa8(%rbp)
movq %r15, -0xa0(%rbp)
movq %rbx, -0x98(%rbp)
movb $0x1, -0x90(%rbp)
movl $0x0, %ecx
movq %rcx, -0x8c(%rbp)
movl $0x0, -0x84(%rbp)
movq %r14, -0x80(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x78(%rbp)
movq %rbx, -0x70(%rbp)
movb %cl, -0x68(%rbp)
movl $0xff, -0x64(%rbp)
leaq -0x64(%rbp), %r14
movb %cl, 0xc(%r14)
movq %rcx, 0x4(%r14)
movq %r13, -0xa8(%rbp)
movsd %xmm0, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
mulsd 0x2e35(%rip), %xmm2     # 0xf240
movsd %xmm2, -0x40(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movq %rsi, %r13
callq 0x3c1a
movq %r14, %r12
xorl %r14d, %r14d
movq -0x30(%rbp), %rdi
callq 0x3290
movq %rax, %rdi
cmpq -0x38(%rbp), %rax
leaq 0x7715(%rip), %rax      # 0x13b58
leaq 0x75de(%rip), %rcx      # 0x13a28
leaq 0x7667(%rip), %rdx      # 0x13ab8
leaq 0x76a0(%rip), %r8       # 0x13af8
movq %r13, %rsi
jne 0xc2d4
leaq -0x120(%rbp), %rdi
callq 0x3ce8
leaq -0x110(%rbp), %r15
leaq -0xc0(%rbp), %r12
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0xc48c
callq 0x3220
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
je 0xc49d
callq 0x3220
movq 0x7b24(%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 0xc4f5
movq %rax, %rbx
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc504
callq 0x3220
jmp 0xc504
jmp 0xc4ec
movq %rax, %rbx
jmp 0xc504
jmp 0xc4f5
jmp 0xc4f5
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x3ddc
movq 0x7abd(%rip), %rsi      # 0x13fc8
leaq -0x298(%rbp), %rdi
callq 0x3100
leaq -0x228(%rbp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3390