// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::EndTabBar()
void    ImGui::EndTabBar()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar != NULL, "Mismatched BeginTabBar()/EndTabBar()!");
        return;
    }

    // Fallback in case no TabItem have been submitted
    if (tab_bar->WantLayout)
        TabBarLayout(tab_bar);

    // Restore the last visible height if no tab is visible, this reduce vertical flicker/movement when a tabs gets removed without calling SetTabItemClosed().
    const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount);
    if (tab_bar->VisibleTabWasSubmitted || tab_bar->VisibleTabId == 0 || tab_bar_appearing)
    {
        tab_bar->CurrTabsContentsHeight = ImMax(window->DC.CursorPos.y - tab_bar->BarRect.Max.y, tab_bar->CurrTabsContentsHeight);
        window->DC.CursorPos.y = tab_bar->BarRect.Max.y + tab_bar->CurrTabsContentsHeight;
    }
    else
    {
        window->DC.CursorPos.y = tab_bar->BarRect.Max.y + tab_bar->PrevTabsContentsHeight;
    }
    if (tab_bar->BeginCount > 1)
        window->DC.CursorPos = tab_bar->BackupCursorPos;

    if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0)
        PopID();

    g.CurrentTabBarStack.pop_back();
    g.CurrentTabBar = g.CurrentTabBarStack.empty() ? NULL : GetTabBarFromTabBarRef(g.CurrentTabBarStack.back());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xbd161(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x93(%rax)
je 0x155e07
jmp 0x155fa4
movq -0x8(%rbp), %rax
movq 0x2108(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x155e5f
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x1a(%rbp)
je 0x155e30
movb $0x1, %al
movb %al, -0x1a(%rbp)
jmp 0x155e30
movb -0x1a(%rbp), %al
testb $0x1, %al
jne 0x155e39
jmp 0x155e3b
jmp 0x155e5a
leaq 0x3a2cc(%rip), %rdi     # 0x19010e
leaq 0x38597(%rip), %rsi     # 0x18e3e0
movl $0x1b58, %edx           # imm = 0x1B58
leaq 0x3a2f8(%rip), %rcx     # 0x19014d
callq 0xd180
jmp 0x155fa4
movq -0x18(%rbp), %rax
testb $0x1, 0x6a(%rax)
je 0x155e72
movq -0x18(%rbp), %rdi
callq 0x155fb0
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a68(%rcx), %eax
setl %al
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x6b(%rax)
jne 0x155ea8
movq -0x18(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x155ea8
testb $0x1, -0x19(%rbp)
je 0x155ef4
movq -0x10(%rbp), %rax
movss 0xdc(%rax), %xmm0
movq -0x18(%rbp), %rax
subss 0x38(%rax), %xmm0
movq -0x18(%rbp), %rax
movss 0x3c(%rax), %xmm1
callq 0x139050
movq -0x18(%rbp), %rax
movss %xmm0, 0x3c(%rax)
movq -0x18(%rbp), %rax
movss 0x38(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x3c(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xdc(%rax)
jmp 0x155f12
movq -0x18(%rbp), %rax
movss 0x38(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x40(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xdc(%rax)
movq -0x18(%rbp), %rax
movsbl 0x69(%rax), %eax
cmpl $0x1, %eax
jle 0x155f35
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x80(%rcx), %rcx
movq %rcx, 0xd8(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
jne 0x155f4b
callq 0xdb640
movq -0x8(%rbp), %rdi
addq $0x2138, %rdi           # imm = 0x2138
callq 0x137340
movq -0x8(%rbp), %rdi
addq $0x2138, %rdi           # imm = 0x2138
callq 0x162800
testb $0x1, %al
jne 0x155f71
jmp 0x155f79
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x155f95
movq -0x8(%rbp), %rdi
addq $0x2138, %rdi           # imm = 0x2138
callq 0x137390
movq %rax, %rdi
callq 0x156fd0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x2108(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)