// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/multi/menu/popupmenu.cpp
// Function: smooth::GUI::PopupMenu::Show()
S::Int S::GUI::PopupMenu::Show()
{
	if (IsVisible()) return Success();

	visible = True;

	if (!IsRegistered()) return Success();

	SetFlags(GetFlags() & ~MB_POPUPOPEN);

	closedByClick = False;

	Window	*window = container->GetContainerWindow();

	/* Create tool window, add entries and display it.
	 */
	toolWindow = new ToolWindow(GetPosition(), GetSize());
	toolWindow->onPaint.Connect(&PopupMenu::OnToolWindowPaint, this);
	toolWindow->onLoseFocus.Connect(&internalRequestClose);

	window->onChangePosition.Connect(&internalRequestClose);
	window->onChangeSize.Connect(&internalRequestClose);

	for (Int i = 0; i < Length(); i++)
	{
		MenuEntry	*entry = GetNthEntry(i);

		if (entry->GetObjectType() != PopupMenuEntry::classID) continue;

		entry->SetRegisteredFlag(False);

		toolWindow->Add(entry);
	}

	Add(toolWindow);

	internalOnOpenPopupMenu.Emit(GetHandle());

	toolWindow->Show();

	/* Notify subscribers of popup open.
	 */
	onShow.Emit();

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x80(%rbp)
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xc0936
jmp 0xc098b
leaq -0x20(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x5ca80
movq -0x90(%rbp), %rdi
callq 0x59680
movl %eax, -0x84(%rbp)
jmp 0xc095a
movl -0x84(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5a410
jmp 0xc0c61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5a410
jmp 0xc0c6d
movq -0x80(%rbp), %rdi
movb $0x1, 0xcb(%rdi)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xc09f8
leaq -0x40(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x5ca80
movq -0xa0(%rbp), %rdi
callq 0x59680
movl %eax, -0x94(%rbp)
jmp 0xc09c7
movl -0x94(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5a410
jmp 0xc0c61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5a410
jmp 0xc0c6d
movq -0x80(%rbp), %rdi
callq 0x5a120
movq -0x80(%rbp), %rdi
movl %eax, %esi
andl $-0x3, %esi
callq 0x59730
movq -0x80(%rbp), %rax
movb $0x0, 0x690(%rax)
movq 0x190(%rax), %rdi
callq 0x59bc0
movq %rax, -0x48(%rbp)
movl $0x6d8, %edi            # imm = 0x6D8
callq 0x59820
movq -0x80(%rbp), %rdi
movq %rax, -0xb0(%rbp)
callq 0x5d740
movq %rax, -0xa8(%rbp)
jmp 0xc0a4d
movq -0x80(%rbp), %rdi
callq 0x5bf70
movq %rax, -0xb8(%rbp)
jmp 0xc0a5f
movq -0xb8(%rbp), %rdx
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x5dce0
jmp 0xc0a7b
movq -0x80(%rbp), %rcx
movq -0xb0(%rbp), %rax
movq %rax, 0x688(%rcx)
movq 0x688(%rcx), %rdi
addq $0x648, %rdi            # imm = 0x648
movq 0x147a6e(%rip), %rax    # 0x208510
movq %rax, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0xc1510
movq -0x80(%rbp), %rsi
movq 0x688(%rsi), %rdi
addq $0x518, %rdi            # imm = 0x518
addq $0x698, %rsi            # imm = 0x698
callq 0x97550
movq -0x80(%rbp), %rsi
movq -0x48(%rbp), %rdi
addq $0x278, %rdi            # imm = 0x278
addq $0x698, %rsi            # imm = 0x698
callq 0x8e210
movq -0x80(%rbp), %rsi
movq -0x48(%rbp), %rdi
addq $0x298, %rdi            # imm = 0x298
addq $0x698, %rsi            # imm = 0x698
callq 0xc1650
movl $0x0, -0x5c(%rbp)
movq -0x80(%rbp), %rdi
movl -0x5c(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq (%rdi), %rax
callq *0x178(%rax)
movl %eax, %ecx
movl -0xbc(%rbp), %eax
cmpl %ecx, %eax
jge 0xc0bc3
movq -0x80(%rbp), %rdi
movl -0x5c(%rbp), %esi
movq (%rdi), %rax
callq *0x180(%rax)
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x5bb10
movq %rax, %rdi
movq 0x147afd(%rip), %rax    # 0x208660
movswl (%rax), %esi
callq 0x5da50
testb $0x1, %al
jne 0xc0b71
jmp 0xc0b95
jmp 0xc0bb5
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x6d8, %esi            # imm = 0x6D8
callq 0x595b0
jmp 0xc0c6d
movq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x5ba80
movq -0x80(%rbp), %rax
movq 0x688(%rax), %rdi
movq -0x68(%rbp), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xc0b16
movq -0x80(%rbp), %rdi
movq 0x688(%rdi), %rsi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movq -0x80(%rbp), %rdi
callq 0x5d050
movl %eax, %esi
movq 0x147b77(%rip), %rdi    # 0x208760
callq 0x907d0
movq -0x80(%rbp), %rax
movq 0x688(%rax), %rdi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
movq -0x80(%rbp), %rdi
addq $0x1f8, %rdi            # imm = 0x1F8
callq 0x8af60
leaq -0x78(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x5ca80
movq -0xc8(%rbp), %rdi
callq 0x59680
movl %eax, -0xc0(%rbp)
jmp 0xc0c36
movl -0xc0(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xc0c61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xc0c6d
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)