// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movq 0x48a59(%rip), %r14     # 0x55490
cmpb $0x0, (%r14)
je 0xcd4b
movl 0x172c(%r14), %eax
cmpl %eax, 0x1730(%r14)
je 0xcd6a
movl %eax, 0x1730(%r14)
cmpl $0x1, 0x1760(%r14)
jne 0xcd89
movq 0x1758(%r14), %rax
testq %rax, %rax
je 0xca80
cmpb $0x0, 0x72(%rax)
jne 0xca80
movb $0x0, 0x70(%rax)
callq 0xcdc7
cmpl $0x0, 0x1790(%r14)
jne 0xcb46
movq $0x0, 0x17a8(%r14)
cmpl $0x0, 0x1788(%r14)
jne 0xcb46
cmpb $0x1, 0x354(%r14)
jne 0xcb46
movq 0x1770(%r14), %rax
testq %rax, %rax
je 0xcad2
cmpb $0x0, 0x71(%rax)
jne 0xcad2
cmpb $0x0, 0x70(%rax)
jne 0xcb46
cmpq $0x0, 0x1780(%r14)
je 0xcb25
movq 0x1778(%r14), %rdi
callq 0xd00c
movq 0x1778(%r14), %rax
testb $0x4, 0xc(%rax)
jne 0xcb46
movq %rax, 0x17a8(%r14)
movq 0x1780(%r14), %rax
movl 0x48(%rax), %ecx
movq 0x48983(%rip), %rdx     # 0x55490
movl %ecx, 0x1790(%rdx)
movw $0x1, 0x1799(%rdx)
movq %rax, 0x17a0(%rdx)
jmp 0xcb46
testq %rax, %rax
je 0xcb46
callq 0xc521
testq %rax, %rax
jne 0xcb46
movq 0x48955(%rip), %rax     # 0x55490
movq $0x0, 0x1770(%rax)
movl 0x174c(%r14), %eax
testl %eax, %eax
jns 0xcbd5
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl %eax, %ecx
xorl %r15d, %r15d
testl %ecx, %ecx
cmovgl %ecx, %r15d
leaq (,%r15,8), %rdi
movq 0x48918(%rip), %rax     # 0x55490
incl 0x334(%rax)
callq *0xd0(%rax)
movq %rax, %rbx
movq 0x1750(%r14), %rsi
movslq 0x1748(%r14), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x7080
movq 0x1750(%r14), %rdi
testq %rdi, %rdi
je 0xcbba
movq 0x488dc(%rip), %rax     # 0x55490
decl 0x334(%rax)
movq 0x488cf(%rip), %rax     # 0x55490
callq *0xd8(%rax)
movq %rbx, 0x1750(%r14)
movl %r15d, 0x174c(%r14)
movl $0x0, 0x1748(%r14)
movl 0x1738(%r14), %r15d
cmpl %r15d, 0x174c(%r14)
jge 0xcc5b
movslq %r15d, %rdi
shlq $0x3, %rdi
movq 0x48892(%rip), %rax     # 0x55490
incl 0x334(%rax)
callq *0xd0(%rax)
movq %rax, %rbx
movq 0x1750(%r14), %rsi
movslq 0x1748(%r14), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x7080
movq 0x1750(%r14), %rdi
testq %rdi, %rdi
je 0xcc40
movq 0x48856(%rip), %rax     # 0x55490
decl 0x334(%rax)
movq 0x48849(%rip), %rax     # 0x55490
callq *0xd8(%rax)
movq %rbx, 0x1750(%r14)
movl %r15d, 0x174c(%r14)
leaq 0x1748(%r14), %rbx
movl 0x1738(%r14), %eax
testl %eax, %eax
je 0xcca9
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0xcd2c
movq 0x1740(%r14), %rax
movq (%rax,%r15,8), %rsi
testb $0x10, 0xe(%rsi)
je 0xcc92
cmpb $0x0, 0x70(%rsi)
jne 0xcc9a
movq %rbx, %rdi
callq 0xd1ef
incq %r15
movl 0x1738(%r14), %eax
cmpq %rax, %r15
jne 0xcc70
movl (%rbx), %ecx
cmpl %ecx, %eax
jne 0xcda8
movl %eax, 0x1748(%r14)
movl %ecx, 0x1738(%r14)
movl 0x174c(%r14), %eax
movl 0x173c(%r14), %ecx
movl %ecx, 0x174c(%r14)
movl %eax, 0x173c(%r14)
movq 0x1750(%r14), %rax
movq 0x1740(%r14), %rcx
movq %rcx, 0x1750(%r14)
movq %rax, 0x1740(%r14)
movl $0x0, 0x100(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x308(%r14)
movups %xmm0, 0x318(%r14)
movw $0x0, 0x328(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3207d(%rip), %rdi     # 0x3edb0
leaq 0x31d59(%rip), %rsi     # 0x3ea93
leaq 0x324cf(%rip), %rcx     # 0x3f210
movl $0x31c, %edx            # imm = 0x31C
callq 0x7140
leaq 0x30b4f(%rip), %rdi     # 0x3d8a1
leaq 0x3092c(%rip), %rsi     # 0x3d685
leaq 0x30b4f(%rip), %rcx     # 0x3d8af
movl $0x8dd, %edx            # imm = 0x8DD
callq 0x7140
leaq 0x30b55(%rip), %rdi     # 0x3d8c6
leaq 0x3090d(%rip), %rsi     # 0x3d685
leaq 0x30b30(%rip), %rcx     # 0x3d8af
movl $0x8de, %edx            # imm = 0x8DE
callq 0x7140
leaq 0x30b58(%rip), %rdi     # 0x3d8e8
leaq 0x308ee(%rip), %rsi     # 0x3d685
leaq 0x30b11(%rip), %rcx     # 0x3d8af
movl $0x8e3, %edx            # imm = 0x8E3
callq 0x7140
leaq 0x30b58(%rip), %rdi     # 0x3d907
leaq 0x308cf(%rip), %rsi     # 0x3d685
leaq 0x30af2(%rip), %rcx     # 0x3d8af
movl $0x90c, %edx            # imm = 0x90C
callq 0x7140