// File: /workspace/github_cpp_makefile_star2_O1/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 0x65de1(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
leaq -0x90(%rbp), %rsi
movl $0x20, %edx
movq %r9, %rdi
callq 0x998a4
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
movl $0x20, %esi
movl %r15d, %edx
movq %r12, -0x40(%rbp)
movq %r12, %rcx
movq %rax, %r8
callq 0x968ed
movq %rbx, %rdi
callq 0x42741
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 0x99a6b
testb %al, %al
je 0x98012
cmpl $0xa, %r15d
jae 0x98027
movq 0x18(%rbp), %r13
movq 0x10(%rbp), %r14
movl %r15d, %eax
shlq $0x5, %rax
leaq 0x60a84(%rip), %rcx     # 0xf8a10
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 0x96d7f
movq %r14, %rax
orq %r13, %rax
je 0x97ff1
movl %r15d, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x97229
testl %eax, %eax
movq %r14, %rdx
cmovgq %r13, %rdx
cmovgq %r14, %r13
movl %r15d, %edi
movq %rbx, %rsi
movq %r13, %rcx
callq 0x972df
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0xc5b0
testl %eax, %eax
setne %r14b
je 0x98015
movl -0x2c(%rbp), %edi
callq 0x46ca4
jmp 0x98015
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f3c6(%rip), %rdi     # 0xb73f4
leaq 0x3b113(%rip), %rsi     # 0xd3148
leaq 0x3b601(%rip), %rcx     # 0xd363d
movl $0x70d, %edx            # imm = 0x70D
callq 0xc140