// File: /workspace/github_cpp_makefile_star2_O1/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 0x611f6(%rip), %rax     # 0xfdcd0
movq (%rax), %r15
movq 0x1ae0(%r15), %rdx
movb $0x1, 0x90(%rdx)
cmpb $0x0, 0x93(%rdx)
je 0x9cafc
xorl %r13d, %r13d
jmp 0x9cda5
movq %r9, %r14
movl %esi, %r9d
movq %rdi, %r13
movq %rcx, -0x38(%rbp)
testq %r14, %r14
jne 0x9cb2b
cmpl $0xa, %r9d
jae 0x9cdb7
movl %r9d, %eax
shlq $0x5, %rax
leaq 0x5beea(%rip), %rcx     # 0xf8a10
movq 0x10(%rax,%rcx), %r14
movq %r8, -0x40(%rbp)
movq %rdx, -0x58(%rbp)
movl 0x10(%rbp), %ebx
leaq -0xa0(%rbp), %rdi
movl $0x40, %esi
movl %r9d, -0x2c(%rbp)
movl %r9d, %edx
movq %r10, -0x48(%rbp)
movq %r10, %rcx
movq %r14, %r8
callq 0x968ed
xorl %r12d, %r12d
testl $0x20002, %ebx          # imm = 0x20002
sete %r12b
orl %ebx, %r12d
orl $0x200010, %r12d        # imm = 0x200010
cmpq $0x0, -0x38(%rbp)
je 0x9cd4d
callq 0x57404
movss %xmm0, -0x30(%rbp)
callq 0x5752d
movq %r13, -0x50(%rbp)
movq %r13, %rdi
callq 0x55c36
callq 0x57252
movss -0x30(%rbp), %xmm1
addss 0x15b0(%r15), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss 0x1a42c(%rip), %xmm1    # 0xb6fe4
maxss %xmm0, %xmm1
movaps %xmm1, %xmm0
callq 0x437f3
leaq 0x1a352(%rip), %rdi     # 0xb6f1d
xorl %r13d, %r13d
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x9cdd6
testb %al, %al
movq -0x48(%rbp), %r12
je 0x9cc0f
movq 0x2198(%r15), %rsi
leaq -0xa0(%rbp), %rdi
movl -0x2c(%rbp), %edx
movq %r12, %rcx
movq %r14, %r8
callq 0x96d7f
movl %eax, %r13d
movq 0x1598(%r15), %r14
movss 0x159c(%r15), %xmm0
movss %xmm0, 0x1598(%r15)
andl $0x4000, %ebx           # imm = 0x4000
orl $0x2400, %ebx           # imm = 0x2400
movss 0x15b0(%r15), %xmm1
xorps %xmm0, %xmm0
callq 0x569e1
leaq -0x60(%rbp), %rsi
movss -0x30(%rbp), %xmm0
movss %xmm0, (%rsi)
movss %xmm0, 0x4(%rsi)
leaq 0x36811(%rip), %rdi     # 0xd346f
movl %ebx, %edx
callq 0x92ee7
testb %al, %al
je 0x9cc9d
cmpb $0x0, 0x140(%r15)
movq -0x38(%rbp), %rax
movq %rax, %r8
movq -0x40(%rbp), %rcx
cmovneq %rcx, %r8
testq %rcx, %rcx
cmoveq %rax, %r8
movl -0x2c(%rbp), %edi
movl $0x2d, %esi
movq %r12, %rdx
movq %r12, %rcx
callq 0x9698f
movb $0x1, %r13b
movss 0x15b0(%r15), %xmm1
xorps %xmm0, %xmm0
callq 0x569e1
leaq -0x60(%rbp), %rsi
movss -0x30(%rbp), %xmm0
movss %xmm0, (%rsi)
movss %xmm0, 0x4(%rsi)
leaq 0x23d50(%rip), %rdi     # 0xc0a17
movl %ebx, %edx
callq 0x92ee7
testb %al, %al
je 0x9cd06
cmpb $0x0, 0x140(%r15)
movq -0x38(%rbp), %rax
movq %rax, %r8
movq -0x40(%rbp), %rcx
cmovneq %rcx, %r8
testq %rcx, %rcx
cmoveq %rax, %r8
movl -0x2c(%rbp), %edi
movl $0x2b, %esi
movq %r12, %rdx
movq %r12, %rcx
callq 0x9698f
movb $0x1, %r13b
movq -0x50(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x44e8b
cmpq %r12, %rax
je 0x9cd3a
movq %rax, %rbx
movss 0x15b0(%r15), %xmm1
xorps %xmm0, %xmm0
callq 0x569e1
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x91b8c
movq %r14, 0x1598(%r15)
callq 0x56188
callq 0x56723
jmp 0x9cd91
movq %r13, %rdi
xorl %r13d, %r13d
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x9cdd6
testb %al, %al
je 0x9cd91
movq 0x2198(%r15), %rsi
leaq -0xa0(%rbp), %rdi
movl -0x2c(%rbp), %edx
movq -0x48(%rbp), %rcx
movq %r14, %r8
callq 0x96d7f
movl %eax, %r13d
testb %r13b, %r13b
je 0x9cda5
movq -0x58(%rbp), %rax
movl 0x124(%rax), %edi
callq 0x46ca4
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a636(%rip), %rdi     # 0xb73f4
leaq 0x36383(%rip), %rsi     # 0xd3148
leaq 0x36871(%rip), %rcx     # 0xd363d
movl $0x70d, %edx            # imm = 0x70D
callq 0xc140