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

	Surface	*surface  = GetDrawSurface();
	Point	 realPos  = GetRealPosition();
	Size	 realSize = GetRealSize();
	Int	 realGripSize = Math::Round(gripSize * surface->GetSurfaceDPI() / 96.0);
	Rect	 sliderRect;

	switch (message)
	{
		case SP_PAINT:
			surface->StartPaint(Rect(realPos, realSize));

			surface->Box(Rect(realPos, realSize), GetBackgroundColor(), Rect::Filled);

			if (subtype == OR_HORZ)	surface->Bar(realPos + Point((realGripSize - 1) / 2, (realSize.cy - 2) / 2), realPos + Point(realSize.cx - (realGripSize - 1) / 2, (realSize.cy - 2) / 2), OR_HORZ);
			else			surface->Bar(realPos + Point((realSize.cy - 2) / 2, (realGripSize - 1) / 2), realPos + Point((realSize.cy - 2) / 2, realSize.cy - (realGripSize - 1) / 2), OR_VERT);

			if (subtype == OR_HORZ)	sliderRect = Rect(realPos + Point((Int) (((Float) (realSize.cx - realGripSize)) / ((Float) (endValue - startValue)) * ((Float) (*variable - startValue))), 0), Size(gripSize - 1, 16) * surface->GetSurfaceDPI() / 96.0 + Size(1, 1));
			else			sliderRect = Rect(realPos + Point(0, (realSize.cy - realGripSize - 1) - (Int) (((Float) (realSize.cy - realGripSize - 1)) / ((Float) (endValue - startValue)) * ((Float) (*variable - startValue)))), Size(16, gripSize - 1) * surface->GetSurfaceDPI() / 96.0 + Size(2, 2));

			if (!dragging)	surface->Box(sliderRect, Setup::BackgroundColor, Rect::Filled);
			else		surface->Box(sliderRect, Setup::LightGrayColor, Rect::Filled);

			surface->Frame(sliderRect, FRAME_UP);

			surface->EndPaint();

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x198(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xa3094
leaq -0x28(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x1a8(%rbp), %rdi
callq 0x59680
movl %eax, -0x19c(%rbp)
jmp 0xa3063
movl -0x19c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xa375f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xa376b
movq -0x198(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xa30fd
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x5ca80
movq -0x1b8(%rbp), %rdi
callq 0x59680
movl %eax, -0x1ac(%rbp)
jmp 0xa30cc
movl -0x1ac(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xa375f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xa376b
movq -0x198(%rbp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq -0x198(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq -0x198(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, %rcx
movq -0x198(%rbp), %rax
movq %rcx, -0x60(%rbp)
movl 0x5c8(%rax), %eax
movl %eax, -0x1bc(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
movw %ax, %cx
movl -0x1bc(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xe434d(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl %eax, -0x64(%rbp)
leaq -0x74(%rbp), %rdi
callq 0x5c030
movl -0x14(%rbp), %eax
testl %eax, %eax
jne 0xa3707
jmp 0xa3195
movq -0x50(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x84(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x59ff0
movq -0x1d8(%rbp), %rdi
leaq -0x84(%rbp), %rsi
callq 0x591b0
movq -0x50(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x94(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x59ff0
movq -0x198(%rbp), %rdi
movq (%rdi), %rax
callq *0x140(%rax)
movq %rax, -0x1c8(%rbp)
movq 0x165d9c(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x1c0(%rbp)
leaq -0x9c(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x1d0(%rbp), %rdi
movq -0x1c8(%rbp), %rdx
movl -0x1c0(%rbp), %ecx
leaq -0x94(%rbp), %rsi
leaq -0x9c(%rbp), %r8
callq 0x5c110
movq -0x198(%rbp), %rax
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa3312
movq -0x50(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movl -0x64(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl -0x5c(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
leaq -0xac(%rbp), %rdi
callq 0x5c2c0
leaq -0x58(%rbp), %rdi
leaq -0xac(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xa4(%rbp)
movl -0x60(%rbp), %esi
movl -0x64(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
subl %eax, %esi
movl -0x5c(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
leaq -0xbc(%rbp), %rdi
callq 0x5c2c0
leaq -0x58(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
callq 0x5ca20
movq -0x1e0(%rbp), %rdi
movq %rax, -0xb4(%rbp)
leaq -0xa4(%rbp), %rsi
leaq -0xb4(%rbp), %rdx
movl $0x1, %ecx
callq 0x5dc90
jmp 0xa33d1
movq -0x50(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movl -0x5c(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl -0x64(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
leaq -0xcc(%rbp), %rdi
callq 0x5c2c0
leaq -0x58(%rbp), %rdi
leaq -0xcc(%rbp), %rsi
callq 0x5ca20
movq %rax, -0xc4(%rbp)
movl -0x5c(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl -0x5c(%rbp), %eax
movl %eax, -0x1ec(%rbp)
movl -0x64(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x1ec(%rbp), %edx
subl %eax, %edx
leaq -0xdc(%rbp), %rdi
callq 0x5c2c0
leaq -0x58(%rbp), %rdi
leaq -0xdc(%rbp), %rsi
callq 0x5ca20
movq -0x1e8(%rbp), %rdi
movq %rax, -0xd4(%rbp)
leaq -0xc4(%rbp), %rsi
leaq -0xd4(%rbp), %rdx
movl $0x2, %ecx
callq 0x5dc90
movq -0x198(%rbp), %rax
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa3515
movq -0x198(%rbp), %rax
movl -0x60(%rbp), %ecx
movl -0x64(%rbp), %edx
subl %edx, %ecx
cvtsi2sd %ecx, %xmm0
movl 0x5dc(%rax), %edx
movl 0x5d8(%rax), %ecx
subl %ecx, %edx
cvtsi2sd %edx, %xmm1
divsd %xmm1, %xmm0
movq 0x5d0(%rax), %rax
movl (%rax), %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
leaq -0xfc(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
xorl %edx, %edx
callq 0x5c2c0
movq -0x1f8(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x5ca20
movq %rax, %rcx
movq -0x198(%rbp), %rax
movq %rcx, -0xf4(%rbp)
movl 0x5c8(%rax), %esi
decl %esi
leaq -0x11c(%rbp), %rdi
movl $0x10, %edx
callq 0x59260
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
cvtsi2sd %eax, %xmm0
leaq -0x11c(%rbp), %rdi
callq 0x5a7b0
movq %rax, -0x114(%rbp)
leaq -0x114(%rbp), %rdi
movsd 0xe4019(%rip), %xmm0    # 0x1874c0
callq 0x5c6b0
movq %rax, -0x10c(%rbp)
leaq -0x124(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x59260
leaq -0x10c(%rbp), %rdi
leaq -0x124(%rbp), %rsi
callq 0x590b0
movq %rax, -0x104(%rbp)
leaq -0xec(%rbp), %rdi
leaq -0xf4(%rbp), %rsi
leaq -0x104(%rbp), %rdx
callq 0x59ff0
movq -0xec(%rbp), %rax
movq %rax, -0x74(%rbp)
movq -0xe4(%rbp), %rax
movq %rax, -0x6c(%rbp)
jmp 0xa3641
movq -0x198(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl -0x64(%rbp), %edx
notl %edx
addl %ecx, %edx
cvtsi2sd %edx, %xmm0
movl 0x5dc(%rax), %esi
movl 0x5d8(%rax), %ecx
subl %ecx, %esi
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
movq 0x5d0(%rax), %rax
movl (%rax), %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
subl %eax, %edx
leaq -0x144(%rbp), %rdi
movq %rdi, -0x200(%rbp)
xorl %esi, %esi
callq 0x5c2c0
movq -0x200(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x5ca20
movq %rax, %rcx
movq -0x198(%rbp), %rax
movq %rcx, -0x13c(%rbp)
movl 0x5c8(%rax), %edx
decl %edx
leaq -0x164(%rbp), %rdi
movl $0x10, %esi
callq 0x59260
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
cvtsi2sd %eax, %xmm0
leaq -0x164(%rbp), %rdi
callq 0x5a7b0
movq %rax, -0x15c(%rbp)
leaq -0x15c(%rbp), %rdi
movsd 0xe3ee8(%rip), %xmm0    # 0x1874c0
callq 0x5c6b0
movq %rax, -0x154(%rbp)
leaq -0x16c(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0x59260
leaq -0x154(%rbp), %rdi
leaq -0x16c(%rbp), %rsi
callq 0x590b0
movq %rax, -0x14c(%rbp)
leaq -0x134(%rbp), %rdi
leaq -0x13c(%rbp), %rsi
leaq -0x14c(%rbp), %rdx
callq 0x59ff0
movq -0x134(%rbp), %rax
movq %rax, -0x74(%rbp)
movq -0x12c(%rbp), %rax
movq %rax, -0x6c(%rbp)
movq -0x198(%rbp), %rax
testb $0x1, 0x5c4(%rax)
jne 0xa36a1
movq -0x50(%rbp), %rax
movq %rax, -0x210(%rbp)
movq 0x16593d(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x204(%rbp)
leaq -0x174(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x210(%rbp), %rdi
movl -0x204(%rbp), %ecx
leaq -0x74(%rbp), %rsi
movq 0x164e15(%rip), %rdx    # 0x2084a8
leaq -0x174(%rbp), %r8
callq 0x5c110
jmp 0xa36ef
movq -0x50(%rbp), %rax
movq %rax, -0x220(%rbp)
movq 0x1658ed(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x214(%rbp)
leaq -0x17c(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x220(%rbp), %rdi
movl -0x214(%rbp), %ecx
leaq -0x74(%rbp), %rsi
movq 0x16509d(%rip), %rdx    # 0x208780
leaq -0x17c(%rbp), %r8
callq 0x5c110
movq -0x50(%rbp), %rdi
leaq -0x74(%rbp), %rsi
xorl %edx, %edx
callq 0x5c050
movq -0x50(%rbp), %rdi
callq 0x5d270
leaq -0x190(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x5ca80
movq -0x230(%rbp), %rdi
callq 0x59680
movl %eax, -0x224(%rbp)
jmp 0xa372e
movl -0x224(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x5a410
jmp 0xa375f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x5a410
jmp 0xa376b
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)