// File: Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::UpdateMouseMovingWindowNewFrame()
void ImGui::UpdateMouseMovingWindowNewFrame()
{
    ImGuiContext& g = *GImGui;
    if (g.MovingWindow != NULL)
    {
        // We actually want to move the root window. g.MovingWindow == window we clicked on (could be a child window).
        // We track it to preserve Focus and so that generally ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consistency.
        KeepAliveID(g.ActiveId);
        IM_ASSERT(g.MovingWindow && g.MovingWindow->RootWindow);
        ImGuiWindow* moving_window = g.MovingWindow->RootWindow;
        if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos))
        {
            ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset;
            if (moving_window->Pos.x != pos.x || moving_window->Pos.y != pos.y)
            {
                MarkIniSettingsDirty(moving_window);
                SetWindowPos(moving_window, pos, ImGuiCond_Always);
            }
            FocusWindow(g.MovingWindow);
        }
        else
        {
            ClearActiveID();
            g.MovingWindow = NULL;
        }
    }
    else
    {
        // When clicking/dragging from a window that has the _NoMove flag, we still set the ActiveId in order to prevent hovering others.
        if (g.ActiveIdWindow && g.ActiveIdWindow->MoveId == g.ActiveId)
        {
            KeepAliveID(g.ActiveId);
            if (!g.IO.MouseDown[0])
                ClearActiveID();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x1479d1(%rip), %rax    # 0x212f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1b00(%rax)
je 0xcb6b1
movq -0x8(%rbp), %rax
movl 0x1b30(%rax), %edi
callq 0xc9a90
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x1b00(%rcx)
movb %al, -0x19(%rbp)
je 0xcb5c0
movq -0x8(%rbp), %rax
movq 0x1b00(%rax), %rax
cmpq $0x0, 0x390(%rax)
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0xcb5c9
jmp 0xcb5cb
jmp 0xcb5ea
leaq 0xa8282(%rip), %rdi     # 0x173854
leaq 0xa7930(%rip), %rsi     # 0x172f09
movl $0xd6c, %edx            # imm = 0xD6C
leaq 0xa829c(%rip), %rcx     # 0x173881
callq 0xd180
movq -0x8(%rbp), %rax
movq 0x1b00(%rax), %rax
movq 0x390(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x130(%rax)
je 0xcb69b
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0xcb710
testb $0x1, %al
jne 0xcb62b
jmp 0xcb69b
movq -0x8(%rbp), %rsi
movq %rsi, %rdi
addq $0x128, %rdi            # imm = 0x128
addq $0x1b58, %rsi           # imm = 0x1B58
callq 0xc3c00
movlpd %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movss 0x10(%rax), %xmm0
ucomiss -0x18(%rbp), %xmm0
jne 0xcb66e
jp 0xcb66e
movq -0x10(%rbp), %rax
movss 0x14(%rax), %xmm0
ucomiss -0x14(%rbp), %xmm0
jne 0xcb66e
jp 0xcb66e
jmp 0xcb689
movq -0x10(%rbp), %rdi
callq 0xcb7c0
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0xcb810
movq -0x8(%rbp), %rax
movq 0x1b00(%rax), %rdi
callq 0xcb380
jmp 0xcb6af
callq 0xca040
movq -0x8(%rbp), %rax
movq $0x0, 0x1b00(%rax)
jmp 0xcb6fe
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1b60(%rax)
je 0xcb6fc
movq -0x8(%rbp), %rax
movq 0x1b60(%rax), %rax
movl 0x54(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1b30(%rcx), %eax
jne 0xcb6fc
movq -0x8(%rbp), %rax
movl 0x1b30(%rax), %edi
callq 0xc9a90
movq -0x8(%rbp), %rax
testb $0x1, 0x130(%rax)
jne 0xcb6fa
callq 0xca040
jmp 0xcb6fc
jmp 0xcb6fe
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)