// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0xb4938(%rip), %r14     # 0xfbcd0
movq 0x1b00(%r14), %rax
testq %rax, %rax
je 0x4749c
movl 0x1b30(%r14), %ecx
movl 0x1b70(%r14), %edx
movl %ecx, 0x1b34(%r14)
cmpl %ecx, %edx
jne 0x473c9
movb $0x1, 0x1b74(%r14)
movq 0x390(%rax), %rbx
testq %rbx, %rbx
je 0x474f0
cmpb $0x1, 0x130(%r14)
jne 0x47486
leaq 0x128(%r14), %rdi
callq 0x4750f
testb %al, %al
je 0x47486
movss 0x128(%r14), %xmm1
movss 0x12c(%r14), %xmm0
subss 0x1b58(%r14), %xmm1
subss 0x1b5c(%r14), %xmm0
movaps %xmm1, %xmm2
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movlps %xmm2, -0x18(%rbp)
movss 0x10(%rbx), %xmm2
ucomiss %xmm1, %xmm2
jne 0x47441
jp 0x47441
movss 0x14(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x47441
jnp 0x47478
testb $0x1, 0xd(%rbx)
jne 0x47467
movq 0xb4882(%rip), %rax     # 0xfbcd0
xorps %xmm0, %xmm0
ucomiss 0x30e4(%rax), %xmm0
jb 0x47467
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x30e4(%rax)
leaq -0x18(%rbp), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4759d
movq 0x1b00(%r14), %rdi
callq 0x4726c
jmp 0x474d6
xorl %edi, %edi
xorl %esi, %esi
callq 0x4603f
movq $0x0, 0x1b00(%r14)
jmp 0x474d6
movq 0x1b60(%r14), %rax
testq %rax, %rax
je 0x474d6
movl 0x54(%rax), %eax
cmpl 0x1b30(%r14), %eax
jne 0x474d6
movl %eax, 0x1b34(%r14)
cmpl %eax, 0x1b70(%r14)
jne 0x474cc
movb $0x1, 0x1b74(%r14)
cmpb $0x0, 0x130(%r14)
je 0x474df
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %edi, %edi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4603f
leaq 0x6f4e0(%rip), %rdi     # 0xb69d7
leaq 0x6ec67(%rip), %rsi     # 0xb6165
leaq 0x6f4ff(%rip), %rcx     # 0xb6a04
movl $0xd6c, %edx            # imm = 0xD6C
callq 0xc140