// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::InputScalar(char const*, int, void*, void const*, void const*, char const*, int)
bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

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

    if (format == NULL)
        format = DataTypeGetInfo(data_type)->PrintFmt;

    char buf[64];
    DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format);

    bool value_changed = false;
    if ((flags & (ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
        flags |= ImGuiInputTextFlags_CharsDecimal;
    flags |= ImGuiInputTextFlags_AutoSelectAll;
    flags |= ImGuiInputTextFlags_NoMarkEdited;  // We call MarkItemEdited() ourselves by comparing the actual data rather than the string.

    if (p_step != NULL)
    {
        const float button_size = GetFrameHeight();

        BeginGroup(); // The only purpose of the group here is to allow the caller to query item data e.g. IsItemActive()
        PushID(label);
        SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2));
        if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view
            value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);

        // Step buttons
        const ImVec2 backup_frame_padding = style.FramePadding;
        style.FramePadding.x = style.FramePadding.y;
        ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups;
        if (flags & ImGuiInputTextFlags_ReadOnly)
            button_flags |= ImGuiButtonFlags_Disabled;
        SameLine(0, style.ItemInnerSpacing.x);
        if (ButtonEx("-", ImVec2(button_size, button_size), button_flags))
        {
            DataTypeApplyOp(data_type, '-', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step);
            value_changed = true;
        }
        SameLine(0, style.ItemInnerSpacing.x);
        if (ButtonEx("+", ImVec2(button_size, button_size), button_flags))
        {
            DataTypeApplyOp(data_type, '+', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step);
            value_changed = true;
        }

        const char* label_end = FindRenderedTextEnd(label);
        if (label != label_end)
        {
            SameLine(0, style.ItemInnerSpacing.x);
            TextEx(label, label_end);
        }
        style.FramePadding = backup_frame_padding;

        PopID();
        EndGroup();
    }
    else
    {
        if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
            value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
    }
    if (value_changed)
        MarkItemEdited(window->DC.LastItemId);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r10
leaq 0x60e57(%rip), %rax     # 0xfbcd0
movq (%rax), %r15
movq 0x1ae0(%r15), %rdx
movb $0x1, 0x90(%rdx)
cmpb $0x0, 0x93(%rdx)
jne 0x9b146
movq %r9, %rbx
movq %rcx, %r12
movl %esi, %r9d
testq %rbx, %rbx
jne 0x9aec2
cmpl $0xa, %r9d
jae 0x9b15b
movl %r9d, %eax
shlq $0x5, %rax
leaq 0x5bb53(%rip), %rcx     # 0xf6a10
movq 0x10(%rax,%rcx), %rbx
movq %r8, -0x50(%rbp)
movq %rdi, -0x48(%rbp)
movq %rdx, -0x58(%rbp)
movl 0x10(%rbp), %r13d
leaq -0xa0(%rbp), %rdi
movl $0x40, %esi
movl %r9d, -0x2c(%rbp)
movl %r9d, %edx
movq %r10, -0x38(%rbp)
movq %r10, %rcx
movq %rbx, %r8
callq 0x94c8a
xorl %r14d, %r14d
testl $0x20002, %r13d         # imm = 0x20002
sete %r14b
orl %r13d, %r14d
orl $0x200010, %r14d        # imm = 0x200010
testq %r12, %r12
je 0x9b100
callq 0x562ff
movss %xmm0, -0x30(%rbp)
callq 0x56428
movq -0x48(%rbp), %rdi
callq 0x54b5f
callq 0x5614d
movss -0x30(%rbp), %xmm1
addss 0x15b0(%r15), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss 0x1a094(%rip), %xmm1    # 0xb4fe4
maxss %xmm0, %xmm1
movaps %xmm1, %xmm0
callq 0x42f61
leaq 0x19fba(%rip), %rdi     # 0xb4f1d
movq $0x0, -0x40(%rbp)
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
movl %r14d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x9b17a
testb %al, %al
je 0x9afaa
movq 0x2198(%r15), %rsi
leaq -0xa0(%rbp), %rdi
movl -0x2c(%rbp), %edx
movq -0x38(%rbp), %rcx
movq %rbx, %r8
callq 0x95142
movq %rax, -0x40(%rbp)
movq 0x1598(%r15), %r14
movq %r14, %rax
shrq $0x20, %rax
movl %eax, 0x1598(%r15)
andl $0x4000, %r13d          # imm = 0x4000
orl $0x2400, %r13d          # imm = 0x2400
movss 0x15b0(%r15), %xmm1
xorps %xmm0, %xmm0
callq 0x5591d
leaq -0x60(%rbp), %rsi
movss -0x30(%rbp), %xmm0
movss %xmm0, (%rsi)
movss %xmm0, 0x4(%rsi)
leaq 0x36348(%rip), %rdi     # 0xd133f
movl %r13d, %edx
callq 0x911cc
testb %al, %al
je 0x9b037
cmpb $0x0, 0x140(%r15)
movq %r12, %r8
movq -0x50(%rbp), %rax
cmovneq %rax, %r8
testq %rax, %rax
cmoveq %r12, %r8
movl -0x2c(%rbp), %edi
movl $0x2d, %esi
movq -0x38(%rbp), %rcx
movq %rcx, %rdx
callq 0x94d2c
movb $0x1, %al
movq %rax, -0x40(%rbp)
movss 0x15b0(%r15), %xmm1
xorps %xmm0, %xmm0
callq 0x5591d
leaq -0x60(%rbp), %rsi
movss -0x30(%rbp), %xmm0
movss %xmm0, (%rsi)
movss %xmm0, 0x4(%rsi)
leaq 0x23986(%rip), %rdi     # 0xbe9e7
movl %r13d, %edx
callq 0x911cc
testb %al, %al
movq -0x40(%rbp), %r13
je 0x9b0a2
cmpb $0x0, 0x140(%r15)
movq %r12, %r8
movq -0x50(%rbp), %rax
cmovneq %rax, %r8
testq %rax, %rax
cmoveq %r12, %r8
movl -0x2c(%rbp), %edi
movl $0x2b, %esi
movq -0x38(%rbp), %rcx
movq %rcx, %rdx
callq 0x94d2c
movb $0x1, %r13b
movq -0x48(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x4443d
cmpq %r12, %rax
je 0x9b0d6
movq %rax, %rbx
movss 0x15b0(%r15), %xmm1
xorps %xmm0, %xmm0
callq 0x5591d
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x8fe70
movq %r14, 0x1598(%r15)
callq 0x55082
callq 0x55617
testb %r13b, %r13b
je 0x9b146
movq -0x58(%rbp), %rax
movl 0x124(%rax), %edi
callq 0x4618e
movb $0x1, %r12b
jmp 0x9b149
xorl %r12d, %r12d
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
movq -0x48(%rbp), %rdi
movl %r14d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x9b17a
testb %al, %al
je 0x9b149
movq 0x2198(%r15), %rsi
leaq -0xa0(%rbp), %rdi
movl -0x2c(%rbp), %edx
movq -0x38(%rbp), %rcx
movq %rbx, %r8
callq 0x95142
testb %al, %al
jne 0x9b0ec
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a292(%rip), %rdi     # 0xb53f4
leaq 0x35eaf(%rip), %rsi     # 0xd1018
leaq 0x3639d(%rip), %rcx     # 0xd150d
movl $0x70d, %edx            # imm = 0x70D
callq 0xc140