// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::UpdateMouseMovingWindowEndFrame()
void ImGui::UpdateMouseMovingWindowEndFrame()
{
    ImGuiContext& g = *GImGui;
    if (g.ActiveId != 0 || g.HoveredId != 0)
        return;

    // Unless we just made a window/popup appear
    if (g.NavWindow && g.NavWindow->Appearing)
        return;

    // Click on empty space to focus window and start moving (after we're done with all our widgets)
    if (g.IO.MouseClicked[0])
    {
        // Handle the edge case of a popup being closed while clicking in its empty space.
        // If we try to focus it, FocusWindow() > ClosePopupsOverWindow() will accidentally close any parent popups because they are not linked together any more.
        ImGuiWindow* root_window = g.HoveredRootWindow;
        const bool is_closed_popup = root_window && (root_window->Flags & ImGuiWindowFlags_Popup) && !IsPopupOpen(root_window->PopupId, ImGuiPopupFlags_AnyPopupLevel);

        if (root_window != NULL && !is_closed_popup)
        {
            StartMouseMovingWindow(g.HoveredWindow); //-V595

            // Cancel moving if clicked outside of title bar
            if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(root_window->Flags & ImGuiWindowFlags_NoTitleBar))
                if (!root_window->TitleBarRect().Contains(g.IO.MouseClickedPos[0]))
                    g.MovingWindow = NULL;

            // Cancel moving if clicked over an item which was disabled or inhibited by popups (note that we know HoveredId == 0 already)
            if (g.HoveredIdDisabled)
                g.MovingWindow = NULL;
        }
        else if (root_window == NULL && g.NavWindow != NULL && GetTopMostPopupModal() == NULL)
        {
            // Clicking on void disable focus
            FocusWindow(NULL);
        }
    }

    // With right mouse button we close popups without changing focus based on where the mouse is aimed
    // Instead, focus will be restored to the window under the bottom-most closed popup.
    // (The left mouse button path calls FocusWindow on the hovered window, which will lead NewFrame->ClosePopupsOverWindow to trigger)
    if (g.IO.MouseClicked[1])
    {
        // Find the top-most window between HoveredWindow and the top-most Modal Window.
        // This is where we can trim the popup stack.
        ImGuiWindow* modal = GetTopMostPopupModal();
        bool hovered_window_above_modal = g.HoveredWindow && IsWindowAbove(g.HoveredWindow, modal);
        ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0xb5ac5(%rip), %r14     # 0xfdcd0
cmpl $0x0, 0x1b30(%r14)
jne 0x4821f
cmpl $0x0, 0x1b1c(%r14)
je 0x48224
popq %rbx
popq %r14
popq %rbp
retq
movq 0x1c90(%r14), %rax
testq %rax, %rax
je 0x48239
cmpb $0x0, 0x94(%rax)
jne 0x4821f
cmpb $0x1, 0x420(%r14)
jne 0x48349
movq 0x1af0(%r14), %rbx
testq %rbx, %rbx
je 0x48259
testb $0x4, 0xf(%rbx)
jne 0x4825d
xorl %edx, %edx
jmp 0x482a9
movslq 0x1c70(%r14), %rcx
testq %rcx, %rcx
setg %dl
jle 0x482a6
movl 0xa0(%rbx), %esi
movq 0x1c78(%r14), %rdi
movb $0x1, %dl
cmpl %esi, (%rdi)
je 0x482a6
addq $0x30, %rdi
movl $0x1, %r8d
movq %r8, %rdx
cmpq %r8, %rcx
je 0x482a0
leaq 0x1(%rdx), %r8
leaq 0x30(%rdi), %r9
cmpl %esi, (%rdi)
movq %r9, %rdi
jne 0x48289
cmpq %rcx, %rdx
setb %dl
xorb $0x1, %dl
testq %rbx, %rbx
je 0x482f1
testb %dl, %dl
jne 0x482f1
movq 0x1ae8(%r14), %rdi
callq 0x47d1d
cmpb $0x1, 0xcd(%r14)
jne 0x48334
testb $0x1, 0xc(%rbx)
jne 0x48334
movq %rbx, %rdi
callq 0x5eee4
movss 0x3cc(%r14), %xmm3
ucomiss %xmm0, %xmm3
jae 0x48314
movq $0x0, 0x1b00(%r14)
jmp 0x48334
testq %rbx, %rbx
setne %cl
testq %rax, %rax
sete %al
orb %cl, %al
jne 0x48349
callq 0x484a1
testq %rax, %rax
jne 0x48349
xorl %edi, %edi
callq 0x47d9b
jmp 0x48349
movss 0x3d0(%r14), %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
ucomiss %xmm0, %xmm2
jb 0x482e4
ucomiss %xmm3, %xmm1
jbe 0x482e4
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm2, %xmm1
jbe 0x482e4
cmpb $0x1, 0x1b27(%r14)
jne 0x48349
movq $0x0, 0x1b00(%r14)
cmpb $0x1, 0x421(%r14)
jne 0x4821f
callq 0x484a1
movq 0x1ae8(%r14), %rcx
testq %rcx, %rcx
je 0x483b0
movq 0xb5961(%rip), %rsi     # 0xfdcd0
movl 0x1a88(%rsi), %edi
testl %edi, %edi
jle 0x483a8
movq 0x1a90(%rsi), %r8
movq -0x8(%r8,%rdi,8), %r8
cmpq %rcx, %r8
sete %r9b
cmpq %rax, %r8
setne %r10b
andb %r10b, %dl
orb %r9b, %dl
cmpq %rax, %r8
je 0x483aa
decq %rdi
cmpq %rcx, %r8
jne 0x48375
jmp 0x483aa
xorl %edx, %edx
testb %dl, %dl
cmovneq %rcx, %rax
movq %rax, %rdi
movl $0x1, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4853f