// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::BeginTooltipEx(int, int)
void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags)
{
    ImGuiContext& g = *GImGui;

    if (g.DragDropWithinSource || g.DragDropWithinTarget)
    {
        // The default tooltip position is a little offset to give space to see the context menu (it's also clamped within the current viewport/monitor)
        // In the context of a dragging tooltip we try to reduce that offset and we enforce following the cursor.
        // Whatever we do we want to call SetNextWindowPos() to enforce a tooltip position and disable clipping the tooltip without our display area, like regular tooltip do.
        //ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding;
        ImVec2 tooltip_pos = g.IO.MousePos + ImVec2(16 * g.Style.MouseCursorScale, 8 * g.Style.MouseCursorScale);
        SetNextWindowPos(tooltip_pos);
        SetNextWindowBgAlpha(g.Style.Colors[ImGuiCol_PopupBg].w * 0.60f);
        //PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This would be nice but e.g ColorButton with checkboard has issue with transparent colors :(
        tooltip_flags |= ImGuiTooltipFlags_OverridePreviousTooltip;
    }

    char window_name[16];
    ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", g.TooltipOverrideCount);
    if (tooltip_flags & ImGuiTooltipFlags_OverridePreviousTooltip)
        if (ImGuiWindow* window = FindWindowByName(window_name))
            if (window->Active)
            {
                // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one.
                window->Hidden = true;
                window->HiddenFramesCanSkipItems = 1; // FIXME: This may not be necessary?
                ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount);
            }
    ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
    Begin(window_name, NULL, flags | extra_flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
movq 0x9f7b9(%rip), %r15     # 0xe3ce0
cmpb $0x0, 0x2005(%r15)
jne 0x4453e
movl %esi, %r14d
cmpb $0x1, 0x2006(%r15)
jne 0x445b1
movss 0x1614(%r15), %xmm0
movss 0x58399(%rip), %xmm1    # 0x9c8e8
mulss %xmm0, %xmm1
mulss 0x583ad(%rip), %xmm0    # 0x9c908
addss 0x128(%r15), %xmm1
movss 0x1670(%r15), %xmm2
addss 0x12c(%r15), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movlps %xmm1, 0x1b98(%r15)
andq $0x0, 0x1ba0(%r15)
movl $0x1, 0x1b8c(%r15)
orb $0x41, 0x1b88(%r15)
mulss 0x58374(%rip), %xmm2    # 0x9c918
movss %xmm2, 0x1be8(%r15)
pushq $0x1
popq %r14
movl 0x30a8(%r15), %ecx
leaq 0x5aa05(%rip), %rdx     # 0x9efc4
leaq -0x30(%rbp), %rdi
pushq $0x10
popq %rsi
xorl %eax, %eax
callq 0x3468c
testb $0x1, %r14b
je 0x4461d
leaq -0x30(%rbp), %rdi
callq 0x412c3
testq %rax, %rax
je 0x4461d
cmpb $0x1, 0x8e(%rax)
jne 0x4461d
movb $0x1, %cl
movb %cl, 0x95(%rax)
movb %cl, 0xac(%rax)
movl 0x30a8(%r15), %ecx
incl %ecx
movl %ecx, 0x30a8(%r15)
leaq 0x5a9b5(%rip), %rdx     # 0x9efc4
leaq -0x30(%rbp), %rdi
pushq $0x10
popq %rsi
xorl %eax, %eax
callq 0x3468c
orl $0x20c0347, %ebx        # imm = 0x20C0347
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x3bad8
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq