// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabItemEx(ImGuiTabBar*, char const*, bool*, int)
bool    ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags)
{
    // Layout whole tab bar if not already done
    if (tab_bar->WantLayout)
        TabBarLayout(tab_bar);

    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    const ImGuiStyle& style = g.Style;
    const ImGuiID id = TabBarCalcTabID(tab_bar, label);

    // If the user called us with *p_open == false, we early out and don't render.
    // We make a call to ItemAdd() so that attempts to use a contextual popup menu with an implicit ID won't use an older ID.
    IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags);
    if (p_open && !*p_open)
    {
        PushItemFlag(ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus, true);
        ItemAdd(ImRect(), id);
        PopItemFlag();
        return false;
    }

    IM_ASSERT(!p_open || !(flags & ImGuiTabItemFlags_Button));
    IM_ASSERT((flags & (ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing)) != (ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing)); // Can't use both Leading and Trailing

    // Store into ImGuiTabItemFlags_NoCloseButton, also honor ImGuiTabItemFlags_NoCloseButton passed by user (although not documented)
    if (flags & ImGuiTabItemFlags_NoCloseButton)
        p_open = NULL;
    else if (p_open == NULL)
        flags |= ImGuiTabItemFlags_NoCloseButton;

    // Calculate tab contents size
    ImVec2 size = TabItemCalcSize(label, p_open != NULL);

    // Acquire tab data
    ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, id);
    bool tab_is_new = false;
    if (tab == NULL)
    {
        tab_bar->Tabs.push_back(ImGuiTabItem());
        tab = &tab_bar->Tabs.back();
        tab->ID = id;
        tab->Width = size.x;
        tab_bar->TabsAddedNew = true;
        tab_is_new = true;
    }
    tab_bar->LastTabItemIdx = (ImS16)tab_bar->Tabs.index_from_ptr(tab);
    tab->ContentWidth = size.x;
    tab->BeginOrder = tab_bar->TabsActiveCount++;

    const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount);
    const bool tab_bar_focused = (tab_bar->Flags & ImGuiTabBarFlags_IsFocused) != 0;
    const bool tab_appearing = (tab->LastFrameVisible + 1 < g.FrameCount);
    const bool is_tab_button = (flags & ImGuiTabItemFlags_Button) != 0;
    tab->LastFrameVisible = g.FrameCount;
    tab->Flags = flags;

    // Append name with zero-terminator
    tab->NameOffset = (ImS16)tab_bar->TabsNames.size();
    tab_bar->TabsNames.append(label, label + strlen(label) + 1);

    // Update selected tab
    if (tab_appearing && (tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs) && tab_bar->NextSelectedTabId == 0)
        if (!tab_bar_appearing || tab_bar->SelectedTabId == 0)
            if (!is_tab_button)
                tab_bar->NextSelectedTabId = id;  // New tabs gets activated
    if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // SetSelected can only be passed on explicit tab bar
        if (!is_tab_button)
            tab_bar->NextSelectedTabId = id;

    // Lock visibility
    // (Note: tab_contents_visible != tab_selected... because CTRL+TAB operations may preview some tabs without selecting them!)
    bool tab_contents_visible = (tab_bar->VisibleTabId == id);
    if (tab_contents_visible)
        tab_bar->VisibleTabWasSubmitted = true;

    // On the very first frame of a tab bar we let first tab contents be visible to minimize appearing glitches
    if (!tab_contents_visible && tab_bar->SelectedTabId == 0 && tab_bar_appearing)
        if (tab_bar->Tabs.Size == 1 && !(tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs))
            tab_contents_visible = true;

    // Note that tab_is_new is not necessarily the same as tab_appearing! When a tab bar stops being submitted
    // and then gets submitted again, the tabs will have 'tab_appearing=true' but 'tab_is_new=false'.
    if (tab_appearing && (!tab_bar_appearing || tab_is_new))
    {
        PushItemFlag(ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus, true);
        ItemAdd(ImRect(), id);
        PopItemFlag();
        if (is_tab_button)
            return false;
        return tab_contents_visible;
    }

    if (tab_bar->SelectedTabId == id)
        tab->LastFrameSelected = g.FrameCount;

    // Backup current layout position
    const ImVec2 backup_main_cursor_pos = window->DC.CursorPos;

    // Layout
    const bool is_central_section = (tab->Flags & (ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing)) == 0;
    size.x = tab->Width;
    if (is_central_section)
        window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_FLOOR(tab->Offset - tab_bar->ScrollingAnim), 0.0f);
    else
        window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(tab->Offset, 0.0f);
    ImVec2 pos = window->DC.CursorPos;
    ImRect bb(pos, pos + size);

    // We don't have CPU clipping primitives to clip the CloseButton (until it becomes a texture), so need to add an extra draw call (temporary in the case of vertical animation)
    const bool want_clip_rect = is_central_section && (bb.Min.x < tab_bar->ScrollingRectMinX || bb.Max.x > tab_bar->ScrollingRectMaxX);
    if (want_clip_rect)
        PushClipRect(ImVec2(ImMax(bb.Min.x, tab_bar->ScrollingRectMinX), bb.Min.y - 1), ImVec2(tab_bar->ScrollingRectMaxX, bb.Max.y), true);

    ImVec2 backup_cursor_max_pos = window->DC.CursorMaxPos;
    ItemSize(bb.GetSize(), style.FramePadding.y);
    window->DC.CursorMaxPos = backup_cursor_max_pos;

    if (!ItemAdd(bb, id))
    {
        if (want_clip_rect)
            PopClipRect();
        window->DC.CursorPos = backup_main_cursor_pos;
        return tab_contents_visible;
    }

    // Click to Select a tab
    ImGuiButtonFlags button_flags = ((is_tab_button ? ImGuiButtonFlags_PressedOnClickRelease : ImGuiButtonFlags_PressedOnClick) | ImGuiButtonFlags_AllowItemOverlap);
    if (g.DragDropActive)
        button_flags |= ImGuiButtonFlags_PressedOnDragDropHold;
    bool hovered, held;
    bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
    if (pressed && !is_tab_button)
        tab_bar->NextSelectedTabId = id;
    hovered |= (g.HoveredId == id);

    // Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered)
    if (g.ActiveId != id)
        SetItemAllowOverlap();

    // Drag and drop: re-order tabs
    if (held && !tab_appearing && IsMouseDragging(0))
    {
        if (!g.DragDropActive && (tab_bar->Flags & ImGuiTabBarFlags_Reorderable))
        {
            // While moving a tab it will jump on the other side of the mouse, so we also test for MouseDelta.x
            if (g.IO.MouseDelta.x < 0.0f && g.IO.MousePos.x < bb.Min.x)
            {
                if (tab_bar->Flags & ImGuiTabBarFlags_Reorderable)
                    TabBarQueueReorder(tab_bar, tab, -1);
            }
            else if (g.IO.MouseDelta.x > 0.0f && g.IO.MousePos.x > bb.Max.x)
            {
                if (tab_bar->Flags & ImGuiTabBarFlags_Reorderable)
                    TabBarQueueReorder(tab_bar, tab, +1);
            }
        }
    }

#if 0
    if (hovered && g.HoveredIdNotActiveTimer > TOOLTIP_DELAY && bb.GetWidth() < tab->ContentWidth)
    {
        // Enlarge tab display when hovering
        bb.Max.x = bb.Min.x + IM_FLOOR(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f)));
        display_draw_list = GetForegroundDrawList(window);
        TabItemBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive));
    }
#endif

    // Render tab shape
    ImDrawList* display_draw_list = window->DrawList;
    const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabUnfocused));
    TabItemBackground(display_draw_list, bb, flags, tab_col);
    RenderNavHighlight(bb, id);

    // Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget.
    const bool hovered_unblocked = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
    if (hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1)))
        if (!is_tab_button)
            tab_bar->NextSelectedTabId = id;

    if (tab_bar->Flags & ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)
        flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton;

    // Render tab label, process close button
    const ImGuiID close_button_id = p_open ? GetIDWithSeed("#CLOSE", NULL, id) : 0;
    bool just_closed;
    bool text_clipped;
    TabItemLabelAndCloseButton(display_draw_list, bb, flags, tab_bar->FramePadding, label, id, close_button_id, tab_contents_visible, &just_closed, &text_clipped);
    if (just_closed && p_open != NULL)
    {
        *p_open = false;
        TabBarCloseTab(tab_bar, tab);
    }

    // Restore main window position so user can draw there
    if (want_clip_rect)
        PopClipRect();
    window->DC.CursorPos = backup_main_cursor_pos;

    // Tooltip (FIXME: Won't work over the close button because ItemOverlap systems messes up with HoveredIdTimer)
    // We test IsItemHovered() to discard e.g. when another item is active or drag and drop over the tab bar (which g.HoveredId ignores)
    if (text_clipped && g.HoveredId == id && !held && g.HoveredIdNotActiveTimer > g.TooltipSlowDelay && IsItemHovered())
        if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip) && !(tab->Flags & ImGuiTabItemFlags_NoTooltip))
            SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);

    IM_ASSERT(!is_tab_button || !(tab_bar->SelectedTabId == tab->ID && is_tab_button)); // TabItemButton should not be selected
    if (is_tab_button)
        return pressed;
    return tab_contents_visible;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
cmpb $0x1, 0x6a(%rdi)
jne 0x8cdb2
movq %rbx, %rdi
callq 0x8bd1f
leaq 0x56f27(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
je 0x8cdd4
xorl %r14d, %r14d
jmp 0x8d4fd
movq %rcx, -0x40(%rbp)
movq %rax, -0x98(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8d650
movl %eax, -0x34(%rbp)
testq %r15, %r15
je 0x8ce03
cmpb $0x0, (%r15)
je 0x8ce71
btl $0x15, %r14d
jb 0x8d531
movl %r14d, %eax
notl %eax
testb $-0x40, %al
je 0x8d512
movl %r14d, %eax
orl $0x100000, %eax         # imm = 0x100000
xorl %ecx, %ecx
btl $0x14, %r14d
cmovbl %r14d, %eax
cmovaeq %r15, %rcx
testq %r15, %r15
cmovnel %r14d, %eax
movl %eax, -0x2c(%rbp)
xorl %esi, %esi
movq %rcx, -0x88(%rbp)
testq %rcx, %rcx
setne %sil
movq %r12, %rdi
callq 0x8d692
movaps %xmm0, -0x80(%rbp)
movq %rbx, %rdi
movl -0x34(%rbp), %r14d
movl %r14d, %esi
callq 0x8cadd
testq %rax, %rax
movq %r12, -0x90(%rbp)
movq %rax, -0x60(%rbp)
je 0x8cea0
movq %rax, %r12
jmp 0x8cee6
pushq $0x18
popq %rdi
pushq $0x1
popq %rsi
callq 0x423da
xorps %xmm0, %xmm0
leaq -0xd0(%rbp), %rdi
movaps %xmm0, (%rdi)
xorl %r14d, %r14d
movl -0x34(%rbp), %esi
xorl %edx, %edx
callq 0x40ea5
callq 0x4246f
jmp 0x8d4fd
xorps %xmm0, %xmm0
leaq -0xd0(%rbp), %rsi
movaps %xmm0, (%rsi)
andl $0x0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
orq $-0x1, 0x8(%rsi)
orw $-0x1, 0x20(%rsi)
orl $-0x1, 0x1c(%rsi)
movq %rbx, %rdi
callq 0x93250
movq %rbx, %rdi
callq 0x932b6
movq %rax, %r12
movl %r14d, (%rax)
movaps -0x80(%rbp), %xmm0
movss %xmm0, 0x14(%rax)
movb $0x1, 0x6c(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x932f2
movw %ax, 0x70(%rbx)
movaps -0x80(%rbp), %xmm0
movss %xmm0, 0x18(%r12)
movzwl 0x6e(%rbx), %eax
movl %eax, %ecx
incl %ecx
movw %cx, 0x6e(%rbx)
movw %ax, 0x1e(%r12)
movl 0x10(%rbx), %eax
movl %eax, -0x58(%rbp)
movl 0x28(%rbx), %eax
incl %eax
movl %eax, -0x50(%rbp)
movq -0x98(%rbp), %rax
movl 0x1a68(%rax), %r13d
movl 0x8(%r12), %r15d
incl %r15d
movl %r13d, 0x8(%r12)
movl -0x2c(%rbp), %eax
movl %eax, 0x4(%r12)
leaq 0x88(%rbx), %r14
movl 0x88(%rbx), %eax
xorl %ecx, %ecx
subl $0x1, %eax
cmovbl %ecx, %eax
movq %r12, -0x48(%rbp)
movw %ax, 0x1c(%r12)
movq -0x90(%rbp), %r12
movq %r12, %rdi
callq 0xc380
leaq (%r12,%rax), %rdx
incq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x355a2
movl %r15d, %esi
movl %r13d, %edx
cmpl %r13d, %r15d
movl -0x34(%rbp), %r15d
jge 0x8cfbd
testb $0x2, 0x10(%rbx)
je 0x8cfbd
cmpl $0x0, 0x1c(%rbx)
jne 0x8cfbd
cmpl %edx, -0x50(%rbp)
jl 0x8cfac
btl $0x15, -0x2c(%rbp)
jae 0x8cfb9
jmp 0x8cfbd
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
orl 0x18(%rbx), %eax
jne 0x8cfbd
movl %r15d, 0x1c(%rbx)
testb $0x2, -0x2c(%rbp)
je 0x8cfd7
cmpl %r15d, 0x18(%rbx)
je 0x8cfd7
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
jne 0x8cfd7
movl %r15d, 0x1c(%rbx)
cmpl %r15d, 0x20(%rbx)
movq -0x98(%rbp), %r12
movaps -0x80(%rbp), %xmm5
movl -0x50(%rbp), %edi
jne 0x8cff4
movb $0x1, 0x6b(%rbx)
movb $0x1, %r14b
jmp 0x8d016
cmpl %edx, %edi
setge %al
cmpl $0x0, 0x18(%rbx)
setne %cl
orb %al, %cl
jne 0x8d013
cmpl $0x1, (%rbx)
jne 0x8d013
testb $0x2, 0x10(%rbx)
sete %r14b
jmp 0x8d016
xorl %r14d, %r14d
cmpl %edx, %edi
setge %al
cmpq $0x0, -0x60(%rbp)
sete %cl
cmpl %edx, %esi
jge 0x8d065
orb %al, %cl
je 0x8d065
btl $0x15, -0x2c(%rbp)
setae %bl
pushq $0x18
popq %rdi
pushq $0x1
popq %rsi
callq 0x423da
xorps %xmm0, %xmm0
leaq -0xd0(%rbp), %rdi
movaps %xmm0, (%rdi)
movl %r15d, %esi
xorl %edx, %edx
callq 0x40ea5
callq 0x4246f
andb %r14b, %bl
movl %ebx, %r14d
jmp 0x8d4fd
cmpl %r15d, 0x18(%rbx)
jne 0x8d07a
movl 0x1a68(%r12), %eax
movq -0x48(%rbp), %rcx
movl %eax, 0xc(%rcx)
movq -0x48(%rbp), %rcx
movl 0x4(%rcx), %eax
movss 0x14(%rcx), %xmm0
movss 0x10(%rcx), %xmm1
testb $-0x40, %al
movq -0x40(%rbp), %rcx
movl %edx, -0xa0(%rbp)
jne 0x8d0a5
subss 0x4c(%rbx), %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss 0x2c(%rbx), %xmm1
movq 0xd8(%rcx), %rdx
xorps %xmm2, %xmm2
addss 0x30(%rbx), %xmm2
movaps %xmm1, %xmm3
unpcklps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movlps %xmm3, 0xd8(%rcx)
addss %xmm1, %xmm0
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
addss %xmm2, %xmm5
movaps %xmm0, %xmm3
unpcklps %xmm5, %xmm3            # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
movss %xmm1, -0xd0(%rbp)
movss %xmm2, -0xcc(%rbp)
movlps %xmm3, -0xc8(%rbp)
testb $-0x40, %al
movq %rdx, -0x50(%rbp)
movl %esi, -0x9c(%rbp)
jne 0x8d119
movss 0x5c(%rbx), %xmm4
movss 0x60(%rbx), %xmm3
ucomiss %xmm1, %xmm4
ja 0x8d283
ucomiss %xmm3, %xmm0
ja 0x8d283
movl $0x0, -0x80(%rbp)
movq 0xf0(%rcx), %r15
subss %xmm1, %xmm0
subss %xmm2, %xmm5
unpcklps %xmm5, %xmm0            # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
leaq -0x68(%rbp), %rdi
movlps %xmm0, (%rdi)
movss 0x159c(%r12), %xmm0
movq %rcx, %r13
callq 0x40d3b
movq %r15, 0xf0(%r13)
leaq -0xd0(%rbp), %rdi
movl -0x34(%rbp), %r13d
movl %r13d, %esi
xorl %edx, %edx
callq 0x40ea5
testb %al, %al
je 0x8d264
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
movl %eax, -0x54(%rbp)
shrl $0x11, %eax
movzbl 0x2004(%r12), %ecx
shll $0x9, %ecx
leal (%rax,%rcx), %r8d
addl $0x1010, %r8d           # imm = 0x1010
leaq -0xd0(%rbp), %rdi
leaq -0x68(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movl %r13d, %esi
callq 0x79dde
movb %al, -0x2d(%rbp)
testb %al, %al
movq %r12, %r15
movl %r13d, %r12d
je 0x8d1c2
cmpl $0x0, -0x54(%rbp)
jne 0x8d1c2
movl %r12d, 0x1c(%rbx)
cmpl %r12d, 0x1b1c(%r15)
sete %al
orb %al, -0x68(%rbp)
cmpl %r12d, 0x1b30(%r15)
je 0x8d1dd
callq 0x406fd
cmpb $0x1, -0x70(%rbp)
movq -0x40(%rbp), %rcx
movl -0xa0(%rbp), %eax
movl -0x9c(%rbp), %edx
jne 0x8d316
cmpl %eax, %edx
jl 0x8d316
movss 0xede9(%rip), %xmm0     # 0x9bff0
xorl %edi, %edi
callq 0x40317
movq -0x40(%rbp), %rcx
testb %al, %al
je 0x8d316
cmpb $0x0, 0x2004(%r15)
jne 0x8d316
testb $0x1, 0x10(%rbx)
je 0x8d316
movss 0x3b8(%r15), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x8d2ec
movss -0xd0(%rbp), %xmm2
ucomiss 0x128(%r15), %xmm2
jbe 0x8d2ec
pushq $-0x1
jmp 0x8d305
cmpb $0x0, -0x80(%rbp)
je 0x8d26f
callq 0x3f128
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0xd8(%rax)
jmp 0x8d4fd
movaps %xmm4, %xmm0
cmpless %xmm1, %xmm0
andps %xmm0, %xmm1
andnps %xmm4, %xmm0
orps %xmm1, %xmm0
addss 0xed54(%rip), %xmm2     # 0x9bff0
leaq -0x68(%rbp), %rdi
movss %xmm0, (%rdi)
movss %xmm2, 0x4(%rdi)
leaq -0x70(%rbp), %rsi
movss %xmm3, (%rsi)
movss %xmm5, 0x4(%rsi)
pushq $0x1
popq %rdx
callq 0x3f0d3
movq -0x40(%rbp), %rcx
movss -0xc8(%rbp), %xmm0
movss -0xd0(%rbp), %xmm1
movss -0xcc(%rbp), %xmm2
movss -0xc4(%rbp), %xmm5
movb $0x1, %al
movl %eax, -0x80(%rbp)
jmp 0x8d120
ucomiss %xmm1, %xmm0
jbe 0x8d316
movss 0x128(%r15), %xmm0
ucomiss -0xc8(%rbp), %xmm0
jbe 0x8d316
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
callq 0x8cbc5
movq -0x40(%rbp), %rcx
movq 0x2b8(%rcx), %rax
movq %rax, -0x60(%rbp)
pushq $0x22
popq %rdi
cmpb $0x0, -0x70(%rbp)
je 0x8d333
movq -0x90(%rbp), %r15
jmp 0x8d366
cmpb $0x0, -0x68(%rbp)
movq -0x90(%rbp), %r15
jne 0x8d366
xorl %eax, %eax
testb %r14b, %r14b
je 0x8d358
btl $0x15, -0x58(%rbp)
setae %al
leal 0x23(,%rax,2), %edi
jmp 0x8d366
btl $0x15, -0x58(%rbp)
setae %al
leal (%rax,%rax,2), %edi
addl $0x21, %edi
movss 0xec8a(%rip), %xmm0     # 0x9bff8
callq 0x35d33
leaq -0xd0(%rbp), %r13
movq -0x60(%rbp), %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
movl %eax, %ecx
callq 0x8d72c
pushq $0x1
popq %rdx
movq %r13, %rdi
movl %r12d, %esi
callq 0x36c91
pushq $0x8
popq %rdi
callq 0x374fd
testb %al, %al
je 0x8d3d2
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x401cd
testb %al, %al
je 0x8d3bc
btl $0x15, -0x2c(%rbp)
jae 0x8d3ce
jmp 0x8d3d2
pushq $0x1
popq %rdi
callq 0x40253
testb %al, %al
je 0x8d3d2
cmpl $0x0, -0x54(%rbp)
jne 0x8d3d2
movl %r12d, 0x1c(%rbx)
movl 0x10(%rbx), %r13d
shrl %r13d
andl $0x4, %r13d
orl -0x2c(%rbp), %r13d
cmpq $0x0, -0x88(%rbp)
je 0x8d401
leaq 0x136c9(%rip), %rdi     # 0xa0abb
xorl %esi, %esi
movl %r12d, %edx
callq 0x42fc0
movl %eax, %r9d
jmp 0x8d404
xorl %r9d, %r9d
movsd 0x78(%rbx), %xmm0
subq $0x8, %rsp
leaq -0x2e(%rbp), %rax
leaq -0x2f(%rbp), %r10
movzbl %r14b, %r11d
leaq -0xd0(%rbp), %rsi
movq -0x60(%rbp), %rdi
movl %r13d, %edx
movq %r15, %rcx
movl %r12d, %r8d
pushq %rax
pushq %r10
pushq %r11
callq 0x8d9d3
addq $0x20, %rsp
cmpq $0x0, -0x88(%rbp)
je 0x8d461
cmpb $0x0, -0x2f(%rbp)
je 0x8d461
movq -0x88(%rbp), %rax
movb $0x0, (%rax)
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
callq 0x8cb75
cmpb $0x0, -0x80(%rbp)
movq -0x98(%rbp), %r13
je 0x8d473
callq 0x3f128
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0xd8(%rax)
cmpb $0x1, -0x2e(%rbp)
jne 0x8d4e5
cmpl %r12d, 0x1b1c(%r13)
jne 0x8d4e5
cmpb $0x0, -0x70(%rbp)
jne 0x8d4e5
movss 0x1b2c(%r13), %xmm0
ucomiss 0x30ac(%r13), %xmm0
jbe 0x8d4e5
xorl %edi, %edi
callq 0x374fd
testb %al, %al
je 0x8d4e5
testb $0x20, 0x10(%rbx)
jne 0x8d4e5
movq -0x48(%rbp), %rax
testb $0x10, 0x4(%rax)
jne 0x8d4e5
movq %r15, %rdi
xorl %esi, %esi
callq 0x36123
subl %r15d, %eax
leaq 0x122d6(%rip), %rdi     # 0x9f7af
movl %eax, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3fb35
btl $0x15, -0x2c(%rbp)
jae 0x8d4fd
movl 0x18(%rbx), %eax
movb -0x2d(%rbp), %cl
movl %ecx, %r14d
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
je 0x8d550
movl %r14d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cc35(%rip), %rdi     # 0xba14e
leaq 0x2ae68(%rip), %rsi     # 0xb8388
leaq 0x2cbd9(%rip), %rcx     # 0xba100
movl $0x1da9, %edx           # imm = 0x1DA9
callq 0xc140
leaq 0x2cb99(%rip), %rdi     # 0xba0d1
leaq 0x2ae49(%rip), %rsi     # 0xb8388
leaq 0x2cbba(%rip), %rcx     # 0xba100
movl $0x1da8, %edx           # imm = 0x1DA8
callq 0xc140
leaq 0x2cc76(%rip), %rdi     # 0xba1cd
leaq 0x2ae2a(%rip), %rsi     # 0xb8388
leaq 0x2cb9b(%rip), %rcx     # 0xba100
movl $0x1e60, %edx           # imm = 0x1E60
callq 0xc140