// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::EndFrame()
void ImGui::EndFrame()
{
    ImGuiState& g = *GImGui;
    IM_ASSERT(g.Initialized);                       // Forgot to call ImGui::NewFrame()
    IM_ASSERT(g.FrameCountEnded != g.FrameCount);   // ImGui::EndFrame() called multiple times, or forgot to call ImGui::NewFrame() again

    g.FrameCountEnded = g.FrameCount;

    // Hide implicit "Debug" window if it hasn't been used
    IM_ASSERT(g.CurrentWindowStack.Size == 1);    // Mismatched Begin/End
    if (g.CurrentWindow && !g.CurrentWindow->Accessed)
        g.CurrentWindow->Active = false;
    ImGui::End();

    // Click to focus window and start moving (after we're done with all our widgets)
    if (!g.ActiveId)
        g.MovedWindow = NULL;
    if (g.ActiveId == 0 && g.HoveredId == 0 && g.IO.MouseClicked[0])
    {
        if (!(g.FocusedWindow && !g.FocusedWindow->WasActive && g.FocusedWindow->Active)) // Unless we just made a popup appear
        {
            if (g.HoveredRootWindow != NULL)
            {
                FocusWindow(g.HoveredWindow);
                if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove))
                {
                    g.MovedWindow = g.HoveredWindow;
                    SetActiveID(g.HoveredRootWindow->MoveID, g.HoveredRootWindow);
                }
            }
            else if (g.FocusedWindow != NULL && GetFrontMostModalRootWindow() == NULL)
            {
                // Clicking on void disable focus
                FocusWindow(NULL);
            }
        }
    }

    // Sort the window list so that all child windows are after their parent
    // We cannot do that on FocusWindow() because childs may not exist yet
    g.WindowsSortBuffer.resize(0);
    g.WindowsSortBuffer.reserve(g.Windows.Size);
    for (int i = 0; i != g.Windows.Size; i++)
    {
        ImGuiWindow* window = g.Windows[i];
        if (window->Flags & ImGuiWindowFlags_ChildWindow)       // if a child is active its parent will add it
            if (window->Active)
                continue;
        AddWindowToSortedBuffer(g.WindowsSortBuffer, window);
    }
    IM_ASSERT(g.Windows.Size == g.WindowsSortBuffer.Size);  // we done something wrong
    g.Windows.swap(g.WindowsSortBuffer);

    // Clear Input data for next frame
    g.IO.MouseWheel = 0.0f;
    memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x4519b(%rip), %r12     # 0x50480
cmpb $0x0, (%r12)
je 0xb49a
movl 0x172c(%r12), %eax
cmpl %eax, 0x1730(%r12)
je 0xb4b9
movl %eax, 0x1730(%r12)
cmpl $0x1, 0x1760(%r12)
jne 0xb4d8
movq 0x1758(%r12), %rax
testq %rax, %rax
je 0xb334
cmpb $0x0, 0x72(%rax)
jne 0xb334
movb $0x0, 0x70(%rax)
callq 0xb516
cmpl $0x0, 0x1790(%r12)
jne 0xb3fc
andq $0x0, 0x17a8(%r12)
cmpl $0x0, 0x1788(%r12)
jne 0xb3fc
cmpb $0x1, 0x354(%r12)
jne 0xb3fc
movq 0x1770(%r12), %rax
testq %rax, %rax
je 0xb3a6
cmpb $0x0, 0x71(%rax)
jne 0xb388
cmpb $0x0, 0x70(%rax)
jne 0xb3fc
cmpq $0x0, 0x1780(%r12)
jne 0xb3b1
callq 0xb07e
testq %rax, %rax
jne 0xb3fc
xorl %edi, %edi
callq 0xb5a3
jmp 0xb3fc
cmpq $0x0, 0x1780(%r12)
je 0xb3fc
movq 0x1778(%r12), %rdi
callq 0xb5a3
movq 0x1778(%r12), %rax
testb $0x4, 0xc(%rax)
jne 0xb3fc
movq %rax, 0x17a8(%r12)
movq 0x1780(%r12), %rax
movl 0x48(%rax), %ecx
movq 0x4509a(%rip), %rdx     # 0x50480
movl %ecx, 0x1790(%rdx)
movw $0x1, 0x1799(%rdx)
movq %rax, 0x17a0(%rdx)
leaq 0x1748(%r12), %rbx
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e7ce
leaq 0x1738(%r12), %r14
movl 0x1738(%r12), %esi
movq %rbx, %rdi
callq 0x1e9e6
cmpl (%r14), %r15d
je 0xb455
movq %r14, %rdi
movl %r15d, %esi
callq 0x1e6f4
movq (%rax), %rsi
testb $0x10, 0xe(%rsi)
je 0xb448
cmpb $0x0, 0x70(%rsi)
jne 0xb450
movq %rbx, %rdi
callq 0xb686
incl %r15d
jmp 0xb429
cmpl %r15d, (%rbx)
jne 0xb4f7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ea48
andl $0x0, 0x100(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x308(%r12)
movups %xmm0, 0x318(%r12)
andw $0x0, 0x328(%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b3e8(%rip), %rdi     # 0x36889
leaq 0x2b1c5(%rip), %rsi     # 0x3666d
leaq 0x2b3e8(%rip), %rcx     # 0x36897
movl $0x8dd, %edx            # imm = 0x8DD
callq 0x7140
leaq 0x2b3ee(%rip), %rdi     # 0x368ae
leaq 0x2b1a6(%rip), %rsi     # 0x3666d
leaq 0x2b3c9(%rip), %rcx     # 0x36897
movl $0x8de, %edx            # imm = 0x8DE
callq 0x7140
leaq 0x2b3f1(%rip), %rdi     # 0x368d0
leaq 0x2b187(%rip), %rsi     # 0x3666d
leaq 0x2b3aa(%rip), %rcx     # 0x36897
movl $0x8e3, %edx            # imm = 0x8E3
callq 0x7140
leaq 0x2b3f1(%rip), %rdi     # 0x368ef
leaq 0x2b168(%rip), %rsi     # 0x3666d
leaq 0x2b38b(%rip), %rcx     # 0x36897
movl $0x90c, %edx            # imm = 0x90C
callq 0x7140