// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/widget.cpp
// Function: smooth::GUI::Widget::Deactivate()
S::Int S::GUI::Widget::Deactivate()
{
	if (!active) return Success();

	Surface	*surface = (IsVisible() ? GetDrawSurface() : NIL);

	if (surface) { surface->StartPaint(GetVisibleArea()); Hide(); }

	active = False;

	foreach (Widget *widget, widgets)
	{
		widget->mouseOver	= False;

		widget->leftButtonDown	= False;
		widget->rightButtonDown	= False;

		widget->mouseDragging	= False;
	}

	if (surface) { Show(); surface->EndPaint(); }

	onDeactivate.Emit();

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
testb $0x1, 0xcc(%rax)
jne 0x88429
leaq -0x20(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x5ca80
movq -0x80(%rbp), %rdi
callq 0x59680
movl %eax, -0x74(%rbp)
jmp 0x883fb
movl -0x74(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5a410
jmp 0x885f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5a410
jmp 0x885fd
movq -0x70(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0x8843c
jmp 0x8844f
movq -0x70(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq %rax, -0x88(%rbp)
jmp 0x8845a
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x8845a
movq -0x88(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x884a6
movq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
movq (%rdi), %rax
callq *0x130(%rax)
movq -0x90(%rbp), %rdi
movq %rax, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x591b0
movq -0x70(%rbp), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movq -0x70(%rbp), %rax
movb $0x0, 0xcc(%rax)
movl $0x0, -0x4c(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
movb %al, -0x91(%rbp)
jne 0x884f9
movq -0x70(%rbp), %rdi
movl -0x50(%rbp), %eax
movl %eax, -0x98(%rbp)
addq $0x38, %rdi
callq 0x5c990
movl %eax, %ecx
movl -0x98(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x88505
jmp 0x88578
movq -0x70(%rbp), %rdi
addq $0x38, %rdi
movl -0x50(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x50(%rbp)
callq 0x8af30
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x4c(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x88531
jmp 0x88568
movq -0x58(%rbp), %rax
movb $0x0, 0xd4(%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0xd5(%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0xd6(%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0xd7(%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x88522
jmp 0x8856a
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x884bf
cmpq $0x0, -0x38(%rbp)
je 0x88592
movq -0x70(%rbp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq -0x38(%rbp), %rdi
callq 0x5d270
movq -0x70(%rbp), %rdi
addq $0x258, %rdi            # imm = 0x258
callq 0x8af60
leaq -0x68(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x5ca80
movq -0xa8(%rbp), %rdi
callq 0x59680
movl %eax, -0x9c(%rbp)
jmp 0x885c6
movl -0x9c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5a410
jmp 0x885f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5a410
jmp 0x885fd
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)