// File: 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
subq $0x50, %rsp
movq 0x13ec61(%rip), %rax    # 0x212f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, (%rax)
je 0xd42ee
jmp 0xd430d
leaq 0x9f693(%rip), %rdi     # 0x173988
leaq 0x9ec0d(%rip), %rsi     # 0x172f09
movl $0x10e8, %edx           # imm = 0x10E8
leaq 0x9f730(%rip), %rcx     # 0x173a38
callq 0xd180
movq -0x8(%rbp), %rax
movl 0x1a6c(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a68(%rcx), %eax
je 0xd4328
callq 0xd35c0
movq -0x8(%rbp), %rax
movl 0x1a68(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1a70(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x3ac(%rax)
movq -0x8(%rbp), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
callq 0xeb450
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0xcb100
movq -0x8(%rbp), %rdi
addq $0x1e70, %rdi           # imm = 0x1E70
addq $0x20, %rdi
callq 0xeb4a0
testb $0x1, %al
jne 0xd439b
movq -0x8(%rbp), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
movq -0x8(%rbp), %rsi
addq $0x1e70, %rsi           # imm = 0x1E70
callq 0xd45d0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1dc0(%rax)
je 0xd43d9
movq -0x8(%rbp), %rax
movq 0x1dc0(%rax), %rax
movl 0xc(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0xd43d9
movq -0x8(%rbp), %rax
movq 0x1dc0(%rax), %rax
movq 0x390(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0xd43e1
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0xd43e1
movq -0x48(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1dc0(%rax)
je 0xd4408
movq -0x8(%rbp), %rax
movq 0x1dd0(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0xd4410
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0xd4410
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a88(%rcx), %eax
je 0xd4492
movq -0x8(%rbp), %rdi
addq $0x1a88, %rdi           # imm = 0x1A88
movl -0x24(%rbp), %esi
callq 0xea8d0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xd4750
testb $0x1, %al
jne 0xd4457
jmp 0xd4485
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
jne 0xd4485
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xd4485
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0xd4485
movq -0x30(%rbp), %rdi
callq 0xd4780
jmp 0xd4487
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd441f
movl $0x0, -0x34(%rbp)
cmpl $0x2, -0x34(%rbp)
jge 0xd44da
movslq -0x34(%rbp), %rax
cmpq $0x0, -0x20(%rbp,%rax,8)
je 0xd44cd
movslq -0x34(%rbp), %rax
movq -0x20(%rbp,%rax,8), %rdi
callq 0xd4750
testb $0x1, %al
jne 0xd44bf
jmp 0xd44cd
movslq -0x34(%rbp), %rax
movq -0x20(%rbp,%rax,8), %rdi
callq 0xd4780
jmp 0xd44cf
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xd4499
movq -0x8(%rbp), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
callq 0xd33c0
movq -0x8(%rbp), %rax
testb $0x1, 0xc8(%rax)
je 0xd453c
movq -0x8(%rbp), %rax
movq %rax, %rdi
addq $0x1f38, %rdi           # imm = 0x1F38
movq 0x128(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movss 0x1614(%rax), %xmm1
movl 0x2000(%rax), %esi
movsd -0x40(%rbp), %xmm0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xff000000, %ecx       # imm = 0xFF000000
movl $0x30000000, %r8d       # imm = 0x30000000
callq 0x11cfd0
movq -0x8(%rbp), %rdi
addq $0x1f38, %rdi           # imm = 0x1F38
addq $0x20, %rdi
callq 0xeb4a0
testb $0x1, %al
jne 0xd456f
movq -0x8(%rbp), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
movq -0x8(%rbp), %rsi
addq $0x1f38, %rsi           # imm = 0x1F38
callq 0xd45d0
movq -0x8(%rbp), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
movq -0x8(%rbp), %rsi
addq $0x1e10, %rsi           # imm = 0x1E10
callq 0xd47e0
movq -0x8(%rbp), %rax
movl 0x1e28(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3a4(%rax)
movq -0x8(%rbp), %rax
movl 0x1e24(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3a8(%rax)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0xcb100
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)