// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/widget.cpp
// Function: smooth::GUI::Widget::Paint(int)
S::Int S::GUI::Widget::Paint(Int message)
{
	if (!registered) return Error();
	if (!visible)	 return Success();

	Window	*window	= container->GetContainerWindow();

	if (window == NIL) return Success();

	switch (message)
	{
		case SP_PAINT:
			widgets.LockForRead();

			foreach (Widget *widget, widgets)
			{
				if (widget->IsAffected(window->GetUpdateRect())) widget->Paint(message);
			}

			widgets.Unlock();

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
testb $0x1, 0xca(%rax)
jne 0x88690
leaq -0x28(%rbp), %rdi
movq %rdi, -0x98(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x98(%rbp), %rdi
callq 0x59680
movl %eax, -0x8c(%rbp)
jmp 0x8865f
movl -0x8c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0x888c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0x888d0
movq -0x88(%rbp), %rax
testb $0x1, 0xcb(%rax)
jne 0x886f5
leaq -0x48(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x5ca80
movq -0xa8(%rbp), %rdi
callq 0x59680
movl %eax, -0x9c(%rbp)
jmp 0x886c4
movl -0x9c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0x888c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0x888d0
movq -0x88(%rbp), %rax
movq 0x190(%rax), %rdi
callq 0x59bc0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x88768
leaq -0x60(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x5ca80
movq -0xb8(%rbp), %rdi
callq 0x59680
movl %eax, -0xac(%rbp)
jmp 0x88737
movl -0xac(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a410
jmp 0x888c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a410
jmp 0x888d0
movl -0x14(%rbp), %eax
testl %eax, %eax
jne 0x88875
jmp 0x88775
movq -0x88(%rbp), %rdi
addq $0x38, %rdi
callq 0x5c430
movl $0x0, -0x64(%rbp)
movl $0xffffffff, -0x68(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x0, -0x64(%rbp)
movb %al, -0xb9(%rbp)
jne 0x887d0
movq -0x88(%rbp), %rdi
movl -0x68(%rbp), %eax
movl %eax, -0xc0(%rbp)
addq $0x38, %rdi
callq 0x5c990
movl %eax, %ecx
movl -0xc0(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x887df
jmp 0x88865
movq -0x88(%rbp), %rdi
addq $0x38, %rdi
movl -0x68(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x68(%rbp)
callq 0x8af30
movq (%rax), %rax
movq %rax, -0x70(%rbp)
cmpl $0x0, -0x64(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8880e
jmp 0x88855
movq -0x70(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5c5d0
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
movq (%rdi), %rax
callq *0x158(%rax)
testb $0x1, %al
jne 0x8883b
jmp 0x88848
movq -0x70(%rbp), %rdi
movl -0x14(%rbp), %esi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x8884a
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x887ff
jmp 0x88857
movl -0x64(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x88793
movq -0x88(%rbp), %rdi
addq $0x38, %rdi
callq 0x59f70
leaq -0x80(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x5ca80
movq -0xd8(%rbp), %rdi
callq 0x59680
movl %eax, -0xcc(%rbp)
jmp 0x88899
movl -0xcc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5a410
jmp 0x888c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5a410
jmp 0x888d0
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)