// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/widgets/multi/menu/popupmenuentrycheck.cpp
// Function: smooth::GUI::PopupMenuEntryCheck::Paint(int)
S::Int S::GUI::PopupMenuEntryCheck::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 (*bVar == True)
			{
				Float	 scaleFactor = surface->GetSurfaceDPI() / 96.0;

				for (Int i = 0; i < 2; i++)
				{
					Color	 color	= (IsActive() ? Setup::TextColor : Setup::InactiveTextColor);

					if (message == SP_MOUSEIN) color = Setup::GradientTextColor;
					if (i == 0)		   color = Color(color.GetRed() + (255 - color.GetRed()) * 0.6, color.GetGreen() + (255 - color.GetGreen()) * 0.6, color.GetBlue() + (255 - color.GetBlue()) * 0.6);

					Int	 width  = 4 * scaleFactor;
					Point	 offset = Point(IsRightToLeft() ? 1 : 0, 0);

					if (i == 0) offset += Point(IsRightToLeft() ? -1 : 1, 1);

					Point	 p1	= Point(frame.left		       + width, frame.top    + width) + offset;
					Point	 p2	= Point(frame.left + frame.GetHeight() - width, frame.bottom - width) + offset;

					surface->Line(p1 + Point(0, 0), p2 + Point( 0,  0), color);
					surface->Line(p1 + Point(1, 0), p2 + Point( 0, -1), color);
					surface->Line(p1 + Point(0, 1), p2 + Point(-1,  0), color);

					p1 = Point(frame.left + frame.GetHeight() - width - 1, frame.top    + width) + offset;
					p2 = Point(frame.left			  + width - 1, frame.bottom - width) + offset;

					surface->Line(p1 + Point( 0, 0), p2 + Point(0,  0), color);
					surface->Line(p1 + Point( 0, 1), p2 + Point(1,  0), color);
					surface->Line(p1 + Point(-1, 0), p2 + Point(0, -1), color);
				}
			}

			break;
	}

	surface->EndPaint();

	return Success();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %esi, 0x1c(%rsp)
