// File: /workspace/github_c_makefile_star2_O1/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 0x8e60d
movq (%r14), %rax
movq %r14, %rdi
callq *0x90(%rax)
xorl %ecx, %ecx
testb %al, %al
je 0x8e60d
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 0x8e601
cmpl $0x1, 0x1c(%rsp)
je 0x8e601
movq 0x5d8(%r14), %rax
cmpb $0x1, (%rax)
jne 0x8e601
movq 0x38(%rsp), %rdi
callq 0x58930
cwtl
cvtsi2sd %eax, %xmm0
divsd 0x66293(%rip), %xmm0    # 0xf44f0
mulsd 0x6613b(%rip), %xmm0    # 0xf43a0
cvttsd2si %xmm0, %eax
movq %rax, 0x50(%rsp)
notl %eax
movq %rax, 0x90(%rsp)
movl $0x1, %ebx
movq 0xde764(%rip), %rax     # 0x16c9e8
addq $0x8, %rax
movq %rax, 0x88(%rsp)
movq 0xde6b9(%rip), %rax     # 0x16c950
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 0xde67f(%rip), %rcx     # 0x16c950
cmovneq 0xde70f(%rip), %rcx     # 0x16c9e8
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movl (%rcx), %eax
movl %eax, 0x20(%rsp)
cmpl $0x2, 0x1c(%rsp)
jne 0x8e2ff
movq 0xde83b(%rip), %rax     # 0x16cb30
movupd (%rax), %xmm0
movapd %xmm0, 0x20(%rsp)
cmpl $0x1, %ebx
jne 0x8e394
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 0x6975e(%rip), %xmm2    # 0xf7a88
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)
xorl %r12d, %r12d
movzbl %al, %r15d
cmpl $0x1, %ebx
movl %ebx, 0x5c(%rsp)
jne 0x8e3d0
movq (%r14), %rax
movq %r14, %rdi
callq *0x160(%rax)
movzbl %al, %eax
negl %eax
orl $0x1, %eax
addl %r15d, %eax
movl $0x1, %r12d
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 (%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, %r15d
subl %r8d, %r15d
subl %edx, %r15d
leal (%r15,%rdi), %edx
movq %rdx, 0xa0(%rsp)
leal (%rbx,%r12), %r13d
movq %r12, 0x78(%rsp)
shlq $0x20, %r13
leaq (%rsi,%rbp), %rax
movq %rax, 0x10(%rsp)
leaq (%rdx,%r13), %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 (%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 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 %r15d, %eax
decl %eax
orq %r13, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %rbx, %r15
movq %r14, %rsi
movq %r12, %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
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), %r13
addl %r14d, %r13d
shlq $0x20, %r13
leaq (%r12,%rbx), %rax
movq %rax, 0x10(%rsp)
leaq (%rcx,%r13), %rax
movq %rax, 0x8(%rsp)
movq %r15, %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 %rbx, %rax
movq %rax, 0x10(%rsp)
orq %r13, %rbp
movq %rbp, 0x8(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
leaq 0x8(%rsp), %rbp
movq %rbp, %rdx
leaq 0x20(%rsp), %rcx
callq 0x58300
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 0x58300
movl 0x5c(%rsp), %ebx
decl %ebx
movq 0x98(%rsp), %r14
je 0x8e2ab
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
nop