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

	switch (message)
	{
		case SP_PAINT:
		case SP_UPDATE:
			{
				Surface	*surface = GetDrawSurface();
				Rect	 frame	 = Rect(GetRealPosition(), GetRealSize());

				surface->StartPaint(frame);

				if (message == SP_PAINT)
				{
					Font	 nFont = font;

					if (!IsActive()) nFont.SetColor(Setup::InactiveTextColor);

					surface->Box(frame, GetBackgroundColor(), Rect::Filled);
					surface->SetText(text, frame + Point(frame.GetHeight(), Math::Ceil(Float(frame.GetHeight() - scaledTextSize.cy) / 2) - 1), nFont);
				}

				Rect	 valueFrame = Rect(GetRealPosition() + Point(3, 3) * surface->GetSurfaceDPI() / 96.0, Size(frame.GetHeight(), frame.GetHeight()) - (Size(3, 3) * surface->GetSurfaceDPI() / 96.0) * 2);

				if (IsActive())	surface->Box(valueFrame, Setup::ClientColor, Rect::Filled);
				else		surface->Box(valueFrame, Setup::BackgroundColor, Rect::Filled);

				surface->Frame(valueFrame, FRAME_DOWN);

				if (*variable == True)
				{
					Point p1 = Point(valueFrame.left + 3 - (IsRightToLeft() ? 1 : 0), valueFrame.top + 3);
					Point p2 = Point(valueFrame.right - 1 - (IsRightToLeft() ? 1 : 0), valueFrame.bottom - 1);

					for (Int i = 0; i < 2; i++)
					{
						Int	 color = IsActive() ? Setup::DividerDarkColor : Setup::DividerDarkColor.Average(Setup::BackgroundColor);

						if (i == 1)
						{
							color = IsActive() ? Setup::ClientTextColor : Setup::InactiveTextColor;

							p1 -= Point((IsRightToLeft() ? -i : i), i);
							p2 -= Point((IsRightToLeft() ? -i : i), i);
						}

						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);
						surface->Line(p1 + Point(valueFrame.GetWidth() - 5, 0), p2 - Point(valueFrame.GetWidth() - 3, 0), color);
						surface->Line(p1 + Point(valueFrame.GetWidth() - 5, 1), p2 - Point(valueFrame.GetWidth() - 4, 0), color);
						surface->Line(p1 + Point(valueFrame.GetWidth() - 6, 0), p2 - Point(valueFrame.GetWidth() - 3, 1), color);
					}
				}

				surface->EndPaint();
			}

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0x92bc4
leaq -0x28(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x2c8(%rbp), %rdi
callq 0x59680
movl %eax, -0x2bc(%rbp)
jmp 0x92b93
movl -0x2bc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0x9373d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0x93749
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0x92c2d
leaq -0x48(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x5ca80
movq -0x2d8(%rbp), %rdi
callq 0x59680
movl %eax, -0x2cc(%rbp)
jmp 0x92bfc
movl -0x2cc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0x9373d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0x93749
movl -0x14(%rbp), %eax
subl $0x1, %eax
ja 0x936e5
jmp 0x92c3b
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0x2b8(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x2b8(%rbp), %rdi
movq %rax, -0x68(%rbp)
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x59ff0
movq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x591b0
cmpl $0x0, -0x14(%rbp)
jne 0x92e7a
movq -0x2b8(%rbp), %rsi
addq $0x140, %rsi            # imm = 0x140
leaq -0xb0(%rbp), %rdi
callq 0x59da0
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
movq 0x98(%rax), %rax
callq *%rax
movb %al, -0x2d9(%rbp)
jmp 0x92ccb
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0x92d0b
jmp 0x92cd7
movq 0x175c52(%rip), %rsi    # 0x208930
leaq -0xb0(%rbp), %rdi
callq 0x5d110
jmp 0x92cec
jmp 0x92d0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x5abf0
jmp 0x93749
movq -0x2b8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq (%rdi), %rax
movq 0x140(%rax), %rax
callq *%rax
movq %rax, -0x2e8(%rbp)
jmp 0x92d32
movq 0x176267(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x2f4(%rbp)
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
jmp 0x92d53
movl -0x2f4(%rbp), %ecx
movq -0x2e8(%rbp), %rdx
movq -0x2f0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0xb8(%rbp), %r8
callq 0x5c110
jmp 0x92d79
movq -0x2b8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, -0x308(%rbp)
addq $0xf0, %rax
movq %rax, -0x300(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl %eax, -0x2f8(%rbp)
jmp 0x92da9
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl %eax, -0x30c(%rbp)
jmp 0x92dba
movl -0x30c(%rbp), %eax
movq -0x2b8(%rbp), %rcx
movl 0x18c(%rcx), %ecx
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xf45ad(%rip), %xmm1    # 0x187388
mulsd %xmm1, %xmm0
callq 0x5b240
movq %rax, -0x318(%rbp)
jmp 0x92ded
movl -0x2f8(%rbp), %esi
movq -0x318(%rbp), %rax
movl %eax, %edx
decl %edx
leaq -0xd0(%rbp), %rdi
callq 0x5c2c0
jmp 0x92e0c
leaq -0x60(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x5be80
movq %rdx, -0x328(%rbp)
movq %rax, -0x320(%rbp)
jmp 0x92e2c
movq -0x300(%rbp), %rsi
movq -0x308(%rbp), %rdi
movq -0x328(%rbp), %rax
movq -0x320(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movq %rax, -0xc0(%rbp)
leaq -0xc8(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
xorl %r8d, %r8d
callq 0x5c3f0
jmp 0x92e6e
leaq -0xb0(%rbp), %rdi
callq 0x5abf0
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq %rax, -0xf0(%rbp)
leaq -0x108(%rbp), %rdi
movq %rdi, -0x340(%rbp)
movl $0x3, %edx
movl %edx, -0x32c(%rbp)
movl %edx, %esi
callq 0x5c2c0
movq -0x50(%rbp), %rdi
callq 0x5d470
movq -0x340(%rbp), %rdi
cwtl
cvtsi2sd %eax, %xmm0
callq 0x5a300
movq %rax, -0x100(%rbp)
leaq -0x100(%rbp), %rdi
movsd 0xf45df(%rip), %xmm0    # 0x1874c0
callq 0x5cd70
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xe8(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x591a0
movq -0x338(%rbp), %rdi
movl %eax, -0x330(%rbp)
callq 0x591a0
movl -0x330(%rbp), %esi
movl %eax, %edx
leaq -0x118(%rbp), %rdi
callq 0x59260
movl -0x32c(%rbp), %edx
leaq -0x138(%rbp), %rdi
movl %edx, %esi
callq 0x59260
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
cvtsi2sd %eax, %xmm0
leaq -0x138(%rbp), %rdi
callq 0x5a7b0
movq %rax, -0x130(%rbp)
leaq -0x130(%rbp), %rdi
movsd 0xf453f(%rip), %xmm0    # 0x1874c0
callq 0x5c6b0
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
movsd 0xf43dc(%rip), %xmm0    # 0x187378
callq 0x5a7b0
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5db90
movq %rax, -0x110(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x59ff0
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0x92ff2
jmp 0x93045
movq -0x50(%rbp), %rax
movq %rax, -0x350(%rbp)
movq 0x175f9c(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x344(%rbp)
leaq -0x140(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x350(%rbp), %rdi
movl -0x344(%rbp), %ecx
leaq -0xe0(%rbp), %rsi
movq 0x175611(%rip), %rdx    # 0x208648
leaq -0x140(%rbp), %r8
callq 0x5c110
jmp 0x93096
movq -0x50(%rbp), %rax
movq %rax, -0x360(%rbp)
movq 0x175f49(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x354(%rbp)
leaq -0x148(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x360(%rbp), %rdi
movl -0x354(%rbp), %ecx
leaq -0xe0(%rbp), %rsi
movq 0x17541e(%rip), %rdx    # 0x2084a8
leaq -0x148(%rbp), %r8
callq 0x5c110
movq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
movl $0x1, %edx
callq 0x5c050
movq -0x2b8(%rbp), %rax
movq 0x5c0(%rax), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x936dc
movq -0x2b8(%rbp), %rdi
movl -0xe0(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x368(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movl -0x368(%rbp), %esi
movb %al, %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
subl %eax, %esi
movl -0xdc(%rbp), %edx
addl $0x3, %edx
leaq -0x150(%rbp), %rdi
callq 0x5c2c0
movq -0x2b8(%rbp), %rdi
movl -0xd8(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x364(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movl -0x364(%rbp), %esi
movb %al, %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
subl %eax, %esi
movl -0xd4(%rbp), %edx
subl $0x1, %edx
leaq -0x158(%rbp), %rdi
callq 0x5c2c0
movl $0x0, -0x15c(%rbp)
cmpl $0x2, -0x15c(%rbp)
jge 0x936da
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0x9318c
jmp 0x931a1
leaq -0x170(%rbp), %rdi
movq 0x1756c6(%rip), %rsi    # 0x208860
callq 0x5c720
jmp 0x931bb
leaq -0x170(%rbp), %rdi
movq 0x1756b1(%rip), %rsi    # 0x208860
movq 0x1752f2(%rip), %rdx    # 0x2084a8
callq 0x5cbb0
leaq -0x170(%rbp), %rdi
callq 0x59210
movl %eax, -0x160(%rbp)
cmpl $0x1, -0x15c(%rbp)
jne 0x932dc
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0x931f0
jmp 0x93200
movq 0x175be9(%rip), %rax    # 0x208de0
movq %rax, -0x370(%rbp)
jmp 0x93210
movq 0x175729(%rip), %rax    # 0x208930
movq %rax, -0x370(%rbp)
jmp 0x93210
movq -0x370(%rbp), %rdi
callq 0x59210
movq -0x2b8(%rbp), %rdi
movl %eax, -0x160(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
testb $0x1, %al
jne 0x93238
jmp 0x93248
xorl %eax, %eax
subl -0x15c(%rbp), %eax
movl %eax, -0x374(%rbp)
jmp 0x93254
movl -0x15c(%rbp), %eax
movl %eax, -0x374(%rbp)
movl -0x374(%rbp), %esi
movl -0x15c(%rbp), %edx
leaq -0x178(%rbp), %rdi
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x5cd40
movq -0x2b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x160(%rax)
testb $0x1, %al
jne 0x93295
jmp 0x932a5
xorl %eax, %eax
subl -0x15c(%rbp), %eax
movl %eax, -0x378(%rbp)
jmp 0x932b1
movl -0x15c(%rbp), %eax
movl %eax, -0x378(%rbp)
movl -0x378(%rbp), %esi
movl -0x15c(%rbp), %edx
leaq -0x180(%rbp), %rdi
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x5cd40
movq -0x50(%rbp), %rax
movq %rax, -0x3a8(%rbp)
leaq -0x190(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x188(%rbp)
leaq -0x1a0(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x198(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
movq -0x3a8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
leaq -0x198(%rbp), %rdx
leaq -0x1b0(%rbp), %rcx
callq 0x5cce0
movq -0x50(%rbp), %rax
movq %rax, -0x3a0(%rbp)
leaq -0x1c0(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x1b8(%rbp)
leaq -0x1d0(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x1c8(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x1e0(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
movq -0x3a0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
leaq -0x1e0(%rbp), %rcx
callq 0x5cce0
movq -0x50(%rbp), %rax
movq %rax, -0x398(%rbp)
leaq -0x1f0(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x1e8(%rbp)
leaq -0x200(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x1f8(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x210(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
movq -0x398(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
leaq -0x210(%rbp), %rcx
callq 0x5cce0
movq -0x50(%rbp), %rax
movq %rax, -0x390(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5a5a0
movl %eax, %esi
subl $0x5, %esi
leaq -0x220(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x218(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5a5a0
movl %eax, %esi
subl $0x3, %esi
leaq -0x230(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x228(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x240(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
movq -0x390(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x228(%rbp), %rdx
leaq -0x240(%rbp), %rcx
callq 0x5cce0
movq -0x50(%rbp), %rax
movq %rax, -0x388(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5a5a0
movl %eax, %esi
subl $0x5, %esi
leaq -0x250(%rbp), %rdi
movl $0x1, %edx
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x248(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5a5a0
movl %eax, %esi
subl $0x4, %esi
leaq -0x260(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x258(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x270(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
movq -0x388(%rbp), %rdi
leaq -0x248(%rbp), %rsi
leaq -0x258(%rbp), %rdx
leaq -0x270(%rbp), %rcx
callq 0x5cce0
movq -0x50(%rbp), %rax
movq %rax, -0x380(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5a5a0
movl %eax, %esi
subl $0x6, %esi
leaq -0x280(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0x150(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x5ca20
movq %rax, -0x278(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5a5a0
movl %eax, %esi
subl $0x3, %esi
leaq -0x290(%rbp), %rdi
movl $0x1, %edx
callq 0x5c2c0
leaq -0x158(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x288(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x2a0(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
movq -0x380(%rbp), %rdi
leaq -0x278(%rbp), %rsi
leaq -0x288(%rbp), %rdx
leaq -0x2a0(%rbp), %rcx
callq 0x5cce0
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x93169
jmp 0x936dc
movq -0x50(%rbp), %rdi
callq 0x5d270
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x5ca80
movq -0x3b8(%rbp), %rdi
callq 0x59680
movl %eax, -0x3ac(%rbp)
jmp 0x9370c
movl -0x3ac(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x5a410
jmp 0x9373d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x5a410
jmp 0x93749
movl -0x4(%rbp), %eax
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)