// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::BeginMenu(char const*, bool)
bool ImGui::BeginMenu(const char* label, bool enabled)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiState& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);

    ImVec2 label_size = CalcTextSize(label, NULL, true);
    ImGuiWindow* backed_focused_window = g.FocusedWindow;

    bool pressed;
    bool opened = IsPopupOpen(id);
    bool menuset_opened = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenedPopupStack.Size > g.CurrentPopupStack.Size && g.OpenedPopupStack[g.CurrentPopupStack.Size].ParentMenuSet == window->GetID("##menus"));
    if (menuset_opened)
        g.FocusedWindow = window;

    ImVec2 popup_pos, pos = window->DC.CursorPos;
    if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
    {
        popup_pos = ImVec2(pos.x - window->WindowPadding.x, pos.y - style.FramePadding.y + window->MenuBarHeight());
        window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
        ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, style.ItemSpacing * 2.0f);
        float w = label_size.x;
        pressed = ImGui::Selectable(label, opened, ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
        ImGui::PopStyleVar();
        ImGui::SameLine();
        window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
    }
    else
    {
        popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y);
        float w = window->MenuColumns.DeclColumns(label_size.x, 0.0f, (float)(int)(g.FontSize * 1.20f)); // Feedback to next frame
        float extra_w = ImMax(0.0f, ImGui::GetContentRegionAvail().x - w);
        pressed = ImGui::Selectable(label, opened, ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
        if (!enabled) ImGui::PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
        RenderCollapseTriangle(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.20f, 0.0f), false);
        if (!enabled) ImGui::PopStyleColor();
    }

    bool hovered = enabled && IsHovered(window->DC.LastItemRect, id);
    if (menuset_opened)
        g.FocusedWindow = backed_focused_window;

    bool want_open = false, want_close = false;
    if (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu))
    {
        // Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers so menus feel more reactive.
        bool moving_within_opened_triangle = false;
        if (g.HoveredWindow == window && g.OpenedPopupStack.Size > g.CurrentPopupStack.Size && g.OpenedPopupStack[g.CurrentPopupStack.Size].ParentWindow == window)
        {
            if (ImGuiWindow* next_window = g.OpenedPopupStack[g.CurrentPopupStack.Size].Window)
            {
                ImRect next_window_rect = next_window->Rect();
                ImVec2 ta = g.IO.MousePos - g.IO.MouseDelta;
                ImVec2 tb = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR();
                ImVec2 tc = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR();
                float extra = ImClamp(fabsf(ta.x - tb.x) * 0.30f, 5.0f, 30.0f); // add a bit of extra slack.
                ta.x += (window->Pos.x < next_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
                tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +100.0f);
                moving_within_opened_triangle = ImIsPointInTriangle(g.IO.MousePos, ta, tb, tc);
                //window->DrawList->PushClipRectFullScreen(); window->DrawList->AddTriangleFilled(ta, tb, tc, moving_within_opened_triangle ? 0x80008000 : 0x80000080); window->DrawList->PopClipRect(); // Debug
            }
        }

        want_close = (opened && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_within_opened_triangle);
        want_open = (!opened && hovered && !moving_within_opened_triangle) || (!opened && hovered && pressed);
    }
    else if (opened && pressed && menuset_opened) // menu-bar: click open menu to close
    {
        want_close = true;
        want_open = opened = false;
    }
    else if (pressed || (hovered && menuset_opened && !opened)) // menu-bar: first click to open, then hover to open others
        want_open = true;

    if (want_close && IsPopupOpen(id))
        ClosePopupToLevel(GImGui->CurrentPopupStack.Size);

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

    opened |= want_open;
    if (want_open)
        ImGui::OpenPopup(label);

    if (opened)
    {
        ImGui::SetNextWindowPos(popup_pos, ImGuiSetCond_Always);
        ImGuiWindowFlags flags = ImGuiWindowFlags_ShowBorders | ((window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) ? ImGuiWindowFlags_ChildMenu|ImGuiWindowFlags_ChildWindow : ImGuiWindowFlags_ChildMenu);
        opened = BeginPopupEx(label, flags); // opened can be 'false' when the popup is completely clipped (e.g. zero size display)
    }

    return opened;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
callq 0x2e220
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x74(%rax)
je 0x285a3
movb $0x0, -0x1(%rbp)
jmp 0x28f56
movq 0x50f16(%rip), %rax     # 0x794c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x13e8, %rax           # imm = 0x13E8
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0xf8(%rbp)
callq 0xbc60
movq -0xf8(%rbp), %rsi
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movss 0x32a8d(%rip), %xmm0    # 0x5b07c
callq 0x10930
movlpd %xmm0, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movq 0x1770(%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x34(%rbp), %edi
callq 0x15840
andb $0x1, %al
movb %al, -0x4a(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x2000000, %ecx        # imm = 0x2000000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xe9(%rbp)
jne 0x286a3
movq -0x28(%rbp), %rax
movl 0x17f8(%rax), %ecx
movq -0x28(%rbp), %rdx
xorl %eax, %eax
cmpl 0x1808(%rdx), %ecx
movb %al, -0xf9(%rbp)
jle 0x28697
movq -0x28(%rbp), %rdi
addq $0x17f8, %rdi           # imm = 0x17F8
movq -0x28(%rbp), %rax
movl 0x1808(%rax), %esi
callq 0x2eca0
movl 0x18(%rax), %eax
movl %eax, -0x100(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x3320f(%rip), %rsi     # 0x5b88a
xorl %eax, %eax
movl %eax, %edx
callq 0xbc60
movl %eax, %ecx
movl -0x100(%rbp), %eax
cmpl %ecx, %eax
sete %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
movb %al, -0xe9(%rbp)
movb -0xe9(%rbp), %al
andb $0x1, %al
movb %al, -0x4b(%rbp)
testb $0x1, -0x4b(%rbp)
je 0x286c3
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x1770(%rax)
leaq -0x58(%rbp), %rdi
callq 0x2d230
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x118(%rax)
jne 0x28866
movq -0x20(%rbp), %rdi
movss 0x40(%rdi), %xmm2
movss -0x60(%rbp), %xmm1
movss -0x5c(%rbp), %xmm0
subss %xmm2, %xmm1
movss %xmm1, -0x118(%rbp)
movq -0x30(%rbp), %rax
movss 0x24(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x11c(%rbp)
callq 0x2f1d0
movss -0x11c(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x118(%rbp), %xmm0
addss %xmm2, %xmm1
leaq -0x68(%rbp), %rdi
callq 0x2d280
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movss 0x2c(%rax), %xmm0
movss 0x328c6(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm1
movq -0x20(%rbp), %rax
movss 0xa8(%rax), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xa8(%rax)
movq -0x30(%rbp), %rdi
addq $0x2c, %rdi
movss 0x32927(%rip), %xmm0    # 0x5b0b8
callq 0xe4b0
movlpd %xmm0, -0x70(%rbp)
movl $0x7, %edi
leaq -0x70(%rbp), %rsi
callq 0x18ae0
movss -0x3c(%rbp), %xmm0
movss %xmm0, -0x74(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movb -0x4a(%rbp), %al
movb %al, -0x111(%rbp)
movb -0x11(%rbp), %dl
xorb $-0x1, %dl
xorl %eax, %eax
movl $0x10, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
orl $0x5, %eax
movl %eax, -0x104(%rbp)
movss -0x74(%rbp), %xmm0
leaq -0x7c(%rbp), %rdi
xorps %xmm1, %xmm1
callq 0x2d280
movb -0x111(%rbp), %al
movq -0x110(%rbp), %rdi
movl -0x104(%rbp), %edx
leaq -0x7c(%rbp), %rcx
andb $0x1, %al
movzbl %al, %esi
callq 0x27150
andb $0x1, %al
movb %al, -0x49(%rbp)
movl $0x1, %edi
callq 0x159f0
xorps %xmm0, %xmm0
movss 0x3284d(%rip), %xmm1    # 0x5b07c
callq 0x1a5e0
movq -0x30(%rbp), %rax
movss 0x327e4(%rip), %xmm0    # 0x5b024
mulss 0x2c(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movq -0x20(%rbp), %rax
addss 0xa8(%rax), %xmm0
movss %xmm0, 0xa8(%rax)
jmp 0x28a1d
movss -0x60(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
movq -0x30(%rbp), %rax
movss 0x8(%rax), %xmm2
subss %xmm2, %xmm1
leaq -0x84(%rbp), %rdi
callq 0x2d280
movq -0x84(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
movss -0x3c(%rbp), %xmm0
movq -0x28(%rbp), %rax
movss 0x1718(%rax), %xmm1
movss 0x3284c(%rip), %xmm2    # 0x5b104
mulss %xmm2, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm2
xorps %xmm1, %xmm1
callq 0xb6b0
movss %xmm0, -0x88(%rbp)
callq 0x15d60
movlpd %xmm0, -0x94(%rbp)
movss -0x94(%rbp), %xmm1
subss -0x88(%rbp), %xmm1
xorps %xmm0, %xmm0
callq 0xb7c0
movss %xmm0, -0x8c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movb -0x4a(%rbp), %al
movb %al, -0x129(%rbp)
movb -0x11(%rbp), %dl
xorb $-0x1, %dl
xorl %eax, %eax
movl $0x10, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
orl $0x25, %eax
movl %eax, -0x120(%rbp)
movss -0x88(%rbp), %xmm0
leaq -0x9c(%rbp), %rdi
xorps %xmm1, %xmm1
callq 0x2d280
movb -0x129(%rbp), %al
movq -0x128(%rbp), %rdi
movl -0x120(%rbp), %edx
leaq -0x9c(%rbp), %rcx
andb $0x1, %al
movzbl %al, %esi
callq 0x27150
andb $0x1, %al
movb %al, -0x49(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x28990
movq -0x28(%rbp), %rsi
addq $0x13e8, %rsi           # imm = 0x13E8
addq $0x78, %rsi
addq $0x10, %rsi
xorl %edi, %edi
callq 0x16040
movq -0x20(%rbp), %rax
movss 0x220(%rax), %xmm1
movss -0x8c(%rbp), %xmm0
addss %xmm0, %xmm1
movq -0x28(%rbp), %rax
movss 0x1718(%rax), %xmm0
movss 0x32648(%rip), %xmm2    # 0x5b004
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
leaq -0xac(%rbp), %rdi
movq %rdi, -0x138(%rbp)
xorps %xmm1, %xmm1
callq 0x2d280
movq -0x138(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0xc7e0
movlpd %xmm0, -0xa4(%rbp)
movsd -0xa4(%rbp), %xmm0
movss 0x32616(%rip), %xmm1    # 0x5b018
xorl %esi, %esi
movl %esi, %edi
callq 0x10b80
testb $0x1, -0x11(%rbp)
jne 0x28a1b
movl $0x1, %edi
callq 0x161b0
jmp 0x28a1d
xorl %eax, %eax
testb $0x1, -0x11(%rbp)
movb %al, -0x139(%rbp)
je 0x28a4a
movq -0x20(%rbp), %rdi
addq $0xa8, %rdi
addq $0x3c, %rdi
movl -0x34(%rbp), %esi
xorl %edx, %edx
callq 0xc3f0
movb %al, -0x139(%rbp)
movb -0x139(%rbp), %al
andb $0x1, %al
movb %al, -0xad(%rbp)
testb $0x1, -0x4b(%rbp)
je 0x28a6d
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x1770(%rax)
movb $0x0, -0xae(%rbp)
movb $0x0, -0xaf(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
andl $0xa000000, %eax        # imm = 0xA000000
cmpl $0x0, %eax
je 0x28e20
movb $0x0, -0xb0(%rbp)
movq -0x28(%rbp), %rax
movq 0x1778(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x28d3c
movq -0x28(%rbp), %rax
movl 0x17f8(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1808(%rcx), %eax
jle 0x28d3c
movq -0x28(%rbp), %rdi
addq $0x17f8, %rdi           # imm = 0x17F8
movq -0x28(%rbp), %rax
movl 0x1808(%rax), %esi
callq 0x2eca0
movq 0x10(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x28d3c
movq -0x28(%rbp), %rdi
addq $0x17f8, %rdi           # imm = 0x17F8
movq -0x28(%rbp), %rax
movl 0x1808(%rax), %esi
callq 0x2eca0
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
je 0x28d3a
movq -0xb8(%rbp), %rdi
callq 0x2f2d0
movlpd %xmm0, -0xc8(%rbp)
movlpd %xmm1, -0xc0(%rbp)
movq -0x28(%rbp), %rsi
movq %rsi, %rdi
addq $0xf0, %rdi
addq $0x34c, %rsi            # imm = 0x34C
callq 0xdf20
movlpd %xmm0, -0xd0(%rbp)
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm1
movq -0xb8(%rbp), %rax
movss 0x18(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x28b8f
leaq -0xc8(%rbp), %rdi
callq 0x2f290
movlpd %xmm0, -0xd8(%rbp)
jmp 0x28ba3
leaq -0xc8(%rbp), %rdi
callq 0x301f0
movlpd %xmm0, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm1
movq -0xb8(%rbp), %rax
movss 0x18(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x28bd3
leaq -0xc8(%rbp), %rdi
callq 0x2f3c0
movlpd %xmm0, -0xe0(%rbp)
jmp 0x28be7
leaq -0xc8(%rbp), %rdi
callq 0x2f2b0
movlpd %xmm0, -0xe0(%rbp)
movss -0xd0(%rbp), %xmm0
subss -0xd8(%rbp), %xmm0
movaps 0x32542(%rip), %xmm1    # 0x5b140
pand %xmm1, %xmm0
movss 0x3241e(%rip), %xmm1    # 0x5b028
mulss %xmm1, %xmm0
movss 0x3246a(%rip), %xmm1    # 0x5b080
movss 0x32512(%rip), %xmm2    # 0x5b130
callq 0xe3b0
movss %xmm0, -0xe4(%rbp)
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0xb8(%rbp), %rax
movss 0x18(%rax), %xmm1
movss 0x32474(%rip), %xmm3    # 0x5b0bc
movss 0x323d4(%rip), %xmm2    # 0x5b024
cmpltss %xmm1, %xmm0
movaps %xmm0, %xmm1
andps %xmm3, %xmm1
andnps %xmm2, %xmm0
orps %xmm1, %xmm0
addss -0xd0(%rbp), %xmm0
movss %xmm0, -0xd0(%rbp)
movss -0xcc(%rbp), %xmm0
movss %xmm0, -0x144(%rbp)
movss -0xd4(%rbp), %xmm0
subss -0xe4(%rbp), %xmm0
subss -0xcc(%rbp), %xmm0
movss 0x3248b(%rip), %xmm1    # 0x5b12c
callq 0xb7c0
movaps %xmm0, %xmm1
movss -0x144(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0xd4(%rbp)
movss -0xcc(%rbp), %xmm0
movss %xmm0, -0x140(%rbp)
movss -0xdc(%rbp), %xmm0
addss -0xe4(%rbp), %xmm0
subss -0xcc(%rbp), %xmm0
movss 0x3243b(%rip), %xmm1    # 0x5b128
callq 0xe370
movaps %xmm0, %xmm1
movss -0x140(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0xdc(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
addq $0xe8, %rdi
leaq -0xd0(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
leaq -0xe0(%rbp), %rcx
callq 0x90b0
andb $0x1, %al
movb %al, -0xb0(%rbp)
jmp 0x28d3c
xorl %eax, %eax
testb $0x1, -0x4a(%rbp)
movb %al, -0x145(%rbp)
je 0x28dae
xorl %eax, %eax
testb $0x1, -0xad(%rbp)
movb %al, -0x145(%rbp)
jne 0x28dae
movq -0x28(%rbp), %rax
movq 0x1778(%rax), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x145(%rbp)
jne 0x28dae
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x178c(%rcx)
movb %al, -0x145(%rbp)
je 0x28dae
movq -0x28(%rbp), %rax
movl 0x178c(%rax), %ecx
xorl %eax, %eax
cmpl -0x34(%rbp), %ecx
movb %al, -0x145(%rbp)
je 0x28dae
movb -0xb0(%rbp), %al
xorb $-0x1, %al
movb %al, -0x145(%rbp)
movb -0x145(%rbp), %al
andb $0x1, %al
movb %al, -0xaf(%rbp)
testb $0x1, -0x4a(%rbp)
jne 0x28ddc
testb $0x1, -0xad(%rbp)
je 0x28ddc
movb $0x1, %al
testb $0x1, -0xb0(%rbp)
movb %al, -0x146(%rbp)
je 0x28e10
xorl %eax, %eax
testb $0x1, -0x4a(%rbp)
movb %al, -0x147(%rbp)
jne 0x28e04
xorl %eax, %eax
testb $0x1, -0xad(%rbp)
movb %al, -0x147(%rbp)
je 0x28e04
movb -0x49(%rbp), %al
movb %al, -0x147(%rbp)
movb -0x147(%rbp), %al
movb %al, -0x146(%rbp)
movb -0x146(%rbp), %al
andb $0x1, %al
movb %al, -0xae(%rbp)
jmp 0x28e6c
testb $0x1, -0x4a(%rbp)
je 0x28e46
testb $0x1, -0x49(%rbp)
je 0x28e46
testb $0x1, -0x4b(%rbp)
je 0x28e46
movb $0x1, -0xaf(%rbp)
movb $0x0, -0x4a(%rbp)
movb $0x0, -0xae(%rbp)
jmp 0x28e6a
testb $0x1, -0x49(%rbp)
jne 0x28e61
testb $0x1, -0xad(%rbp)
je 0x28e68
testb $0x1, -0x4b(%rbp)
je 0x28e68
testb $0x1, -0x4a(%rbp)
jne 0x28e68
movb $0x1, -0xae(%rbp)
jmp 0x28e6a
jmp 0x28e6c
testb $0x1, -0xaf(%rbp)
je 0x28e95
movl -0x34(%rbp), %edi
callq 0x15840
testb $0x1, %al
jne 0x28e83
jmp 0x28e95
movq 0x50636(%rip), %rax     # 0x794c0
movl 0x1808(%rax), %edi
callq 0x15530
testb $0x1, -0x4a(%rbp)
jne 0x28ecc
testb $0x1, -0xae(%rbp)
je 0x28ecc
movq -0x28(%rbp), %rax
movl 0x17f8(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1808(%rcx), %eax
jle 0x28ecc
movq -0x10(%rbp), %rdi
callq 0x15330
movb $0x0, -0x1(%rbp)
jmp 0x28f56
movb -0xae(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
movb -0x4a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
orl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x4a(%rbp)
testb $0x1, -0xae(%rbp)
je 0x28efe
movq -0x10(%rbp), %rdi
callq 0x15330
testb $0x1, -0x4a(%rbp)
je 0x28f4e
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x19450
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edx
andl $0xa000000, %edx        # imm = 0xA000000
movl $0x8000000, %eax        # imm = 0x8000000
movl $0x8100000, %ecx        # imm = 0x8100000
cmpl $0x0, %edx
cmovnel %ecx, %eax
orl $0x80, %eax
movl %eax, -0xe8(%rbp)
movq -0x10(%rbp), %rdi
movl -0xe8(%rbp), %esi
callq 0x155e0
andb $0x1, %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)