// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::InputScalarAsWidgetReplacement(ImRect const&, char const*, ImGuiDataType, void*, unsigned int, int)
bool ImGui::InputScalarAsWidgetReplacement(const ImRect& aabb, const char* label, ImGuiDataType data_type, void* data_ptr, ImGuiID id, int decimal_precision)
{
    ImGuiState& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();

    // Our replacement widget will override the focus ID (registered previously to allow for a TAB focus to happen)
    SetActiveID(g.ScalarAsInputTextId, window);
    g.HoveredId = 0;
    FocusableItemUnregister(window);

    char buf[32];
    DataTypeFormatString(data_type, data_ptr, decimal_precision, buf, IM_ARRAYSIZE(buf));
    bool value_changed = InputTextEx(label, buf, IM_ARRAYSIZE(buf), aabb.GetSize() - g.Style.FramePadding*2.0f, ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll);
    if (g.ScalarAsInputTextId == 0)
    {
        // First frame
        IM_ASSERT(g.ActiveId == id);    // InputText ID expected to match the Slider ID (else we'd need to store them both, which is also possible)
        g.ScalarAsInputTextId = g.ActiveId;
        g.HoveredId = id;
    }
    else if (g.ActiveId != g.ScalarAsInputTextId)
    {
        // Release
        g.ScalarAsInputTextId = 0;
    }
    if (value_changed)
        DataTypeApplyOpFromText(buf, GImGui->InputTextState.InitialText.begin(), data_type, data_ptr, NULL);
    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq 0x5c727(%rip), %rax     # 0x794c0
movq %rax, -0x30(%rbp)
callq 0x2e220
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movl 0x27a0(%rax), %edi
movq -0x38(%rbp), %rsi
callq 0xbe60
movq -0x30(%rbp), %rax
movl $0x0, 0x1788(%rax)
movq -0x38(%rbp), %rdi
callq 0xc660
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rsi
movl -0x28(%rbp), %edx
leaq -0x60(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movl $0x20, %r8d
callq 0x1cf50
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e250
movlpd %xmm0, -0x74(%rbp)
movq -0x30(%rbp), %rdi
addq $0x1408, %rdi           # imm = 0x1408
movss 0x3e29c(%rip), %xmm0    # 0x5b0b8
callq 0xe4b0
movlpd %xmm0, -0x7c(%rbp)
leaq -0x74(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0xdf20
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
movlpd %xmm0, -0x6c(%rbp)
movl $0x20, %edx
leaq -0x6c(%rbp), %rcx
movl $0x11, %r8d
xorl %eax, %eax
movl %eax, %r9d
movq $0x0, (%rsp)
callq 0x1d020
andb $0x1, %al
movb %al, -0x61(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x27a0(%rax)
jne 0x1cecc
movq -0x30(%rbp), %rax
movl 0x1790(%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x1ce8a
jmp 0x1cea9
leaq 0x3f025(%rip), %rdi     # 0x5beb6
leaq 0x3e42d(%rip), %rsi     # 0x5b2c5
movl $0x16d7, %edx           # imm = 0x16D7
leaq 0x3f023(%rip), %rcx     # 0x5bec7
callq 0x7160
movq -0x30(%rbp), %rax
movl 0x1790(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x27a0(%rax)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x1788(%rax)
jmp 0x1cef2
movq -0x30(%rbp), %rax
movl 0x1790(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x27a0(%rcx), %eax
je 0x1cef0
movq -0x30(%rbp), %rax
movl $0x0, 0x27a0(%rax)
jmp 0x1cef2
testb $0x1, -0x61(%rbp)
je 0x1cf35
leaq -0x60(%rbp), %rax
movq %rax, -0x98(%rbp)
movq 0x5c5b6(%rip), %rdi     # 0x794c0
addq $0x1ab0, %rdi           # imm = 0x1AB0
addq $0x18, %rdi
callq 0x2fe30
movq -0x98(%rbp), %rdi
movq %rax, %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x1f910
movb -0x61(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)