// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginMenu(char const*, bool)
bool ImGui::BeginMenu(const char* label, bool enabled)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);
    bool menu_is_open = IsPopupOpen(id, ImGuiPopupFlags_None);

    // Sub-menus are ChildWindow so that mouse can be hovering across them (otherwise top-most popup menu would steal focus and not allow hovering on parent menu)
    ImGuiWindowFlags flags = ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoNavFocus;
    if (window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu))
        flags |= ImGuiWindowFlags_ChildWindow;

    // If a menu with same the ID was already submitted, we will append to it, matching the behavior of Begin().
    // We are relying on a O(N) search - so O(N log N) over the frame - which seems like the most efficient for the expected small amount of BeginMenu() calls per frame.
    // If somehow this is ever becoming a problem we can switch to use e.g. ImGuiStorage mapping key to last frame used.
    if (g.MenusIdSubmittedThisFrame.contains(id))
    {
        if (menu_is_open)
            menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
        else
            g.NextWindowData.ClearFlags();          // we behave like Begin() and need to consume those values
        return menu_is_open;
    }

    // Tag menu as used. Next time BeginMenu() with same ID is called it will append to existing menu
    g.MenusIdSubmittedThisFrame.push_back(id);

    ImVec2 label_size = CalcTextSize(label, NULL, true);
    bool pressed;
    bool menuset_is_open = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].OpenParentId == window->IDStack.back());
    ImGuiWindow* backed_nav_window = g.NavWindow;
    if (menuset_is_open)
        g.NavWindow = window;  // Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent)

    // The reference position stored in popup_pos will be used by Begin() to find a suitable position for the child menu,
    // However the final position is going to be different! It is chosen by FindBestWindowPosForPopup().
    // e.g. Menus tend to overlap each other horizontally to amplify relative Z-ordering.
    ImVec2 popup_pos, pos = window->DC.CursorPos;
    if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
    {
        // Menu inside an horizontal menu bar
        // Selectable extend their highlight by half ItemSpacing in each direction.
        // For ChildMenu, the popup position will be overwritten by the call to FindBestWindowPosForPopup() in Begin()
        popup_pos = ImVec2(pos.x - 1.0f - IM_FLOOR(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight());
        window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f);
        PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y));
        float w = label_size.x;
        pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
        PopStyleVar();
        window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
    }
    else
    {
        // Menu inside a menu
        // (In a typical menu window where all items are BeginMenu() or MenuItem() calls, extra_w will always be 0.0f.
        //  Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system.
        popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y);
        float min_w = window->DC.MenuColumns.DeclColumns(label_size.x, 0.0f, IM_FLOOR(g.FontSize * 1.20f)); // Feedback to next frame
        float extra_w = ImMax(0.0f, GetContentRegionAvail().x - min_w);
        pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_SpanAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(min_w, 0.0f));
        ImU32 text_col = GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled);
        RenderArrow(window->DrawList, pos + ImVec2(window->DC.MenuColumns.Pos[2] + extra_w + g.FontSize * 0.30f, 0.0f), text_col, ImGuiDir_Right);
    }

    const bool hovered = enabled && ItemHoverable(window->DC.LastItemRect, id);
    if (menuset_is_open)
        g.NavWindow = backed_nav_window;

    bool want_open = false;
    bool want_close = false;
    if (window->DC.LayoutType == ImGuiLayoutType_Vertical) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu))
    {
        // Close menu when not hovering it anymore unless we are moving roughly in the direction of the menu
        // Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers, so menus feels more reactive.
        bool moving_toward_other_child_menu = false;

        ImGuiWindow* child_menu_window = (g.BeginPopupStack.Size < g.OpenPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].SourceWindow == window) ? g.OpenPopupStack[g.BeginPopupStack.Size].Window : NULL;
        if (g.HoveredWindow == window && child_menu_window != NULL && !(window->Flags & ImGuiWindowFlags_MenuBar))
        {
            // FIXME-DPI: Values should be derived from a master "scale" factor.
            ImRect next_window_rect = child_menu_window->Rect();
            ImVec2 ta = g.IO.MousePos - g.IO.MouseDelta;
            ImVec2 tb = (window->Pos.x < child_menu_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR();
            ImVec2 tc = (window->Pos.x < child_menu_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR();
            float extra = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, 5.0f, 30.0f);    // add a bit of extra slack.
            ta.x += (window->Pos.x < child_menu_window->Pos.x) ? -0.5f : +0.5f; // to avoid numerical issues
            tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -100.0f);                // triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale?
            tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +100.0f);
            moving_toward_other_child_menu = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos);
            //GetForegroundDrawList()->AddTriangleFilled(ta, tb, tc, moving_within_opened_triangle ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); // [DEBUG]
        }
        if (menu_is_open && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_toward_other_child_menu)
            want_close = true;

        if (!menu_is_open && hovered && pressed) // Click to open
            want_open = true;
        else if (!menu_is_open && hovered && !moving_toward_other_child_menu) // Hover to open
            want_open = true;

        if (g.NavActivateId == id)
        {
            want_close = menu_is_open;
            want_open = !menu_is_open;
        }
        if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open
        {
            want_open = true;
            NavMoveRequestCancel();
        }
    }
    else
    {
        // Menu bar
        if (menu_is_open && pressed && menuset_is_open) // Click an open menu again to close it
        {
            want_close = true;
            want_open = menu_is_open = false;
        }
        else if (pressed || (hovered && menuset_is_open && !menu_is_open)) // First click to open, then hover to open others
        {
            want_open = true;
        }
        else if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Down) // Nav-Down to open
        {
            want_open = true;
            NavMoveRequestCancel();
        }
    }

    if (!enabled) // explicitly close if an open menu becomes disabled, facilitate users code a lot in pattern such as 'if (BeginMenu("options", has_object)) { ..use object.. }'
        want_close = true;
    if (want_close && IsPopupOpen(id, ImGuiPopupFlags_None))
        ClosePopupToLevel(g.BeginPopupStack.Size, true);

    IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0));

    if (!menu_is_open && want_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size)
    {
        // Don't recycle same menu level in the same frame, first close the other menu and yield for a frame.
        OpenPopup(label);
        return false;
    }

    menu_is_open |= want_open;
    if (want_open)
        OpenPopup(label);

    if (menu_is_open)
    {
        SetNextWindowPos(popup_pos, ImGuiCond_Always);
        menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
    }
    else
    {
        g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
    }

    return menu_is_open;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq 0x58ef0(%rip), %rax     # 0xe3ce0
