// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::VSliderScalar(char const*, ImVec2 const&, int, void*, void const*, void const*, char const*, int)
bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);

    const ImVec2 label_size = CalcTextSize(label, NULL, true);
    const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size);
    const ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));

    ItemSize(bb, style.FramePadding.y);
    if (!ItemAdd(frame_bb, id))
        return false;

    // Default format string when passing NULL
    if (format == NULL)
        format = DataTypeGetInfo(data_type)->PrintFmt;
    else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.)
        format = PatchFormatStringFloatToInt(format);

    const bool hovered = ItemHoverable(frame_bb, id);
    if ((hovered && g.IO.MouseClicked[0]) || g.NavActivateId == id || g.NavInputId == id)
    {
        SetActiveID(id, window);
        SetFocusID(id, window);
        FocusWindow(window);
        g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down);
    }

    // Draw frame
    const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
    RenderNavHighlight(frame_bb, id);
    RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding);

    // Slider behavior
    ImRect grab_bb;
    const bool value_changed = SliderBehavior(frame_bb, id, data_type, p_data, p_min, p_max, format, flags | ImGuiSliderFlags_Vertical, &grab_bb);
    if (value_changed)
        MarkItemEdited(id);

    // Render grab
    if (grab_bb.Max.y > grab_bb.Min.y)
        window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding);

    // Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
    // For the vertical slider we allow centered text to overlap the frame padding
    char value_buf[64];
    const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format);
    RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f, 0.0f));
    if (label_size.x > 0.0f)
        RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %edx, -0x2c(%rbp)
leaq 0x63722(%rip), %rax     # 0xe3ce0
movq (%rax), %rbx
movq 0x1ae0(%rbx), %r12
movb $0x1, 0x90(%r12)
cmpb $0x0, 0x93(%r12)
je 0x805e4
xorl %r15d, %r15d
jmp 0x808e2
movq %rsi, %r14
movq %rdi, %r15
movq %r8, -0x70(%rbp)
movq %r9, -0x78(%rbp)
movq %rcx, -0x50(%rbp)
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3700a
movl %eax, %r13d
pushq $0x1
popq %rdx
movss 0x1b9df(%rip), %xmm0    # 0x9bff0
movq %r15, -0x68(%rbp)
movq %r15, %rdi
xorl %esi, %esi
callq 0x365e8
movss 0xd8(%r12), %xmm4
addss (%r14), %xmm4
movss 0xdc(%r12), %xmm1
addss 0x4(%r14), %xmm1
movaps %xmm4, %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movq 0xd8(%r12), %rax
movq %rax, -0x48(%rbp)
movlps %xmm2, -0x40(%rbp)
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
xorps %xmm2, %xmm2
jbe 0x8066b
movss 0x15b0(%rbx), %xmm2
addss %xmm0, %xmm2
movaps %xmm0, -0x90(%rbp)
addss %xmm4, %xmm2
addss %xmm3, %xmm1
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
leaq -0xb0(%rbp), %rdi
movq %rax, (%rdi)
movlps %xmm2, 0x8(%rdi)
movss 0x159c(%rbx), %xmm0
callq 0x4388d
xorl %r15d, %r15d
leaq -0x48(%rbp), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x40ea5
testb %al, %al
je 0x808e2
movq 0x10(%rbp), %rdi
testq %rdi, %rdi
je 0x806d8
cmpl $0x4, -0x2c(%rbp)
jne 0x806ea
cmpb $0x25, (%rdi)
jne 0x806d1
cmpb $0x64, 0x1(%rdi)
jne 0x806d1
cmpb $0x0, 0x2(%rdi)
je 0x806ea
callq 0x7f1ea
jmp 0x806e4
movl -0x2c(%rbp), %edi
callq 0x7ddfc
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x806ee
movq %rdi, -0x38(%rbp)
leaq -0x48(%rbp), %rdi
movl %r13d, %esi
callq 0x37658
testb %al, %al
je 0x80707
cmpb $0x0, 0x420(%rbx)
jne 0x80719
cmpl %r13d, 0x1ca0(%rbx)
je 0x80719
cmpl %r13d, 0x1cac(%rbx)
jne 0x8073e
movl %r13d, %edi
movq %r12, %rsi
callq 0x3739b
movl %r13d, %edi
movq %r12, %rsi
callq 0x454cc
movq %r12, %rdi
callq 0x37fa1
orb $0xc, 0x1b44(%rbx)
movl 0x18(%rbp), %r14d
cmpl %r13d, 0x1b30(%rbx)
jne 0x80750
pushq $0x9
popq %rdi
jmp 0x80760
xorl %edi, %edi
cmpl %r13d, 0x1b1c(%rbx)
sete %dil
addl $0x7, %edi
movss 0x1b890(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movl %eax, %r15d
leaq -0x48(%rbp), %rdi
pushq $0x1
popq %rdx
movl %r13d, %esi
callq 0x36c91
leaq -0x48(%rbp), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movss 0x15a0(%rbx), %xmm2
movl %r15d, %edi
pushq $0x1
popq %rsi
callq 0x36a6f
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rax
movaps %xmm0, (%rax)
orl $0x100000, %r14d        # imm = 0x100000
movq %rax, 0x10(%rsp)
movl %r14d, 0x8(%rsp)
movq -0x38(%rbp), %rax
movq %rax, (%rsp)
leaq -0x48(%rbp), %rdi
movl %r13d, %esi
movl -0x2c(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x70(%rbp), %r8
movq -0x78(%rbp), %r9
callq 0x7fa9b
movl %eax, %r15d
testb %al, %al
je 0x807ec
movl %r13d, %edi
callq 0x3749e
movss -0x54(%rbp), %xmm0
ucomiss -0x5c(%rbp), %xmm0
jbe 0x8083a
movq 0x2b8(%r12), %r14
xorl %edi, %edi
cmpl %r13d, 0x1b30(%rbx)
sete %dil
addl $0x13, %edi
movss 0x1b7e1(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movss 0x15dc(%rbx), %xmm0
leaq -0x60(%rbp), %rsi
pushq $0xf
popq %r8
movq %r14, %rdi
leaq -0x58(%rbp), %rdx
movl %eax, %ecx
callq 0x64020
leaq -0xf0(%rbp), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
movl -0x2c(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0x7de35
cltq
leaq (%rax,%rbp), %rcx
addq $-0xf0, %rcx
movss -0x48(%rbp), %xmm0
movss -0x44(%rbp), %xmm1
addss 0x159c(%rbx), %xmm1
leaq -0xa0(%rbp), %rdi
movss %xmm0, (%rdi)
movss %xmm1, 0x4(%rdi)
leaq -0x98(%rbp), %r9
movq $0x3f000000, (%r9)      # imm = 0x3F000000
andq $0x0, (%rsp)
leaq -0x40(%rbp), %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x36673
xorps %xmm0, %xmm0
movaps -0x90(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x808e2
movss -0x40(%rbp), %xmm0
addss 0x15b0(%rbx), %xmm0
movss -0x44(%rbp), %xmm1
addss 0x159c(%rbx), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pushq $0x1
popq %rdx
movq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x36156
movl %r15d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq