// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/basic/slider.cpp
// Function: smooth::GUI::Slider::Slider(smooth::GUI::Point const&, smooth::GUI::Size const&, int, int*, int, int)
S::GUI::Slider::Slider(const Point &iPos, const Size &iSize, Int sType, Int *var, Int rangeStart, Int rangeEnd) : Widget(iPos, iSize)
{
	type		= classID;
	subtype		= sType;
	startValue	= rangeStart;
	endValue	= rangeEnd;

	dummyVariable	= 0;
	previousValue	= 0;

	gripSize	= 9;

	if (var == NIL)	variable = &dummyVariable;
	else		variable = var;

	if (GetWidth()	== 0 && subtype == OR_HORZ) SetWidth(100);
	if (GetHeight() == 0 && subtype == OR_VERT) SetHeight(100);

	if (subtype == OR_HORZ)	SetHeight(18);
	else			SetWidth(18);

	onValueChange.SetParentObject(this);
	onValueChange.Connect(&onAction);

	clickHotspot	= new Hotspot(subtype == OR_HORZ ? Point(4, 1) : Point(1, 4), GetSize() - (subtype == OR_HORZ ? Size(8, 2) : Size(2, 8)));
	dragHotspot	= new Hotspot(Point(), Size());

	dragging	= False;

	clickHotspot->onLeftButtonClick.Connect(&Slider::OnMouseClick, this);

	dragHotspot->onMouseDragStart.Connect(&Slider::OnMouseDragStart, this);
	dragHotspot->onMouseDrag.Connect(&Slider::OnMouseDrag, this);
	dragHotspot->onMouseDragEnd.Connect(&Slider::OnMouseDragEnd, this);

	Add(clickHotspot);
	Add(dragHotspot);

	onChangeSize.Connect(&Slider::UpdateHotspotPositions, this);

	SetValue(*variable);

	UpdateHotspotPositions();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r12d
movq %r8, %r15
movl %ecx, %ebp
movq %rdi, %rbx
movl 0x50(%rsp), %r13d
callq 0x57a30
movq 0xf061a(%rip), %rax     # 0x16cd20
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x5f0(%rbx), %r14
xorl %eax, %eax
movq %rax, 0x5f8(%rbx)
leaq 0xe6654(%rip), %rcx     # 0x162d78
movq %rcx, 0x5f0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x600(%rbx)
movq 0xf05ac(%rip), %rcx     # 0x16cce8
movzwl (%rcx), %ecx
movw %cx, 0x20(%rbx)
movw %bp, 0x1a0(%rbx)
movl %r12d, 0x5d8(%rbx)
movl %r13d, 0x5dc(%rbx)
leaq 0x5b8(%rbx), %rcx
movq %rax, 0x5b8(%rbx)
movl $0x9, 0x5c8(%rbx)
testq %r15, %r15
cmovneq %r15, %rcx
movq %rcx, 0x5d0(%rbx)
cmpw $0x1, %bp
jne 0x7c7b0
cmpl $0x0, 0xb0(%rbx)
jne 0x7c7b0
leaq 0xa8(%rbx), %rsi
movl 0xb4(%rbx), %eax
leaq 0x8(%rsp), %rdx
movl $0x64, (%rdx)
movl %eax, 0x4(%rdx)
movq %rbx, %rdi
callq 0x57080
cmpl $0x0, 0xb4(%rbx)
jne 0x7c7ea
cmpw $0x2, 0x1a0(%rbx)
jne 0x7c7ea
leaq 0xa8(%rbx), %rsi
movl 0xb0(%rbx), %eax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl $0x64, 0x4(%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
leaq 0xa8(%rbx), %rsi
cmpw $0x1, 0x1a0(%rbx)
jne 0x7c81d
movl 0xb0(%rbx), %eax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl $0x12, 0x4(%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
jmp 0x7c83d
movl 0xb4(%rbx), %eax
leaq 0x8(%rsp), %rdx
movl $0x12, (%rdx)
movl %eax, 0x4(%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
movq %rbx, 0x5f8(%rbx)
leaq 0x478(%rbx), %rsi
movq %r14, %rdi
callq 0x72aa2
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r15
xorl %eax, %eax
xorl %ecx, %ecx
cmpw $0x1, 0x1a0(%rbx)
setne %al
sete %cl
leal 0x1(%rcx,%rcx,2), %ecx
movl $0xfffffff8, %edx       # imm = 0xFFFFFFF8
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
cmovel %edx, %edi
cmovel %esi, %edx
leal (%rax,%rax,2), %eax
incl %eax
leaq 0x8(%rsp), %rsi
movl %ecx, (%rsi)
movl %eax, 0x4(%rsi)
addl 0xb0(%rbx), %edi
addl 0xb4(%rbx), %edx
shlq $0x20, %rdx
orq %rdx, %rdi
leaq 0x10(%rsp), %rdx
movq %rdi, (%rdx)
movq %r15, %rdi
callq 0x55a30
movq %r15, 0x5e0(%rbx)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r15
xorl %eax, %eax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %r15, %rdi
callq 0x55a30
movq %r15, 0x5e8(%rbx)
movb $0x0, 0x5c4(%rbx)
movl $0x338, %edi            # imm = 0x338
addq 0x5e0(%rbx), %rdi
movq 0xf023c(%rip), %rsi     # 0x16cb48
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d4ba
movl $0x3f8, %edi            # imm = 0x3F8
addq 0x5e8(%rbx), %rdi
movq 0xf05c7(%rip), %rsi     # 0x16cef0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d4ba
movl $0x418, %edi            # imm = 0x418
addq 0x5e8(%rbx), %rdi
movq 0xefb72(%rip), %rsi     # 0x16c4b8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d4ba
movl $0x438, %edi            # imm = 0x438
addq 0x5e8(%rbx), %rdi
movq 0xf05c5(%rip), %rsi     # 0x16cf28
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d4ba
movq 0x5e0(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x5e8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
leaq 0x298(%rbx), %rdi
movq 0xf0575(%rip), %rsi     # 0x16cf10
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d578
movq 0x5d0(%rbx), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x55250
movq %rbx, %rdi
callq 0x591f8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7c9cf
movq %rax, %r12
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x55480
jmp 0x7c9e4
movq %rax, %r12
movq %r14, %rdi
callq 0x72cce
movq %rbx, %rdi
callq 0x57640
movq %r12, %rdi
callq 0x57090