// File: /workspace/github_c_makefile_star2_O3/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 0xef9ea(%rip), %rax     # 0x16bd20
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x5f0(%rbx), %r14
xorl %eax, %eax
movq %rax, 0x5f8(%rbx)
leaq 0xe5a24(%rip), %rcx     # 0x161d78
movq %rcx, 0x5f0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x600(%rbx)
movq 0xef97c(%rip), %rcx     # 0x16bce8
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 0x7c3e7
cmpl $0x0, 0xb0(%rbx)
jne 0x7c3e7
leaq 0xa8(%rbx), %rsi
movl 0xb4(%rbx), %eax
leaq 0x8(%rsp), %rdx
movl $0x64, (%rdx)
movl %eax, 0x4(%rdx)
movq %rbx, %rdi
callq 0x57080
movzwl 0x1a0(%rbx), %ebp
cmpl $0x0, 0xb4(%rbx)
sete %al
cmpw $0x2, %bp
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x7c42d
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)
movzwl 0x1a0(%rbx), %ebp
leaq 0xa8(%rbx), %rsi
cmpw $0x1, %bp
jne 0x7c45c
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 0x7c47c
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 0x7273c
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 $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movl $0xfffffff8, %edx       # imm = 0xFFFFFFF8
movl $0xfffffff8, %r8d       # imm = 0xFFFFFFF8
cmovel %edi, %r8d
cmovel %edx, %edi
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), %r8d
shlq $0x20, %r8
orq %r8, %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 0xef5fa(%rip), %rsi     # 0x16bb48
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d11a
movl $0x3f8, %edi            # imm = 0x3F8
addq 0x5e8(%rbx), %rdi
movq 0xef985(%rip), %rsi     # 0x16bef0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d11a
movl $0x418, %edi            # imm = 0x418
addq 0x5e8(%rbx), %rdi
movq 0xeef30(%rip), %rsi     # 0x16b4b8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d11a
movl $0x438, %edi            # imm = 0x438
addq 0x5e8(%rbx), %rdi
movq 0xef983(%rip), %rsi     # 0x16bf28
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d11a
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 0xef933(%rip), %rsi     # 0x16bf10
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7d1da
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 0x7c611
movq %rax, %r12
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x55480
jmp 0x7c626
movq %rax, %r12
movq %r14, %rdi
callq 0x7296e
movq %rbx, %rdi
callq 0x57640
movq %r12, %rdi
callq 0x57090