movq (%rax), %r14
movq 0x1ae0(%r14), %r13
movb $0x1, 0x90(%r13)
cmpb $0x0, 0x93(%r13)
je 0x8ae13
xorl %ebx, %ebx
jmp 0x8b4fd
movq %rdi, %rbx
movl %esi, -0x30(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3700a
leaq -0x2c(%rbp), %r15
movl %eax, (%r15)
movl %eax, %edi
xorl %esi, %esi
callq 0x384af
movq %r14, %rcx
movl %eax, %r14d
xorl %eax, %eax
testl $0x14000000, 0xc(%r13)  # imm = 0x14000000
setne %al
shll $0x18, %eax
orl $0x10080145, %eax       # imm = 0x10080145
movl %eax, -0x58(%rbp)
movq %rcx, -0x38(%rbp)
leaq 0x30c0(%rcx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x9316e
testb %al, %al
je 0x8ae84
testb %r14b, %r14b
jne 0x8b4f0
movq -0x38(%rbp), %rax
andl $0x0, 0x1b88(%rax)
jmp 0x8ae0c
leaq -0x2c(%rbp), %rsi
movq %r12, %rdi
callq 0x49fbe
pushq $0x1
popq %rdx
movss 0x11155(%rip), %xmm0    # 0x9bff0
movq %rbx, -0x60(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x365e8
testb $0x4, 0xf(%r13)
jne 0x8af07
movq -0x38(%rbp), %rax
movl 0x1c80(%rax), %esi
cmpl %esi, 0x1c70(%rax)
jle 0x8af07
movaps %xmm0, -0x80(%rbp)
movq -0x38(%rbp), %rbx
leaq 0x1c70(%rbx), %rdi
callq 0x4b386
movl 0x1c(%rax), %r15d
leaq 0xc8(%r13), %rdi
callq 0x4a148
leaq 0x1c90(%rbx), %rcx
movq 0x1c90(%rbx), %rdx
movq %rdx, -0x88(%rbp)
cmpl (%rax), %r15d
jne 0x8af24
movq %r13, (%rcx)
movb $0x1, %al
jmp 0x8af26
movq -0x38(%rbp), %rax
leaq 0x1c90(%rax), %rcx
movq 0x1c90(%rax), %rax
movq %rax, -0x88(%rbp)
xorl %eax, %eax
jmp 0x8af2a
xorl %eax, %eax
movaps -0x80(%rbp), %xmm0
movq %rcx, -0xa8(%rbp)
movl %eax, -0x54(%rbp)
movl 0xd8(%r13), %eax
movss 0xdc(%r13), %xmm2
movd %eax, %xmm1
cmpl $0x0, 0x1bc(%r13)
movl %r14d, -0x3c(%rbp)
movzbl %r14b, %r12d
movl %r12d, -0x40(%rbp)
je 0x8b068
movd %xmm1, -0x44(%rbp)
movaps %xmm2, %xmm1
movq -0x38(%rbp), %r14
subss 0x1568(%r14), %xmm1
movl %eax, -0x68(%rbp)
movss %xmm1, -0x64(%rbp)
leaq 0x168(%r13), %rdi
movss 0x1980(%r14), %xmm1
mulss 0x2d169(%rip), %xmm1    # 0xb8100
cvttps2dq %xmm1, %xmm1
movaps %xmm2, -0xa0(%rbp)
cvtdq2ps %xmm1, %xmm2
xorps %xmm1, %xmm1
callq 0x8a88c
movss %xmm0, -0x6c(%rbp)
callq 0x409d2
movss -0x6c(%rbp), %xmm2
subss %xmm2, %xmm0
movaps %xmm0, %xmm1
cmpless 0x118f8(%rip), %xmm1    # 0x9c8c4
andnps %xmm0, %xmm1
movaps %xmm1, -0x80(%rbp)
movl -0x30(%rbp), %ebx
movl %ebx, %eax
xorb $0x1, %al
movzbl %al, %r15d
leal 0xb00001(,%r15,8), %edx
leaq -0x50(%rbp), %rcx
movss %xmm2, (%rcx)
andl $0x0, 0x4(%rcx)
movq -0x60(%rbp), %rdi
movl %r12d, %esi
callq 0x7d81c
movl %eax, %r12d
movss 0x10fef(%rip), %xmm0    # 0x9bff8
movl %r15d, %edi
callq 0x35d33
movaps -0x80(%rbp), %xmm1
addss 0x17c(%r13), %xmm1
movq 0x2b8(%r13), %rdi
movss 0x1980(%r14), %xmm0
mulss 0x118ea(%rip), %xmm0    # 0x9c920
addss %xmm1, %xmm0
addss -0x44(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
addss 0x11876(%rip), %xmm1    # 0x9c8c4
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pushq $0x1
popq %rdx
movl %eax, %esi
movss 0x10f9a(%rip), %xmm1    # 0x9bff8
callq 0x6b8b0
jmp 0x8b188
addss 0x10f80(%rip), %xmm1    # 0x9bff0
movss 0x10fa0(%rip), %xmm3    # 0x9c018
movq -0x38(%rbp), %r14
movaps %xmm1, %xmm4
movss 0x15a8(%r14), %xmm1
mulss %xmm3, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
subss %xmm1, %xmm4
movss %xmm4, -0x44(%rbp)
subss 0x159c(%r14), %xmm2
movaps %xmm2, -0xa0(%rbp)
movq %r13, %rdi
movaps %xmm0, -0x80(%rbp)
callq 0x4b4de
addss -0xa0(%rbp), %xmm0
movss -0x44(%rbp), %xmm1
movss %xmm1, -0x68(%rbp)
movss %xmm0, -0x64(%rbp)
movss 0x15a8(%r14), %xmm0
movss 0x10f38(%rip), %xmm1    # 0x9c018
mulss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss 0xd8(%r13), %xmm1
movss %xmm1, 0xd8(%r13)
addss %xmm0, %xmm0
movss 0x15ac(%r14), %xmm1
leaq -0x50(%rbp), %r15
movss %xmm0, (%r15)
movss %xmm1, 0x4(%r15)
pushq $0xd
popq %rdi
movq %r15, %rsi
callq 0x35fca
movl -0x30(%rbp), %ebx
movl %ebx, %eax
xorb $0x1, %al
movzbl %al, %eax
leal 0x300001(,%rax,8), %edx
movaps -0x80(%rbp), %xmm0
movss %xmm0, (%r15)
andl $0x0, 0x4(%r15)
leaq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdi
movl %r12d, %esi
callq 0x7d81c
movl %eax, %r12d
pushq $0x1
popq %rdi
callq 0x3605c
movss 0x15a8(%r14), %xmm0
mulss 0x11785(%rip), %xmm0    # 0x9c8f4
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
addss 0xd8(%r13), %xmm0
movss %xmm0, 0xd8(%r13)
testb %bl, %bl
je 0x8b1a4
leaq 0x12c(%r13), %rdi
movl -0x2c(%rbp), %esi
callq 0x37658
movl -0x30(%rbp), %r8d
movl %eax, %r15d
jmp 0x8b1aa
movl %ebx, %r8d
xorl %r15d, %r15d
movl -0x3c(%rbp), %ebx
movl -0x54(%rbp), %ecx
testb %cl, %cl
je 0x8b1c5
movq -0xa8(%rbp), %rax
movq -0x88(%rbp), %rdx
movq %rdx, (%rax)
cmpl $0x1, 0x1bc(%r13)
jne 0x8b1fd
movb %r12b, -0x38(%rbp)
movl 0x1c80(%r14), %esi
cmpl 0x1c70(%r14), %esi
jge 0x8b216
leaq 0x1c70(%r14), %r12
movq %r12, %rdi
callq 0x4b386
cmpq %r13, 0x10(%rax)
je 0x8b269
xorl %r12d, %r12d
jmp 0x8b27c
testb %r12b, %r12b
je 0x8b21b
andb %bl, %r12b
andb %r12b, %cl
xorb %cl, %bl
movl %ecx, %r15d
xorb $0x1, %r15b
jmp 0x8b475
xorl %r12d, %r12d
jmp 0x8b280
andb %r15b, %cl
xorb $0x1, %cl
movl %ebx, %eax
orb %cl, %al
cmpb $0x1, %al
jne 0x8b25f
movl 0x1c98(%r14), %eax
cmpl -0x2c(%rbp), %eax
jne 0x8b304
cmpb $0x1, 0x1d00(%r14)
jne 0x8b304
xorl %ecx, %ecx
cmpl $0x3, 0x1d10(%r14)
je 0x8b463
xorl %r15d, %r15d
jmp 0x8b475
movb $0x1, %r15b
xorl %ebx, %ebx
jmp 0x8b307
movl 0x1c80(%r14), %esi
movq %r12, %rdi
callq 0x4b386
movq 0x8(%rax), %r12
movl -0x30(%rbp), %r8d
movb $0x1, %al
cmpq %r13, 0x1ae8(%r14)
jne 0x8b3bf
testq %r12, %r12
je 0x8b3bf
testb $0x4, 0xd(%r13)
jne 0x8b3bf
movl %r15d, -0x3c(%rbp)
movq %r12, %rdi
callq 0x4b560
movss 0x128(%r14), %xmm3
movss 0x12c(%r14), %xmm2
subss 0x3b8(%r14), %xmm3
subss 0x3bc(%r14), %xmm2
leaq 0x128(%r14), %rcx
movaps %xmm3, %xmm4
unpcklps %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
movlps %xmm4, -0x50(%rbp)
movss 0x10(%r12), %xmm4
ucomiss 0x10(%r13), %xmm4
jbe 0x8b30e
shufps $0x1, %xmm0, %xmm1      # xmm1 = xmm1[1,0],xmm0[0,0]
shufps $0xe2, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[2,3]
movss 0x115f2(%rip), %xmm4    # 0x9c8f4
jmp 0x8b31e
xorl %r15d, %r15d
xorl %ecx, %ecx
jmp 0x8b475
shufps $0x1, %xmm1, %xmm0      # xmm0 = xmm0[1,0],xmm1[0,0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movss 0x10cfa(%rip), %xmm4    # 0x9c018
leaq -0xb8(%rbp), %rsi
movlps %xmm0, (%rsi)
leaq -0xb0(%rbp), %rdx
movlps %xmm1, (%rdx)
addss %xmm3, %xmm4
subss %xmm0, %xmm3
andps 0x114af(%rip), %xmm3    # 0x9c7f0
mulss 0x115d7(%rip), %xmm3    # 0x9c920
movss 0x16ec3(%rip), %xmm5    # 0xa2214
minss %xmm3, %xmm5
movss 0x11563(%rip), %xmm6    # 0x9c8c0
cmpltss %xmm6, %xmm3
movaps %xmm3, %xmm7
andnps %xmm5, %xmm7
andps %xmm6, %xmm3
orps %xmm7, %xmm3
leaq -0x50(%rbp), %rdi
movss %xmm4, (%rdi)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
subss %xmm3, %xmm0
subss %xmm2, %xmm0
maxss 0x16ede(%rip), %xmm0    # 0xa2268
addss %xmm2, %xmm0
movss %xmm0, 0x4(%rsi)
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm3, %xmm1
subss %xmm2, %xmm1
minss 0x11509(%rip), %xmm1    # 0x9c8b0
addss %xmm2, %xmm1
movss %xmm1, 0x4(%rdx)
callq 0x340b7
xorb $0x1, %al
movl -0x30(%rbp), %r8d
movl -0x3c(%rbp), %r15d
movl %ebx, %ecx
xorb $0x1, %cl
movl %r15d, %edx
orb %cl, %dl
cmpb $0x1, %dl
jne 0x8b3dd
movl -0x2c(%rbp), %edx
xorl %esi, %esi
movl -0x40(%rbp), %r9d
movb -0x38(%rbp), %r10b
jmp 0x8b40e
movl -0x2c(%rbp), %edx
cmpq %r13, 0x1ae8(%r14)
movb -0x38(%rbp), %r10b
je 0x8b3f1
xorl %esi, %esi
jmp 0x8b40a
movl 0x1b20(%r14), %esi
testl %esi, %esi
setne %dil
cmpl %edx, %esi
setne %sil
andb %dil, %sil
andb %al, %sil
movl -0x40(%rbp), %r9d
movl %r10d, %edi
andb %cl, %dil
andb %r15b, %dil
movzbl %dil, %edi
movzbl %al, %eax
testb %r15b, %r15b
cmovel %edi, %eax
testb %bl, %bl
cmovnel %edi, %eax
testb %r10b, %r10b
cmovnel %edi, %eax
cmpl %edx, 0x1ca0(%r14)
movzbl %cl, %r15d
cmovnel %eax, %r15d
movzbl %sil, %ecx
cmovel %r9d, %ecx
cmpl %edx, 0x1c98(%r14)
jne 0x8b475
cmpb $0x1, 0x1d00(%r14)
jne 0x8b475
cmpl $0x1, 0x1d10(%r14)
jne 0x8b475
movl %ecx, %r15d
callq 0x45606
movl %r15d, %ecx
movl -0x30(%rbp), %r8d
movb $0x1, %r15b
testb %r8b, %r8b
je 0x8b47e
testb %cl, %cl
je 0x8b49b
movl -0x2c(%rbp), %edi
xorl %esi, %esi
callq 0x384af
testb %al, %al
je 0x8b49b
movl 0x1c80(%r14), %edi
pushq $0x1
popq %rsi
callq 0x44963
movl %r15d, %eax
notb %al
orb %bl, %al
testb $0x1, %al
jne 0x8b4c5
movl 0x1c70(%r14), %eax
cmpl 0x1c80(%r14), %eax
jle 0x8b4c5
xorl %ebx, %ebx
movq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x446ff
jmp 0x8b4fd
testb $0x1, %r15b
je 0x8b4d8
movq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x446ff
jmp 0x8b4dc
testb %bl, %bl
je 0x8b511
leaq -0x50(%rbp), %rdx
andq $0x0, (%rdx)
leaq -0x68(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x42997
movl -0x2c(%rbp), %edi
movl -0x58(%rbp), %esi
callq 0x44b2e
movl %eax, %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, 0x1b88(%r14)
jmp 0x8ae0c