// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TempInputScalar(ImRect const&, unsigned int, char const*, int, void*, char const*, void const*, void const*)
bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min, const void* p_clamp_max)
{
    ImGuiContext& g = *GImGui;

    char fmt_buf[32];
    char data_buf[32];
    format = ImParseFormatTrimDecorations(format, fmt_buf, IM_ARRAYSIZE(fmt_buf));
    DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, p_data, format);
    ImStrTrimBlanks(data_buf);

    ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited;
    flags |= ((data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double) ? ImGuiInputTextFlags_CharsScientific : ImGuiInputTextFlags_CharsDecimal);
    bool value_changed = false;
    if (TempInputText(bb, id, label, data_buf, IM_ARRAYSIZE(data_buf), flags))
    {
        // Backup old value
        size_t data_type_size = DataTypeGetInfo(data_type)->Size;
        ImGuiDataTypeTempStorage data_backup;
        memcpy(&data_backup, p_data, data_type_size);

        // Apply new value (or operations) then clamp
        DataTypeApplyOpFromText(data_buf, g.InputTextState.InitialTextA.Data, data_type, p_data, NULL);
        if (p_clamp_min || p_clamp_max)
        {
            if (DataTypeCompare(data_type, p_clamp_min, p_clamp_max) > 0)
                ImSwap(p_clamp_min, p_clamp_max);
            DataTypeClamp(data_type, p_data, p_clamp_min, p_clamp_max);
        }

        // Only mark as edited if new value is different
        value_changed = memcmp(&data_backup, p_data, data_type_size) != 0;
        if (value_changed)
            MarkItemEdited(id);
    }
    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r12
movl %ecx, %r15d
movq %rdx, -0x48(%rbp)
movl %esi, %r14d
movq %rdi, %r13
leaq 0x65ac9(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
leaq -0x90(%rbp), %rsi
movl $0x20, %edx
movq %r9, %rdi
callq 0x97b0e
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
movl $0x20, %esi
movl %r15d, %edx
movq %r12, -0x40(%rbp)
movq %r12, %rcx
movq %rax, %r8
callq 0x94c8a
movq %rbx, %rdi
callq 0x41e99
movl %r15d, %eax
andl $-0x2, %eax
cmpl $0x8, %eax
movl $0x220010, %eax         # imm = 0x220010
movl $0x200011, %r9d         # imm = 0x200011
cmovel %eax, %r9d
movq %r13, %rdi
movl %r14d, -0x2c(%rbp)
movl %r14d, %esi
movq -0x48(%rbp), %rdx
movq %rbx, %rcx
movl $0x20, %r8d
callq 0x97c8d
testb %al, %al
je 0x9632a
cmpl $0xa, %r15d
jae 0x9633f
movq 0x18(%rbp), %r13
movq 0x10(%rbp), %r14
movl %r15d, %eax
shlq $0x5, %rax
leaq 0x6076c(%rip), %rcx     # 0xf6a10
movq (%rax,%rcx), %r12
leaq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
movq %r12, %rdx
callq 0xc080
movq -0x38(%rbp), %rax
movq 0x2198(%rax), %rsi
leaq -0x70(%rbp), %rdi
movl %r15d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x95142
movq %r14, %rax
orq %r13, %rax
je 0x96309
movl %r15d, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x955ec
testl %eax, %eax
movq %r14, %rdx
cmovgq %r13, %rdx
cmovgq %r14, %r13
movl %r15d, %edi
movq %rbx, %rsi
movq %r13, %rcx
callq 0x956a2
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0xc5b0
testl %eax, %eax
setne %r14b
je 0x9632d
movl -0x2c(%rbp), %edi
callq 0x4618e
jmp 0x9632d
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f0ae(%rip), %rdi     # 0xb53f4
leaq 0x3accb(%rip), %rsi     # 0xd1018
leaq 0x3b1b9(%rip), %rcx     # 0xd150d
movl $0x70d, %edx            # imm = 0x70D
callq 0xc140