// File: /workspace/github_cpp_makefile_star2_O1/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 0xa6125(%rip), %r15     # 0xfdcd0
cmpb $0x0, 0x2005(%r15)
jne 0x57bc2
movl %esi, %r14d
cmpb $0x1, 0x2006(%r15)
jne 0x57c3a
movss 0x1614(%r15), %xmm0
movss 0x5fce5(%rip), %xmm1    # 0xb78b8
mulss %xmm0, %xmm1
mulss 0x5fcf9(%rip), %xmm0    # 0xb78d8
addss 0x128(%r15), %xmm1
addss 0x12c(%r15), %xmm0
movss 0x1670(%r15), %xmm2
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movlps %xmm1, 0x1b98(%r15)
movq $0x0, 0x1ba0(%r15)
movl $0x1, 0x1b8c(%r15)
orb $0x41, 0x1b88(%r15)
mulss 0x5f3b5(%rip), %xmm2    # 0xb6fe0
movss %xmm2, 0x1be8(%r15)
movl $0x1, %r14d
movl 0x30a8(%r15), %ecx
leaq 0x6234c(%rip), %rdx     # 0xb9f94
leaq -0x30(%rbp), %rdi
movl $0x10, %esi
xorl %eax, %eax
callq 0x427cb
testb $0x1, %r14b
je 0x57cc1
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x428dc
movl $0x1ac8, %edi           # imm = 0x1AC8
addq 0xa6059(%rip), %rdi     # 0xfdcd0
movl %eax, %esi
callq 0x43208
testq %rax, %rax
je 0x57cc1
cmpb $0x1, 0x8e(%rax)
jne 0x57cc1
movb $0x1, %cl
movb %cl, 0x95(%rax)
movb %cl, 0xac(%rax)
movl 0x30a8(%r15), %ecx
incl %ecx
movl %ecx, 0x30a8(%r15)
leaq 0x622e3(%rip), %rdx     # 0xb9f94
leaq -0x30(%rbp), %rdi
movl $0x10, %esi
xorl %eax, %eax
callq 0x427cb
orl $0x20c0347, %ebx        # imm = 0x20C0347
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x4c3ad
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq