// File: /workspace/github_cpp_makefile_star2_O3/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 $0x198, %rsp            # imm = 0x198
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xf0(%rbp)
movq 0x387c1(%rip), %r12     # 0x55480
movq 0x1758(%r12), %rax
movb $0x1, 0x72(%rax)
movq %rax, -0x98(%rbp)
cmpb $0x0, 0x74(%rax)
jne 0x1d4e9
movl %r9d, %r14d
movl %r8d, %r15d
movq %rcx, %r13
movq %rsi, %rbx
movl %edi, -0x2c(%rbp)
movq %rdx, -0x78(%rbp)
movss 0x206a5(%rip), %xmm0    # 0x3d39c
movq %rsi, %rdi
xorl %esi, %esi
movl $0x1, %edx
movaps %xmm2, -0x70(%rbp)
callq 0xe505
movaps -0x70(%rbp), %xmm3
movaps %xmm0, %xmm9
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm3
jne 0x1cd48
jp 0x1cd48
movaps %xmm9, -0x40(%rbp)
callq 0x14877
movaps -0x40(%rbp), %xmm9
movaps -0x70(%rbp), %xmm3
movss 0x1408(%r12), %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
movq %rbx, -0x168(%rbp)
jne 0x1cd8a
jp 0x1cd8a
movaps %xmm9, %xmm2
shufps $0x55, %xmm9, %xmm2     # xmm2 = xmm2[1,1],xmm9[1,1]
movss 0x140c(%r12), %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 0x1cd94
movss 0x140c(%r12), %xmm0
movq %r14, -0xc0(%rbp)
movq -0x98(%rbp), %rax
movss 0xa8(%rax), %xmm5
movaps %xmm3, -0x70(%rbp)
addss %xmm3, %xmm5
addss 0xac(%rax), %xmm1
movaps %xmm5, %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movq 0xa8(%rax), %rbx
movq %rbx, -0x178(%rbp)
movaps %xmm2, -0x150(%rbp)
movlps %xmm2, -0x170(%rbp)
movd %ebx, %xmm2
movq %rbx, %rax
shrq $0x20, %rax
movd %eax, %xmm6
movss 0x1408(%r12), %xmm3
movaps %xmm5, %xmm7
subss %xmm3, %xmm7
addss %xmm2, %xmm3
movaps %xmm0, %xmm4
addss %xmm6, %xmm4
movaps %xmm3, -0x120(%rbp)
movaps %xmm4, -0x130(%rbp)
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movaps %xmm1, %xmm8
subss %xmm0, %xmm8
movaps %xmm7, -0xe0(%rbp)
movaps %xmm7, %xmm4
movaps %xmm8, -0x110(%rbp)
unpcklps %xmm8, %xmm4            # xmm4 = xmm4[0],xmm8[0],xmm4[1],xmm8[1]
movlhps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
movups %xmm3, -0x1a0(%rbp)
xorps %xmm4, %xmm4
ucomiss %xmm4, %xmm9
xorps %xmm3, %xmm3
jbe 0x1ce5c
movss 0x141c(%r12), %xmm3
addss %xmm9, %xmm3
movaps %xmm5, -0x190(%rbp)
addss %xmm5, %xmm3
addss %xmm4, %xmm1
movaps %xmm3, %xmm4
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
leaq -0x1b0(%rbp), %r14
movq %rbx, (%r14)
movlps %xmm4, 0x8(%r14)
subss %xmm2, %xmm3
movss %xmm6, -0xac(%rbp)
subss %xmm6, %xmm1
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
leaq -0x90(%rbp), %rdi
movlps %xmm3, (%rdi)
callq 0xa99d
movq %r14, %rdi
xorl %esi, %esi
callq 0xaaef
testb %al, %al
je 0x1d4e9
movq %rbx, %xmm1
movaps -0xf0(%rbp), %xmm0
ucomiss 0x20509(%rip), %xmm0    # 0x3d3d0
movq %rbx, -0x158(%rbp)
movq %r13, -0xa0(%rbp)
movdqa %xmm1, -0x140(%rbp)
jne 0x1cee1
jnp 0x1cefb
movaps -0xd0(%rbp), %xmm0
ucomiss 0x204e1(%rip), %xmm0    # 0x3d3d0
jne 0x1cfab
jp 0x1cfab
movss 0x204cd(%rip), %xmm0    # 0x3d3d0
testl %r15d, %r15d
jle 0x1cf5c
xorl %r14d, %r14d
movss 0x204a9(%rip), %xmm0    # 0x3d3bc
movss 0x204b5(%rip), %xmm4    # 0x3d3d0
movq -0x78(%rbp), %rbx
movaps %xmm0, -0x50(%rbp)
movaps %xmm4, -0x40(%rbp)
movq %r13, %rdi
movl %r14d, %esi
callq *%rbx
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, %xmm0
cmpl %r14d, %r15d
jne 0x1cf1f
jmp 0x1cf67
movd 0x20458(%rip), %xmm1    # 0x3d3bc
movaps %xmm0, %xmm4
movaps -0xf0(%rbp), %xmm2
movaps %xmm2, %xmm0
movss 0x20457(%rip), %xmm3    # 0x3d3d0
cmpeqss %xmm3, %xmm0
andps %xmm0, %xmm4
andnps %xmm2, %xmm0
orps %xmm4, %xmm0
movaps -0xd0(%rbp), %xmm2
cmpeqss %xmm2, %xmm3
pand %xmm3, %xmm1
andnps %xmm2, %xmm3
orps %xmm1, %xmm3
movaps %xmm3, -0xd0(%rbp)
movaps %xmm0, -0xf0(%rbp)
movq 0x384ce(%rip), %rax     # 0x55480
movups 0x14c0(%rax), %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x13e8(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8c82
movss 0x1410(%r12), %xmm2
movaps -0x140(%rbp), %xmm0
movaps -0x150(%rbp), %xmm1
movl %eax, %edi
movl $0x1, %esi
callq 0xe58d
cvttss2si -0x70(%rbp), %r13d
cmpl %r15d, %r13d
cmovgel %r15d, %r13d
xorl %r14d, %r14d
cmpl $0x0, -0x2c(%rbp)
sete %r14b
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xad1f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movaps -0xe0(%rbp), %xmm0
subss -0x120(%rbp), %xmm0
movaps %xmm0, -0xe0(%rbp)
testb %al, %al
movq %r12, -0x160(%rbp)
je 0x1d139
movl %r14d, -0x40(%rbp)
movl %r14d, %eax
negl %eax
movss 0xf0(%r12), %xmm0
subss -0x120(%rbp), %xmm0
divss -0xe0(%rbp), %xmm0
movss 0x203e5(%rip), %xmm1    # 0x3d460
minss %xmm0, %xmm1
xorps %xmm2, %xmm2
cmpltss %xmm2, %xmm0
andnps %xmm1, %xmm0
addl %r15d, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ebx
testl %ebx, %ebx
js 0x1d51a
cmpl %r15d, %ebx
jge 0x1d51a
movq -0xc0(%rbp), %rax
addl %ebx, %eax
cltd
idivl %r15d
movq -0xa0(%rbp), %r14
movq %r14, %rdi
movl %edx, %esi
movq -0x78(%rbp), %r12
callq *%r12
movss %xmm0, -0x50(%rbp)
movq -0xc0(%rbp), %rax
addl %ebx, %eax
incl %eax
cltd
idivl %r15d
movq %r14, %rdi
movl %edx, %esi
callq *%r12
movl -0x2c(%rbp), %eax
testl %eax, %eax
je 0x1d110
movss -0x50(%rbp), %xmm0
cmpl $0x1, %eax
jne 0x1d135
cvtss2sd %xmm0, %xmm0
leaq 0x212e0(%rip), %rdi     # 0x3e3e5
movl %ebx, %esi
movb $0x1, %al
callq 0xf4b7
jmp 0x1d135
leal 0x1(%rbx), %edx
xorps %xmm2, %xmm2
cvtss2sd -0x50(%rbp), %xmm2
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
leaq 0x212b2(%rip), %rdi     # 0x3e3db
movl %ebx, %esi
movaps %xmm2, %xmm0
movb $0x2, %al
callq 0xf4b7
movl -0x40(%rbp), %r14d
movq %rbx, -0xf8(%rbp)
subl %r14d, %r13d
xorl %ebx, %ebx
cmpl $0x0, -0x2c(%rbp)
setne %bl
movq -0xc0(%rbp), %rax
cltd
idivl %r15d
movq -0xa0(%rbp), %rdi
movl %edx, %esi
callq *-0x78(%rbp)
movaps %xmm0, -0x70(%rbp)
movq 0x38312(%rip), %r14     # 0x55480
shll $0x5, %ebx
movups 0x16a0(%r14,%rbx), %xmm0
leaq -0x90(%rbp), %r12
movaps %xmm0, (%r12)
movss 0x13e8(%r14), %xmm1
movss %xmm1, -0x40(%rbp)
movss 0xc(%r12), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0xc(%r12)
movq %r12, %rdi
callq 0x8c82
movl %eax, -0x54(%rbp)
movups 0x16b0(%r14,%rbx), %xmm0
movq -0xc0(%rbp), %r14
movaps %xmm0, (%r12)
movss -0x40(%rbp), %xmm0
mulss 0xc(%r12), %xmm0
movss %xmm0, 0xc(%r12)
leaq -0x90(%rbp), %rdi
callq 0x8c82
movaps -0x70(%rbp), %xmm6
testl %r13d, %r13d
jle 0x1d46d
movl %eax, %r12d
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
movss 0x2018b(%rip), %xmm0    # 0x3d390
movaps %xmm0, %xmm2
divss %xmm1, %xmm2
movaps %xmm2, -0x140(%rbp)
movaps -0xd0(%rbp), %xmm2
movaps -0xf0(%rbp), %xmm1
subss %xmm1, %xmm2
subss %xmm1, %xmm6
movaps %xmm2, -0xd0(%rbp)
divss %xmm2, %xmm6
movaps %xmm0, %xmm2
minss %xmm6, %xmm2
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
xorps %xmm3, %xmm3
cmpltss %xmm3, %xmm6
movaps %xmm6, %xmm2
andnps %xmm1, %xmm2
andps %xmm0, %xmm6
orps %xmm2, %xmm6
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss %xmm0, -0x150(%rbp)
incl %r14d
movaps -0x130(%rbp), %xmm0
movaps -0x110(%rbp), %xmm1
subss %xmm0, %xmm1
movaps %xmm1, -0x110(%rbp)
addss %xmm1, %xmm0
addss %xmm3, %xmm0
movaps %xmm0, -0xc0(%rbp)
xorps %xmm0, %xmm0
movaps %xmm6, -0x70(%rbp)
movaps %xmm0, %xmm1
mulss -0x150(%rbp), %xmm0
cvttss2si %xmm0, %ebx
testl %ebx, %ebx
js 0x1d4fb
cmpl %r15d, %ebx
jge 0x1d4fb
movaps -0x140(%rbp), %xmm0
addss %xmm1, %xmm0
movaps %xmm0, -0x40(%rbp)
leal (%r14,%rbx), %eax
cltd
idivl %r15d
movq -0xa0(%rbp), %rdi
movl %edx, %esi
movaps %xmm1, -0x50(%rbp)
callq *-0x78(%rbp)
movaps %xmm0, %xmm6
subss -0xf0(%rbp), %xmm6
divss -0xd0(%rbp), %xmm6
movss 0x20096(%rip), %xmm4    # 0x3d390
movaps %xmm4, %xmm0
minss %xmm6, %xmm0
movaps %xmm4, %xmm1
subss %xmm0, %xmm1
cmpltss 0x200c7(%rip), %xmm6    # 0x3d3d8
movaps %xmm6, %xmm0
andnps %xmm1, %xmm0
andps %xmm4, %xmm6
orps %xmm0, %xmm6
movl -0x2c(%rbp), %eax
testl %eax, %eax
je 0x1d3cb
movaps -0x50(%rbp), %xmm1
cmpl $0x1, %eax
jne 0x1d460
movq -0x98(%rbp), %rax
movq 0x270(%rax), %rdi
movaps -0xe0(%rbp), %xmm0
movaps %xmm1, %xmm3
mulss %xmm0, %xmm3
movaps -0x120(%rbp), %xmm1
addss %xmm1, %xmm3
movaps -0x70(%rbp), %xmm2
mulss -0x110(%rbp), %xmm2
addss -0x130(%rbp), %xmm2
unpcklps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movlps %xmm3, -0x90(%rbp)
mulss -0x40(%rbp), %xmm0
addss %xmm1, %xmm0
addss 0x20011(%rip), %xmm0    # 0x3d39c
unpcklps -0xc0(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlps %xmm0, -0xa8(%rbp)
cmpl %ebx, -0xf8(%rbp)
movl -0x54(%rbp), %ecx
cmovel %r12d, %ecx
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movl $0xf, %r8d
movaps %xmm6, -0x50(%rbp)
callq 0x2f984
jmp 0x1d45c
movq -0x98(%rbp), %rax
movq 0x270(%rax), %rdi
movaps -0xe0(%rbp), %xmm0
movaps -0x50(%rbp), %xmm7
mulss %xmm0, %xmm7
movaps -0x120(%rbp), %xmm1
addss %xmm1, %xmm7
movaps -0x110(%rbp), %xmm3
movaps -0x70(%rbp), %xmm5
mulss %xmm3, %xmm5
movaps -0x130(%rbp), %xmm2
addss %xmm2, %xmm5
unpcklps %xmm5, %xmm7            # xmm7 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
movlps %xmm7, -0x90(%rbp)
mulss -0x40(%rbp), %xmm0
addss %xmm1, %xmm0
movaps %xmm3, %xmm1
mulss %xmm6, %xmm1
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, -0xa8(%rbp)
cmpl %ebx, -0xf8(%rbp)
movl -0x54(%rbp), %ecx
cmovel %r12d, %ecx
leaq -0x90(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movaps %xmm4, %xmm0
movaps %xmm6, -0x50(%rbp)
callq 0x2f6ea
movaps -0x50(%rbp), %xmm6
decl %r13d
movaps -0x40(%rbp), %xmm0
jne 0x1d294
movq 0x10(%rbp), %rdx
testq %rdx, %rdx
movq -0x160(%rbp), %rbx
movss -0xac(%rbp), %xmm0
je 0x1d4c0
addss 0x140c(%rbx), %xmm0
leaq -0x170(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq -0x158(%rbp), %rax
movl %eax, (%rdi)
movss %xmm0, 0x4(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x2, %r9d
callq 0xe23a
movaps -0x190(%rbp), %xmm0
addss 0x141c(%rbx), %xmm0
unpcklps -0x130(%rbp), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq -0x168(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xdecf
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20e38(%rip), %rdi     # 0x3e33a
leaq 0x201ac(%rip), %rsi     # 0x3d6b5
leaq 0x20e4d(%rip), %rcx     # 0x3e35d
movl $0x19d5, %edx           # imm = 0x19D5
callq 0x7140
leaq 0x20e19(%rip), %rdi     # 0x3e33a
leaq 0x2018d(%rip), %rsi     # 0x3d6b5
leaq 0x20e2e(%rip), %rcx     # 0x3e35d
movl $0x19bd, %edx           # imm = 0x19BD
callq 0x7140