// File: /workspace/github_cpp_makefile_star2_O1/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::Render()
void ImGui::Render()
{
    ImGuiState& g = *GImGui;
    IM_ASSERT(g.Initialized);   // Forgot to call ImGui::NewFrame()

    if (g.FrameCountEnded != g.FrameCount)
        ImGui::EndFrame();
    g.FrameCountRendered = g.FrameCount;

    // Skip render altogether if alpha is 0.0
    // Note that vertex buffers have been created and are wasted, so it is best practice that you don't create windows in the first place, or consistently respond to Begin() returning false.
    if (g.Style.Alpha > 0.0f)
    {
        // Render tooltip
        if (g.Tooltip[0])
        {
            ImGui::BeginTooltip();
            ImGui::TextUnformatted(g.Tooltip);
            ImGui::EndTooltip();
        }

        // Gather windows to render
        g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsActiveWindows = 0;
        for (int i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
            g.RenderDrawLists[i].resize(0);
        for (int i = 0; i != g.Windows.Size; i++)
        {
            ImGuiWindow* window = g.Windows[i];
            if (window->Active && window->HiddenFrames <= 0 && (window->Flags & (ImGuiWindowFlags_ChildWindow)) == 0)
            {
                // FIXME: Generalize this with a proper layering system so e.g. user can draw in specific layers, below text, ..
                g.IO.MetricsActiveWindows++;
                if (window->Flags & ImGuiWindowFlags_Popup)
                    AddWindowToRenderList(g.RenderDrawLists[1], window);
                else if (window->Flags & ImGuiWindowFlags_Tooltip)
                    AddWindowToRenderList(g.RenderDrawLists[2], window);
                else
                    AddWindowToRenderList(g.RenderDrawLists[0], window);
            }
        }

        // Flatten layers
        int n = g.RenderDrawLists[0].Size;
        int flattened_size = n;
        for (int i = 1; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
            flattened_size += g.RenderDrawLists[i].Size;
        g.RenderDrawLists[0].resize(flattened_size);
        for (int i = 1; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
        {
            ImVector<ImDrawList*>& layer = g.RenderDrawLists[i];
            if (layer.empty())
                continue;
            memcpy(&g.RenderDrawLists[0][n], &layer[0], layer.Size * sizeof(ImDrawList*));
            n += layer.Size;
        }

        // Draw software mouse cursor if requested
        if (g.IO.MouseDrawCursor)
        {
            const ImGuiMouseCursorData& cursor_data = g.MouseCursorData[g.MouseCursor];
            const ImVec2 pos = g.IO.MousePos - cursor_data.HotOffset;
            const ImVec2 size = cursor_data.Size;
            const ImTextureID tex_id = g.IO.Fonts->TexID;
            g.OverlayDrawList.PushTextureID(tex_id);
            g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(1,0), pos+ImVec2(1,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
            g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(2,0), pos+ImVec2(2,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
            g.OverlayDrawList.AddImage(tex_id, pos,             pos + size,             cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0xFF000000); // Black border
            g.OverlayDrawList.AddImage(tex_id, pos,             pos + size,             cursor_data.TexUvMin[0], cursor_data.TexUvMax[0], 0xFFFFFFFF); // White fill
            g.OverlayDrawList.PopTextureID();
        }
        if (!g.OverlayDrawList.VtxBuffer.empty())
            AddDrawListToRenderList(g.RenderDrawLists[0], &g.OverlayDrawList);

        // Setup draw data
        g.RenderDrawData.Valid = true;
        g.RenderDrawData.CmdLists = (g.RenderDrawLists[0].Size > 0) ? &g.RenderDrawLists[0][0] : NULL;
        g.RenderDrawData.CmdListsCount = g.RenderDrawLists[0].Size;
        g.RenderDrawData.TotalVtxCount = g.IO.MetricsRenderVertices;
        g.RenderDrawData.TotalIdxCount = g.IO.MetricsRenderIndices;

        // Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData()
        if (g.RenderDrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
            g.IO.RenderDrawListsFn(&g.RenderDrawData);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq 0x4814d(%rip), %rbx     # 0x55490
cmpb $0x0, (%rbx)
je 0xd8e0
movl 0x1730(%rbx), %eax
cmpl 0x172c(%rbx), %eax
je 0xd35f
callq 0xca26
movl 0x172c(%rbx), %eax
movl %eax, 0x1734(%rbx)
movss 0x13e8(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xd89b
cmpb $0x0, 0x27e0(%rbx)
je 0xd3cb
leaq 0x27e0(%rbx), %r14
movq 0x480fa(%rip), %rax     # 0x55490
leaq -0x38(%rbp), %rdx
movq $0x0, (%rdx)
movss 0x16fc(%rax), %xmm0
leaq 0x3083e(%rip), %rdi     # 0x3dbee
xorl %esi, %esi
movl $0x1000147, %ecx        # imm = 0x1000147
callq 0xf7d7
movq %r14, %rdi
xorl %esi, %esi
callq 0xd93a
callq 0xde3d
movl $0x0, 0x340(%rbx)
movq $0x0, 0x338(%rbx)
xorl %r15d, %r15d
xorl %r12d, %r12d
movl 0x1874(%rbx,%r12), %eax
testl %eax, %eax
jns 0xd47e
movl %eax, %r13d
shrl $0x1f, %r13d
addl %eax, %r13d
sarl %r13d
addl %eax, %r13d
testl %r13d, %r13d
cmovlel %r15d, %r13d
leaq (,%r13,8), %rdi
movq 0x48074(%rip), %rax     # 0x55490
incl 0x334(%rax)
callq *0xd0(%rax)
movq %rax, %r14
movq 0x1878(%rbx,%r12), %rsi
movslq 0x1870(%rbx,%r12), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x7080
movq 0x1878(%rbx,%r12), %rdi
testq %rdi, %rdi
je 0xd461
movq 0x48035(%rip), %rax     # 0x55490
decl 0x334(%rax)
movq 0x48028(%rip), %rax     # 0x55490
callq *0xd8(%rax)
movq %r14, 0x1878(%rbx,%r12)
movl %r13d, 0x1874(%rbx,%r12)
movl $0x0, 0x1870(%rbx,%r12)
addq $0x10, %r12
cmpq $0x30, %r12
jne 0xd3e6
movl 0x1738(%rbx), %eax
testl %eax, %eax
je 0xd50c
xorl %r14d, %r14d
movl $0x1880, %r15d          # imm = 0x1880
cltq
cmpq %rax, %r14
jge 0xd8c1
movq 0x1740(%rbx), %rax
movq (%rax,%r14,8), %rsi
cmpb $0x1, 0x70(%rsi)
jne 0xd4fe
cmpl $0x0, 0x90(%rsi)
jg 0xd4fe
movl 0xc(%rsi), %eax
btl $0x14, %eax
jb 0xd4fe
incl 0x340(%rbx)
movl %eax, %edi
shrl $0x13, %edi
andl $0x20, %edi
addq $0x1870, %rdi           # imm = 0x1870
btl $0x19, %eax
cmovbq %r15, %rdi
addq %rbx, %rdi
callq 0xde78
incq %r14
movl 0x1738(%rbx), %eax
cmpq %rax, %r14
jne 0xd4ab
leaq 0x1870(%rbx), %r14
movl 0x1870(%rbx), %r12d
xorl %eax, %eax
movl %r12d, %r13d
addl 0x1880(%rbx,%rax), %r13d
addq $0x10, %rax
cmpq $0x20, %rax
jne 0xd51f
movl 0x1874(%rbx), %eax
cmpl %r13d, %eax
jge 0xd5d8
testl %eax, %eax
je 0xd556
movl %eax, %r15d
shrl $0x1f, %r15d
addl %eax, %r15d
sarl %r15d
addl %eax, %r15d
jmp 0xd55c
movl $0x8, %r15d
cmpl %r13d, %r15d
cmovlel %r13d, %r15d
cmpl %r15d, %eax
jge 0xd5d8
movslq %r15d, %rdi
shlq $0x3, %rdi
movq 0x47f1a(%rip), %rax     # 0x55490
incl 0x334(%rax)
callq *0xd0(%rax)
movq 0x1878(%rbx), %rsi
movslq 0x1870(%rbx), %rdx
shlq $0x3, %rdx
movq %rax, -0x50(%rbp)
movq %rax, %rdi
callq 0x7080
movq 0x1878(%rbx), %rdi
testq %rdi, %rdi
je 0xd5b9
movq 0x47edd(%rip), %rax     # 0x55490
decl 0x334(%rax)
movq 0x47ed0(%rip), %rax     # 0x55490
callq *0xd8(%rax)
movq -0x50(%rbp), %rax
movq %rax, 0x1878(%rbx)
movl %r15d, 0x1874(%rbx)
movl %r13d, 0x1870(%rbx)
xorl %r15d, %r15d
movl 0x1880(%rbx,%r15), %edx
testq %rdx, %rdx
je 0xd62b
cmpl %r12d, (%r14)
jle 0xd8aa
testl %edx, %edx
jle 0xd8aa
movslq %r12d, %r12
leaq (,%r12,8), %rdi
addq 0x1878(%rbx), %rdi
movq 0x1888(%rbx,%r15), %rsi
shlq $0x3, %rdx
callq 0x7080
addl 0x1880(%rbx,%r15), %r12d
addq $0x10, %r15
cmpq $0x20, %r15
jne 0xd5e2
cmpb $0x0, 0x104(%rbx)
je 0xd817
movslq 0x1940(%rbx), %rax
imulq $0x34, %rax, %r12
movss 0xf0(%rbx), %xmm0
movss 0xf4(%rbx), %xmm1
leaq (%rbx,%r12), %rax
addq $0x1958, %rax           # imm = 0x1958
movq %rax, -0x80(%rbp)
subss -0x10(%rax), %xmm0
subss -0xc(%rax), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x38(%rbp), %rcx
movlps %xmm0, (%rcx)
movss -0x8(%rax), %xmm0
movaps %xmm0, -0x70(%rbp)
movss -0x4(%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
movq 0x90(%rbx), %rax
movq (%rax), %rax
leaq -0x40(%rbp), %r15
movq %rax, (%r15)
leaq 0x18a8(%rbx), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2d60a
leaq -0x38(%rbp), %rax
movss (%rax), %xmm0
addss 0x2fcbc(%rip), %xmm0    # 0x3d380
movq (%r15), %rsi
xorps %xmm2, %xmm2
movss 0x4(%rax), %xmm1
addss %xmm2, %xmm1
movaps -0x70(%rbp), %xmm2
addss %xmm0, %xmm2
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x30(%rbp), %rax
movlps %xmm0, (%rax)
movq %rax, %rdx
addss -0x50(%rbp), %xmm1
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
leaq -0x58(%rbp), %rax
movlps %xmm2, (%rax)
movq %rax, %rcx
leaq 0x1960(%rbx,%r12), %r15
leaq 0x1968(%rbx,%r12), %rax
movq %rax, -0x78(%rbp)
leaq 0x1970(%rbx,%r12), %r12
movl $0x30000000, %eax       # imm = 0x30000000
movl %eax, (%rsp)
movq %r13, %rdi
movq %r15, %r8
movq %r12, %r9
callq 0x311b2
leaq -0x38(%rbp), %rax
movss (%rax), %xmm0
addss 0x2fc88(%rip), %xmm0    # 0x3d3c4
xorps %xmm2, %xmm2
addss 0x4(%rax), %xmm2
leaq -0x40(%rbp), %rax
movq (%rax), %rsi
movaps -0x70(%rbp), %xmm1
addss %xmm0, %xmm1
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
leaq -0x30(%rbp), %rax
movlps %xmm0, (%rax)
addss -0x50(%rbp), %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
leaq -0x58(%rbp), %rax
movlps %xmm1, (%rax)
movl $0x30000000, %eax       # imm = 0x30000000
movl %eax, (%rsp)
leaq -0x30(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %r13, %rdi
movq %r15, %r8
movq %r12, %r9
callq 0x311b2
leaq -0x40(%rbp), %rax
movq (%rax), %rsi
leaq -0x38(%rbp), %rax
movss (%rax), %xmm0
addss -0x70(%rbp), %xmm0
movss 0x4(%rax), %xmm1
movq %rax, %rdx
addss -0x50(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x30(%rbp), %rax
movlps %xmm0, (%rax)
movl $0xff000000, (%rsp)     # imm = 0xFF000000
leaq -0x30(%rbp), %rcx
movq %r13, %rdi
movq %r15, %r8
movq %r12, %r9
callq 0x311b2
leaq -0x40(%rbp), %rax
movq (%rax), %rsi
leaq -0x38(%rbp), %rdx
movaps -0x70(%rbp), %xmm0
addss (%rdx), %xmm0
movaps -0x50(%rbp), %xmm1
addss 0x4(%rdx), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x30(%rbp), %rax
movlps %xmm0, (%rax)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
leaq -0x30(%rbp), %rcx
movq %r13, %rdi
movq -0x80(%rbp), %r8
movq -0x78(%rbp), %r9
callq 0x311b2
movq %r13, %rdi
callq 0x2d6a6
cmpl $0x0, 0x18c8(%rbx)
je 0xd82f
leaq 0x18a8(%rbx), %rsi
movq %r14, %rdi
callq 0xdee2
movb $0x1, 0x1850(%rbx)
movl 0x1870(%rbx), %eax
testl %eax, %eax
jle 0xd87c
movq 0x1878(%rbx), %rcx
movq %rcx, 0x1858(%rbx)
movl %eax, 0x1860(%rbx)
movq 0x338(%rbx), %rax
movq %rax, 0x1864(%rbx)
movq 0xb8(%rbx), %rax
testq %rax, %rax
je 0xd89b
addq $0x1850, %rbx           # imm = 0x1850
movq %rbx, %rdi
callq *%rax
jmp 0xd89b
movq $0x0, 0x1858(%rbx)
movl %eax, 0x1860(%rbx)
movq 0x338(%rbx), %rax
movq %rax, 0x1864(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x314ff(%rip), %rdi     # 0x3edb0
leaq 0x311db(%rip), %rsi     # 0x3ea93
leaq 0x31a20(%rip), %rcx     # 0x3f2df
jmp 0xd8d6
leaq 0x314e8(%rip), %rdi     # 0x3edb0
leaq 0x311c4(%rip), %rsi     # 0x3ea93
leaq 0x3193a(%rip), %rcx     # 0x3f210
movl $0x31c, %edx            # imm = 0x31C
callq 0x7140
leaq 0x2ffba(%rip), %rdi     # 0x3d8a1
leaq 0x2fd97(%rip), %rsi     # 0x3d685
leaq 0x3003d(%rip), %rcx     # 0x3d932
movl $0x917, %edx            # imm = 0x917
callq 0x7140