// File: /workspace/github_cpp_makefile_star2_O1/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 0x59425(%rip), %rax     # 0xfdcd0
movq (%rax), %r12
movq 0x1ae0(%r12), %r13
movb $0x1, 0x90(%r13)
cmpb $0x0, 0x93(%r13)
jne 0xa508b
movq %rdi, %r15
movl %esi, -0x30(%rbp)
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x46258
movl %eax, %r14d
movl %eax, %edi
xorl %esi, %esi
callq 0x483c1
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
testb $0x14, 0xf(%r13)
setne %al
shll $0x18, %eax
orl $0x10080145, %eax       # imm = 0x10080145
movl %eax, -0x4c(%rbp)
movq 0x30c8(%r12), %rsi
movslq 0x30c0(%r12), %rcx
leaq (%rsi,%rcx,4), %rax
cmpq %rax, %rsi
jae 0xa4954
movq %rsi, %rdx
addq $0x4, %rsi
cmpl %r14d, (%rdx)
jne 0xa4917
cmpq %rax, %rdx
jae 0xa4954
movl -0x2c(%rbp), %ebx
testb %bl, %bl
je 0xa4e77
movl %r14d, %edi
movl -0x4c(%rbp), %esi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x583e4
movl 0x30c4(%r12), %eax
cmpl %eax, %ecx
movq %r15, -0x40(%rbp)
jne 0xa49d7
leal 0x1(%rcx), %ebx
testl %eax, %eax
je 0xa4978
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl %eax, %ecx
jmp 0xa497d
movl $0x8, %ecx
cmpl %ebx, %ecx
cmovgl %ecx, %ebx
cmpl %ebx, %eax
jge 0xa49d7
movslq %ebx, %rdi
shlq $0x2, %rdi
callq 0x424fb
movq %rax, %r15
movq 0x30c8(%r12), %rsi
testq %rsi, %rsi
je 0xa49c3
movslq 0x30c0(%r12), %rdx
shlq $0x2, %rdx
movq %r15, %rdi
callq 0xc080
movq 0x30c8(%r12), %rdi
callq 0x425d4
movq %r15, 0x30c8(%r12)
movl %ebx, 0x30c4(%r12)
movq -0x40(%rbp), %r15
movq 0x30c8(%r12), %rax
movslq 0x30c0(%r12), %rcx
movl %r14d, (%rax,%rcx,4)
incl 0x30c0(%r12)
xorl %ebx, %ebx
movss 0x125d3(%rip), %xmm0    # 0xb6fd0
movq %r15, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4548d
testb $0x4, 0xf(%r13)
jne 0xa4a63
movl 0x1c80(%r12), %eax
cmpl %eax, 0x1c70(%r12)
jle 0xa4a61
testl %eax, %eax
js 0xa50bf
movslq 0xc8(%r13), %rcx
testq %rcx, %rcx
jle 0xa50de
movq 0x1c78(%r12), %rdx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movl 0x1c(%rdx,%rax), %eax
movq 0xd0(%r13), %rdx
cmpl -0x4(%rdx,%rcx,4), %eax
sete %bl
jmp 0xa4a63
xorl %ebx, %ebx
movq 0x1c90(%r12), %rax
movq %rax, -0x98(%rbp)
testb %bl, %bl
je 0xa4a7e
movq %r13, 0x1c90(%r12)
movq %rbx, -0x78(%rbp)
movq $0x0, -0x54(%rbp)
movl 0xd8(%r13), %eax
movss 0xdc(%r13), %xmm2
movd %eax, %xmm1
cmpl $0x0, 0x1bc(%r13)
movzbl -0x2c(%rbp), %ecx
movl %ecx, -0x34(%rbp)
je 0xa4bc3
movd %xmm1, -0x38(%rbp)
movaps %xmm2, %xmm1
subss 0x1568(%r12), %xmm1
movl %eax, -0x54(%rbp)
movss %xmm1, -0x50(%rbp)
leaq 0x168(%r13), %rdi
movss 0x1980(%r12), %xmm1
mulss 0x2e3de(%rip), %xmm1    # 0xd2ec4
cvttps2dq %xmm1, %xmm1
movaps %xmm2, -0x90(%rbp)
cvtdq2ps %xmm1, %xmm2
xorps %xmm1, %xmm1
callq 0xa42be
movss %xmm0, -0x70(%rbp)
callq 0x52f20
movss -0x70(%rbp), %xmm2
subss %xmm2, %xmm0
movaps %xmm0, %xmm1
cmpless 0x12d29(%rip), %xmm1    # 0xb7844
andnps %xmm0, %xmm1
movaps %xmm1, -0xb0(%rbp)
movl -0x30(%rbp), %ebx
movl %ebx, %eax
xorb $0x1, %al
movzbl %al, %r15d
leal 0xb00001(,%r15,8), %edx
leaq -0x48(%rbp), %rcx
movss %xmm2, (%rcx)
movl $0x0, 0x4(%rcx)
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x962c5
movb %al, -0x70(%rbp)
movss 0x12486(%rip), %xmm0    # 0xb6fe4
movl %r15d, %edi
callq 0x445bd
movaps -0xb0(%rbp), %xmm1
addss 0x17c(%r13), %xmm1
movq 0x2b8(%r13), %rdi
movss 0x1980(%r12), %xmm0
mulss 0x12d5d(%rip), %xmm0    # 0xb78ec
addss %xmm1, %xmm0
addss -0x38(%rbp), %xmm0
movaps -0x90(%rbp), %xmm1
addss 0x12c9d(%rip), %xmm1    # 0xb7844
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movl %eax, %esi
movl $0x1, %edx
movss 0x1242b(%rip), %xmm1    # 0xb6fe4
callq 0x8391b
jmp 0xa4ceb
addss 0x12405(%rip), %xmm1    # 0xb6fd0
movss 0x12431(%rip), %xmm3    # 0xb7004
movaps %xmm1, %xmm4
movss 0x15a8(%r12), %xmm1
mulss %xmm3, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
subss %xmm1, %xmm4
movss %xmm4, -0x38(%rbp)
subss 0x159c(%r12), %xmm2
movaps %xmm2, -0x90(%rbp)
movq %r13, %rdi
movaps %xmm0, -0x70(%rbp)
callq 0x5f48e
addss -0x90(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movss %xmm1, -0x54(%rbp)
movss %xmm0, -0x50(%rbp)
movss 0x15a8(%r12), %xmm0
movss 0x123ca(%rip), %xmm1    # 0xb7004
mulss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss 0xd8(%r13), %xmm1
movss %xmm1, 0xd8(%r13)
addss %xmm0, %xmm0
movss 0x15ac(%r12), %xmm1
leaq -0x48(%rbp), %r15
movss %xmm0, (%r15)
movss %xmm1, 0x4(%r15)
movl $0xd, %edi
movq %r15, %rsi
callq 0x44ba2
movl -0x30(%rbp), %ebx
movl %ebx, %eax
xorb $0x1, %al
movzbl %al, %eax
leal 0x300001(,%rax,8), %edx
movaps -0x70(%rbp), %xmm0
movss %xmm0, (%r15)
movl $0x0, 0x4(%r15)
leaq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x962c5
movb %al, -0x70(%rbp)
movl $0x1, %edi
callq 0x44d5f
movss 0x15a8(%r12), %xmm0
mulss 0x12bf2(%rip), %xmm0    # 0xb78c4
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
addss 0xd8(%r13), %xmm0
movss %xmm0, 0xd8(%r13)
testb %bl, %bl
je 0xa4d06
leaq 0x12c(%r13), %rdi
movl %r14d, %esi
callq 0x46e45
movl -0x30(%rbp), %edi
movl %eax, %r15d
jmp 0xa4d0b
movl %ebx, %edi
xorl %r15d, %r15d
movl -0x34(%rbp), %ebx
cmpb $0x0, -0x78(%rbp)
je 0xa4d23
movq -0x98(%rbp), %rax
movq %rax, 0x1c90(%r12)
cmpl $0x1, 0x1bc(%r13)
jne 0xa4e0f
movl 0x1c80(%r12), %eax
cmpl 0x1c70(%r12), %eax
jge 0xa4d66
testl %eax, %eax
js 0xa50bf
movq 0x1c78(%r12), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
cmpq %r13, 0x10(%rcx,%rax)
je 0xa4e97
xorl %ecx, %ecx
movb $0x1, %al
cmpq %r13, 0x1ae8(%r12)
jne 0xa4f59
testq %rcx, %rcx
je 0xa4f59
testb $0x4, 0xd(%r13)
jne 0xa4f59
movss 0x10(%rcx), %xmm0
movss 0x14(%rcx), %xmm3
movss 0x18(%rcx), %xmm1
addss %xmm0, %xmm1
movss 0x1c(%rcx), %xmm2
movsd 0x10(%rcx), %xmm4
movss 0x128(%r12), %xmm5
movss 0x12c(%r12), %xmm6
subss 0x3b8(%r12), %xmm5
subss 0x3bc(%r12), %xmm6
unpcklps %xmm6, %xmm5            # xmm5 = xmm5[0],xmm6[0],xmm5[1],xmm6[1]
movlps %xmm5, -0x48(%rbp)
xorl %eax, %eax
ucomiss 0x10(%r13), %xmm0
addss %xmm3, %xmm2
leaq 0x128(%r12), %rcx
seta %r8b
ja 0xa4df7
movaps %xmm1, %xmm4
unpcklps %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1]
movlps %xmm4, -0xa0(%rbp)
ja 0xa4ea3
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movaps %xmm1, %xmm0
jmp 0xa4ea6
movb -0x70(%rbp), %al
testb %al, %al
je 0xa4e32
movl -0x2c(%rbp), %r13d
andb %r13b, %al
movq -0x78(%rbp), %rbx
andb %al, %bl
xorb %bl, %r13b
movl %ebx, %r15d
xorb $0x1, %r15b
jmp 0xa4fe7
movq -0x78(%rbp), %rcx
andb %r15b, %cl
xorb $0x1, %cl
movl -0x2c(%rbp), %r13d
movl %r13d, %eax
orb %cl, %al
cmpb $0x1, %al
jne 0xa4e88
cmpl %r14d, 0x1c98(%r12)
jne 0xa4e8d
cmpb $0x1, 0x1d00(%r12)
jne 0xa4e8d
xorl %ebx, %ebx
cmpl $0x3, 0x1d10(%r12)
je 0xa4fdc
xorl %r15d, %r15d
jmp 0xa4fe7
movl $0x0, 0x1b88(%r12)
jmp 0xa508d
movb $0x1, %r15b
jmp 0xa4e90
xorl %r15d, %r15d
xorl %ebx, %ebx
jmp 0xa4fe7
addq %rax, %rcx
movq 0x8(%rcx), %rcx
jmp 0xa4d68
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
leaq -0xb8(%rbp), %rdx
movlps %xmm0, (%rdx)
leaq -0x48(%rbp), %rdi
movss (%rdi), %xmm2
leaq -0xa0(%rbp), %rsi
movaps %xmm2, %xmm1
subss (%rsi), %xmm1
andps 0x12903(%rip), %xmm1    # 0xb77d0
mulss 0x12a17(%rip), %xmm1    # 0xb78ec
movss 0x4(%rdi), %xmm0
movss 0x18022(%rip), %xmm3    # 0xbcf04
minss %xmm1, %xmm3
movss 0x129a6(%rip), %xmm4    # 0xb7894
cmpltss %xmm4, %xmm1
movaps %xmm1, %xmm5
andnps %xmm3, %xmm5
andps %xmm4, %xmm1
movb %r8b, %al
leaq 0x2e22a(%rip), %r8      # 0xd3130
addss (%r8,%rax,4), %xmm2
orps %xmm5, %xmm1
movss %xmm2, (%rdi)
movss 0x4(%rsi), %xmm2
subss %xmm1, %xmm2
subss %xmm0, %xmm2
maxss 0x18030(%rip), %xmm2    # 0xbcf58
addss %xmm0, %xmm2
movss %xmm2, 0x4(%rsi)
movss 0x4(%rdx), %xmm2
addss %xmm1, %xmm2
subss %xmm0, %xmm2
minss 0x1293e(%rip), %xmm2    # 0xb7884
addss %xmm0, %xmm2
movss %xmm2, 0x4(%rdx)
callq 0x4200e
xorb $0x1, %al
movl -0x30(%rbp), %edi
movl -0x2c(%rbp), %ecx
xorb $0x1, %cl
movl %r15d, %edx
orb %cl, %dl
jne 0xa4f74
cmpq %r13, 0x1ae8(%r12)
je 0xa50a1
xorl %edx, %edx
movl -0x2c(%rbp), %r13d
movl %r13d, %esi
notb %sil
andb %r15b, %sil
movb -0x70(%rbp), %r8b
andb %r8b, %sil
movzbl %sil, %esi
movzbl %al, %eax
testb %r15b, %r15b
cmovel %esi, %eax
testb %r13b, %r13b
cmovnel %esi, %eax
testb %r8b, %r8b
cmovnel %esi, %eax
cmpl %r14d, 0x1ca0(%r12)
movzbl %cl, %r15d
cmovnel %eax, %r15d
movzbl %dl, %eax
cmovel %ebx, %eax
movq %rax, %rbx
cmpl %r14d, 0x1c98(%r12)
jne 0xa4fe7
cmpb $0x1, 0x1d00(%r12)
jne 0xa4fe7
cmpl $0x1, 0x1d10(%r12)
jne 0xa4fe7
callq 0x58f1d
movl -0x30(%rbp), %edi
movb $0x1, %r15b
testb %dil, %dil
je 0xa4ff0
testb %bl, %bl
je 0xa5010
movl %r14d, %edi
xorl %esi, %esi
callq 0x483c1
testb %al, %al
je 0xa5010
movl 0x1c80(%r12), %edi
movl $0x1, %esi
callq 0x58144
movl %r15d, %eax
notb %al
orb %r13b, %al
testb $0x1, %al
jne 0xa503d
movl 0x1c70(%r12), %eax
cmpl 0x1c80(%r12), %eax
jle 0xa503d
xorl %ebx, %ebx
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x57da5
jmp 0xa508d
orb %r15b, %r13b
testb $0x1, %r15b
je 0xa5051
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x57da5
testb $0x1, %r13b
je 0xa507f
leaq -0x48(%rbp), %rdx
movq $0x0, (%rdx)
leaq -0x54(%rbp), %rdi
movl $0x1, %esi
callq 0x5566a
movl %r14d, %edi
movl -0x4c(%rbp), %esi
callq 0x583e4
movl %eax, %ebx
jmp 0xa508d
movl $0x0, 0x1b88(%r12)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1b20(%r12), %edx
testl %edx, %edx
setne %sil
cmpl %r14d, %edx
setne %dl
andb %sil, %dl
andb %al, %dl
jmp 0xa4f76
leaq 0x165b2(%rip), %rdi     # 0xbb678
leaq 0x165be(%rip), %rsi     # 0xbb68b
leaq 0x17a76(%rip), %rcx     # 0xbcb4a
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
leaq 0x2a8f5(%rip), %rdi     # 0xcf9da
leaq 0x1659f(%rip), %rsi     # 0xbb68b
leaq 0x17905(%rip), %rcx     # 0xbc9f8
movl $0x666, %edx            # imm = 0x666
callq 0xc140