// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/multi/tree/tree.cpp
// Function: smooth::GUI::Tree::Paint(int)
S::Int S::GUI::Tree::Paint(Int message)
{
	if (!IsRegistered()) return Error();
	if (!IsVisible())    return Success();

	Surface	*surface = GetDrawSurface();
	Rect	 frame	 = Rect(GetRealPosition(), GetRealSize());
	Window	*window	 = container->GetContainerWindow();

	CalculateHeight();

	switch (message)
	{
		case SP_PAINT:
			surface->StartPaint(GetVisibleArea());

			if (!IsMarked()) list.Hide();

			if (window->IsMouseOn(Rect(Point(frame.left, frame.top), Size(frame.GetWidth(),  Math::Round(16 * surface->GetSurfaceDPI() / 96.0))))) PaintText(Setup::GradientTextColor, True);
			else																       PaintText(active ? font.GetColor() : Setup::InactiveTextColor, False);

			if (IsMarked())
			{
				list.SetVisibleDirect(False);
				list.SetMetrics(Point(12, 16), GetSize() - Size(12, 15));

				Rect	 visibleArea	   = list.GetVisibleArea() - list.GetRealPosition();

				Point	 entryPosition	   = Point(0, 0);
				Point	 entryRealPosition = Point(0, 0);

				for (Int i = 0; i < Length(); i++)
				{
					ListEntry	*entry	       = GetNthEntry(i);
					Size		 entryRealSize = entry->GetRealSize();

					entry->SetVisibleDirect(False);

					if (entryRealPosition.y + entryRealSize.cy >= visibleArea.top && entryRealPosition.y <= visibleArea.bottom)
					{
						entry->SetMetrics(entryPosition, Size(list.GetWidth(), entry->GetHeight()));
						entry->SetVisibleDirect(True);

						/* Draw horizontal branch line.
						 */
						Point	 startPos = GetRealPosition() + Point(Math::Round(6 * surface->GetSurfaceDPI() / 96.0) + (IsRightToLeft() ? 1 : 0), entryRealPosition.y + Math::Round(8 * surface->GetSurfaceDPI() / 96.0) + Math::Round(16 * surface->GetSurfaceDPI() / 96.0));

						for (Int x = 0; x < Math::Round(5 * surface->GetSurfaceDPI() / 96.0); x += 2)
						{
							surface->SetPixel(startPos + Point(x, 0), Setup::InactiveTextColor);
						}
					}

					/* Compute next entry position.
					 */
					if (i < Length() - 1)
					{
						entryPosition.y	    += entry->GetHeight();
						entryRealPosition.y  = Math::Round(entryPosition.y * surface->GetSurfaceDPI() / 96.0);
					}
				}

				list.SetVisibleDirect(True);
				list.Paint(SP_PAINT);

				/* Draw vertical dotted line.
				 */
				Point	 startPos = frame.GetPosition() + Point(Math::Round(6 * surface->GetSurfaceDPI() / 96.0) + (IsRightToLeft() ? 1 : 0), Math::Round(16 * surface->GetSurfaceDPI() / 96.0));

				for (Int i = visibleArea.top - visibleArea.top % 2; i < Math::Min(entryRealPosition.y, visibleArea.bottom) + Math::Round(9 * surface->GetSurfaceDPI() / 96.0); i += 2)
				{
					surface->SetPixel(startPos + Point(0, i), Setup::InactiveTextColor);
				}
			}

			surface->EndPaint();

			break;
		case SP_MOUSEIN:
			if (window->IsMouseOn(Rect(Point(frame.left, frame.top), Size(frame.GetWidth(), Math::Round(16 * surface->GetSurfaceDPI() / 96.0))))) PaintText(Setup::GradientTextColor, True);

			break;
		case SP_MOUSEOUT:
			PaintText(font.GetColor(), False);

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xc64d4
leaq -0x28(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x1b8(%rbp), %rdi
callq 0x59680
movl %eax, -0x1ac(%rbp)
jmp 0xc64a3
movl -0x1ac(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xc6ee6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xc6ef2
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xc653d
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x5ca80
movq -0x1c8(%rbp), %rdi
callq 0x59680
movl %eax, -0x1bc(%rbp)
jmp 0xc650c
movl -0x1bc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xc6ee6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xc6ef2
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq -0x1a8(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq -0x1a8(%rbp), %rdi
movq %rax, -0x68(%rbp)
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x59ff0
movq -0x1a8(%rbp), %rax
movq 0x190(%rax), %rdi
callq 0x59bc0
movq -0x1a8(%rbp), %rdi
movq %rax, -0x78(%rbp)
callq 0x5d340
movl -0x14(%rbp), %eax
movl %eax, -0x1cc(%rbp)
testl %eax, %eax
je 0xc65e1
jmp 0xc65bc
movl -0x1cc(%rbp), %eax
subl $0x2, %eax
je 0xc6dbb
jmp 0xc65cd
movl -0x1cc(%rbp), %eax
subl $0x3, %eax
je 0xc6e6a
jmp 0xc6e8e
movq -0x1a8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq (%rdi), %rax
callq *0x130(%rax)
movq -0x1d8(%rbp), %rdi
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x591b0
movq -0x1a8(%rbp), %rdi
callq 0x5b1b0
testb $0x1, %al
jne 0xc663d
movq -0x1a8(%rbp), %rdi
addq $0x630, %rdi            # imm = 0x630
callq 0x59770
movq -0x78(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movl -0x60(%rbp), %esi
movl -0x5c(%rbp), %edx
leaq -0xa0(%rbp), %rdi
callq 0x5c2c0
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movl %eax, -0x1e4(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
shll $0x4, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc0e3e(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl -0x1e4(%rbp), %esi
movl %eax, %edx
leaq -0xa8(%rbp), %rdi
callq 0x59260
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x59ff0
movq -0x1e0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5c060
testb $0x1, %al
jne 0xc66d2
jmp 0xc66ec
movq -0x1a8(%rbp), %rdi
movq 0x142438(%rip), %rsi    # 0x208b18
movl $0x1, %edx
callq 0x5c940
jmp 0xc673d
movq -0x1a8(%rbp), %rax
testb $0x1, 0xcc(%rax)
je 0xc6718
movq -0x1a8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x5bc50
movq %rax, -0x1f0(%rbp)
jmp 0xc6728
movq 0x142211(%rip), %rax    # 0x208930
movq %rax, -0x1f0(%rbp)
jmp 0xc6728
movq -0x1a8(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
xorl %edx, %edx
callq 0x5c940
movq -0x1a8(%rbp), %rdi
callq 0x5b1b0
testb $0x1, %al
jne 0xc6752
jmp 0xc6dad
movq -0x1a8(%rbp), %rdi
addq $0x630, %rdi            # imm = 0x630
xorl %esi, %esi
callq 0x59e20
movq -0x1a8(%rbp), %rax
addq $0x630, %rax            # imm = 0x630
movq %rax, -0x1f8(%rbp)
leaq -0xb0(%rbp), %rdi
movl $0xc, %esi
movl $0x10, %edx
callq 0x5c2c0
movq -0x1a8(%rbp), %rdi
callq 0x5bf70
movq %rax, -0x200(%rbp)
leaq -0xc0(%rbp), %rdi
movl $0xc, %esi
movl $0xf, %edx
callq 0x59260
movq -0x200(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5db90
movq -0x1f8(%rbp), %rdi
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x5b6a0
movq -0x1a8(%rbp), %rdi
addq $0x630, %rdi            # imm = 0x630
callq 0x5dd70
movq -0x1a8(%rbp), %rdi
movq %rax, -0xe0(%rbp)
movq %rdx, -0xd8(%rbp)
addq $0x630, %rdi            # imm = 0x630
callq 0x5bae0
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x5b5a0
movq %rax, -0xd0(%rbp)
movq %rdx, -0xc8(%rbp)
leaq -0xf0(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5c2c0
leaq -0xf8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5c2c0
movl $0x0, -0xfc(%rbp)
movq -0x1a8(%rbp), %rdi
movl -0xfc(%rbp), %eax
movl %eax, -0x204(%rbp)
callq 0x59190
movl %eax, %ecx
movl -0x204(%rbp), %eax
cmpl %ecx, %eax
jge 0xc6bcf
movq -0x1a8(%rbp), %rdi
movl -0xfc(%rbp), %esi
callq 0x5d640
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rdi
xorl %esi, %esi
callq 0x59e20
movl -0xf4(%rbp), %eax
addl -0x10c(%rbp), %eax
cmpl -0xcc(%rbp), %eax
jl 0xc6b3b
movl -0xf4(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jg 0xc6b3b
movq -0x1a8(%rbp), %rdi
movq -0x108(%rbp), %rax
movq %rax, -0x230(%rbp)
addq $0x630, %rdi            # imm = 0x630
callq 0x5a210
movl %eax, -0x234(%rbp)
movq -0x108(%rbp), %rdi
callq 0x5b860
movl -0x234(%rbp), %esi
movl %eax, %edx
leaq -0x118(%rbp), %rdi
callq 0x59260
movq -0x230(%rbp), %rdi
movq (%rdi), %rax
leaq -0xf0(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq *0x150(%rax)
movq -0x108(%rbp), %rdi
movl $0x1, %esi
callq 0x59e20
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, -0x128(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x6, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc0b1c(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq -0x1a8(%rbp), %rdi
movq %rax, -0x228(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movb %al, %sil
movq -0x228(%rbp), %rax
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, -0x214(%rbp)
movslq -0xf4(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
shll $0x3, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc0ab1(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rcx
movq -0x220(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x210(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
shll $0x4, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc0a7b(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl -0x214(%rbp), %esi
movq %rax, %rcx
movq -0x210(%rbp), %rax
addq %rcx, %rax
movl %eax, %edx
leaq -0x130(%rbp), %rdi
callq 0x5c2c0
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x120(%rbp)
movl $0x0, -0x134(%rbp)
movslq -0x134(%rbp), %rax
movq %rax, -0x240(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x5, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc0a06(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rcx
movq -0x240(%rbp), %rax
cmpq %rcx, %rax
jge 0xc6b39
movq -0x50(%rbp), %rax
movq %rax, -0x248(%rbp)
movl -0x134(%rbp), %esi
leaq -0x144(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x120(%rbp), %rdi
leaq -0x144(%rbp), %rsi
callq 0x5ca20
movq -0x248(%rbp), %rdi
movq %rax, -0x13c(%rbp)
leaq -0x13c(%rbp), %rsi
movq 0x141e10(%rip), %rdx    # 0x208930
callq 0x59140
movl -0x134(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x134(%rbp)
jmp 0xc6a93
jmp 0xc6b3b
movq -0x1a8(%rbp), %rdi
movl -0xfc(%rbp), %eax
movl %eax, -0x24c(%rbp)
callq 0x59190
movl %eax, %ecx
movl -0x24c(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xc6bb9
movq -0x108(%rbp), %rdi
callq 0x5b860
addl -0xec(%rbp), %eax
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %eax
movl %eax, -0x250(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
movw %ax, %cx
movl -0x250(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc0916(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl %eax, -0xf4(%rbp)
jmp 0xc6bbb
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0xc6874
movq -0x1a8(%rbp), %rdi
addq $0x630, %rdi            # imm = 0x630
movl $0x1, %esi
callq 0x59e20
movq -0x1a8(%rbp), %rdi
addq $0x630, %rdi            # imm = 0x630
xorl %esi, %esi
callq 0x5acb0
leaq -0x60(%rbp), %rdi
callq 0x5d510
movq %rax, -0x154(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x6, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc089b(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq -0x1a8(%rbp), %rdi
movq %rax, -0x260(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movb %al, %sil
movq -0x260(%rbp), %rax
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, -0x258(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
shll $0x4, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc083e(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl -0x258(%rbp), %esi
movl %eax, %edx
leaq -0x15c(%rbp), %rdi
callq 0x5c2c0
leaq -0x154(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x14c(%rbp)
movl -0xcc(%rbp), %eax
movl %eax, -0x254(%rbp)
movl -0xcc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x254(%rbp), %eax
subl %edx, %eax
movl %eax, -0x160(%rbp)
movslq -0x160(%rbp), %rax
movq %rax, -0x268(%rbp)
movl -0xf4(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x5ce90
cltq
movq %rax, -0x270(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x9, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc079e(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq -0x270(%rbp), %rcx
movq %rax, %rdx
movq -0x268(%rbp), %rax
addq %rdx, %rcx
cmpq %rcx, %rax
jge 0xc6dab
movq -0x50(%rbp), %rax
movq %rax, -0x278(%rbp)
movl -0x160(%rbp), %edx
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
callq 0x5c2c0
leaq -0x14c(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x5ca20
movq -0x278(%rbp), %rdi
movq %rax, -0x168(%rbp)
leaq -0x168(%rbp), %rsi
movq 0x141b9e(%rip), %rdx    # 0x208930
callq 0x59140
movl -0x160(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x160(%rbp)
jmp 0xc6ce1
jmp 0xc6dad
movq -0x50(%rbp), %rdi
callq 0x5d270
jmp 0xc6e8e
movq -0x78(%rbp), %rax
movq %rax, -0x280(%rbp)
movl -0x60(%rbp), %esi
movl -0x5c(%rbp), %edx
leaq -0x188(%rbp), %rdi
callq 0x5c2c0
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movl %eax, -0x284(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
shll $0x4, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc06c0(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl -0x284(%rbp), %esi
movl %eax, %edx
leaq -0x190(%rbp), %rdi
callq 0x59260
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0x59ff0
movq -0x280(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x5c060
testb $0x1, %al
jne 0xc6e50
jmp 0xc6e68
movq -0x1a8(%rbp), %rdi
movq 0x141cba(%rip), %rsi    # 0x208b18
movl $0x1, %edx
callq 0x5c940
jmp 0xc6e8e
movq -0x1a8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x5bc50
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x5c940
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x5ca80
movq -0x290(%rbp), %rdi
callq 0x59680
movl %eax, -0x288(%rbp)
jmp 0xc6eb5
movl -0x288(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x5a410
jmp 0xc6ee6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x5a410
jmp 0xc6ef2
movl -0x4(%rbp), %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)