// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::SliderScalar(char const*, int, void*, void const*, void const*, char const*, int)
bool ImGui::SliderScalar(const char* label, 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 float w = CalcItemWidth();

    const ImVec2 label_size = CalcTextSize(label, NULL, true);
    const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y * 2.0f));
    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.0f));

    ItemSize(total_bb, style.FramePadding.y);
    if (!ItemAdd(total_bb, id, &frame_bb))
        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);

    // Tabbing or CTRL-clicking on Slider turns it into an input box
    const bool hovered = ItemHoverable(frame_bb, id);
    const bool temp_input_allowed = (flags & ImGuiSliderFlags_NoInput) == 0;
    bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id);
    if (!temp_input_is_active)
    {
        const bool focus_requested = temp_input_allowed && FocusableItemRegister(window, id);
        const bool clicked = (hovered && g.IO.MouseClicked[0]);
        if (focus_requested || clicked || g.NavActivateId == id || g.NavInputId == id)
        {
            SetActiveID(id, window);
            SetFocusID(id, window);
            FocusWindow(window);
            g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
            if (temp_input_allowed && (focus_requested || (clicked && g.IO.KeyCtrl) || g.NavInputId == id))
            {
                temp_input_is_active = true;
                FocusableItemUnregister(window);
            }
        }
    }

    if (temp_input_is_active)
    {
        // Only clamp CTRL+Click input when ImGuiSliderFlags_AlwaysClamp is set
        const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0;
        return TempInputScalar(frame_bb, id, label, data_type, p_data, format, is_clamp_input ? p_min : NULL, is_clamp_input ? p_max : NULL);
    }

    // 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, &grab_bb);
    if (value_changed)
        MarkItemEdited(id);

    // Render grab
    if (grab_bb.Max.x > grab_bb.Min.x)
        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.
    char value_buf[64];
    const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format);
    RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f, 0.5f));

    if (label_size.x > 0.0f)
        RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);

    IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags);
    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0x65168(%rip), %r13     # 0xfdcd0
