// File: /workspace/github_cpp_makefile_star2_O1/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 0x69022(%rip), %rax     # 0xfdcd0
movq (%rax), %r12
movq 0x1ae0(%r12), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
jne 0x94f5c
movaps %xmm0, -0x60(%rbp)
movq %rsi, -0x70(%rbp)
movl 0xd8(%r15), %r13d
movl 0xdc(%r15), %ebx
movd %r13d, %xmm0
movdqa %xmm0, -0x40(%rbp)
movd %ebx, %xmm0
movdqa %xmm0, -0x50(%rbp)
movsd (%rdi), %xmm0
movaps %xmm0, -0x90(%rbp)
callq 0x57252
movaps %xmm0, %xmm1
movss 0x159c(%r12), %xmm2
addss %xmm2, %xmm2
addss 0x1980(%r12), %xmm2
movaps -0x90(%rbp), %xmm0
callq 0x57311
leaq -0x98(%rbp), %rdi
movlps %xmm0, (%rdi)
movaps -0x40(%rbp), %xmm0
addss (%rdi), %xmm0
movaps -0x50(%rbp), %xmm1
addss 0x4(%rdi), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x80(%rbp), %r14
movl %r13d, (%r14)
movl %ebx, 0x4(%r14)
movlps %xmm0, 0x8(%r14)
movss 0x159c(%r12), %xmm0
callq 0x532de
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5346f
testb %al, %al
je 0x94f5c
movss 0x2225c(%rip), %xmm1    # 0xb6fe4
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 0x445bd
movss 0x15a0(%r12), %xmm2
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movl %eax, %edi
movl $0x1, %esi
callq 0x459e5
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 0x2219f(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movss 0x15a0(%r12), %xmm2
xorps %xmm0, %xmm0
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
movaps -0x60(%rbp), %xmm1
callq 0x84158
movq -0x70(%rbp), %rbx
testq %rbx, %rbx
jne 0x94ea7
movss 0x22a0b(%rip), %xmm0    # 0xb7884
mulss -0x60(%rbp), %xmm0
addss 0x2808e(%rip), %xmm0    # 0xbcf14
cvtss2sd %xmm0, %xmm0
leaq 0x3e530(%rip), %rdx     # 0xd33c1
leaq -0xd0(%rbp), %rbx
movl $0x20, %esi
movq %rbx, %rdi
movb $0x1, %al
callq 0x427cb
movss 0x22121(%rip), %xmm0    # 0xb6fd0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4548d
movlps %xmm0, -0x68(%rbp)
movss -0x68(%rbp), %xmm0
ucomiss 0x22979(%rip), %xmm0    # 0xb7844
jbe 0x94f5c
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 -0x68(%rbp), %r8
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x45527
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq