// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movl %ecx, %r14d
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
cmpb $0x1, 0x6a(%rdi)
jne 0xa53c6
movq %rbx, %rdi
callq 0xa405e
leaq 0x56903(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
je 0xa53ef
xorl %r15d, %r15d
jmp 0xa5c09
movq %rax, -0x68(%rbp)
movl 0x10(%rbx), %edi
movq %r12, %rsi
callq 0xa5de3
movl %eax, %r15d
testq %r13, %r13
je 0xa541c
cmpb $0x0, (%r13)
je 0xa54bb
btl $0x15, %r14d
jb 0xa5c7b
movl %r14d, %eax
notl %eax
testb $-0x40, %al
je 0xa5c3d
movl %r14d, %eax
orl $0x100000, %eax         # imm = 0x100000
xorl %ecx, %ecx
btl $0x14, %r14d
cmovbl %r14d, %eax
cmovaeq %r13, %rcx
testq %r13, %r13
cmovnel %r14d, %eax
movl %eax, -0x2c(%rbp)
xorl %esi, %esi
movq %rcx, -0x98(%rbp)
testq %rcx, %rcx
setne %sil
movq %r12, %rdi
callq 0xa5e25
testl %r15d, %r15d
setne %cl
movl (%rbx), %eax
testl %eax, %eax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
movl %r15d, -0x30(%rbp)
movaps %xmm0, -0x90(%rbp)
jne 0xa54a1
movl %eax, %edx
movq 0x8(%rbx), %rcx
shlq $0x2, %rdx
leaq (%rdx,%rdx,8), %rdx
xorl %r13d, %r13d
cmpl %r15d, (%rcx,%r13)
je 0xa54f1
addq $0x24, %r13
cmpq %r13, %rdx
jne 0xa5492
cmpl 0x4(%rbx), %eax
jne 0xa54eb
leal 0x1(%rax), %r15d
testl %eax, %eax
je 0xa5500
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl %eax, %ecx
jmp 0xa5505
movl $0x18, %edi
movl $0x1, %esi
callq 0x53d92
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movl %r15d, %esi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x524a8
callq 0x53ede
jmp 0xa5c09
movq 0x8(%rbx), %r14
jmp 0xa5559
addq %rcx, %r13
movl $0x0, -0x38(%rbp)
jmp 0xa55bf
movl $0x8, %ecx
cmpl %r15d, %ecx
cmovgl %ecx, %r15d
movslq %r15d, %rax
shlq $0x2, %rax
leaq (%rax,%rax,8), %rdi
callq 0x41c63
movq %rax, %r14
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0xa5544
movslq (%rbx), %rax
shlq $0x2, %rax
leaq (%rax,%rax,8), %rdx
movq %r14, %rdi
callq 0xc080
movq 0x8(%rbx), %rdi
callq 0x41d3c
movq %r14, 0x8(%rbx)
movl %r15d, 0x4(%rbx)
movl (%rbx), %eax
movl -0x30(%rbp), %r15d
movaps -0x90(%rbp), %xmm0
cltq
leaq (%rax,%rax,8), %rax
xorl %ecx, %ecx
movq %rcx, (%r14,%rax,4)
movq $-0x1, 0x8(%r14,%rax,4)
movq %rcx, 0x10(%r14,%rax,4)
movl $0x0, 0x18(%r14,%rax,4)
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
movq %rcx, 0x1c(%r14,%rax,4)
movl (%rbx), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%rbx)
testl %ecx, %ecx
js 0xa5c5c
movq 0x8(%rbx), %rcx
movl %eax, %edx
leaq (%rdx,%rdx,8), %rdx
leaq (%rcx,%rdx,4), %r13
addq $-0x24, %r13
movl %r15d, (%r13)
movss %xmm0, 0x14(%r13)
movb $0x1, 0x6c(%rbx)
movb $0x1, %dl
movl %edx, -0x38(%rbp)
movq %r12, -0xa0(%rbp)
cmpq %r13, %rcx
ja 0xa5c1e
cltq
leaq (%rax,%rax,8), %rax
leaq (%rcx,%rax,4), %rax
cmpq %r13, %rax
jbe 0xa5c1e
movl %r13d, %eax
subl %ecx, %eax
shrl $0x2, %eax
imull $0xffff8e39, %eax, %eax # imm = 0xFFFF8E39
movw %ax, 0x70(%rbx)
movss %xmm0, 0x18(%r13)
movzwl 0x6e(%rbx), %eax
movl %eax, %ecx
incl %ecx
movw %cx, 0x6e(%rbx)
movw %ax, 0x1e(%r13)
movl 0x10(%rbx), %eax
movl %eax, -0x6c(%rbp)
movl 0x28(%rbx), %eax
incl %eax
movl %eax, -0x60(%rbp)
movq -0xa8(%rbp), %rax
movl 0x1a68(%rax), %r12d
movq %rbx, %r14
movl 0x8(%r13), %ebx
incl %ebx
movl %r12d, 0x8(%r13)
movl -0x2c(%rbp), %eax
movl %eax, 0x4(%r13)
leaq 0x88(%r14), %rax
movq %rax, -0x58(%rbp)
movl 0x88(%r14), %eax
xorl %ecx, %ecx
subl $0x1, %eax
cmovbl %ecx, %eax
movw %ax, 0x1c(%r13)
movq -0xa0(%rbp), %r15
movq %r15, %rdi
callq 0xc350
leaq (%r15,%rax), %rdx
incq %rdx
movq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x432cc
movl %r12d, %edx
movl %ebx, %esi
movq %r14, %rbx
cmpl %r12d, %esi
movl -0x30(%rbp), %r14d
jge 0xa56b8
testb $0x2, 0x10(%rbx)
je 0xa56b8
cmpl $0x0, 0x1c(%rbx)
jne 0xa56b8
cmpl %edx, -0x60(%rbp)
jl 0xa56a7
btl $0x15, -0x2c(%rbp)
jae 0xa56b4
jmp 0xa56b8
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
orl 0x18(%rbx), %eax
jne 0xa56b8
movl %r14d, 0x1c(%rbx)
testb $0x2, -0x2c(%rbp)
je 0xa56d2
cmpl %r14d, 0x18(%rbx)
je 0xa56d2
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
jne 0xa56d2
movl %r14d, 0x1c(%rbx)
cmpl %r14d, 0x20(%rbx)
movaps -0x90(%rbp), %xmm5
movl -0x60(%rbp), %edi
jne 0xa56eb
movb $0x1, 0x6b(%rbx)
movb $0x1, %r15b
jmp 0xa570d
cmpl %edx, %edi
setge %al
cmpl $0x0, 0x18(%rbx)
setne %cl
orb %al, %cl
jne 0xa570a
cmpl $0x1, (%rbx)
jne 0xa570a
testb $0x2, 0x10(%rbx)
sete %r15b
jmp 0xa570d
xorl %r15d, %r15d
cmpl %edx, %esi
setl %al
cmpl %edx, %edi
setge %cl
movl -0x38(%rbp), %edi
orb %cl, %dil
andb %al, %dil
cmpb $0x1, %dil
jne 0xa5761
btl $0x15, -0x2c(%rbp)
setae %bl
movl $0x18, %edi
movl $0x1, %esi
callq 0x53d92
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movl %r14d, %esi
xorl %edx, %edx
callq 0x524a8
callq 0x53ede
andb %r15b, %bl
movl %ebx, %r15d
jmp 0xa5c09
movl %esi, -0x38(%rbp)
cmpl %r14d, 0x18(%rbx)
movq -0xa8(%rbp), %r12
jne 0xa577d
movl 0x1a68(%r12), %eax
movl %eax, 0xc(%r13)
movl 0x4(%r13), %eax
movss 0x14(%r13), %xmm0
movss 0x10(%r13), %xmm1
testb $-0x40, %al
movq -0x68(%rbp), %rcx
movl %edx, -0xb0(%rbp)
jne 0xa57a7
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)
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
addss %xmm1, %xmm0
addss %xmm2, %xmm5
movaps %xmm0, %xmm3
unpcklps %xmm5, %xmm3            # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
movss %xmm1, -0x50(%rbp)
movss %xmm2, -0x4c(%rbp)
movlps %xmm3, -0x48(%rbp)
testb $-0x40, %al
movq %r15, -0x58(%rbp)
movq %rdx, -0x60(%rbp)
jne 0xa5810
movss 0x5c(%rbx), %xmm4
movss 0x60(%rbx), %xmm3
ucomiss %xmm1, %xmm4
ja 0xa597b
ucomiss %xmm3, %xmm0
ja 0xa597b
movl $0x0, -0x90(%rbp)
movq 0xf0(%rcx), %r14
subss %xmm1, %xmm0
subss %xmm2, %xmm5
unpcklps %xmm5, %xmm0            # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
leaq -0x78(%rbp), %rdi
movlps %xmm0, (%rdi)
movss 0x159c(%r12), %xmm0
movq %rcx, %r15
callq 0x52315
movq %r14, 0xf0(%r15)
leaq -0x50(%rbp), %rdi
movl -0x30(%rbp), %r14d
movl %r14d, %esi
xorl %edx, %edx
callq 0x524a8
testb %al, %al
je 0xa5955
movl -0x2c(%rbp), %r15d
andl $0x200000, %r15d        # imm = 0x200000
movl %r15d, %eax
shrl $0x11, %eax
movzbl 0x2004(%r12), %ecx
shll $0x9, %ecx
leal (%rax,%rcx), %r8d
addl $0x1010, %r8d           # imm = 0x1010
leaq -0x50(%rbp), %rdi
leaq -0x78(%rbp), %rdx
leaq -0x80(%rbp), %rcx
movl %r14d, %esi
callq 0x90b6f
movl %eax, %r14d
testb %al, %al
je 0xa58b4
testl %r15d, %r15d
jne 0xa58b4
movl -0x30(%rbp), %eax
movl %eax, 0x1c(%rbx)
movl %r15d, -0xac(%rbp)
movl -0x30(%rbp), %ecx
cmpl %ecx, 0x1b1c(%r12)
sete %al
orb %al, -0x78(%rbp)
cmpl %ecx, 0x1b30(%r12)
je 0xa58db
callq 0x51c22
cmpb $0x1, -0x80(%rbp)
movl -0xb0(%rbp), %eax
jne 0xa5a08
cmpl %eax, -0x38(%rbp)
jl 0xa5a08
movss 0xf6d4(%rip), %xmm0     # 0xb4fd0
xorl %edi, %edi
callq 0x5179d
testb %al, %al
je 0xa5a08
cmpb $0x0, 0x2004(%r12)
jne 0xa5a08
testb $0x1, 0x10(%rbx)
je 0xa5a08
movss 0x3b8(%r12), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0xa59dd
movss -0x50(%rbp), %xmm2
ucomiss 0x128(%r12), %xmm2
jbe 0xa59dd
movb $-0x1, %al
jmp 0xa59f4
cmpb $0x0, -0x90(%rbp)
movq -0x58(%rbp), %r15
je 0xa5967
callq 0x4ff37
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0xd8(%rax)
jmp 0xa5c09
movaps %xmm4, %xmm0
cmpless %xmm1, %xmm0
andps %xmm0, %xmm1
andnps %xmm4, %xmm0
orps %xmm1, %xmm0
addss 0xf63c(%rip), %xmm2     # 0xb4fd0
leaq -0x78(%rbp), %rdi
movss %xmm0, (%rdi)
movss %xmm2, 0x4(%rdi)
leaq -0x80(%rbp), %rsi
movss %xmm3, (%rsi)
movss %xmm5, 0x4(%rsi)
movl $0x1, %edx
callq 0x4feb9
movq -0x68(%rbp), %rcx
movss -0x48(%rbp), %xmm0
movss -0x50(%rbp), %xmm1
movss -0x4c(%rbp), %xmm2
movss -0x44(%rbp), %xmm5
movb $0x1, %al
movl %eax, -0x90(%rbp)
jmp 0xa581a
ucomiss %xmm1, %xmm0
jbe 0xa5a08
movss 0x128(%r12), %xmm0
ucomiss -0x48(%rbp), %xmm0
jbe 0xa5a08
movb $0x1, %al
cmpl $0x0, 0x64(%rbx)
jne 0xa5cb9
movl (%r13), %ecx
movl %ecx, 0x64(%rbx)
movb %al, 0x68(%rbx)
movq -0x68(%rbp), %rax
movq 0x2b8(%rax), %r15
movl $0x22, %edi
cmpb $0x0, -0x80(%rbp)
jne 0xa5a4d
cmpb $0x0, -0x78(%rbp)
jne 0xa5a4d
cmpb $0x0, -0x58(%rbp)
je 0xa5a3d
xorl %eax, %eax
btl $0x15, -0x6c(%rbp)
setae %al
leal 0x23(,%rax,2), %edi
jmp 0xa5a4d
xorl %eax, %eax
btl $0x15, -0x6c(%rbp)
setae %al
leal (%rax,%rax,2), %edi
addl $0x21, %edi
movb %r14b, -0x38(%rbp)
movss 0xf58b(%rip), %xmm0     # 0xb4fe4
callq 0x43bca
leaq -0x50(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
movl -0x2c(%rbp), %edx
movl %eax, %ecx
callq 0xa5ec1
movq %r14, %rdi
movl -0x30(%rbp), %esi
movl $0x1, %edx
callq 0x4521b
movl $0x8, %edi
callq 0x461ed
testb %al, %al
je 0xa5ac6
movl $0x1, %edi
xorl %esi, %esi
callq 0x51653
testb %al, %al
je 0xa5aa9
btl $0x15, -0x2c(%rbp)
jae 0xa5ac0
jmp 0xa5ac6
movl $0x1, %edi
callq 0x516d9
testb %al, %al
je 0xa5ac6
cmpl $0x0, -0xac(%rbp)
jne 0xa5ac6
movl -0x30(%rbp), %eax
movl %eax, 0x1c(%rbx)
movl 0x10(%rbx), %r14d
shrl %r14d
andl $0x4, %r14d
orl -0x2c(%rbp), %r14d
cmpq $0x0, -0x98(%rbp)
je 0xa5af9
leaq 0x13fbb(%rip), %rdi     # 0xb9aa1
xorl %esi, %esi
movl -0x30(%rbp), %r12d
movl %r12d, %edx
callq 0x55046
movl %eax, %r9d
jmp 0xa5b00
xorl %r9d, %r9d
movl -0x30(%rbp), %r12d
movsd 0x78(%rbx), %xmm0
subq $0x8, %rsp
leaq -0x31(%rbp), %rax
leaq -0x32(%rbp), %r10
movzbl -0x58(%rbp), %r11d
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
movl %r14d, %edx
movq -0xa0(%rbp), %rcx
movl %r12d, %r8d
pushq %rax
pushq %r10
pushq %r11
callq 0xa635b
addq $0x20, %rsp
cmpq $0x0, -0x98(%rbp)
je 0xa5b5d
cmpb $0x0, -0x32(%rbp)
je 0xa5b5d
movq -0x98(%rbp), %rax
movb $0x0, (%rax)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa5137
cmpb $0x0, -0x90(%rbp)
movq -0xa8(%rbp), %r14
je 0xa5b72
callq 0x4ff37
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0xd8(%rax)
cmpb $0x1, -0x31(%rbp)
movq -0x58(%rbp), %r15
jne 0xa5bef
movl -0x30(%rbp), %eax
cmpl %eax, 0x1b1c(%r14)
jne 0xa5bef
cmpb $0x0, -0x80(%rbp)
jne 0xa5bef
movss 0x1b2c(%r14), %xmm0
ucomiss 0x30ac(%r14), %xmm0
jbe 0xa5bef
xorl %edi, %edi
callq 0x461ed
testb %al, %al
je 0xa5bef
testb $0x20, 0x10(%rbx)
jne 0xa5bef
testb $0x10, 0x4(%r13)
jne 0xa5bef
movq -0xa0(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x4443d
subl %r14d, %eax
leaq 0x12b9c(%rip), %rdi     # 0xb877f
movl %eax, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x50d5f
btl $0x15, -0x2c(%rbp)
jae 0xa5c09
movl 0x18(%rbx), %eax
movb -0x38(%rbp), %cl
movl %ecx, %r15d
cmpl (%r13), %eax
je 0xa5c9a
movl %r15d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a90b(%rip), %rdi     # 0xc0530
leaq 0x13a5f(%rip), %rsi     # 0xb968b
leaq 0x2d5f4(%rip), %rcx     # 0xd3227
movl $0x67d, %edx            # imm = 0x67D
callq 0xc140
leaq 0x2d19a(%rip), %rdi     # 0xd2dde
leaq 0x2b3cd(%rip), %rsi     # 0xd1018
leaq 0x2d13e(%rip), %rcx     # 0xd2d90
movl $0x1da9, %edx           # imm = 0x1DA9
callq 0xc140
leaq 0x27d47(%rip), %rdi     # 0xcd9aa
leaq 0x13a21(%rip), %rsi     # 0xb968b
leaq 0x2d682(%rip), %rcx     # 0xd32f3
movl $0x666, %edx            # imm = 0x666
callq 0xc140
leaq 0x2d0df(%rip), %rdi     # 0xd2d61
leaq 0x2b38f(%rip), %rsi     # 0xd1018
leaq 0x2d100(%rip), %rcx     # 0xd2d90
movl $0x1da8, %edx           # imm = 0x1DA8
callq 0xc140
leaq 0x2d1bc(%rip), %rdi     # 0xd2e5d
leaq 0x2b370(%rip), %rsi     # 0xd1018
leaq 0x2d0e1(%rip), %rcx     # 0xd2d90
movl $0x1e60, %edx           # imm = 0x1E60
callq 0xc140
leaq 0x2cf30(%rip), %rdi     # 0xd2bf0
leaq 0x2b351(%rip), %rsi     # 0xd1018
leaq 0x2ced9(%rip), %rcx     # 0xd2ba7
movl $0x1cc4, %edx           # imm = 0x1CC4
callq 0xc140