// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::Render()
void ImGui::Render()
{
    ImGuiContext& g = *GImGui;
    IM_ASSERT(g.Initialized);

    if (g.FrameCountEnded != g.FrameCount)
        EndFrame();
    g.FrameCountRendered = g.FrameCount;
    g.IO.MetricsRenderWindows = 0;
    g.DrawDataBuilder.Clear();

    CallContextHooks(&g, ImGuiContextHookType_RenderPre);

    // Add background ImDrawList
    if (!g.BackgroundDrawList.VtxBuffer.empty())
        AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.BackgroundDrawList);

    // Add ImDrawList to render
    ImGuiWindow* windows_to_render_top_most[2];
    windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
    windows_to_render_top_most[1] = (g.NavWindowingTarget ? g.NavWindowingListWindow : NULL);
    for (int n = 0; n != g.Windows.Size; n++)
    {
        ImGuiWindow* window = g.Windows[n];
        if (IsWindowActiveAndVisible(window) && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != windows_to_render_top_most[0] && window != windows_to_render_top_most[1])
            AddRootWindowToDrawData(window);
    }
    for (int n = 0; n < IM_ARRAYSIZE(windows_to_render_top_most); n++)
        if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window
            AddRootWindowToDrawData(windows_to_render_top_most[n]);
    g.DrawDataBuilder.FlattenIntoSingleLayer();

    // Draw software mouse cursor if requested
    if (g.IO.MouseDrawCursor)
        RenderMouseCursor(&g.ForegroundDrawList, g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));

    // Add foreground ImDrawList
    if (!g.ForegroundDrawList.VtxBuffer.empty())
        AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.ForegroundDrawList);

    // Setup ImDrawData structure for end-user
    SetupDrawData(&g.DrawDataBuilder.Layers[0], &g.DrawData);
    g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount;
    g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;

    CallContextHooks(&g, ImGuiContextHookType_RenderPost);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0xa407b(%rip), %rbx     # 0xe3ce0
cmpb $0x0, (%rbx)
je 0x3fe87
movl 0x1a6c(%rbx), %eax
cmpl 0x1a68(%rbx), %eax
je 0x3fc87
callq 0x3f170
movl 0x1a68(%rbx), %eax
movl %eax, 0x1a70(%rbx)
andl $0x0, 0x3ac(%rbx)
leaq 0x1e48(%rbx), %r14
movq %r14, %rdi
callq 0x4b35c
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x37e1a
cmpl $0x0, 0x1e90(%rbx)
je 0x3fcc6
leaq 0x1e70(%rbx), %rsi
movq %r14, %rdi
callq 0x3fea6
movq 0x1dc0(%rbx), %rax
testq %rax, %rax
movq %r14, -0x48(%rbp)
je 0x3fce5
testb $0x20, 0xd(%rax)
jne 0x3fcf2
movq 0x390(%rax), %r13
jmp 0x3fcf5
andq $0x0, -0x40(%rbp)
xorl %r13d, %r13d
xorl %r14d, %r14d
jmp 0x3fd00
xorl %r13d, %r13d
movq %r13, -0x40(%rbp)
movq 0x1dd0(%rbx), %r14
movq %r14, -0x38(%rbp)
leaq 0x1a88(%rbx), %r15
xorl %r12d, %r12d
cmpl (%r15), %r12d
je 0x3fd53
movq %r15, %rdi
movl %r12d, %esi
callq 0x4ad62
movq (%rax), %rdi
cmpb $0x1, 0x8e(%rdi)
jne 0x3fd4e
cmpb $0x0, 0x95(%rdi)
jne 0x3fd4e
cmpq %r13, %rdi
sete %al
cmpq %r14, %rdi
sete %cl
orb %al, %cl
orb 0xf(%rdi), %cl
testb $0x1, %cl
jne 0x3fd4e
callq 0x3ffa0
incl %r12d
jmp 0x3fd0e
xorl %r14d, %r14d
cmpq $0x2, %r14
je 0x3fd82
movq -0x40(%rbp,%r14,8), %rdi
testq %rdi, %rdi
je 0x3fd7d
cmpb $0x1, 0x8e(%rdi)
jne 0x3fd7d
cmpb $0x0, 0x95(%rdi)
jne 0x3fd7d
callq 0x3ffa0
incq %r14
jmp 0x3fd56
movq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x3f054
cmpb $0x0, 0xc8(%rbx)
je 0x3fdc7
leaq 0x1f38(%rbx), %rdi
movsd 0x128(%rbx), %xmm0
movss 0x1614(%rbx), %xmm1
movl 0x2000(%rbx), %esi
pushq $-0x1
popq %rdx
movl $0xff000000, %ecx       # imm = 0xFF000000
movl $0x30000000, %r8d       # imm = 0x30000000
callq 0x6bb5f
cmpl $0x0, 0x1f58(%rbx)
je 0x3fddf
leaq 0x1f38(%rbx), %rsi
movq %r14, %rdi
callq 0x3fea6
callq 0x37e82
movb $0x1, 0x1e10(%rbx)
movl 0x1e48(%rbx), %edx
xorl %ecx, %ecx
testl %edx, %edx
jle 0x3fe00
movq 0x1e50(%rbx), %rsi
jmp 0x3fe02
xorl %esi, %esi
movq %rsi, 0x1e18(%rbx)
movl %edx, 0x1e20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1e24(%rbx)
movq 0x8(%rax), %rsi
movq %rsi, 0x1e34(%rbx)
movq 0xb8(%rax), %rax
movq %rax, 0x1e3c(%rbx)
testl %edx, %edx
cmovlel %ecx, %edx
xorl %eax, %eax
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x3fe62
movq 0x1e50(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
addl 0x20(%rdi), %eax
movl %eax, 0x1e28(%rbx)
addl 0x10(%rdi), %ecx
movl %ecx, 0x1e24(%rbx)
incq %rsi
jmp 0x3fe3b
movl %eax, 0x3a4(%rbx)
movl %ecx, 0x3a8(%rbx)
pushq $0x5
popq %rsi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37e1a
leaq 0x5dcad(%rip), %rdi     # 0x9db3b
leaq 0x5d300(%rip), %rsi     # 0x9d195
leaq 0x5dd2d(%rip), %rcx     # 0x9dbc9
movl $0x10e8, %edx           # imm = 0x10E8
callq 0xc140