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

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

	surface->StartPaint(frame);

	PopupMenuEntry::Paint(message);

	switch (message)
	{
		case SP_PAINT:
		case SP_MOUSEIN:
		case SP_MOUSEOUT:
			if (*iVar == iCode)
			{
				Float	 scaleFactor = surface->GetSurfaceDPI() / 96.0;

				for (Int j = 0; j < 2; j++)
				{
					Color	 color	= (IsActive() ? Setup::TextColor : Setup::InactiveTextColor);
					Point	 offset	= Point(IsRightToLeft() ? 1 : 0, 0);

					if (message == SP_MOUSEIN) color = Setup::GradientTextColor;

					if (j == 0)
					{
						color  = Color(color.GetRed() + (255 - color.GetRed()) * 0.6, color.GetGreen() + (255 - color.GetGreen()) * 0.6, color.GetBlue() + (255 - color.GetBlue()) * 0.6);
						offset = Point(IsRightToLeft() ? -1 : 1, 1);
					}

					Int	 inset	    = 1 * scaleFactor;

					Point	 lineStart  = Point(frame.left, frame.top) + Point(4, 4) * scaleFactor + offset + Point(inset + 2, 0);
					Point	 lineEnd    = lineStart + Point(5 * scaleFactor - 2 * inset - 2, 0);

					for (Int i = 0; i < 5 * scaleFactor; i++)
					{
						if	(i <=			  inset) { lineStart.x--; lineEnd.x++; }
						else if (i >= (5 * scaleFactor) - inset) { lineStart.x++; lineEnd.x--; }

						lineStart.y++;
						lineEnd.y++;

						surface->Line(lineStart, lineEnd, color);
					}
				}
			}

			break;
	}

	surface->EndPaint();

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x118(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xc5394
leaq -0x28(%rbp), %rdi
movq %rdi, -0x128(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x128(%rbp), %rdi
callq 0x59680
movl %eax, -0x11c(%rbp)
jmp 0xc5363
movl -0x11c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xc5993
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xc599f
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xc53fd
leaq -0x48(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x5ca80
movq -0x138(%rbp), %rdi
callq 0x59680
movl %eax, -0x12c(%rbp)
jmp 0xc53cc
movl -0x12c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xc5993
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xc599f
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq -0x118(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq -0x118(%rbp), %rdi
movq %rax, -0x68(%rbp)
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x148(%rbp)
leaq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x59ff0
movq -0x148(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x591b0
movq -0x118(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x5c0a0
movl -0x14(%rbp), %eax
movl %eax, -0x13c(%rbp)
testl %eax, %eax
je 0xc5493
jmp 0xc547f
movl -0x13c(%rbp), %eax
addl $-0x2, %eax
subl $0x1, %eax
ja 0xc5932
jmp 0xc5493
movq -0x118(%rbp), %rcx
movq 0x5e0(%rcx), %rax
movl (%rax), %eax
cmpl 0x5e8(%rcx), %eax
jne 0xc5930
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
cvtsi2sd %eax, %xmm0
movsd 0xc1ffb(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
cmpl $0x2, -0x7c(%rbp)
jge 0xc592e
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0xc54f5
jmp 0xc5505
movq 0x1434cc(%rip), %rax    # 0x2089c8
movq %rax, -0x150(%rbp)
jmp 0xc5515
movq 0x143424(%rip), %rax    # 0x208930
movq %rax, -0x150(%rbp)
jmp 0xc5515
movq -0x150(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x5c720
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
callq *0x160(%rax)
movb %al, %cl
xorl %esi, %esi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %esi
leaq -0x98(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
cmpl $0x2, -0x14(%rbp)
jne 0xc5577
movq 0x1435b6(%rip), %rax    # 0x208b18
movq (%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
cmpl $0x0, -0x7c(%rbp)
jne 0xc56ec
leaq -0x90(%rbp), %rdi
callq 0x59f20
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x170(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x59f20
movsd -0x170(%rbp), %xmm1
movl %eax, %ecx
movl $0xff, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc540e(%rip), %xmm2    # 0x18a9d0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x158(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5d920
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x168(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5d920
movsd -0x168(%rbp), %xmm1
movl %eax, %ecx
movl $0xff, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc53bb(%rip), %xmm2    # 0x18a9d0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x154(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5b650
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x160(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5b650
movsd -0x160(%rbp), %xmm1
movl -0x158(%rbp), %esi
movl -0x154(%rbp), %edx
movl %eax, %ecx
movl $0xff, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc535c(%rip), %xmm2    # 0x18a9d0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
leaq -0xa8(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
movq -0x118(%rbp), %rdi
movq -0xa8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movb %al, %cl
movl $0x1, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, %cl
cmovnel %eax, %esi
leaq -0xb0(%rbp), %rdi
movl $0x1, %edx
callq 0x5c2c0
movq -0xb0(%rbp), %rax
movq %rax, -0x98(%rbp)
movsd 0xc1c74(%rip), %xmm0    # 0x187368
mulsd -0x78(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xb4(%rbp)
movl -0x60(%rbp), %esi
movl -0x5c(%rbp), %edx
leaq -0xd4(%rbp), %rdi
callq 0x5c2c0
leaq -0xe4(%rbp), %rdi
movl $0x4, %edx
movl %edx, %esi
callq 0x5c2c0
movsd -0x78(%rbp), %xmm0
leaq -0xe4(%rbp), %rdi
callq 0x5a300
movq %rax, -0xdc(%rbp)
leaq -0xd4(%rbp), %rdi
leaq -0xdc(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xcc(%rbp)
leaq -0xcc(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xc4(%rbp)
movl -0xb4(%rbp), %esi
addl $0x2, %esi
leaq -0xec(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0xc4(%rbp), %rdi
leaq -0xec(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xbc(%rbp)
movsd -0x78(%rbp), %xmm0
movl -0xb4(%rbp), %eax
shll %eax
cvtsi2sd %eax, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0xc46fb(%rip), %xmm2    # 0x189ed0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0xc1b93(%rip), %xmm1    # 0x187378
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
leaq -0xfc(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0xbc(%rbp), %rdi
leaq -0xfc(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xf4(%rbp)
movl $0x0, -0x100(%rbp)
cvtsi2sdl -0x100(%rbp), %xmm1
movsd 0xc46a1(%rip), %xmm0    # 0x189ed0
mulsd -0x78(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xc591e
movl -0x100(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jg 0xc586c
movl -0xbc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xbc(%rbp)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0xc58ce
cvtsi2sdl -0x100(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
cvtsi2sdl -0xb4(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
movsd 0xc4630(%rip), %xmm3    # 0x189ed0
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0xc58cc
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
movl -0xf4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0xc58ce
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
movq -0x50(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
leaq -0xf4(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x5cce0
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0xc581f
jmp 0xc5920
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xc54d5
jmp 0xc5930
jmp 0xc5932
movq -0x50(%rbp), %rdi
callq 0x5d270
leaq -0x110(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x5ca80
movq -0x180(%rbp), %rdi
callq 0x59680
movl %eax, -0x174(%rbp)
jmp 0xc5962
movl -0x174(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x5a410
jmp 0xc5993
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x5a410
jmp 0xc599f
movl -0x4(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)