// File: /workspace/github_cpp_makefile_star2_O2/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 0x67a77(%rip), %rax     # 0xe3ce0
movq (%rax), %r12
movq 0x1ae0(%r12), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
jne 0x7c504
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 0x43d17
movaps %xmm0, %xmm1
movss 0x159c(%r12), %xmm2
addss %xmm2, %xmm2
addss 0x1980(%r12), %xmm2
movaps -0x90(%rbp), %xmm0
callq 0x43dc5
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 0x40d3b
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x40ea5
testb %al, %al
je 0x7c504
movss 0x1fcbb(%rip), %xmm1    # 0x9bff8
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)
pushq $0x7
popq %rdi
callq 0x35d33
movss 0x15a0(%r12), %xmm2
pushq $0x1
popq %rsi
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movl %eax, %edi
callq 0x36a6f
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
pushq $0x28
popq %rdi
movss 0x1fc04(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movss 0x15a0(%r12), %xmm2
xorps %xmm0, %xmm0
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
movaps -0x60(%rbp), %xmm1
callq 0x6bece
movq -0x68(%rbp), %rbx
testq %rbx, %rbx
jne 0x7c454
movss 0x20488(%rip), %xmm0    # 0x9c8b0
mulss -0x60(%rbp), %xmm0
addss 0x25def(%rip), %xmm0    # 0xa2224
cvtss2sd %xmm0, %xmm0
leaq 0x3c1c1(%rip), %rdx     # 0xb8601
leaq -0xd0(%rbp), %rbx
pushq $0x20
popq %rsi
movq %rbx, %rdi
movb $0x1, %al
callq 0x3468c
movss 0x1fb94(%rip), %xmm0    # 0x9bff0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x365e8
movlps %xmm0, -0x70(%rbp)
ucomiss 0x20451(%rip), %xmm0    # 0x9c8c4
jbe 0x7c504
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 0x36673
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq