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

	visible = False;

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

	Window	*window = container->GetContainerWindow();

	/* Close tool window, remove entries and delete it.
	 */
	toolWindow->Close();

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

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

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

		toolWindow->Remove(entry);

		entry->SetRegisteredFlag(True);
		entry->SetContainer(this);
	}

	DeleteObject(toolWindow);

	toolWindow = NIL;

	/* Notify subscribers of popup close.
	 */
	onHide.Emit();

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
testb $0x1, 0xcb(%rax)
jne 0xc0d69
leaq -0x20(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x5ca80
movq -0x80(%rbp), %rdi
callq 0x59680
movl %eax, -0x74(%rbp)
jmp 0xc0d3b
movl -0x74(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5a410
jmp 0xc0f4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5a410
jmp 0xc0f57
movq -0x70(%rbp), %rdi
movb $0x0, 0xcb(%rdi)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xc0dd6
leaq -0x40(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x5ca80
movq -0x90(%rbp), %rdi
callq 0x59680
movl %eax, -0x84(%rbp)
jmp 0xc0da5
movl -0x84(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5a410
jmp 0xc0f4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5a410
jmp 0xc0f57
movq -0x70(%rbp), %rax
movq 0x190(%rax), %rdi
callq 0x59bc0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, -0x48(%rbp)
movq 0x688(%rax), %rdi
callq 0x5ce80
movq -0x70(%rbp), %rsi
movq -0x48(%rbp), %rdi
addq $0x278, %rdi            # imm = 0x278
addq $0x698, %rsi            # imm = 0x698
callq 0xc1780
movq -0x70(%rbp), %rsi
movq -0x48(%rbp), %rdi
addq $0x298, %rdi            # imm = 0x298
addq $0x698, %rsi            # imm = 0x698
callq 0xc18a0
movl $0x0, -0x4c(%rbp)
movq -0x70(%rbp), %rdi
movl -0x4c(%rbp), %eax
movl %eax, -0x94(%rbp)
movq (%rdi), %rax
callq *0x178(%rax)
movl %eax, %ecx
movl -0x94(%rbp), %eax
cmpl %ecx, %eax
jge 0xc0ed1
movq -0x70(%rbp), %rdi
movl -0x4c(%rbp), %esi
movq (%rdi), %rax
callq *0x180(%rax)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x5bb10
movq %rax, %rdi
movq 0x1477dd(%rip), %rax    # 0x208660
movswl (%rax), %esi
callq 0x5da50
testb $0x1, %al
jne 0xc0e91
jmp 0xc0e93
jmp 0xc0ec3
movq -0x70(%rbp), %rax
movq 0x688(%rax), %rdi
movq -0x58(%rbp), %rsi
movq (%rdi), %rax
callq *0x38(%rax)
movq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5ba80
movq -0x70(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x598b0
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xc0e3a
movq -0x70(%rbp), %rax
movq 0x688(%rax), %rdi
callq 0x5d8d0
movq -0x70(%rbp), %rdi
movq $0x0, 0x688(%rdi)
addq $0x218, %rdi            # imm = 0x218
callq 0x8af60
leaq -0x68(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x5ca80
movq -0xa0(%rbp), %rdi
callq 0x59680
movl %eax, -0x98(%rbp)
jmp 0xc0f20
movl -0x98(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5a410
jmp 0xc0f4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5a410
jmp 0xc0f57
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x5b6b0