// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::PlotEx(ImGuiPlotType, char const*, float (*)(void*, int), void*, int, int, char const*, float, float, ImVec2)
void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return;

    ImGuiState& g = *GImGui;
    const ImGuiStyle& style = g.Style;

    const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
    if (graph_size.x == 0.0f)
        graph_size.x = CalcItemWidth() + (style.FramePadding.x * 2);
    if (graph_size.y == 0.0f)
        graph_size.y = label_size.y + (style.FramePadding.y * 2);

    const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(graph_size.x, graph_size.y));
    const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
    const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0));
    ItemSize(total_bb, style.FramePadding.y);
    if (!ItemAdd(total_bb, NULL))
        return;

    // Determine scale from values if not specified
    if (scale_min == FLT_MAX || scale_max == FLT_MAX)
    {
        float v_min = FLT_MAX;
        float v_max = -FLT_MAX;
        for (int i = 0; i < values_count; i++)
        {
            const float v = values_getter(data, i);
            v_min = ImMin(v_min, v);
            v_max = ImMax(v_max, v);
        }
        if (scale_min == FLT_MAX)
            scale_min = v_min;
        if (scale_max == FLT_MAX)
            scale_max = v_max;
    }

    RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);

    int res_w = ImMin((int)graph_size.x, values_count);
    if (plot_type == ImGuiPlotType_Lines)
        res_w -= 1;

    // Tooltip on hover
    int v_hovered = -1;
    if (IsHovered(inner_bb, 0))
    {
        const float t = ImClamp((g.IO.MousePos.x - inner_bb.Min.x) / (inner_bb.Max.x - inner_bb.Min.x), 0.0f, 0.9999f);
        const int v_idx = (int)(t * (values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0)));
        IM_ASSERT(v_idx >= 0 && v_idx < values_count);

        const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
        const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count);
        if (plot_type == ImGuiPlotType_Lines)
            ImGui::SetTooltip("%d: %8.4g\n%d: %8.4g", v_idx, v0, v_idx+1, v1);
        else if (plot_type == ImGuiPlotType_Histogram)
            ImGui::SetTooltip("%d: %8.4g", v_idx, v0);
        v_hovered = v_idx;
    }

    const float t_step = 1.0f / (float)res_w;

    float v0 = values_getter(data, (0 + values_offset) % values_count);
    float t0 = 0.0f;
    ImVec2 p0 = ImVec2( t0, 1.0f - ImSaturate((v0 - scale_min) / (scale_max - scale_min)) );

    const ImU32 col_base = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram);
    const ImU32 col_hovered = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered);

    for (int n = 0; n < res_w; n++)
    {
        const float t1 = t0 + t_step;
        const int v_idx = (int)(t0 * values_count);
        IM_ASSERT(v_idx >= 0 && v_idx < values_count);
        const float v1 = values_getter(data, (v_idx + values_offset + 1) % values_count);
        const ImVec2 p1 = ImVec2( t1, 1.0f - ImSaturate((v1 - scale_min) / (scale_max - scale_min)) );

        // NB- Draw calls are merged together by the DrawList system.
        if (plot_type == ImGuiPlotType_Lines)
            window->DrawList->AddLine(ImLerp(inner_bb.Min, inner_bb.Max, p0), ImLerp(inner_bb.Min, inner_bb.Max, p1), v_hovered == v_idx ? col_hovered : col_base);
        else if (plot_type == ImGuiPlotType_Histogram)
            window->DrawList->AddRectFilled(ImLerp(inner_bb.Min, inner_bb.Max, p0), ImLerp(inner_bb.Min, inner_bb.Max, ImVec2(p1.x, 1.0f))+ImVec2(-1,0), v_hovered == v_idx ? col_hovered : col_base);

        t0 = t1;
        p0 = p1;
    }

    // Text overlay
    if (overlay_text)
        RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, overlay_text, NULL, NULL, ImGuiAlign_Center);

    RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movq %r9, -0xc0(%rbp)
