// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movl %ecx, %r14d
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
cmpb $0x1, 0x6a(%rdi)
jne 0xa6e9e
movq %rbx, %rdi
callq 0xa5a3d
leaq 0x56e2b(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
je 0xa6ec0
xorl %r14d, %r14d
jmp 0xa773f
movq %rcx, -0x70(%rbp)
movq %rax, -0x40(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa7919
movl %eax, %r15d
testq %r13, %r13
je 0xa6ee6
cmpb $0x0, (%r13)
je 0xa6f91
testq %r13, %r13
sete %al
btl $0x15, %r14d
setae %cl
orb %al, %cl
je 0xa7773
movl %r14d, %eax
notl %eax
testb $-0x40, %al
je 0xa7792
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, -0xc0(%rbp)
testq %rcx, %rcx
setne %sil
movq %r12, %rdi
callq 0xa795b
testl %r15d, %r15d
je 0xa6fd3
movslq (%rbx), %rax
testq %rax, %rax
setg %cl
jle 0xa6fc1
movq 0x8(%rbx), %r13
movb $0x1, %cl
cmpl %r15d, (%r13)
je 0xa6fcf
leaq (%rax,%rax,8), %rcx
leaq -0x24(,%rcx,4), %rcx
addq %r13, %rcx
movl $0x1, %edi
movq %rdi, %rdx
cmpq %rdi, %rax
je 0xa6fc3
leaq 0x24(%r13), %rsi
leaq 0x1(%rdx), %rdi
cmpl %r15d, 0x24(%r13)
movq %rsi, %r13
jne 0xa6f76
jmp 0xa6fc6
movl $0x18, %edi
movl $0x1, %esi
callq 0x54e0c
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
xorl %r14d, %r14d
movl %r15d, %esi
xorl %edx, %edx
callq 0x5346f
callq 0x54f76
jmp 0xa773f
jmp 0xa6fcf
movq %rcx, %rsi
cmpq %rax, %rdx
setb %cl
movq %rsi, %r13
testb %cl, %cl
jne 0xa6fd6
xorl %r13d, %r13d
movq %r13, %rdx
testq %r13, %r13
movaps %xmm0, -0xb0(%rbp)
jne 0xa70cf
movl %r15d, %r14d
movl (%rbx), %r15d
movl 0x4(%rbx), %eax
cmpl %eax, %r15d
jne 0xa7069
incl %r15d
testl %eax, %eax
je 0xa700b
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl %eax, %ecx
jmp 0xa7010
movl $0x8, %ecx
cmpl %r15d, %ecx
cmovgl %ecx, %r15d
cmpl %r15d, %eax
jge 0xa7069
movslq %r15d, %rax
shlq $0x2, %rax
leaq (%rax,%rax,8), %rdi
callq 0x424fb
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0xa705a
movslq (%rbx), %rcx
shlq $0x2, %rcx
leaq (%rcx,%rcx,8), %rdx
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0xc080
movq 0x8(%rbx), %rdi
callq 0x425d4
movq -0x48(%rbp), %rax
movq %rax, 0x8(%rbx)
movl %r15d, 0x4(%rbx)
movaps -0xb0(%rbp), %xmm0
movq 0x8(%rbx), %rax
movslq (%rbx), %rcx
leaq (%rcx,%rcx,8), %rcx
xorl %edx, %edx
movq %rdx, (%rax,%rcx,4)
movq $-0x1, 0x8(%rax,%rcx,4)
movq %rdx, 0x10(%rax,%rcx,4)
movl $0x0, 0x18(%rax,%rcx,4)
movabsq $0xffffffffffff, %rdx   # imm = 0xFFFFFFFFFFFF
movq %rdx, 0x1c(%rax,%rcx,4)
movl (%rbx), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%rbx)
testl %ecx, %ecx
js 0xa77b1
movq 0x8(%rbx), %rcx
movl %eax, %eax
leaq (%rax,%rax,8), %rax
leaq (%rcx,%rax,4), %rdx
addq $-0x24, %rdx
movl %r14d, %r15d
movl %r14d, (%rdx)
movss %xmm0, 0x14(%rdx)
movb $0x1, 0x6c(%rbx)
movl %r15d, -0x34(%rbp)
movq %r12, -0xb8(%rbp)
movq 0x8(%rbx), %rax
cmpq %rdx, %rax
ja 0xa7754
movslq (%rbx), %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,4), %rcx
cmpq %rdx, %rcx
jbe 0xa7754
movl %edx, %ecx
subl %eax, %ecx
shrl $0x2, %ecx
imull $0xffff8e39, %ecx, %eax # imm = 0xFFFF8E39
movw %ax, 0x70(%rbx)
movss %xmm0, 0x18(%rdx)
movzwl 0x6e(%rbx), %eax
movl %eax, %ecx
incl %ecx
movw %cx, 0x6e(%rbx)
movw %ax, 0x1e(%rdx)
movl 0x10(%rbx), %eax
movl %eax, -0x74(%rbp)
movl 0x28(%rbx), %eax
incl %eax
movl %eax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movl 0x1a68(%rax), %r12d
movl 0x8(%rdx), %r14d
incl %r14d
movl %r12d, 0x8(%rdx)
movl -0x2c(%rbp), %eax
movl %eax, 0x4(%rdx)
leaq 0x88(%rbx), %rax
movq %rax, -0x88(%rbp)
movl 0x88(%rbx), %eax
xorl %ecx, %ecx
subl $0x1, %eax
cmovbl %ecx, %eax
movq %rdx, -0x48(%rbp)
movw %ax, 0x1c(%rdx)
movq -0xb8(%rbp), %r15
movq %r15, %rdi
callq 0xc350
leaq (%r15,%rax), %rdx
incq %rdx
movq -0x88(%rbp), %rdi
movq %r15, %rsi
callq 0x43bae
movl %r14d, %edi
cmpl %r12d, %r14d
movl -0x34(%rbp), %r15d
jge 0xa71cc
testb $0x2, 0x10(%rbx)
je 0xa71cc
cmpl $0x0, 0x1c(%rbx)
jne 0xa71cc
cmpl %r12d, -0x68(%rbp)
jl 0xa71bb
btl $0x15, -0x2c(%rbp)
jae 0xa71c8
jmp 0xa71cc
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
orl 0x18(%rbx), %eax
jne 0xa71cc
movl %r15d, 0x1c(%rbx)
testb $0x2, -0x2c(%rbp)
je 0xa71e6
cmpl %r15d, 0x18(%rbx)
je 0xa71e6
movl -0x2c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
jne 0xa71e6
movl %r15d, 0x1c(%rbx)
cmpl %r15d, 0x20(%rbx)
movq -0x48(%rbp), %rdx
movl -0x68(%rbp), %r8d
jne 0xa71fd
movb $0x1, 0x6b(%rbx)
movb $0x1, %r14b
jmp 0xa7220
cmpl %r12d, %r8d
setge %al
cmpl $0x0, 0x18(%rbx)
setne %cl
orb %al, %cl
jne 0xa721d
cmpl $0x1, (%rbx)
jne 0xa721d
testb $0x2, 0x10(%rbx)
sete %r14b
jmp 0xa7220
xorl %r14d, %r14d
cmpl %r12d, %r8d
setge %al
testq %r13, %r13
sete %cl
cmpl %r12d, %edi
jge 0xa7270
orb %al, %cl
je 0xa7270
btl $0x15, -0x2c(%rbp)
setae %bl
movl $0x18, %edi
movl $0x1, %esi
callq 0x54e0c
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movl %r15d, %esi
xorl %edx, %edx
callq 0x5346f
callq 0x54f76
andb %r14b, %bl
movl %ebx, %r14d
jmp 0xa773f
cmpl %r15d, 0x18(%rbx)
jne 0xa7283
movq -0x40(%rbp), %rax
movl 0x1a68(%rax), %eax
movl %eax, 0xc(%rdx)
movl 0x4(%rdx), %eax
movss 0x14(%rdx), %xmm0
movss 0x10(%rdx), %xmm1
testb $-0x40, %al
jne 0xa72a0
subss 0x4c(%rbx), %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss 0x2c(%rbx), %xmm1
movq -0x70(%rbp), %rdx
movq 0xd8(%rdx), %rcx
movq %rcx, -0x88(%rbp)
xorps %xmm2, %xmm2
addss 0x30(%rbx), %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movlps %xmm1, 0xd8(%rdx)
movl 0xd8(%rdx), %ecx
movl 0xdc(%rdx), %edx
movd %ecx, %xmm1
movl %ecx, -0x60(%rbp)
movd %edx, %xmm2
addss %xmm1, %xmm0
movaps -0xb0(%rbp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movl %edx, -0x5c(%rbp)
movlps %xmm0, -0x58(%rbp)
testb $-0x40, %al
movl %r12d, -0x80(%rbp)
je 0xa7309
xorl %eax, %eax
jmp 0xa7322
movss 0x5c(%rbx), %xmm0
movb $0x1, %al
ucomiss -0x60(%rbp), %xmm0
ja 0xa7322
movss -0x58(%rbp), %xmm0
ucomiss 0x60(%rbx), %xmm0
seta %al
movl %edi, -0x9c(%rbp)
movq %r14, -0x68(%rbp)
movl %eax, -0xb0(%rbp)
testb %al, %al
je 0xa7392
movss 0x5c(%rbx), %xmm0
movss -0x60(%rbp), %xmm1
movss -0x5c(%rbp), %xmm2
movaps %xmm0, %xmm3
cmpless %xmm1, %xmm3
andps %xmm3, %xmm1
andnps %xmm0, %xmm3
orps %xmm1, %xmm3
addss 0xfc72(%rip), %xmm2     # 0xb6fd0
leaq -0x90(%rbp), %rdi
movss %xmm3, (%rdi)
movss %xmm2, 0x4(%rdi)
movss 0x60(%rbx), %xmm0
movss -0x54(%rbp), %xmm1
leaq -0x98(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movl $0x1, %edx
callq 0x50eae
movq -0x70(%rbp), %r15
movq 0xf0(%r15), %r12
leaq -0x60(%rbp), %r14
movss 0x8(%r14), %xmm0
movss 0xc(%r14), %xmm1
subss (%r14), %xmm0
subss 0x4(%r14), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x90(%rbp), %rdi
movlps %xmm0, (%rdi)
movq -0x40(%rbp), %r13
movss 0x159c(%r13), %xmm0
callq 0x532de
movq %r12, 0xf0(%r15)
movq %r14, %rdi
movl -0x34(%rbp), %r15d
movl %r15d, %esi
xorl %edx, %edx
callq 0x5346f
testb %al, %al
je 0xa74ed
movl -0x2c(%rbp), %r12d
andl $0x200000, %r12d        # imm = 0x200000
movl %r12d, %eax
shrl $0x11, %eax
movzbl 0x2004(%r13), %ecx
shll $0x9, %ecx
leal (%rax,%rcx), %r8d
addl $0x1010, %r8d           # imm = 0x1010
leaq -0x60(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x98(%rbp), %rcx
movl %r15d, %esi
callq 0x92870
movb %al, -0x2d(%rbp)
testb %al, %al
movq -0x68(%rbp), %r14
je 0xa744c
testl %r12d, %r12d
jne 0xa744c
movl %r15d, 0x1c(%rbx)
movq -0x40(%rbp), %rcx
cmpl %r15d, 0x1b1c(%rcx)
sete %al
orb %al, -0x90(%rbp)
cmpl %r15d, 0x1b30(%rcx)
movq -0xb8(%rbp), %r13
je 0xa7475
callq 0x52c1e
cmpb $0x1, -0x98(%rbp)
movl -0x80(%rbp), %eax
jne 0xa7545
cmpl %eax, -0x9c(%rbp)
jl 0xa7545
movss 0xfb37(%rip), %xmm0     # 0xb6fd0
xorl %edi, %edi
callq 0x5278b
testb %al, %al
je 0xa7545
movq -0x40(%rbp), %rax
cmpb $0x0, 0x2004(%rax)
jne 0xa7545
testb $0x1, 0x10(%rbx)
je 0xa7545
movq -0x40(%rbp), %rax
movss 0x3b8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0xa7516
movss -0x60(%rbp), %xmm2
movq -0x40(%rbp), %rax
ucomiss 0x128(%rax), %xmm2
jbe 0xa7516
movb $-0x1, %al
jmp 0xa752f
cmpb $0x0, -0xb0(%rbp)
movq -0x68(%rbp), %r14
je 0xa74ff
callq 0x50f2c
movq -0x70(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0xd8(%rax)
jmp 0xa773f
ucomiss %xmm1, %xmm0
jbe 0xa7545
movq -0x40(%rbp), %rax
movss 0x128(%rax), %xmm0
ucomiss -0x58(%rbp), %xmm0
jbe 0xa7545
movb $0x1, %al
cmpl $0x0, 0x64(%rbx)
jne 0xa77ef
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x64(%rbx)
movb %al, 0x68(%rbx)
movq -0x70(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x80(%rbp)
movl $0x22, %edi
cmpb $0x0, -0x98(%rbp)
jne 0xa7591
cmpb $0x0, -0x90(%rbp)
jne 0xa7591
xorl %eax, %eax
testb %r14b, %r14b
je 0xa7583
btl $0x15, -0x74(%rbp)
setae %al
leal 0x23(,%rax,2), %edi
jmp 0xa7591
btl $0x15, -0x74(%rbp)
setae %al
leal (%rax,%rax,2), %edi
addl $0x21, %edi
movss 0xfa4b(%rip), %xmm0     # 0xb6fe4
callq 0x445bd
leaq -0x60(%rbp), %r14
movq -0x80(%rbp), %rdi
movq %r14, %rsi
movl -0x2c(%rbp), %edx
movl %eax, %ecx
callq 0xa79f7
movq %r14, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x45ca4
movl $0x8, %edi
callq 0x46d03
testb %al, %al
je 0xa7601
movl $0x1, %edi
xorl %esi, %esi
callq 0x52641
testb %al, %al
je 0xa75ea
btl $0x15, -0x2c(%rbp)
jae 0xa75fd
jmp 0xa7601
movl $0x1, %edi
callq 0x526c7
testb %al, %al
je 0xa7601
testl %r12d, %r12d
jne 0xa7601
movl %r15d, 0x1c(%rbx)
movl 0x10(%rbx), %r14d
shrl %r14d
andl $0x4, %r14d
orl -0x2c(%rbp), %r14d
movq -0xc0(%rbp), %r15
testq %r15, %r15
je 0xa7636
leaq 0x1447e(%rip), %rdi     # 0xbbaa1
xorl %esi, %esi
movl -0x34(%rbp), %r12d
movl %r12d, %edx
callq 0x5614c
movl %eax, %r9d
jmp 0xa763d
xorl %r9d, %r9d
movl -0x34(%rbp), %r12d
movsd 0x78(%rbx), %xmm0
subq $0x8, %rsp
leaq -0x2e(%rbp), %rax
leaq -0x2f(%rbp), %r10
movzbl -0x68(%rbp), %r11d
leaq -0x60(%rbp), %rsi
movq -0x80(%rbp), %rdi
movl %r14d, %edx
movq %r13, %rcx
movl %r12d, %r8d
pushq %rax
pushq %r10
pushq %r11
callq 0xa7e8f
addq $0x20, %rsp
testq %r15, %r15
je 0xa768d
cmpb $0x0, -0x2f(%rbp)
je 0xa768d
movb $0x0, (%r15)
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
callq 0xa6bc7
cmpb $0x0, -0xb0(%rbp)
je 0xa769b
callq 0x50f2c
movq -0x70(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0xd8(%rax)
cmpb $0x1, -0x2e(%rbp)
movq -0x48(%rbp), %rcx
movq -0x68(%rbp), %r14
movl -0x34(%rbp), %edx
jne 0xa7727
movq -0x40(%rbp), %rax
cmpl %edx, 0x1b1c(%rax)
jne 0xa7727
cmpb $0x0, -0x98(%rbp)
jne 0xa7727
movq -0x40(%rbp), %rax
movss 0x1b2c(%rax), %xmm0
ucomiss 0x30ac(%rax), %xmm0
jbe 0xa7727
xorl %edi, %edi
callq 0x46d03
movq -0x48(%rbp), %rcx
testb %al, %al
je 0xa7727
testb $0x20, 0x10(%rbx)
jne 0xa7727
testb $0x10, 0x4(%rcx)
jne 0xa7727
movq %r13, %rdi
xorl %esi, %esi
callq 0x44e8b
subl %r13d, %eax
leaq 0x13068(%rip), %rdi     # 0xba77f
movl %eax, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x51d41
movq -0x48(%rbp), %rcx
btl $0x15, -0x2c(%rbp)
jae 0xa773f
movl 0x18(%rbx), %eax
movb -0x2d(%rbp), %dl
movl %edx, %r14d
cmpl (%rcx), %eax
je 0xa77d0
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ae05(%rip), %rdi     # 0xc2560
leaq 0x13f29(%rip), %rsi     # 0xbb68b
leaq 0x2dc11(%rip), %rcx     # 0xd537a
movl $0x67d, %edx            # imm = 0x67D
callq 0xc140
leaq 0x2d73a(%rip), %rdi     # 0xd4eb4
leaq 0x2b9c7(%rip), %rsi     # 0xd3148
leaq 0x2d75b(%rip), %rcx     # 0xd4ee3
movl $0x1da8, %edx           # imm = 0x1DA8
callq 0xc140
leaq 0x2d798(%rip), %rdi     # 0xd4f31
leaq 0x2b9a8(%rip), %rsi     # 0xd3148
leaq 0x2d73c(%rip), %rcx     # 0xd4ee3
movl $0x1da9, %edx           # imm = 0x1DA9
callq 0xc140
leaq 0x28222(%rip), %rdi     # 0xcf9da
leaq 0x13ecc(%rip), %rsi     # 0xbb68b
leaq 0x2dc80(%rip), %rcx     # 0xd5446
movl $0x666, %edx            # imm = 0x666
callq 0xc140
leaq 0x2d7d9(%rip), %rdi     # 0xd4fb0
leaq 0x2b96a(%rip), %rsi     # 0xd3148
leaq 0x2d6fe(%rip), %rcx     # 0xd4ee3
movl $0x1e60, %edx           # imm = 0x1E60
callq 0xc140
leaq 0x2d54d(%rip), %rdi     # 0xd4d43
leaq 0x2b94b(%rip), %rsi     # 0xd3148
leaq 0x2d4f6(%rip), %rcx     # 0xd4cfa
movl $0x1cc4, %edx           # imm = 0x1CC4
callq 0xc140