movq (%r13), %rbx
movq 0x1ae0(%rbx), %r12
movb $0x1, 0x90(%r12)
cmpb $0x0, 0x93(%r12)
jne 0x98ca9
movq %rdi, %r14
movq %rcx, -0x68(%rbp)
movq %r8, -0x70(%rbp)
movq %r9, -0x38(%rbp)
movl %esi, -0x30(%rbp)
movq %rdx, -0x50(%rbp)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x46258
movl %eax, -0x2c(%rbp)
callq 0x57252
movaps %xmm0, -0x90(%rbp)
movss 0x1e40b(%rip), %xmm0    # 0xb6fd0
movq %r14, -0x60(%rbp)
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4548d
movaps %xmm0, %xmm3
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movss 0x159c(%rbx), %xmm0
movaps %xmm0, %xmm2
addss %xmm0, %xmm2
addss %xmm1, %xmm2
movaps -0x90(%rbp), %xmm1
addss 0xd8(%r12), %xmm1
addss 0xdc(%r12), %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movq 0xd8(%r12), %rax
movq %rax, -0x48(%rbp)
movlps %xmm1, -0x40(%rbp)
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm3
xorps %xmm2, %xmm2
jbe 0x98c3a
movss 0x15b0(%rbx), %xmm2
addss %xmm3, %xmm2
movaps %xmm3, -0x90(%rbp)
leaq -0x48(%rbp), %r14
addss 0x8(%r14), %xmm2
addss 0xc(%r14), %xmm1
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
leaq -0xa8(%rbp), %r15
movq %rax, (%r15)
movlps %xmm2, 0x8(%r15)
movq %r15, %rdi
callq 0x56a82
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movq %r14, %rdx
callq 0x5346f
testb %al, %al
je 0x98ca9
movq -0x38(%rbp), %r14
testq %r14, %r14
je 0x98cb1
cmpl $0x4, -0x30(%rbp)
jne 0x98cd3
leaq 0x257ef(%rip), %rsi     # 0xbe482
movq %r14, %rdi
callq 0xc720
testl %eax, %eax
je 0x98cd3
movq %r14, %rdi
callq 0x97ded
jmp 0x98ccf
xorl %r14d, %r14d
jmp 0x98df9
movl -0x30(%rbp), %eax
cmpl $0xa, %eax
jae 0x98fae
movl %eax, %eax
shlq $0x5, %rax
leaq 0x5fd46(%rip), %rcx     # 0xf8a10
movq 0x10(%rax,%rcx), %rax
movq %rax, -0x38(%rbp)
movl 0x10(%rbp), %r14d
leaq -0x48(%rbp), %rdi
movl -0x2c(%rbp), %r15d
movl %r15d, %esi
callq 0x46e45
movl %eax, %ecx
testb %r14b, %r14b
js 0x98d0a
movq (%r13), %rax
cmpl %r15d, 0x1b30(%rax)
movl %r15d, %esi
jne 0x98d12
cmpl %esi, 0x3068(%rax)
sete %r13b
jmp 0x98d15
xorl %r13d, %r13d
movl %r15d, %esi
jmp 0x98d15
xorl %r13d, %r13d
movl 0x10(%rbp), %r15d
testb %r13b, %r13b
jne 0x98dc0
testb %r15b, %r15b
js 0x98d3a
movq %r12, %rdi
movl %ecx, %r14d
callq 0x47129
movl %r14d, %ecx
movl -0x2c(%rbp), %esi
jmp 0x98d3c
xorl %eax, %eax
testb %cl, %cl
je 0x98d49
movb 0x420(%rbx), %r14b
jmp 0x98d4c
xorl %r14d, %r14d
movl %eax, -0x54(%rbp)
orb %r14b, %al
testb $0x1, %al
jne 0x98d66
cmpl %esi, 0x1ca0(%rbx)
je 0x98d66
cmpl %esi, 0x1cac(%rbx)
jne 0x98dbb
movl %esi, %edi
movq %r12, %rsi
callq 0x46b95
movl -0x2c(%rbp), %edi
movq %r12, %rsi
callq 0x58de3
movq %r12, %rdi
callq 0x47d9b
movl -0x2c(%rbp), %esi
orb $0x3, 0x1b44(%rbx)
testb %r15b, %r15b
js 0x98dbb
cmpb $0x0, -0x54(%rbp)
jne 0x98dae
testb %r14b, %r14b
je 0x98da6
cmpb $0x0, 0x140(%rbx)
jne 0x98dae
cmpl %esi, 0x1cac(%rbx)
jne 0x98dbb
movq %r12, %rdi
callq 0x471ff
movl -0x2c(%rbp), %esi
jmp 0x98dc0
testb %r13b, %r13b
je 0x98e0e
xorl %eax, %eax
testb $0x10, %r15b
movq -0x68(%rbp), %r11
cmoveq %rax, %r11
movq -0x70(%rbp), %r10
cmoveq %rax, %r10
leaq -0x48(%rbp), %rdi
movq -0x60(%rbp), %rdx
movl -0x30(%rbp), %ecx
movq -0x50(%rbp), %r8
movq -0x38(%rbp), %r9
pushq %r10
pushq %r11
callq 0x97ec7
addq $0x10, %rsp
movl %eax, %r14d
movl %r14d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x9, %edi
cmpl %esi, 0x1b30(%rbx)
je 0x98e2a
xorl %edi, %edi
cmpl %esi, 0x1b1c(%rbx)
sete %dil
addl $0x7, %edi
movss 0x1e1b2(%rip), %xmm0    # 0xb6fe4
movl %esi, %r15d
callq 0x445bd
movl %eax, %r13d
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x45ca4
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
movss 0x15a0(%rbx), %xmm2
movl %r13d, %edi
movl $0x1, %esi
callq 0x459e5
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %rax
movaps %xmm0, (%rax)
subq $0x8, %rsp
movq %r14, %rdi
movl %r15d, %esi
movl -0x30(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x70(%rbp), %r9
pushq %rax
movl 0x10(%rbp), %eax
pushq %rax
pushq -0x38(%rbp)
callq 0x987b4
addq $0x20, %rsp
movl %eax, %r14d
testb %al, %al
je 0x98eb4
movl -0x2c(%rbp), %edi
callq 0x46ca4
leaq -0x40(%rbp), %r15
movss -0x78(%rbp), %xmm0
ucomiss -0x80(%rbp), %xmm0
jbe 0x98f0d
leaq -0x78(%rbp), %r13
movq 0x2b8(%r12), %r12
xorl %edi, %edi
movl -0x2c(%rbp), %eax
cmpl %eax, 0x1b30(%rbx)
sete %dil
addl $0x13, %edi
movss 0x1e0fb(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movss 0x15dc(%rbx), %xmm0
leaq -0x80(%rbp), %rsi
movq %r12, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl $0xf, %r8d
callq 0x79d4a
leaq -0xf0(%rbp), %r12
movq %r12, %rdi
movl $0x40, %esi
movl -0x30(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0x968ed
cltq
leaq (%rax,%rbp), %rcx
addq $-0xf0, %rcx
movabsq $0x3f0000003f000000, %rax # imm = 0x3F0000003F000000
leaq -0x98(%rbp), %r9
movq %rax, (%r9)
subq $0x8, %rsp
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
pushq $0x0
callq 0x45527
addq $0x10, %rsp
xorps %xmm0, %xmm0
movaps -0x90(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x98df9
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]
movq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x44ec4
jmp 0x98df9
leaq 0x1e43f(%rip), %rdi     # 0xb73f4
leaq 0x3a18c(%rip), %rsi     # 0xd3148
leaq 0x3a67a(%rip), %rcx     # 0xd363d
movl $0x70d, %edx            # imm = 0x70D
callq 0xc140