movq %rcx, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
movq 0x384fc(%rip), %r13     # 0x50480
movq 0x1758(%r13), %rax
movb $0x1, 0x72(%rax)
movq %rax, -0x58(%rbp)
cmpb $0x0, 0x74(%rax)
jne 0x1870d
movl %r8d, %r15d
movl %edi, %r12d
pushq $0x1
popq %rdx
movss 0x1e3ee(%rip), %xmm0    # 0x3639c
movq %rsi, -0x148(%rbp)
movq %rsi, %rdi
xorl %esi, %esi
movaps %xmm2, -0x70(%rbp)
callq 0xc6e3
movaps -0x70(%rbp), %xmm3
movaps %xmm0, %xmm7
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm3
jne 0x17ffd
jp 0x17ffd
movaps %xmm7, -0x40(%rbp)
callq 0x1137a
movaps -0x40(%rbp), %xmm7
movaps -0x70(%rbp), %xmm3
movss 0x1408(%r13), %xmm1
addss %xmm1, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
movss %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1,2,3]
movaps %xmm3, %xmm1
shufps $0x55, %xmm3, %xmm1     # xmm1 = xmm1[1,1],xmm3[1,1]
ucomiss %xmm0, %xmm1
jne 0x18035
jp 0x18035
movaps %xmm7, %xmm2
shufps $0x55, %xmm7, %xmm2     # xmm2 = xmm2[1,1],xmm7[1,1]
movss 0x140c(%r13), %xmm0
movaps %xmm0, %xmm1
addss %xmm0, %xmm1
addss %xmm2, %xmm1
movaps %xmm1, %xmm2
movlhps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
shufps $0xe2, %xmm3, %xmm2     # xmm2 = xmm2[2,0],xmm3[2,3]
movaps %xmm2, %xmm3
jmp 0x1803e
movss 0x140c(%r13), %xmm0
movq -0x58(%rbp), %rax
movss 0xa8(%rax), %xmm4
addss 0xac(%rax), %xmm1
movaps %xmm3, -0x70(%rbp)
addss %xmm3, %xmm4
movaps %xmm4, %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movq 0xa8(%rax), %rbx
movq %rbx, -0x170(%rbp)
movaps %xmm2, -0x110(%rbp)
movlps %xmm2, -0x168(%rbp)
movd %ebx, %xmm6
movss 0x1408(%r13), %xmm2
addss %xmm2, %xmm6
movq %rbx, %rax
shrq $0x20, %rax
movd %eax, %xmm3
movaps %xmm0, %xmm5
movd %xmm3, -0x9c(%rbp)
addss %xmm3, %xmm5
movaps %xmm6, -0xf0(%rbp)
movaps %xmm6, %xmm3
movaps %xmm5, -0x100(%rbp)
unpcklps %xmm5, %xmm3            # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
movaps %xmm4, -0x160(%rbp)
subss %xmm2, %xmm4
movaps %xmm1, %xmm5
subss %xmm0, %xmm5
movaps %xmm4, -0xd0(%rbp)
movaps %xmm4, %xmm2
movaps %xmm5, -0x130(%rbp)
unpcklps %xmm5, %xmm2            # xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
movlhps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
movups %xmm3, -0x190(%rbp)
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm7
xorps %xmm3, %xmm3
jbe 0x18103
movss 0x141c(%r13), %xmm3
addss %xmm7, %xmm3
addss -0x160(%rbp), %xmm3
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
leaq -0x1a0(%rbp), %r14
movq %rbx, (%r14)
movlps %xmm3, 0x8(%r14)
movq %r14, %rdi
callq 0x9af8
movq %r14, %rdi
xorl %esi, %esi
callq 0x9b28
testb %al, %al
je 0x1870d
movq %rbx, %xmm0
movdqa %xmm0, -0x120(%rbp)
movaps -0xe0(%rbp), %xmm0
ucomiss 0x1e27e(%rip), %xmm0    # 0x363d4
movq %rbx, -0x138(%rbp)
jne 0x18161
jnp 0x1817b
movaps -0xb0(%rbp), %xmm0
ucomiss 0x1e265(%rip), %xmm0    # 0x363d4
jne 0x1821f
jp 0x1821f
xorl %r14d, %r14d
testl %r15d, %r15d
movl $0x0, %ebx
cmovgl %r15d, %ebx
movss 0x1e242(%rip), %xmm4    # 0x363d4
movss 0x1e226(%rip), %xmm3    # 0x363c0
cmpl %r14d, %ebx
je 0x181dc
movq -0x88(%rbp), %rdi
movl %r14d, %esi
movaps %xmm3, -0x50(%rbp)
movaps %xmm4, -0x40(%rbp)
callq *-0x80(%rbp)
movaps -0x40(%rbp), %xmm4
minss %xmm0, %xmm4
movaps %xmm0, %xmm1
movaps -0x50(%rbp), %xmm3
cmpless %xmm3, %xmm1
movaps %xmm1, %xmm2
andnps %xmm0, %xmm2
andps %xmm3, %xmm1
orps %xmm2, %xmm1
incl %r14d
movaps %xmm1, %xmm3
jmp 0x1819a
movss 0x1e1f0(%rip), %xmm0    # 0x363d4
movaps -0xe0(%rbp), %xmm2
movaps %xmm2, %xmm1
cmpeqss %xmm0, %xmm1
andps %xmm1, %xmm4
andnps %xmm2, %xmm1
orps %xmm4, %xmm1
movaps -0xb0(%rbp), %xmm2
cmpeqss %xmm2, %xmm0
andps %xmm0, %xmm3
andnps %xmm2, %xmm0
orps %xmm3, %xmm0
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xe0(%rbp)
pushq $0x6
popq %rsi
movss 0x1e166(%rip), %xmm0    # 0x36390
movq -0x58(%rbp), %rdi
callq 0x1eae4
movss 0x1410(%r13), %xmm2
pushq $0x1
popq %rsi
movaps -0x120(%rbp), %xmm0
movaps -0x110(%rbp), %xmm1
movl %eax, %edi
callq 0xc76b
cvttss2si -0x70(%rbp), %ebx
cmpl %r15d, %ebx
cmovgel %r15d, %ebx
xorl %r14d, %r14d
testl %r12d, %r12d
sete %r14b
leaq -0x190(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9d62
testb %al, %al
movl %r12d, -0x110(%rbp)
movq %r13, -0x140(%rbp)
je 0x18377
movl %ebx, -0x40(%rbp)
movl %r14d, -0x50(%rbp)
movl %r14d, %eax
negl %eax
movss 0xf0(%r13), %xmm0
movaps -0xf0(%rbp), %xmm1
subss %xmm1, %xmm0
movaps -0xd0(%rbp), %xmm2
subss %xmm1, %xmm2
movaps %xmm2, -0xd0(%rbp)
divss %xmm2, %xmm0
movss 0x1e18a(%rip), %xmm1    # 0x36458
minss %xmm0, %xmm1
xorps %xmm2, %xmm2
cmpltss %xmm2, %xmm0
andnps %xmm1, %xmm0
addl %r15d, %eax
cvtsi2ss %eax, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ebx
testl %ebx, %ebx
js 0x1873e
cmpl %r15d, %ebx
jge 0x1873e
movq -0xc0(%rbp), %rax
addl %ebx, %eax
cltd
idivl %r15d
movq -0x88(%rbp), %r12
movq %r12, %rdi
movl %edx, %esi
movq -0x80(%rbp), %r14
callq *%r14
movss %xmm0, -0x70(%rbp)
movq -0xc0(%rbp), %rax
addl %ebx, %eax
incl %eax
cltd
idivl %r15d
movq %r12, %rdi
movl %edx, %esi
callq *%r14
movl -0x110(%rbp), %r12d
testl %r12d, %r12d
movq %rbx, -0x78(%rbp)
je 0x1839e
movss -0x70(%rbp), %xmm0
cmpl $0x1, %r12d
movl -0x40(%rbp), %ebx
jne 0x1836d
cvtss2sd %xmm0, %xmm0
leaq 0x1f03b(%rip), %rdi     # 0x3739d
movq -0x78(%rbp), %rsi
movb $0x1, %al
callq 0xd30a
movss 0x1e01b(%rip), %xmm1    # 0x36390
jmp 0x183c8
movaps -0xd0(%rbp), %xmm0
subss -0xf0(%rbp), %xmm0
movaps %xmm0, -0xd0(%rbp)
pushq $-0x1
popq %rax
movq %rax, -0x78(%rbp)
movss 0x1dff4(%rip), %xmm1    # 0x36390
jmp 0x183cc
leal 0x1(%rbx), %edx
cvtss2sd -0x70(%rbp), %xmm2
cvtss2sd %xmm0, %xmm1
leaq 0x1efe2(%rip), %rdi     # 0x37393
movl %ebx, %esi
movaps %xmm2, %xmm0
movb $0x2, %al
callq 0xd30a
movss 0x1dfcb(%rip), %xmm1    # 0x36390
movl -0x40(%rbp), %ebx
movl -0x50(%rbp), %r14d
subl %r14d, %ebx
movl %ebx, %eax
movl %ebx, -0x40(%rbp)
xorl %ebx, %ebx
cvtsi2ss %eax, %xmm0
testl %r12d, %r12d
setne %bl
movaps %xmm1, %xmm2
divss %xmm0, %xmm2
movaps %xmm2, -0x180(%rbp)
movq -0xc0(%rbp), %r13
movl %r13d, %eax
cltd
idivl %r15d
movq -0x88(%rbp), %rdi
movl %edx, %esi
callq *-0x80(%rbp)
movaps -0xe0(%rbp), %xmm1
subss %xmm1, %xmm0
movaps -0xb0(%rbp), %xmm2
subss %xmm1, %xmm2
movaps %xmm2, -0xb0(%rbp)
divss %xmm2, %xmm0
movss 0x1df5f(%rip), %xmm3    # 0x36390
movaps %xmm3, %xmm2
minss %xmm0, %xmm2
movaps %xmm3, %xmm1
subss %xmm2, %xmm1
xorps %xmm2, %xmm2
cmpltss %xmm2, %xmm0
movaps %xmm0, %xmm2
andnps %xmm1, %xmm2
andps %xmm3, %xmm0
orps %xmm2, %xmm0
movaps %xmm0, -0x50(%rbp)
leal 0x24(%rbx,%rbx), %esi
movq -0x58(%rbp), %r14
movq %r14, %rdi
movaps %xmm3, %xmm0
callq 0x1eae4
movl %eax, -0x5c(%rbp)
leal 0x25(,%rbx,2), %esi
movq %r14, %rdi
movss 0x1df11(%rip), %xmm0    # 0x36390
callq 0x1eae4
movl %eax, %r12d
cvtsi2ss %r15d, %xmm0
movss %xmm0, -0x120(%rbp)
incl %r13d
movq %r13, %r14
movaps -0x100(%rbp), %xmm0
movaps -0x130(%rbp), %xmm5
subss %xmm0, %xmm5
addss %xmm5, %xmm0
addss 0x1def8(%rip), %xmm0    # 0x363b0
movaps %xmm0, -0xc0(%rbp)
movaps -0x50(%rbp), %xmm0
xorl %r13d, %r13d
movl -0x40(%rbp), %eax
testl %eax, %eax
cmovgl %eax, %r13d
xorps %xmm2, %xmm2
movaps %xmm5, -0x130(%rbp)
subl $0x1, %r13d
jb 0x18695
movaps %xmm0, -0x50(%rbp)
movaps %xmm2, %xmm0
mulss -0x120(%rbp), %xmm0
cvttss2si %xmm0, %ebx
testl %ebx, %ebx
js 0x1871f
cmpl %r15d, %ebx
jge 0x1871f
movaps -0x180(%rbp), %xmm0
addss %xmm2, %xmm0
movaps %xmm0, -0x40(%rbp)
leal (%r14,%rbx), %eax
cltd
idivl %r15d
movq -0x88(%rbp), %rdi
movl %edx, %esi
movss %xmm2, -0x70(%rbp)
callq *-0x80(%rbp)
movaps %xmm0, %xmm7
subss -0xe0(%rbp), %xmm7
divss -0xb0(%rbp), %xmm7
movss 0x1de46(%rip), %xmm0    # 0x36390
movaps %xmm0, %xmm2
minss %xmm7, %xmm2
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
cmpltss 0x1de4f(%rip), %xmm7    # 0x363b0
movaps %xmm7, %xmm2
andnps %xmm1, %xmm2
andps %xmm0, %xmm7
orps %xmm2, %xmm7
movss -0x70(%rbp), %xmm6
movaps -0xd0(%rbp), %xmm4
mulss %xmm4, %xmm6
movaps -0x50(%rbp), %xmm1
movaps -0x130(%rbp), %xmm5
mulss %xmm5, %xmm1
movl -0x110(%rbp), %eax
testl %eax, %eax
je 0x1861e
movaps -0x40(%rbp), %xmm2
movaps %xmm7, %xmm0
cmpl $0x1, %eax
jne 0x184d9
movq -0x58(%rbp), %rax
movq 0x270(%rax), %rdi
movaps -0xf0(%rbp), %xmm2
addss %xmm2, %xmm6
addss -0x100(%rbp), %xmm1
unpcklps %xmm1, %xmm6            # xmm6 = xmm6[0],xmm1[0],xmm6[1],xmm1[1]
movlps %xmm6, -0x90(%rbp)
movaps %xmm4, %xmm0
mulss -0x40(%rbp), %xmm0
addss %xmm2, %xmm0
addss 0x1ddb6(%rip), %xmm0    # 0x3639c
unpcklps -0xc0(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlps %xmm0, -0x98(%rbp)
cmpl %ebx, -0x78(%rbp)
movl -0x5c(%rbp), %ecx
cmovel %r12d, %ecx
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rsi
leaq -0x98(%rbp), %rdx
pushq $0xf
popq %r8
movaps %xmm7, -0x50(%rbp)
callq 0x29a42
jmp 0x18688
movq -0x58(%rbp), %rax
movq 0x270(%rax), %rdi
movaps -0xf0(%rbp), %xmm3
addss %xmm3, %xmm6
movaps -0x100(%rbp), %xmm2
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm6            # xmm6 = xmm6[0],xmm1[0],xmm6[1],xmm1[1]
movlps %xmm6, -0x90(%rbp)
mulss -0x40(%rbp), %xmm4
addss %xmm3, %xmm4
movaps %xmm7, %xmm1
mulss %xmm5, %xmm1
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movlps %xmm4, -0x98(%rbp)
cmpl %ebx, -0x78(%rbp)
movl -0x5c(%rbp), %ecx
cmovel %r12d, %ecx
leaq -0x90(%rbp), %rsi
leaq -0x98(%rbp), %rdx
movaps %xmm7, -0x50(%rbp)
callq 0x29920
movaps -0x40(%rbp), %xmm2
movaps -0x50(%rbp), %xmm0
jmp 0x184d9
movq 0x10(%rbp), %rdx
testq %rdx, %rdx
movq -0x140(%rbp), %rbx
je 0x186e6
movss -0x9c(%rbp), %xmm0
addss 0x140c(%rbx), %xmm0
leaq -0x90(%rbp), %rdi
movq -0x138(%rbp), %rax
movl %eax, (%rdi)
movss %xmm0, 0x4(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
pushq $0x2
popq %r9
leaq -0x168(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xc49f
movaps -0x160(%rbp), %xmm0
addss 0x141c(%rbx), %xmm0
unpcklps -0x100(%rbp), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
pushq $0x1
popq %rdx
movq -0x148(%rbp), %rdi
xorl %esi, %esi
callq 0xc16e
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ebcc(%rip), %rdi     # 0x372f2
leaq 0x1df40(%rip), %rsi     # 0x3666d
leaq 0x1ebe1(%rip), %rcx     # 0x37315
movl $0x19d5, %edx           # imm = 0x19D5
callq 0x7140
leaq 0x1ebad(%rip), %rdi     # 0x372f2
leaq 0x1df21(%rip), %rsi     # 0x3666d
leaq 0x1ebc2(%rip), %rcx     # 0x37315
movl $0x19bd, %edx           # imm = 0x19BD
callq 0x7140