// File: /workspace/github_cpp_makefile_star2_O1/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 0x47567
cmpb $0x1, 0x1(%rbx)
jne 0x47567
movb $0x0, (%rdi)
callq 0x5ef4d
movq $0x0, 0xa8(%rbx)
cmpb $0x1, (%rbx)
jne 0x47ae8
cmpb $0x1, 0x30e1(%rbx)
jne 0x475a7
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x475a7
movq 0xb673c(%rip), %r14     # 0xfdcd0
movq %rbx, 0xb6735(%rip)     # 0xfdcd0
callq 0x50c72
movq %r14, 0xb6729(%rip)     # 0xfdcd0
cmpl $0x0, 0x3128(%rbx)
jle 0x475e3
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x3130(%rbx), %rax
cmpl $0x6, (%rax,%r14)
jne 0x475d0
leaq (%rax,%r14), %rsi
movq %rbx, %rdi
callq *0x8(%rax,%r14)
incq %r15
movslq 0x3128(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x475b6
cmpl $0x0, 0x1a88(%rbx)
jle 0x4760e
xorl %r14d, %r14d
movq 0x1a90(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x5ef8c
incq %r14
movslq 0x1a88(%rbx), %rax
cmpq %rax, %r14
jl 0x475ef
movq 0x1a90(%rbx), %rdi
testq %rdi, %rdi
je 0x4764f
movq $0x0, 0x1a88(%rbx)
movq 0xb66a4(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x47637
decl 0x3b4(%rax)
movq 0xb66a2(%rip), %rsi     # 0xfdce0
callq *0xb1ed4(%rip)          # 0xf9518
movq $0x0, 0x1a90(%rbx)
movq 0x1aa0(%rbx), %rdi
testq %rdi, %rdi
je 0x47690
movq $0x0, 0x1a98(%rbx)
movq 0xb6663(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x47678
decl 0x3b4(%rax)
movq 0xb6661(%rip), %rsi     # 0xfdce0
callq *0xb1e93(%rip)          # 0xf9518
movq $0x0, 0x1aa0(%rbx)
movq 0x1ab0(%rbx), %rdi
testq %rdi, %rdi
je 0x476d1
movq $0x0, 0x1aa8(%rbx)
movq 0xb6622(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x476b9
decl 0x3b4(%rax)
movq 0xb6620(%rip), %rsi     # 0xfdce0
callq *0xb1e52(%rip)          # 0xf9518
movq $0x0, 0x1ab0(%rbx)
movq $0x0, 0x1ae0(%rbx)
movq 0x1ac0(%rbx), %rdi
testq %rdi, %rdi
je 0x4771d
movq $0x0, 0x1ab8(%rbx)
movq 0xb65d6(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x47705
decl 0x3b4(%rax)
movq 0xb65d4(%rip), %rsi     # 0xfdce0
callq *0xb1e06(%rip)          # 0xf9518
movq $0x0, 0x1ac0(%rbx)
leaq 0x1ac8(%rbx), %rdi
callq 0x5efcc
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 0x47792
movq $0x0, 0x1c10(%rbx)
movq 0xb6561(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x4777a
decl 0x3b4(%rax)
movq 0xb655f(%rip), %rsi     # 0xfdce0
callq *0xb1d91(%rip)          # 0xf9518
movq $0x0, 0x1c18(%rbx)
movq 0x1c28(%rbx), %rdi
testq %rdi, %rdi
je 0x477d3
movq $0x0, 0x1c20(%rbx)
movq 0xb6520(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x477bb
decl 0x3b4(%rax)
movq 0xb651e(%rip), %rsi     # 0xfdce0
callq *0xb1d50(%rip)          # 0xf9518
movq $0x0, 0x1c28(%rbx)
movq 0x1c38(%rbx), %rdi
testq %rdi, %rdi
je 0x47814
movq $0x0, 0x1c30(%rbx)
movq 0xb64df(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x477fc
decl 0x3b4(%rax)
movq 0xb64dd(%rip), %rsi     # 0xfdce0
callq *0xb1d0f(%rip)          # 0xf9518
movq $0x0, 0x1c38(%rbx)
movq 0x1c78(%rbx), %rdi
testq %rdi, %rdi
je 0x47855
movq $0x0, 0x1c70(%rbx)
movq 0xb649e(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x4783d
decl 0x3b4(%rax)
movq 0xb649c(%rip), %rsi     # 0xfdce0
callq *0xb1cce(%rip)          # 0xf9518
movq $0x0, 0x1c78(%rbx)
movq 0x1c88(%rbx), %rdi
testq %rdi, %rdi
je 0x47896
movq $0x0, 0x1c80(%rbx)
movq 0xb645d(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x4787e
decl 0x3b4(%rax)
movq 0xb645b(%rip), %rsi     # 0xfdce0
callq *0xb1c8d(%rip)          # 0xf9518
movq $0x0, 0x1c88(%rbx)
leaq 0x1e48(%rbx), %rdi
callq 0x5f014
leaq 0x1e70(%rbx), %rdi
callq 0x76980
leaq 0x1f38(%rbx), %rdi
callq 0x76980
leaq 0x2110(%rbx), %rdi
callq 0x5f06a
movq 0x2140(%rbx), %rdi
testq %rdi, %rdi
je 0x47907
movq $0x0, 0x2138(%rbx)
movq 0xb63ec(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x478ef
decl 0x3b4(%rax)
movq 0xb63ea(%rip), %rsi     # 0xfdce0
callq *0xb1c1c(%rip)          # 0xf9518
movq $0x0, 0x2140(%rbx)
movq 0x2150(%rbx), %rdi
testq %rdi, %rdi
je 0x47948
movq $0x0, 0x2148(%rbx)
movq 0xb63ab(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x47930
decl 0x3b4(%rax)
movq 0xb63a9(%rip), %rsi     # 0xfdce0
callq *0xb1bdb(%rip)          # 0xf9518
movq $0x0, 0x2150(%rbx)
leaq 0x20b0(%rbx), %rdi
callq 0x5f1a6
movq 0x20e0(%rbx), %rdi
testq %rdi, %rdi
je 0x47995
movq $0x0, 0x20d8(%rbx)
movq 0xb635e(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x4797d
decl 0x3b4(%rax)
movq 0xb635c(%rip), %rsi     # 0xfdce0
callq *0xb1b8e(%rip)          # 0xf9518
movq $0x0, 0x20e0(%rbx)
movq 0x2100(%rbx), %rdi
testq %rdi, %rdi
je 0x479d6
movq $0x0, 0x20f8(%rbx)
movq 0xb631d(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x479be
decl 0x3b4(%rax)
movq 0xb631b(%rip), %rsi     # 0xfdce0
callq *0xb1b4d(%rip)          # 0xf9518
movq $0x0, 0x2100(%rbx)
movq 0x30b8(%rbx), %rdi
testq %rdi, %rdi
je 0x47a17
movq $0x0, 0x30b0(%rbx)
movq 0xb62dc(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x479ff
decl 0x3b4(%rax)
movq 0xb62da(%rip), %rsi     # 0xfdce0
callq *0xb1b0c(%rip)          # 0xf9518
movq $0x0, 0x30b8(%rbx)
movq 0x30c8(%rbx), %rdi
testq %rdi, %rdi
je 0x47a58
movq $0x0, 0x30c0(%rbx)
movq 0xb629b(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x47a40
decl 0x3b4(%rax)
movq 0xb6299(%rip), %rsi     # 0xfdce0
callq *0xb1acb(%rip)          # 0xf9518
movq $0x0, 0x30c8(%rbx)
leaq 0x2160(%rbx), %rdi
callq 0x5f26e
leaq 0x3108(%rbx), %rdi
callq 0x5f326
movq 0x3100(%rbx), %rdi
testq %rdi, %rdi
je 0x47ab1
movq $0x0, 0x30f8(%rbx)
movq 0xb6242(%rip), %rax     # 0xfdcd0
testq %rax, %rax
je 0x47a99
decl 0x3b4(%rax)
movq 0xb6240(%rip), %rsi     # 0xfdce0
callq *0xb1a72(%rip)          # 0xf9518
movq $0x0, 0x3100(%rbx)
movq 0x3140(%rbx), %rdi
testq %rdi, %rdi
je 0x47ad9
movq 0xb143c(%rip), %rax     # 0xf8f00
cmpq (%rax), %rdi
je 0x47ace
callq 0xc3b0
movq $0x0, 0x3140(%rbx)
leaq 0x3148(%rbx), %rdi
callq 0x5f36e
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq