// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rax
movq 0xaad6b(%rip), %rbx     # 0xfbcd0
cmpb $0x0, (%rbx)
je 0x51267
movl 0x1a6c(%rbx), %eax
cmpl 0x1a68(%rbx), %eax
je 0x50f87
callq 0x4ffa8
movl 0x1a68(%rbx), %eax
movl %eax, 0x1a70(%rbx)
movl $0x0, 0x3ac(%rbx)
leaq 0x1e48(%rbx), %r14
movq %r14, %rdi
callq 0x5e1f6
movl 0x3128(%rbx), %eax
testl %eax, %eax
jle 0x50fe5
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x3130(%rbx), %rcx
cmpl $0x4, (%rcx,%r15)
jne 0x50fd6
leaq (%rcx,%r15), %rsi
movq %rbx, %rdi
callq *0x8(%rcx,%r15)
movl 0x3128(%rbx), %eax
incq %r12
movslq %eax, %rcx
addq $0x18, %r15
cmpq %rcx, %r12
jl 0x50fb6
cmpl $0x0, 0x1e90(%rbx)
je 0x50ffd
leaq 0x1e70(%rbx), %rsi
movq %r14, %rdi
callq 0x512a5
movq 0x1dc0(%rbx), %rax
testq %rax, %rax
je 0x51018
testb $0x20, 0xd(%rax)
jne 0x51020
movq 0x390(%rax), %r15
jmp 0x51023
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x5102a
xorl %r15d, %r15d
movq 0x1dd0(%rbx), %r12
movl 0x1a88(%rbx), %eax
testl %eax, %eax
je 0x510ae
xorl %r13d, %r13d
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0x51248
movq 0x1a90(%rbx), %rcx
movq (%rcx,%r13,8), %rsi
cmpb $0x1, 0x8e(%rsi)
jne 0x510a4
cmpb $0x0, 0x95(%rsi)
jne 0x510a4
movl 0xc(%rsi), %ecx
movl %ecx, %edx
shrl $0x18, %edx
andl $0x1, %edx
cmpq %r15, %rsi
sete %dil
cmpq %r12, %rsi
sete %r8b
orb %dil, %r8b
orb %dl, %r8b
jne 0x510a4
movq 0xaac48(%rip), %rax     # 0xfbcd0
shrl $0x15, %ecx
andl $0x10, %ecx
leaq (%rax,%rcx), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
callq 0x5c75c
movl 0x1a88(%rbx), %eax
incq %r13
movl %eax, %ecx
cmpq %rcx, %r13
jne 0x51037
movb $0x1, %r13b
testq %r15, %r15
je 0x510ee
cmpb $0x1, 0x8e(%r15)
jne 0x510ee
cmpb $0x0, 0x95(%r15)
jne 0x510ee
movq 0xaabff(%rip), %rax     # 0xfbcd0
movl 0xc(%r15), %ecx
shrl $0x15, %ecx
andl $0x10, %ecx
leaq (%rax,%rcx), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
movq %r15, %rsi
callq 0x5c75c
movq %r12, %r15
testb $0x1, %r13b
movl $0x0, %r13d
jne 0x510b1
movq %r14, %rdi
callq 0x4fd08
cmpb $0x0, 0xc8(%rbx)
je 0x51140
leaq 0x1f38(%rbx), %rdi
movsd 0x128(%rbx), %xmm0
movss 0x1614(%rbx), %xmm1
movl 0x2000(%rbx), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xff000000, %ecx       # imm = 0xFF000000
movl $0x30000000, %r8d       # imm = 0x30000000
callq 0x8220d
cmpl $0x0, 0x1f58(%rbx)
je 0x51158
leaq 0x1f38(%rbx), %rsi
movq %r14, %rdi
callq 0x512a5
movq 0xaab71(%rip), %rdx     # 0xfbcd0
testq %rdx, %rdx
je 0x51286
movb $0x1, 0x1e10(%rbx)
movslq 0x1e48(%rbx), %rcx
xorl %eax, %eax
testq %rcx, %rcx
jle 0x51186
movq 0x1e50(%rbx), %rsi
jmp 0x51188
xorl %esi, %esi
movq %rsi, 0x1e18(%rbx)
movl %ecx, 0x1e20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1e24(%rbx)
movq 0x10(%rdx), %rsi
movq %rsi, 0x1e34(%rbx)
movq 0xc0(%rdx), %rdx
movq %rdx, 0x1e3c(%rbx)
movl $0x0, %edx
testl %ecx, %ecx
jle 0x511ee
movq 0x1e50(%rbx), %rsi
xorl %edi, %edi
xorl %eax, %eax
xorl %edx, %edx
movq (%rsi,%rdi,8), %r8
addl 0x20(%r8), %edx
addl 0x10(%r8), %eax
incq %rdi
cmpq %rdi, %rcx
jne 0x511ce
movl %edx, 0x1e28(%rbx)
movl %eax, 0x1e24(%rbx)
movl %edx, 0x3a4(%rbx)
movl %eax, 0x3a8(%rbx)
movl 0x3128(%rbx), %eax
testl %eax, %eax
jle 0x51239
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x3130(%rbx), %rcx
cmpl $0x5, (%rcx,%r14)
jne 0x5122a
leaq (%rcx,%r14), %rsi
movq %rbx, %rdi
callq *0x8(%rcx,%r14)
movl 0x3128(%rbx), %eax
incq %r15
movslq %eax, %rcx
addq $0x18, %r14
cmpq %rcx, %r15
jl 0x5120a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68429(%rip), %rdi     # 0xb9678
leaq 0x68435(%rip), %rsi     # 0xb968b
leaq 0x6980a(%rip), %rcx     # 0xbaa67
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
leaq 0x6589d(%rip), %rdi     # 0xb6b0b
leaq 0x64ef0(%rip), %rsi     # 0xb6165
leaq 0x6591d(%rip), %rcx     # 0xb6b99
movl $0x10e8, %edx           # imm = 0x10E8
callq 0xc140
leaq 0x65165(%rip), %rdi     # 0xb63f2
leaq 0x64ed1(%rip), %rsi     # 0xb6165
leaq 0x65724(%rip), %rcx     # 0xb69bf
movl $0xd28, %edx            # imm = 0xD28
callq 0xc140