// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ProgressBar(float, ImVec2 const&, char const*)
void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* overlay)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return;

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

    ImVec2 pos = window->DC.CursorPos;
    ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), g.FontSize + style.FramePadding.y * 2.0f);
    ImRect bb(pos, pos + size);
    ItemSize(size, style.FramePadding.y);
    if (!ItemAdd(bb, 0))
        return;

    // Render
    fraction = ImSaturate(fraction);
    RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
    bb.Expand(ImVec2(-style.FrameBorderSize, -style.FrameBorderSize));
    const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y);
    RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding);

    // Default displaying the fraction as percentage string, but user can override it
    char overlay_buf[32];
    if (!overlay)
    {
        ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction * 100 + 0.01f);
        overlay = overlay_buf;
    }

    ImVec2 overlay_size = CalcTextSize(overlay, NULL);
    if (overlay_size.x > 0.0f)
        RenderTextClipped(ImVec2(ImClamp(fill_br.x + style.ItemSpacing.x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f, 0.5f), &bb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
leaq 0x68cc0(%rip), %rax     # 0xfbcd0
movq (%rax), %r12
movq 0x1ae0(%r12), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
jne 0x932b3
movaps %xmm0, -0x60(%rbp)
movq %rsi, -0x68(%rbp)
movl 0xd8(%r15), %r13d
movl 0xdc(%r15), %ebx
movd %r13d, %xmm0
movdqa %xmm0, -0x40(%rbp)
movl %ebx, -0x50(%rbp)
movsd (%rdi), %xmm0
movaps %xmm0, -0x90(%rbp)
callq 0x5614d
movaps %xmm0, %xmm1
movss 0x159c(%r12), %xmm2
addss %xmm2, %xmm2
addss 0x1980(%r12), %xmm2
movaps -0x90(%rbp), %xmm0
callq 0x5620c
leaq -0x98(%rbp), %rdi
movlps %xmm0, (%rdi)
movaps -0x40(%rbp), %xmm1
addss %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss -0x50(%rbp), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
leaq -0x80(%rbp), %r14
movl %r13d, (%r14)
movl %ebx, 0x4(%r14)
movlps %xmm1, 0x8(%r14)
movss 0x159c(%r12), %xmm0
callq 0x52315
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x524a8
testb %al, %al
je 0x932b3
movss 0x21f00(%rip), %xmm1    # 0xb4fe4
movaps %xmm1, %xmm3
movaps %xmm1, %xmm0
movaps -0x60(%rbp), %xmm2
minss %xmm2, %xmm3
xorps %xmm1, %xmm1
cmpltss %xmm1, %xmm2
andnps %xmm3, %xmm2
movaps %xmm2, -0x60(%rbp)
movsd (%r14), %xmm1
movaps %xmm1, -0x50(%rbp)
movsd 0x8(%r14), %xmm1
movaps %xmm1, -0x40(%rbp)
movl $0x7, %edi
callq 0x43bca
movss 0x15a0(%r12), %xmm2
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movl %eax, %edi
movl $0x1, %esi
callq 0x44f69
movss 0x15a4(%r12), %xmm0
movss (%r14), %xmm1
addss %xmm0, %xmm1
movss %xmm1, -0x40(%rbp)
movss %xmm1, (%r14)
movss 0x4(%r14), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x4(%r14)
movss 0x8(%r14), %xmm2
movss 0xc(%r14), %xmm1
subss %xmm0, %xmm2
movaps %xmm2, -0x50(%rbp)
movss %xmm2, 0x8(%r14)
subss %xmm0, %xmm1
movss %xmm1, 0xc(%r14)
movq 0x2b8(%r15), %r15
movl $0x28, %edi
movss 0x21e43(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movss 0x15a0(%r12), %xmm2
xorps %xmm0, %xmm0
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
movaps -0x60(%rbp), %xmm1
callq 0x8257c
movq -0x68(%rbp), %rbx
testq %rbx, %rbx
jne 0x93203
movss 0x226af(%rip), %xmm0    # 0xb5884
mulss -0x60(%rbp), %xmm0
addss 0x27d02(%rip), %xmm0    # 0xbaee4
cvtss2sd %xmm0, %xmm0
leaq 0x3e0a4(%rip), %rdx     # 0xd1291
leaq -0xd0(%rbp), %rbx
movl $0x20, %esi
movq %rbx, %rdi
movb $0x1, %al
callq 0x41f22
movss 0x21dc5(%rip), %xmm0    # 0xb4fd0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44a23
movlps %xmm0, -0x70(%rbp)
ucomiss 0x22622(%rip), %xmm0    # 0xb5844
jbe 0x932b3
movaps -0x50(%rbp), %xmm4
movss -0x40(%rbp), %xmm1
subss %xmm1, %xmm4
mulss -0x60(%rbp), %xmm4
leaq -0x78(%rbp), %rsi
addss %xmm1, %xmm4
addss 0x15a8(%r12), %xmm4
movss (%rsi), %xmm1
subss %xmm0, %xmm1
subss 0x15b0(%r12), %xmm1
minss %xmm4, %xmm1
movss -0x8(%rsi), %xmm0
movss -0x4(%rsi), %xmm2
cmpltss %xmm0, %xmm4
movaps %xmm4, %xmm3
andnps %xmm1, %xmm3
andps %xmm0, %xmm4
orps %xmm3, %xmm4
leaq -0xa8(%rbp), %rdi
movss %xmm4, (%rdi)
movss %xmm2, 0x4(%rdi)
movabsq $0x3f00000000000000, %rax # imm = 0x3F00000000000000
leaq -0xa0(%rbp), %r9
movq %rax, (%r9)
movq %r14, (%rsp)
leaq -0x70(%rbp), %r8
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x44ac2
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq