// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginTabBarEx(ImGuiTabBar*, ImRect const&, int)
bool    ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImGuiTabBarFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    if ((flags & ImGuiTabBarFlags_DockNode) == 0)
        PushOverrideID(tab_bar->ID);

    // Add to stack
    g.CurrentTabBarStack.push_back(GetTabBarRefFromTabBar(tab_bar));
    g.CurrentTabBar = tab_bar;

    // Append with multiple BeginTabBar()/EndTabBar() pairs.
    tab_bar->BackupCursorPos = window->DC.CursorPos;
    if (tab_bar->CurrFrameVisible == g.FrameCount)
    {
        window->DC.CursorPos = ImVec2(tab_bar->BarRect.Min.x, tab_bar->BarRect.Max.y + tab_bar->ItemSpacingY);
        tab_bar->BeginCount++;
        return true;
    }

    // Ensure correct ordering when toggling ImGuiTabBarFlags_Reorderable flag, or when a new tab was added while being not reorderable
    if ((flags & ImGuiTabBarFlags_Reorderable) != (tab_bar->Flags & ImGuiTabBarFlags_Reorderable) || (tab_bar->TabsAddedNew && !(flags & ImGuiTabBarFlags_Reorderable)))
        if (tab_bar->Tabs.Size > 1)
            ImQsort(tab_bar->Tabs.Data, tab_bar->Tabs.Size, sizeof(ImGuiTabItem), TabItemComparerByBeginOrder);
    tab_bar->TabsAddedNew = false;

    // Flags
    if ((flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0)
        flags |= ImGuiTabBarFlags_FittingPolicyDefault_;

    tab_bar->Flags = flags;
    tab_bar->BarRect = tab_bar_bb;
    tab_bar->WantLayout = true; // Layout will be done on the first call to ItemTab()
    tab_bar->PrevFrameVisible = tab_bar->CurrFrameVisible;
    tab_bar->CurrFrameVisible = g.FrameCount;
    tab_bar->PrevTabsContentsHeight = tab_bar->CurrTabsContentsHeight;
    tab_bar->CurrTabsContentsHeight = 0.0f;
    tab_bar->ItemSpacingY = g.Style.ItemSpacing.y;
    tab_bar->FramePadding = g.Style.FramePadding;
    tab_bar->TabsActiveCount = 0;
    tab_bar->BeginCount = 1;

    // Set cursor pos in a way which only be used in the off-chance the user erroneously submits item before BeginTabItem(): items will overlap
    window->DC.CursorPos = ImVec2(tab_bar->BarRect.Min.x, tab_bar->BarRect.Max.y + tab_bar->ItemSpacingY);

    // Draw separator
    const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive);
    const float y = tab_bar->BarRect.Max.y - 1.0f;
    {
        const float separator_min_x = tab_bar->BarRect.Min.x - IM_FLOOR(window->WindowPadding.x * 0.5f);
        const float separator_max_x = tab_bar->BarRect.Max.x + IM_FLOOR(window->WindowPadding.x * 0.5f);
        window->DrawList->AddLine(ImVec2(separator_min_x, y), ImVec2(separator_max_x, y), col, 1.0f);
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x58100(%rip), %r15     # 0xfbcd0
movq (%r15), %r12
movq 0x1ae0(%r12), %r13
movb 0x93(%r13), %bl
testb %bl, %bl
jne 0xa3ea6
movq %rdi, %r14
movq %rsi, -0x48(%rbp)
movl %edx, -0x2c(%rbp)
btl $0x14, %edx
movq %r12, %rdi
jb 0xa3c09
movl 0x14(%r14), %edi
callq 0x54f5b
movq (%r15), %rdi
movq 0x2118(%rdi), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r14, %rdx
ja 0xa3c46
movslq 0x2110(%rdi), %rcx
imulq $0x98, %rcx, %rcx
addq %rcx, %rdx
movq %r14, %rsi
cmpq %r14, %rdx
jbe 0xa3c49
addq $0x2110, %rdi           # imm = 0x2110
movq %r14, %rsi
callq 0xac0e2
xorl %esi, %esi
jmp 0xa3c49
movq %r14, %rsi
movl 0x2138(%r12), %edx
cmpl 0x213c(%r12), %edx
jne 0xa3c7b
movq %r13, -0x40(%rbp)
leal 0x1(%rdx), %r13d
testl %edx, %edx
movl %eax, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
je 0xa3c85
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
sarl %ecx
addl %edx, %ecx
jmp 0xa3c8a
movq 0x2140(%r12), %r15
jmp 0xa3cf1
movl $0x8, %ecx
cmpl %r13d, %ecx
cmovgl %ecx, %r13d
movslq %r13d, %rdi
shlq $0x4, %rdi
callq 0x41c63
movq %rax, %r15
movq 0x2140(%r12), %rsi
testq %rsi, %rsi
je 0xa3cce
movslq 0x2138(%r12), %rdx
shlq $0x4, %rdx
movq %r15, %rdi
callq 0xc080
movq 0x2140(%r12), %rdi
callq 0x41d3c
movq %r15, 0x2140(%r12)
movl %r13d, 0x213c(%r12)
movl 0x2138(%r12), %edx
movq -0x40(%rbp), %r13
movl -0x30(%rbp), %eax
movq -0x38(%rbp), %rsi
movslq %edx, %rcx
shlq $0x4, %rcx
movq %rsi, (%r15,%rcx)
movl %eax, 0x8(%r15,%rcx)
incl 0x2138(%r12)
movq %r14, 0x2108(%r12)
movq 0xd8(%r13), %rax
movq %rax, 0x80(%r14)
movl 0x24(%r14), %eax
cmpl 0x1a68(%r12), %eax
jne 0xa3d56
movl 0x2c(%r14), %eax
movss 0x38(%r14), %xmm0
addss 0x74(%r14), %xmm0
movl %eax, 0xd8(%r13)
movss %xmm0, 0xdc(%r13)
incb 0x69(%r14)
jmp 0xa3ea6
movl -0x2c(%rbp), %ecx
andl $0x1, %ecx
movl 0x10(%r14), %edx
andl $0x1, %edx
cmpl %edx, %ecx
jne 0xa3d72
testl %ecx, %ecx
jne 0xa3d94
cmpb $0x0, 0x6c(%r14)
je 0xa3d94
movslq (%r14), %rsi
cmpq $0x2, %rsi
jl 0xa3d94
movq 0x8(%r14), %rdi
leaq 0x134(%rip), %rcx       # 0xa3eba
movl $0x24, %edx
callq 0xc620
movl 0x24(%r14), %eax
movb $0x0, 0x6c(%r14)
movl -0x2c(%rbp), %edx
movl %edx, %ecx
orl $0x40, %ecx
testb $-0x40, %dl
cmovnel %edx, %ecx
movl %ecx, 0x10(%r14)
movq -0x48(%rbp), %rdx
movups (%rdx), %xmm0
movups %xmm0, 0x2c(%r14)
movb $0x1, %dl
movb %dl, 0x6a(%r14)
movl %eax, 0x28(%r14)
movl 0x1a68(%r12), %eax
movl %eax, 0x24(%r14)
movss 0x3c(%r14), %xmm0
movss %xmm0, 0x40(%r14)
movl $0x0, 0x3c(%r14)
movss 0x15ac(%r12), %xmm0
movss %xmm0, 0x74(%r14)
movq 0x1598(%r12), %rax
movq %rax, 0x78(%r14)
movw $0x0, 0x6e(%r14)
movb %dl, 0x69(%r14)
movl 0x2c(%r14), %eax
addss 0x38(%r14), %xmm0
movl %eax, 0xd8(%r13)
movss %xmm0, 0xdc(%r13)
xorl %eax, %eax
btl $0x15, %ecx
setae %al
leal 0x23(,%rax,2), %edi
movss 0x111aa(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movss 0x38(%r14), %xmm0
addss 0x11183(%rip), %xmm0    # 0xb4fd0
movss 0x2c(%r14), %xmm1
movss 0x40(%r13), %xmm2
mulss 0x111a3(%rip), %xmm2    # 0xb5004
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm2
subss %xmm2, %xmm1
movss 0x34(%r14), %xmm3
addss %xmm2, %xmm3
movq 0x2b8(%r13), %rdi
leaq -0x58(%rbp), %rsi
movss %xmm1, (%rsi)
movss %xmm0, 0x4(%rsi)
leaq -0x50(%rbp), %rdx
movss %xmm3, (%rdx)
movss %xmm0, 0x4(%rdx)
movl %eax, %ecx
movss 0x11143(%rip), %xmm0    # 0xb4fe4
callq 0x78368
xorb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq