// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::Shutdown(ImGuiContext*)
void ImGui::Shutdown(ImGuiContext* context)
{
    // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
    ImGuiContext& g = *context;
    if (g.IO.Fonts && g.FontAtlasOwnedByContext)
    {
        g.IO.Fonts->Locked = false;
        IM_DELETE(g.IO.Fonts);
    }
    g.IO.Fonts = NULL;

    // Cleanup of other data are conditional on actually having initialized Dear ImGui.
    if (!g.Initialized)
        return;

    // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file)
    if (g.SettingsLoaded && g.IO.IniFilename != NULL)
    {
        ImGuiContext* backup_context = GImGui;
        SetCurrentContext(&g);
        SaveIniSettingsToDisk(g.IO.IniFilename);
        SetCurrentContext(backup_context);
    }

    CallContextHooks(&g, ImGuiContextHookType_Shutdown);

    // Clear everything else
    for (int i = 0; i < g.Windows.Size; i++)
        IM_DELETE(g.Windows[i]);
    g.Windows.clear();
    g.WindowsFocusOrder.clear();
    g.WindowsTempSortBuffer.clear();
    g.CurrentWindow = NULL;
    g.CurrentWindowStack.clear();
    g.WindowsById.Clear();
    g.NavWindow = NULL;
    g.HoveredWindow = g.HoveredRootWindow = g.HoveredWindowUnderMovingWindow = NULL;
    g.ActiveIdWindow = g.ActiveIdPreviousFrameWindow = NULL;
    g.MovingWindow = NULL;
    g.ColorStack.clear();
    g.StyleVarStack.clear();
    g.FontStack.clear();
    g.OpenPopupStack.clear();
    g.BeginPopupStack.clear();
    g.DrawDataBuilder.ClearFreeMemory();
    g.BackgroundDrawList._ClearFreeMemory();
    g.ForegroundDrawList._ClearFreeMemory();

    g.TabBars.Clear();
    g.CurrentTabBarStack.clear();
    g.ShrinkWidthBuffer.clear();

    g.Tables.Clear();
    g.CurrentTableStack.clear();
    g.DrawChannelsTempMergeBuffer.clear();

    g.ClipboardHandlerData.clear();
    g.MenusIdSubmittedThisFrame.clear();
    g.InputTextState.ClearFreeMemory();

    g.SettingsWindows.clear();
    g.SettingsHandlers.clear();

    if (g.LogFile)
    {
#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
        if (g.LogFile != stdout)
#endif
            ImFileClose(g.LogFile);
        g.LogFile = NULL;
    }
    g.LogBuffer.clear();

    g.Initialized = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xa8(%rdi), %rdi
testq %rdi, %rdi
je 0x46a3a
cmpb $0x1, 0x1(%rbx)
jne 0x46a3a
movb $0x0, (%rdi)
callq 0x5dd67
movq $0x0, 0xa8(%rbx)
cmpb $0x1, (%rbx)
jne 0x46fbe
cmpb $0x1, 0x30e1(%rbx)
jne 0x46a7a
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x46a7a
movq 0xb5269(%rip), %r14     # 0xfbcd0
movq %rbx, 0xb5262(%rip)     # 0xfbcd0
callq 0x4fc95
movq %r14, 0xb5256(%rip)     # 0xfbcd0
movl 0x3128(%rbx), %eax
testl %eax, %eax
jle 0x46ab9
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x3130(%rbx), %rcx
cmpl $0x6, (%rcx,%r14)
jne 0x46aaa
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 0x46a8a
cmpl $0x0, 0x1a88(%rbx)
jle 0x46ae4
xorl %r14d, %r14d
movq 0x1a90(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x5dda6
incq %r14
movslq 0x1a88(%rbx), %rax
cmpq %rax, %r14
jl 0x46ac5
movq 0x1a90(%rbx), %rdi
testq %rdi, %rdi
je 0x46b25
movq $0x0, 0x1a88(%rbx)
movq 0xb51ce(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46b0d
decl 0x3b4(%rax)
movq 0xb51cc(%rip), %rsi     # 0xfbce0
callq *0xb09fe(%rip)          # 0xf7518
movq $0x0, 0x1a90(%rbx)
movq 0x1aa0(%rbx), %rdi
testq %rdi, %rdi
je 0x46b66
movq $0x0, 0x1a98(%rbx)
movq 0xb518d(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46b4e
decl 0x3b4(%rax)
movq 0xb518b(%rip), %rsi     # 0xfbce0
callq *0xb09bd(%rip)          # 0xf7518
movq $0x0, 0x1aa0(%rbx)
movq 0x1ab0(%rbx), %rdi
testq %rdi, %rdi
je 0x46ba7
movq $0x0, 0x1aa8(%rbx)
movq 0xb514c(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46b8f
decl 0x3b4(%rax)
movq 0xb514a(%rip), %rsi     # 0xfbce0
callq *0xb097c(%rip)          # 0xf7518
movq $0x0, 0x1ab0(%rbx)
movq $0x0, 0x1ae0(%rbx)
movq 0x1ac0(%rbx), %rdi
testq %rdi, %rdi
je 0x46bf3
movq $0x0, 0x1ab8(%rbx)
movq 0xb5100(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46bdb
decl 0x3b4(%rax)
movq 0xb50fe(%rip), %rsi     # 0xfbce0
callq *0xb0930(%rip)          # 0xf7518
movq $0x0, 0x1ac0(%rbx)
leaq 0x1ac8(%rbx), %rdi
callq 0x5dde6
xorl %eax, %eax
movq %rax, 0x1c90(%rbx)
movq %rax, 0x1b78(%rbx)
movq %rax, 0x1b60(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1ae8(%rbx)
movups %xmm0, 0x1af8(%rbx)
movq 0x1c18(%rbx), %rdi
testq %rdi, %rdi
je 0x46c68
movq $0x0, 0x1c10(%rbx)
movq 0xb508b(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46c50
decl 0x3b4(%rax)
movq 0xb5089(%rip), %rsi     # 0xfbce0
callq *0xb08bb(%rip)          # 0xf7518
movq $0x0, 0x1c18(%rbx)
movq 0x1c28(%rbx), %rdi
testq %rdi, %rdi
je 0x46ca9
movq $0x0, 0x1c20(%rbx)
movq 0xb504a(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46c91
decl 0x3b4(%rax)
movq 0xb5048(%rip), %rsi     # 0xfbce0
callq *0xb087a(%rip)          # 0xf7518
movq $0x0, 0x1c28(%rbx)
movq 0x1c38(%rbx), %rdi
testq %rdi, %rdi
je 0x46cea
movq $0x0, 0x1c30(%rbx)
movq 0xb5009(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46cd2
decl 0x3b4(%rax)
movq 0xb5007(%rip), %rsi     # 0xfbce0
callq *0xb0839(%rip)          # 0xf7518
movq $0x0, 0x1c38(%rbx)
movq 0x1c78(%rbx), %rdi
testq %rdi, %rdi
je 0x46d2b
movq $0x0, 0x1c70(%rbx)
movq 0xb4fc8(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46d13
decl 0x3b4(%rax)
movq 0xb4fc6(%rip), %rsi     # 0xfbce0
callq *0xb07f8(%rip)          # 0xf7518
movq $0x0, 0x1c78(%rbx)
movq 0x1c88(%rbx), %rdi
testq %rdi, %rdi
je 0x46d6c
movq $0x0, 0x1c80(%rbx)
movq 0xb4f87(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46d54
decl 0x3b4(%rax)
movq 0xb4f85(%rip), %rsi     # 0xfbce0
callq *0xb07b7(%rip)          # 0xf7518
movq $0x0, 0x1c88(%rbx)
leaq 0x1e48(%rbx), %rdi
callq 0x5de2e
leaq 0x1e70(%rbx), %rdi
callq 0x753f2
leaq 0x1f38(%rbx), %rdi
callq 0x753f2
leaq 0x2110(%rbx), %rdi
callq 0x5de9e
movq 0x2140(%rbx), %rdi
testq %rdi, %rdi
je 0x46ddd
movq $0x0, 0x2138(%rbx)
movq 0xb4f16(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46dc5
decl 0x3b4(%rax)
movq 0xb4f14(%rip), %rsi     # 0xfbce0
callq *0xb0746(%rip)          # 0xf7518
movq $0x0, 0x2140(%rbx)
movq 0x2150(%rbx), %rdi
testq %rdi, %rdi
je 0x46e1e
movq $0x0, 0x2148(%rbx)
movq 0xb4ed5(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46e06
decl 0x3b4(%rax)
movq 0xb4ed3(%rip), %rsi     # 0xfbce0
callq *0xb0705(%rip)          # 0xf7518
movq $0x0, 0x2150(%rbx)
leaq 0x20b0(%rbx), %rdi
callq 0x5dfe4
movq 0x20e0(%rbx), %rdi
testq %rdi, %rdi
je 0x46e6b
movq $0x0, 0x20d8(%rbx)
movq 0xb4e88(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46e53
decl 0x3b4(%rax)
movq 0xb4e86(%rip), %rsi     # 0xfbce0
callq *0xb06b8(%rip)          # 0xf7518
movq $0x0, 0x20e0(%rbx)
movq 0x2100(%rbx), %rdi
testq %rdi, %rdi
je 0x46eac
movq $0x0, 0x20f8(%rbx)
movq 0xb4e47(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46e94
decl 0x3b4(%rax)
movq 0xb4e45(%rip), %rsi     # 0xfbce0
callq *0xb0677(%rip)          # 0xf7518
movq $0x0, 0x2100(%rbx)
movq 0x30b8(%rbx), %rdi
testq %rdi, %rdi
je 0x46eed
movq $0x0, 0x30b0(%rbx)
movq 0xb4e06(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46ed5
decl 0x3b4(%rax)
movq 0xb4e04(%rip), %rsi     # 0xfbce0
callq *0xb0636(%rip)          # 0xf7518
movq $0x0, 0x30b8(%rbx)
movq 0x30c8(%rbx), %rdi
testq %rdi, %rdi
je 0x46f2e
movq $0x0, 0x30c0(%rbx)
movq 0xb4dc5(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46f16
decl 0x3b4(%rax)
movq 0xb4dc3(%rip), %rsi     # 0xfbce0
callq *0xb05f5(%rip)          # 0xf7518
movq $0x0, 0x30c8(%rbx)
leaq 0x2160(%rbx), %rdi
callq 0x5e0ae
leaq 0x3108(%rbx), %rdi
callq 0x5e166
movq 0x3100(%rbx), %rdi
testq %rdi, %rdi
je 0x46f87
movq $0x0, 0x30f8(%rbx)
movq 0xb4d6c(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x46f6f
decl 0x3b4(%rax)
movq 0xb4d6a(%rip), %rsi     # 0xfbce0
callq *0xb059c(%rip)          # 0xf7518
movq $0x0, 0x3100(%rbx)
movq 0x3140(%rbx), %rdi
testq %rdi, %rdi
je 0x46faf
movq 0xaff66(%rip), %rax     # 0xf6f00
cmpq (%rax), %rdi
je 0x46fa4
callq 0xc3b0
movq $0x0, 0x3140(%rbx)
leaq 0x3148(%rbx), %rdi
callq 0x5e1ae
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq