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

	if (GetSelectedEntry() == NIL && !(flags & CB_HOTSPOTONLY))
	{
		if (GetNthEntry(0) != NIL) ((ListEntry *) GetNthEntry(0))->Select();
	}

	if (flags & CB_HOTSPOTONLY) hotspot->Deactivate();
	else			    hotspot->Activate();

	Surface		*surface = GetDrawSurface();
	Rect		 frame	 = Rect(GetRealPosition(), GetRealSize());

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

			if (!(flags & CB_HOTSPOTONLY))
			{
				if (IsActive())	surface->Box(frame, Setup::ClientColor, Rect::Filled);
				else		surface->Box(frame, Setup::BackgroundColor, Rect::Filled);

				surface->Frame(frame, FRAME_DOWN);
			}

			surface->Box(frame + Point(frame.GetWidth() - frame.GetHeight() + 1, 1) - Size(frame.GetWidth() - frame.GetHeight() + 2, 2), Setup::BackgroundColor, Rect::Filled);
			surface->Frame(frame + Point(frame.GetWidth() - frame.GetHeight() + 1, 1) - Size(frame.GetWidth() - frame.GetHeight() + 2, 2), FRAME_UP);

			{
				Int	 height	   = Math::Round(3 * surface->GetSurfaceDPI() / 96.0);

				Point	 lineStart = Point(frame.right - (frame.GetHeight() - 1) / 2 - height + (IsRightToLeft() ? 1 : 0), frame.top + (frame.GetHeight() - height) / 2);
				Point	 lineEnd   = lineStart + Point(height * 2 - 1, 0);

				for (Int i = 0; i < height; i++)
				{
					if (IsActive())	surface->Line(lineStart, lineEnd, Setup::TextColor);
					else		surface->Line(lineStart, lineEnd, Setup::InactiveTextColor);

					lineStart += Point(1, 1);
					lineEnd	  += Point(-1, 1);
				}
			}

			if (!(flags & CB_HOTSPOTONLY))
			{
				for (Int i = 0; i < Length(); i++)
				{
					ListEntry	*entry = GetNthEntry(i);

					if (entry->IsSelected())
					{
						String	 entryText = entry->GetText();

						if (entryText.Contains(ListEntry::tabDelimiter)) entryText = entryText.Head(entryText.Find(ListEntry::tabDelimiter));

						surface->SetText(entryText, frame + Point(3 * surface->GetSurfaceDPI() / 96.0, Math::Ceil(Float(frame.GetHeight() - entry->GetFont().GetScaledTextSizeY()) / 2) - 1) - Size(frame.GetHeight() + 2, 0), entry->GetFont());

						if (entry->GetUnscaledTextWidth() >= GetWidth() - 22) SetTooltipText(entryText);
						else						      SetTooltipText(NIL);
					}
				}
			}

			surface->EndPaint();

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xae754
leaq -0x28(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x1c8(%rbp), %rdi
callq 0x59680
movl %eax, -0x1bc(%rbp)
jmp 0xae723
movl -0x1bc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xaf171
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xaf17d
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xae7bd
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x5ca80
movq -0x1d8(%rbp), %rdi
callq 0x59680
movl %eax, -0x1cc(%rbp)
jmp 0xae78c
movl -0x1cc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xaf171
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xaf17d
movq -0x1b8(%rbp), %rdi
callq 0x5a280
cmpq $0x0, %rax
jne 0xae815
movq -0x1b8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xae815
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x180(%rax)
cmpq $0x0, %rax
je 0xae813
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x180(%rax)
movq %rax, %rdi
callq 0x5c8c0
jmp 0xae815
movq -0x1b8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xae83d
movq -0x1b8(%rbp), %rax
movq 0x6e8(%rax), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
jmp 0xae851
movq -0x1b8(%rbp), %rax
movq 0x6e8(%rax), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq -0x1b8(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq -0x1b8(%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
movl -0x14(%rbp), %eax
testl %eax, %eax
jne 0xaf119
jmp 0xae8ab
movq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x591b0
movq -0x1b8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xae988
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0xae8e4
jmp 0xae92e
movq -0x50(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq 0x15a6aa(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x1dc(%rbp)
leaq -0x78(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x1e8(%rbp), %rdi
movl -0x1dc(%rbp), %ecx
leaq -0x60(%rbp), %rsi
movq 0x159d25(%rip), %rdx    # 0x208648
leaq -0x78(%rbp), %r8
callq 0x5c110
jmp 0xae976
movq -0x50(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq 0x15a660(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x1ec(%rbp)
leaq -0x80(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x1f8(%rbp), %rdi
movl -0x1ec(%rbp), %ecx
leaq -0x60(%rbp), %rsi
movq 0x159b3b(%rip), %rdx    # 0x2084a8
leaq -0x80(%rbp), %r8
callq 0x5c110
movq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1, %edx
callq 0x5c050
movq -0x50(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movl %eax, -0x230(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x230(%rbp), %esi
subl %eax, %esi
addl $0x1, %esi
leaq -0xa8(%rbp), %rdi
movl $0x1, %edx
callq 0x5c2c0
leaq -0x60(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5be80
movq %rax, -0xa0(%rbp)
movq %rdx, -0x98(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movl %eax, -0x22c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x22c(%rbp), %esi
subl %eax, %esi
addl $0x2, %esi
leaq -0xb0(%rbp), %rdi
movl $0x2, %edx
callq 0x59260
leaq -0xa0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x5c040
movq %rax, -0x90(%rbp)
movq %rdx, -0x88(%rbp)
movq 0x15a55f(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x21c(%rbp)
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x228(%rbp), %rdi
movl -0x21c(%rbp), %ecx
leaq -0x90(%rbp), %rsi
movq 0x159a34(%rip), %rdx    # 0x2084a8
leaq -0xb8(%rbp), %r8
callq 0x5c110
movq -0x50(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movl %eax, -0x218(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x218(%rbp), %esi
subl %eax, %esi
addl $0x1, %esi
leaq -0xe0(%rbp), %rdi
movl $0x1, %edx
callq 0x5c2c0
leaq -0x60(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x5be80
movq %rax, -0xd8(%rbp)
movq %rdx, -0xd0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movl %eax, -0x214(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x214(%rbp), %esi
subl %eax, %esi
addl $0x2, %esi
leaq -0xe8(%rbp), %rdi
movl $0x2, %edx
callq 0x59260
leaq -0xd8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x5c040
movq -0x210(%rbp), %rdi
movq %rax, -0xc8(%rbp)
movq %rdx, -0xc0(%rbp)
leaq -0xc8(%rbp), %rsi
xorl %edx, %edx
callq 0x5c050
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x3, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xd8960(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl %eax, -0xec(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x208(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movq -0x1b8(%rbp), %rdi
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x208(%rbp), %eax
subl %ecx, %eax
subl -0xec(%rbp), %eax
movl %eax, -0x204(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movb %al, %sil
movl -0x204(%rbp), %eax
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
addl %ecx, %eax
movl %eax, -0x200(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x1fc(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x200(%rbp), %esi
subl -0xec(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x1fc(%rbp), %edx
addl %eax, %edx
leaq -0xf4(%rbp), %rdi
callq 0x5c2c0
movl -0xec(%rbp), %esi
shll %esi
subl $0x1, %esi
leaq -0x104(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0xf4(%rbp), %rdi
leaq -0x104(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xfc(%rbp)
movl $0x0, -0x108(%rbp)
movl -0x108(%rbp), %eax
cmpl -0xec(%rbp), %eax
jge 0xaed11
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0xaec70
jmp 0xaec90
movq -0x50(%rbp), %rdi
leaq -0xf4(%rbp), %rsi
leaq -0xfc(%rbp), %rdx
movq 0x159d3f(%rip), %rcx    # 0x2089c8
callq 0x5cce0
jmp 0xaecae
movq -0x50(%rbp), %rdi
leaq -0xf4(%rbp), %rsi
leaq -0xfc(%rbp), %rdx
movq 0x159c87(%rip), %rcx    # 0x208930
callq 0x5cce0
leaq -0x110(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x5c2c0
leaq -0xf4(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x5a510
leaq -0x118(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x5c2c0
leaq -0xfc(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x5a510
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0xaec48
movq -0x1b8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xaf110
movl $0x0, -0x11c(%rbp)
movq -0x1b8(%rbp), %rdi
movl -0x11c(%rbp), %eax
movl %eax, -0x234(%rbp)
movq (%rdi), %rax
callq *0x178(%rax)
movl %eax, %ecx
movl -0x234(%rbp), %eax
cmpl %ecx, %eax
jge 0xaf10e
movq -0x1b8(%rbp), %rdi
movl -0x11c(%rbp), %esi
movq (%rdi), %rax
callq *0x180(%rax)
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
callq 0x59b80
testb $0x1, %al
jne 0xaed8f
jmp 0xaf0f8
movq -0x128(%rbp), %rdi
movq (%rdi), %rax
movq 0xa8(%rax), %rax
callq *%rax
movq %rax, %rsi
leaq -0x140(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x5b6d0
movq -0x240(%rbp), %rdi
movq 0x159dda(%rip), %rsi    # 0x208ba0
callq 0x591d0
movb %al, -0x235(%rbp)
jmp 0xaedd3
movb -0x235(%rbp), %al
testb $0x1, %al
jne 0xaede2
jmp 0xaee69
movq 0x159db7(%rip), %rsi    # 0x208ba0
leaq -0x140(%rbp), %rdi
callq 0x5bd60
movl %eax, -0x244(%rbp)
jmp 0xaedfd
movl -0x244(%rbp), %edx
leaq -0x158(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x5d6b0
jmp 0xaee18
leaq -0x140(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x59760
jmp 0xaee2d
leaq -0x158(%rbp), %rdi
callq 0x5df00
jmp 0xaee69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xaf0e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x5df00
jmp 0xaf0e7
movq -0x50(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x5d470
movw %ax, -0x246(%rbp)
jmp 0xaee82
movw -0x246(%rbp), %ax
movswl %ax, %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm0
movsd 0xd8623(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x258(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl %eax, -0x254(%rbp)
jmp 0xaeebc
movq -0x128(%rbp), %rdi
movq (%rdi), %rax
movq 0xe8(%rax), %rax
callq *%rax
movq %rax, -0x260(%rbp)
jmp 0xaeed8
movq -0x260(%rbp), %rdi
movq 0x159ec2(%rip), %rsi    # 0x208da8
callq 0x5bde0
movl %eax, -0x264(%rbp)
jmp 0xaeef3
movl -0x264(%rbp), %ecx
movl -0x254(%rbp), %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xd847b(%rip), %xmm1    # 0x187388
mulsd %xmm1, %xmm0
callq 0x5b240
movq %rax, -0x270(%rbp)
jmp 0xaef1f
movl -0x258(%rbp), %esi
movq -0x270(%rbp), %rax
movl %eax, %edx
decl %edx
leaq -0x180(%rbp), %rdi
callq 0x5c2c0
jmp 0xaef3e
leaq -0x60(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x5be80
movq %rdx, -0x280(%rbp)
movq %rax, -0x278(%rbp)
jmp 0xaef5e
movq -0x280(%rbp), %rax
movq -0x278(%rbp), %rcx
movq %rcx, -0x178(%rbp)
movq %rax, -0x170(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl %eax, -0x284(%rbp)
jmp 0xaef8b
movl -0x284(%rbp), %esi
addl $0x2, %esi
leaq -0x188(%rbp), %rdi
xorl %edx, %edx
callq 0x59260
jmp 0xaefa4
leaq -0x178(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x5c040
movq %rdx, -0x298(%rbp)
movq %rax, -0x290(%rbp)
jmp 0xaefc7
movq -0x298(%rbp), %rax
movq -0x290(%rbp), %rcx
movq %rcx, -0x168(%rbp)
movq %rax, -0x160(%rbp)
movq -0x128(%rbp), %rdi
movq (%rdi), %rax
movq 0xe8(%rax), %rax
callq *%rax
movq %rax, -0x2a0(%rbp)
jmp 0xaefff
movq -0x2a0(%rbp), %rcx
movq -0x250(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x168(%rbp), %rdx
xorl %r8d, %r8d
callq 0x5c3f0
jmp 0xaf025
movq -0x128(%rbp), %rdi
movq (%rdi), %rax
movq 0xf0(%rax), %rax
callq *%rax
movl %eax, -0x2a4(%rbp)
jmp 0xaf040
movq -0x1b8(%rbp), %rdi
callq 0x5a210
movl %eax, -0x2a8(%rbp)
jmp 0xaf054
movl -0x2a4(%rbp), %eax
movl -0x2a8(%rbp), %ecx
subl $0x16, %ecx
cmpl %ecx, %eax
jl 0xaf085
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
movq 0xb0(%rax), %rax
leaq -0x140(%rbp), %rsi
callq *%rax
jmp 0xaf083
jmp 0xaf0d9
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
jmp 0xaf095
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
movq 0xb0(%rax), %rax
leaq -0x1a0(%rbp), %rsi
callq *%rax
jmp 0xaf0b1
leaq -0x1a0(%rbp), %rdi
callq 0x5df00
jmp 0xaf0d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x5df00
jmp 0xaf0e7
leaq -0x140(%rbp), %rdi
callq 0x5df00
jmp 0xaf0f8
leaq -0x140(%rbp), %rdi
callq 0x5df00
jmp 0xaf17d
jmp 0xaf0fa
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0xaed31
jmp 0xaf110
movq -0x50(%rbp), %rdi
callq 0x5d270
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x5ca80
movq -0x2b8(%rbp), %rdi
callq 0x59680
movl %eax, -0x2ac(%rbp)
jmp 0xaf140
movl -0x2ac(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x5a410
jmp 0xaf171
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x5a410
jmp 0xaf17d
movl -0x4(%rbp), %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)