movq %rdi, %r14
movq (%rdi), %rax
callq *0x88(%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x8e0a2
movq (%r14), %rax
movq %r14, %rdi
callq *0x90(%rax)
xorl %ecx, %ecx
testb %al, %al
je 0x8e0a2
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
movq %rax, %r15
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
movq %rax, %r12
movq %rax, %rbx
shrq $0x20, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x50(%rax)
leal (%rax,%r12), %ecx
shrq $0x20, %rax
leaq 0x60(%rsp), %rsi
movl %r12d, (%rsi)
movl %ebx, 0x4(%rsi)
movl %ecx, 0x8(%rsi)
addl %ebx, %eax
movl %eax, 0xc(%rsi)
movq %r15, 0x38(%rsp)
movq %r15, %rdi
callq 0x55160
movq %r14, %rdi
movl 0x1c(%rsp), %ebx
movl %ebx, %esi
callq 0x578d0
cmpl $0x3, %ebx
ja 0x8e096
cmpl $0x1, 0x1c(%rsp)
je 0x8e096
movq 0x5d8(%r14), %rax
cmpb $0x1, (%rax)
jne 0x8e096
movq 0x38(%rsp), %rdi
callq 0x58930
cwtl
cvtsi2sd %eax, %xmm0
divsd 0x659cf(%rip), %xmm0    # 0xf36b8
mulsd 0x656af(%rip), %xmm0    # 0xf33a0
cvttsd2si %xmm0, %eax
movq %rax, 0x50(%rsp)
notl %eax
movq %rax, 0x90(%rsp)
movb $0x1, %bl
movq 0xddcdb(%rip), %rax     # 0x16b9e8
addq $0x8, %rax
movq %rax, 0x88(%rsp)
movq 0xddc30(%rip), %rax     # 0x16b950
addq $0x8, %rax
movq %rax, 0x80(%rsp)
movq %r14, 0x98(%rsp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x98(%rax)
testb %al, %al
movq 0x80(%rsp), %rax
cmovneq 0x88(%rsp), %rax
movq 0xddbf6(%rip), %rcx     # 0x16b950
cmovneq 0xddc86(%rip), %rcx     # 0x16b9e8
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movl (%rcx), %eax
movl %eax, 0x20(%rsp)
cmpl $0x2, 0x1c(%rsp)
jne 0x8dd88
movq 0xdddb2(%rip), %rax     # 0x16bb30
movupd (%rax), %xmm0
movapd %xmm0, 0x20(%rsp)
testb $0x1, %bl
je 0x8de1d
movl 0x28(%rsp), %ecx
movl %ecx, %eax
movl $0xff, %esi
andl %esi, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorl %esi, %eax
cvtsi2sd %eax, %xmm1
movsd 0x68e5d(%rip), %xmm2    # 0xf6c10
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %ecx, %edx
shrl $0x8, %edx
andl %esi, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorl %esi, %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
shrl $0x10, %ecx
andl %esi, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
xorl %esi, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
shll $0x10, %ecx
shll $0x8, %edx
orl %eax, %edx
orl %ecx, %edx
movslq %edx, %rax
movl $0x0, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x160(%rax)
movzbl %al, %r15d
xorl %ecx, %ecx
testb $0x1, %bl
movl %ebx, 0x5c(%rsp)
je 0x8de57
movq (%r14), %rax
movq %r14, %rdi
callq *0x160(%rax)
movzbl %al, %eax
negl %eax
orl $0x1, %eax
addl %r15d, %eax
movl $0x1, %ecx
movl %eax, %r15d
movq %r15, 0x48(%rsp)
movl 0x60(%rsp), %r14d
addl %r15d, %r14d
movq 0x50(%rsp), %rdx
leal (%r14,%rdx), %esi
movq %rsi, 0xa8(%rsp)
leal (%rcx,%rdx), %eax
movq %rax, 0x70(%rsp)
movl 0x64(%rsp), %r8d
movq %r8, 0xb0(%rsp)
movl 0x6c(%rsp), %edi
movq %rdi, 0x40(%rsp)
leal (%rax,%r8), %ebp
shlq $0x20, %rbp
movl %edi, %r12d
subl %edx, %r12d
movl %r14d, %r13d
subl %r8d, %r13d
subl %edx, %r13d
leal (%rdi,%r13), %edx
movq %rdx, 0xa0(%rsp)
movq %rcx, %rbx
leal (%r12,%rcx), %r15d
movq %rcx, 0x78(%rsp)
shlq $0x20, %r15
leaq (%rsi,%rbp), %rax
movq %rax, 0x10(%rsp)
leaq (%r15,%rdx), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
movq 0x50(%rsp), %rax
addl %r14d, %eax
incl %eax
orq %rbp, %rax
movq %rax, 0x10(%rsp)
leal (%r12,%rbx), %eax
decl %eax
shlq $0x20, %rax
addq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
movq 0x70(%rsp), %rbp
movq 0xb0(%rsp), %rax
addl %ebp, %eax
incl %eax
shlq $0x20, %rax
addq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
addl %r13d, %eax
decl %eax
orq %r15, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %rbx, %r13
movq %r14, %rsi
movq %r12, %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
movl 0x6c(%rsp), %r14d
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %esi
movq 0x90(%rsp), %rcx
leal (%rcx,%rax), %r12d
addl %r14d, %r12d
movq 0x48(%rsp), %rdx
addl %edx, %r12d
movq %rsi, 0x40(%rsp)
subl %esi, %r12d
movl %ebp, %ebx
addl %esi, %ebx
shlq $0x20, %rbx
movq 0x50(%rsp), %rcx
addl %ecx, %eax
subl %ecx, %r14d
leal (%rax,%rdx), %ebp
leal (%rdx,%rax), %ecx
decl %ecx
movq %rcx, 0x48(%rsp)
movq 0x78(%rsp), %r15
addl %r14d, %r15d
shlq $0x20, %r15
leaq (%rbx,%r12), %rax
movq %rax, 0x10(%rsp)
leaq (%r15,%rcx), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
movq 0x70(%rsp), %rax
movq 0x40(%rsp), %rcx
addl %ecx, %eax
incl %eax
shlq $0x20, %rax
orq %r12, %rax
movq %rax, 0x10(%rsp)
orq %r15, %rbp
movq %rbp, 0x8(%rsp)
movq %r13, %r15
movq %r13, %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
leaq 0x8(%rsp), %rbp
movq %rbp, %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
decl %r12d
orq %rbx, %r12
movq %r12, 0x10(%rsp)
movq 0x78(%rsp), %rax
addl %r14d, %eax
decl %eax
shlq $0x20, %rax
addq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
testb $0x1, 0x5c(%rsp)
movl $0x0, %ebx
movq 0x98(%rsp), %r14
jne 0x8dd34
movq 0x38(%rsp), %rdi
callq 0x58780
xorl %ecx, %ecx
movl %ecx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq