// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/window/window.cpp
// Function: smooth::GUI::Window::Remove(smooth::GUI::Widget*)
S::Int S::GUI::Window::Remove(Widget *widget)
{
	if (widget == NIL) return Error();

	if (widget->GetOrientation() == OR_UPPERLEFT || widget->GetOrientation() == OR_UPPERRIGHT || widget->GetOrientation() == OR_LOWERLEFT || widget->GetOrientation() == OR_LOWERRIGHT)
	{
		if (mainLayer->Remove(widget) == Success())
		{
			/* Disable drag & drop if the removed widget was a target.
			 */
			if (!IsDropTarget()) backend->EnableDropFiles(False);

			return Success();
		}

		return Error();
	}

	if (Widget::Remove(widget) == Success())
	{
		/* Recalculate offsets unless the removed widget had free orientation.
		 */
		if (widget->GetOrientation() != OR_FREE) CalculateOffsets();

		/* Disable drag & drop if the removed widget was a target.
		 */
		if (!IsDropTarget()) backend->EnableDropFiles(False);

		return Success();
	}

	return Error();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xda18f
leaq -0x28(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xb0(%rbp), %rdi
callq 0x59680
movl %eax, -0xa4(%rbp)
jmp 0xda15e
movl -0xa4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xda49c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xda4a8
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x14, %eax
je 0xda1db
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x24, %eax
je 0xda1db
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x18, %eax
je 0xda1db
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x28, %eax
jne 0xda32e
movq -0xa0(%rbp), %rax
movq 0x620(%rax), %rdi
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movl %eax, -0xc4(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x5ca80
movq -0xc0(%rbp), %rdi
callq 0x59680
movl %eax, -0xb4(%rbp)
jmp 0xda220
leaq -0x48(%rbp), %rdi
callq 0x5a410
movl -0xb4(%rbp), %ecx
movl -0xc4(%rbp), %eax
cmpl %ecx, %eax
jne 0xda2d4
movq -0xa0(%rbp), %rdi
callq 0x5c6f0
testb $0x1, %al
jne 0xda27f
movq -0xa0(%rbp), %rax
movq 0x5c0(%rax), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x58(%rax)
jmp 0xda27f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xda4a8
leaq -0x58(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x5ca80
movq -0xd0(%rbp), %rdi
callq 0x59680
movl %eax, -0xc8(%rbp)
jmp 0xda2a3
movl -0xc8(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5a410
jmp 0xda49c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5a410
jmp 0xda4a8
leaq -0x68(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xe0(%rbp), %rdi
callq 0x59680
movl %eax, -0xd4(%rbp)
jmp 0xda2fd
movl -0xd4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5b5b0
jmp 0xda49c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5b5b0
jmp 0xda4a8
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5b3a0
movl %eax, -0xf4(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x5ca80
movq -0xf0(%rbp), %rdi
callq 0x59680
movl %eax, -0xe4(%rbp)
jmp 0xda368
leaq -0x78(%rbp), %rdi
callq 0x5a410
movl -0xe4(%rbp), %ecx
movl -0xf4(%rbp), %eax
cmpl %ecx, %eax
jne 0xda43f
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x80, %eax
je 0xda3c1
movq -0xa0(%rbp), %rdi
callq 0x5a1d0
jmp 0xda3c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xda4a8
movq -0xa0(%rbp), %rdi
callq 0x5c6f0
testb $0x1, %al
jne 0xda3e7
movq -0xa0(%rbp), %rax
movq 0x5c0(%rax), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x58(%rax)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x5ca80
movq -0x100(%rbp), %rdi
callq 0x59680
movl %eax, -0xf8(%rbp)
jmp 0xda40e
movl -0xf8(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5a410
jmp 0xda49c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5a410
jmp 0xda4a8
leaq -0x98(%rbp), %rdi
movq %rdi, -0x110(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x110(%rbp), %rdi
callq 0x59680
movl %eax, -0x104(%rbp)
jmp 0xda46b
movl -0x104(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5b5b0
jmp 0xda49c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5b5b0
jmp 0xda4a8
movl -0x4(%rbp), %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)