// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movq 0xabd84(%rip), %rbx     # 0xfdcd0
cmpb $0x0, (%rbx)
je 0x5224e
movl 0x1a6c(%rbx), %eax
cmpl 0x1a68(%rbx), %eax
je 0x51f68
callq 0x50f9d
movl 0x1a68(%rbx), %eax
movl %eax, 0x1a70(%rbx)
movl $0x0, 0x3ac(%rbx)
leaq 0x1e48(%rbx), %r14
movq %r14, %rdi
callq 0x5f3b6
cmpl $0x0, 0x3128(%rbx)
jle 0x51fc9
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x3130(%rbx), %rax
cmpl $0x4, (%rax,%r15)
jne 0x51fb6
leaq (%rax,%r15), %rsi
movq %rbx, %rdi
callq *0x8(%rax,%r15)
incq %r12
movslq 0x3128(%rbx), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x51f9c
cmpl $0x0, 0x1e90(%rbx)
je 0x51fe1
leaq 0x1e70(%rbx), %rsi
movq %r14, %rdi
callq 0x5228c
movq 0x1dc0(%rbx), %rax
testq %rax, %rax
je 0x51ffc
testb $0x20, 0xd(%rax)
jne 0x51ffc
movq 0x390(%rax), %r15
jmp 0x51fff
xorl %r15d, %r15d
movq %r15, -0x40(%rbp)
testq %rax, %rax
je 0x52011
movq 0x1dd0(%rbx), %r12
jmp 0x52014
xorl %r12d, %r12d
movq %r12, -0x38(%rbp)
movl 0x1a88(%rbx), %eax
testl %eax, %eax
je 0x52098
xorl %r13d, %r13d
cltq
cmpq %rax, %r13
jge 0x5222f
movq 0x1a90(%rbx), %rax
movq (%rax,%r13,8), %rsi
cmpb $0x1, 0x8e(%rsi)
jne 0x5208a
cmpb $0x0, 0x95(%rsi)
jne 0x5208a
movl 0xc(%rsi), %eax
movl %eax, %ecx
shrl $0x18, %ecx
andl $0x1, %ecx
cmpq %r15, %rsi
sete %dl
cmpq %r12, %rsi
sete %dil
orb %dl, %dil
orb %cl, %dil
jne 0x5208a
movq 0xabc5c(%rip), %rcx     # 0xfdcd0
shrl $0x15, %eax
andl $0x10, %eax
leaq (%rcx,%rax), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
callq 0x5d8ed
incq %r13
movl 0x1a88(%rbx), %eax
cmpq %rax, %r13
jne 0x52025
xorl %r15d, %r15d
movq -0x40(%rbp,%r15,8), %rsi
testq %rsi, %rsi
je 0x520d7
cmpb $0x1, 0x8e(%rsi)
jne 0x520d7
cmpb $0x0, 0x95(%rsi)
jne 0x520d7
movq 0xabc12(%rip), %rax     # 0xfdcd0
movl 0xc(%rsi), %ecx
shrl $0x15, %ecx
andl $0x10, %ecx
leaq (%rax,%rcx), %rdi
addq $0x1e48, %rdi           # imm = 0x1E48
callq 0x5d8ed
incq %r15
cmpq $0x1, %r15
je 0x5209b
movq %r14, %rdi
callq 0x50ce6
cmpb $0x0, 0xc8(%rbx)
je 0x52123
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 0x83db9
cmpl $0x0, 0x1f58(%rbx)
je 0x5213b
leaq 0x1f38(%rbx), %rsi
movq %r14, %rdi
callq 0x5228c
movq 0xabb8e(%rip), %rcx     # 0xfdcd0
testq %rcx, %rcx
je 0x5226d
movb $0x1, 0x1e10(%rbx)
movslq 0x1e48(%rbx), %rax
testq %rax, %rax
jle 0x52167
movq 0x1e50(%rbx), %rdx
jmp 0x52169
xorl %edx, %edx
movq %rdx, 0x1e18(%rbx)
movl %eax, 0x1e20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1e24(%rbx)
movq 0x10(%rcx), %rdx
movq %rdx, 0x1e34(%rbx)
movq 0xc0(%rcx), %rcx
movq %rcx, 0x1e3c(%rbx)
testl %eax, %eax
jle 0x521d2
movq 0x1e50(%rbx), %rdx
movl 0x1e24(%rbx), %ecx
movl 0x1e28(%rbx), %esi
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
addl 0x20(%r8), %esi
addl 0x10(%r8), %ecx
incq %rdi
cmpq %rdi, %rax
jne 0x521b2
movl %esi, 0x1e28(%rbx)
movl %ecx, 0x1e24(%rbx)
movq 0x1e24(%rbx), %rax
rolq $0x20, %rax
movq %rax, 0x3a4(%rbx)
cmpl $0x0, 0x3128(%rbx)
jle 0x52220
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x3130(%rbx), %rax
cmpl $0x5, (%rax,%r14)
jne 0x5220d
leaq (%rax,%r14), %rsi
movq %rbx, %rdi
callq *0x8(%rax,%r14)
incq %r15
movslq 0x3128(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x521f3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x69442(%rip), %rdi     # 0xbb678
leaq 0x6944e(%rip), %rsi     # 0xbb68b
leaq 0x6a823(%rip), %rcx     # 0xbca67
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
leaq 0x668b6(%rip), %rdi     # 0xb8b0b
leaq 0x65f09(%rip), %rsi     # 0xb8165
leaq 0x66936(%rip), %rcx     # 0xb8b99
movl $0x10e8, %edx           # imm = 0x10E8
callq 0xc140
leaq 0x6617e(%rip), %rdi     # 0xb83f2
leaq 0x65eea(%rip), %rsi     # 0xb8165
leaq 0x6673d(%rip), %rcx     # 0xb89bf
movl $0xd28, %edx            # imm = 0xD28
callq 0xc140