// File: /workspace/github_c_makefile_star2_O2/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)
testb %al, %al
je 0x8b023
movq (%r14), %rax
movq %r14, %rdi
callq *0x90(%rax)
xorl %ecx, %ecx
testb %al, %al
je 0x8b034
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 0x56160
movq %r14, %rdi
movl 0x1c(%rsp), %ebx
movl %ebx, %esi
callq 0x58b20
cmpl $0x3, %ebx
ja 0x8b028
cmpl $0x1, 0x1c(%rsp)
je 0x8b028
movq 0x5d8(%r14), %rax
cmpb $0x1, (%rax)
jne 0x8b028
movq 0x38(%rsp), %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
divsd 0x58888(%rip), %xmm0    # 0xe3510
mulsd 0x586f8(%rip), %xmm0    # 0xe3388
cvttsd2si %xmm0, %eax
movq %rax, 0x50(%rsp)
notl %eax
movq %rax, 0x90(%rsp)
pushq $0x2
popq %r15
movq 0xd6d3a(%rip), %rax     # 0x1619e8
addq $0x8, %rax
movq %rax, 0x88(%rsp)
movq 0xd6c8f(%rip), %rax     # 0x161950
addq $0x8, %rax
movq %rax, 0x80(%rsp)
movl %r15d, %eax
movq %r14, 0x98(%rsp)
subl $0x1, %eax
jb 0x8b028
movl %eax, 0x5c(%rsp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x98(%rax)
testb %al, %al
movq 0x80(%rsp), %rax
cmovneq 0x88(%rsp), %rax
movq 0xd6c45(%rip), %rcx     # 0x161950
cmovneq 0xd6cd5(%rip), %rcx     # 0x1619e8
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movl (%rcx), %eax
movl %eax, 0x20(%rsp)
cmpl $0x2, 0x1c(%rsp)
jne 0x8ad39
movq 0xd6e01(%rip), %rax     # 0x161b30
movupd (%rax), %xmm0
movapd %xmm0, 0x20(%rsp)
cmpl $0x2, %r15d
jne 0x8adb9
movl 0x28(%rsp), %ecx
movl %ecx, %eax
movl $0xff, %esi
andl %esi, %eax
cvtsi2sd %eax, %xmm0
xorl %esi, %eax
cvtsi2sd %eax, %xmm1
movsd 0x5bdb2(%rip), %xmm2    # 0xe6b10
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %ecx, %edx
shrl $0x8, %edx
andl %esi, %edx
cvtsi2sd %edx, %xmm0
xorl %esi, %edx
cvtsi2sd %edx, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
shrl $0x10, %ecx
andl %esi, %ecx
cvtsi2sd %ecx, %xmm0
xorl %esi, %ecx
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
andl $0x0, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x160(%rax)
xorl %r12d, %r12d
movzbl %al, %ebx
cmpl $0x2, %r15d
jne 0x8adef
movq (%r14), %rax
movq %r14, %rdi
callq *0x160(%rax)
movzbl %al, %eax
negl %eax
orl $0x1, %eax
addl %ebx, %eax
movl %eax, %ebx
pushq $0x1
popq %rax
movl %eax, %r12d
movq %rbx, 0x48(%rsp)
movl 0x60(%rsp), %r14d
addl %ebx, %r14d
movq 0x50(%rsp), %rdx
leal (%r14,%rdx), %esi
movq %rsi, 0xa8(%rsp)
leal (%r12,%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, %ebx
subl %edx, %ebx
movl %r14d, %r13d
subl %r8d, %r13d
subl %edx, %r13d
leal (%rdi,%r13), %edx
movq %rdx, 0xa0(%rsp)
leal (%rbx,%r12), %r15d
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
movq %r12, 0x78(%rsp)
callq 0x595b0
movq 0x50(%rsp), %rax
addl %r14d, %eax
incl %eax
orq %rbp, %rax
movq %rax, 0x10(%rsp)
leal (%rbx,%r12), %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 0x595b0
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 0x595b0
movl 0x6c(%rsp), %r14d
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %edx
movq %rdx, 0x40(%rsp)
movq 0x90(%rsp), %rcx
leal (%rcx,%rax), %ebx
addl %r14d, %ebx
movq 0x48(%rsp), %rcx
addl %ecx, %ebx
subl %edx, %ebx
movl %ebp, %r12d
addl %edx, %r12d
shlq $0x20, %r12
movq 0x50(%rsp), %rdx
addl %edx, %eax
subl %edx, %r14d
leal (%rax,%rcx), %ebp
addl %eax, %ecx
decl %ecx
movq %rcx, 0x48(%rsp)
movq 0x78(%rsp), %r15
addl %r14d, %r15d
shlq $0x20, %r15
leaq (%r12,%rbx), %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 0x595b0
movq 0x70(%rsp), %rax
movq 0x40(%rsp), %rcx
addl %ecx, %eax
incl %eax
shlq $0x20, %rax
orq %rbx, %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 0x595b0
decl %ebx
orq %r12, %rbx
movq %rbx, 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 0x595b0
movl 0x5c(%rsp), %eax
movl %eax, %r15d
movq 0x98(%rsp), %r14
jmp 0x8acd8
pushq $-0x1
popq %rcx
jmp 0x8b034
movq 0x38(%rsp), %rdi
callq 0x59a80
xorl %ecx, %ecx
movl %ecx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq