// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/scrollbar.cpp
// Function: smooth::GUI::Scrollbar::OnValueChange()
S::Void S::GUI::Scrollbar::OnValueChange()
{
	UpdateHotspotPositions();

	if (!IsRegistered() || !IsVisible()) return;

	Surface	*surface	= GetDrawSurface();
	Point	 realPos	= GetRealPosition();
	Size	 realSize	= GetRealSize();

	Bool	 smallHotspots	= (subtype == OR_HORZ && (GetWidth() <= 55)) || (subtype == OR_VERT && (GetHeight() <= 55));
	Int	 hotspotSize	= Math::Round((smallHotspots ? 10 : (subtype == OR_HORZ ? GetHeight() : GetWidth())) * surface->GetSurfaceDPI() / 96.0) - 4;

	Rect	 backFrame	= Rect(realPos + (subtype == OR_HORZ ? Point(hotspotSize + 4, 0) : Point(0, hotspotSize + 4)), realSize - (subtype == OR_HORZ ? Size(2 * (hotspotSize + 4), 0) : Size(0, 2 * (hotspotSize + 4))));
	Rect	 sliderFrame	= Rect(realPos + (subtype == OR_HORZ ? Point(hotspotSize + 4 + (Int) (((Float) realSize.cx - 3 * (hotspotSize + 4)) / ((Float) (endValue - startValue)) * ((Float) (*variable - startValue))), 0) : Point(0, hotspotSize + 4 + (Int) (((Float) realSize.cy - 3 * (hotspotSize + 4)) / ((Float) (endValue - startValue)) * ((Float) (*variable - startValue))))), subtype == OR_HORZ ? Size(hotspotSize + 4, realSize.cy) : Size(realSize.cx, hotspotSize + 4));

	surface->StartPaint(backFrame);

	surface->Box(backFrame, Setup::LightGrayColor, Rect::Filled);

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

	surface->Frame(sliderFrame, FRAME_UP);

	surface->EndPaint();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x5cc50
movq -0x98(%rbp), %rdi
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xa0285
jmp 0xa0299
movq -0x98(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xa029e
jmp 0xa0691
movq -0x98(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0x98(%rbp), %rdi
movq %rax, -0x10(%rbp)
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x98(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x20(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa0302
movq -0x98(%rbp), %rdi
callq 0x5a210
movl %eax, %ecx
movb $0x1, %al
cmpl $0x37, %ecx
movb %al, -0x99(%rbp)
jle 0xa0341
movq -0x98(%rbp), %rax
movswl 0x1a0(%rax), %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0x9a(%rbp)
jne 0xa0335
movq -0x98(%rbp), %rdi
callq 0x5b860
cmpl $0x37, %eax
setle %al
movb %al, -0x9a(%rbp)
movb -0x9a(%rbp), %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
andb $0x1, %al
movb %al, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
je 0xa035f
movl $0xa, %eax
movl %eax, -0xa0(%rbp)
jmp 0xa03a4
movq -0x98(%rbp), %rax
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa0386
movq -0x98(%rbp), %rdi
callq 0x5b860
movl %eax, -0xa4(%rbp)
jmp 0xa0398
movq -0x98(%rbp), %rdi
callq 0x5a210
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5d470
movw %ax, %cx
movl -0xa8(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xe70ec(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rcx
movq -0x98(%rbp), %rax
subq $0x4, %rcx
movl %ecx, -0x28(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa040d
movl -0x28(%rbp), %esi
addl $0x4, %esi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
jmp 0xa041e
movl -0x28(%rbp), %edx
addl $0x4, %edx
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x5c2c0
leaq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5ca20
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x40(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa045a
movl -0x28(%rbp), %esi
addl $0x4, %esi
shll %esi
leaq -0x58(%rbp), %rdi
xorl %edx, %edx
callq 0x59260
jmp 0xa046d
movl -0x28(%rbp), %edx
addl $0x4, %edx
shll %edx
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x59260
leaq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5db90
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x59ff0
movq -0x98(%rbp), %rax
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa0503
movq -0x98(%rbp), %rcx
movl -0x28(%rbp), %esi
addl $0x4, %esi
cvtsi2sdl -0x20(%rbp), %xmm0
movl -0x28(%rbp), %eax
addl $0x4, %eax
imull $0x3, %eax, %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
movl 0x5dc(%rcx), %eax
subl 0x5d8(%rcx), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq 0x5d0(%rcx), %rax
movl (%rax), %eax
subl 0x5d8(%rcx), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addl %eax, %esi
leaq -0x78(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
jmp 0xa0562
movq -0x98(%rbp), %rcx
movl -0x28(%rbp), %edx
addl $0x4, %edx
cvtsi2sdl -0x1c(%rbp), %xmm0
movl -0x28(%rbp), %eax
addl $0x4, %eax
imull $0x3, %eax, %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
movl 0x5dc(%rcx), %eax
subl 0x5d8(%rcx), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq 0x5d0(%rcx), %rax
movl (%rax), %eax
subl 0x5d8(%rcx), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addl %eax, %edx
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x5c2c0
leaq -0x18(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x5ca20
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x70(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xa059d
movl -0x28(%rbp), %esi
addl $0x4, %esi
movl -0x1c(%rbp), %edx
leaq -0x80(%rbp), %rdi
callq 0x59260
jmp 0xa05af
movl -0x20(%rbp), %esi
movl -0x28(%rbp), %edx
addl $0x4, %edx
leaq -0x80(%rbp), %rdi
callq 0x59260
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x59ff0
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x591b0
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq 0x1689c1(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0xac(%rbp)
leaq -0x88(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0xb8(%rbp), %rdi
movl -0xac(%rbp), %ecx
leaq -0x38(%rbp), %rsi
movq 0x168171(%rip), %rdx    # 0x208780
leaq -0x88(%rbp), %r8
callq 0x5c110
movq -0x98(%rbp), %rax
testb $0x1, 0x638(%rax)
jne 0xa0679
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq 0x168963(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0xbc(%rbp)
leaq -0x90(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0xc8(%rbp), %rdi
movl -0xbc(%rbp), %ecx
leaq -0x68(%rbp), %rsi
movq 0x167e3b(%rip), %rdx    # 0x2084a8
leaq -0x90(%rbp), %r8
callq 0x5c110
movq -0x10(%rbp), %rdi
leaq -0x68(%rbp), %rsi
xorl %edx, %edx
callq 0x5c050
movq -0x10(%rbp), %rdi
callq 0x5d270
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)