// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/scrollbar.cpp
// Function: smooth::GUI::Scrollbar::OnMouseWheel(double)
S::Void S::GUI::Scrollbar::OnMouseWheel(Float value)
{
	if (subtype != OR_VERT) return;

	Window	*window	= container->GetContainerWindow();

	if (IsMouseOver() || window->IsMouseOn(Rect(container->GetRealPosition(), container->GetRealSize())))
	{
		Surface	*surface = GetDrawSurface();

		surface->StartPaint(container->GetVisibleArea());

		/* Reset spill value upon scroll direction change.
		 */
		if (Math::Sign(value) != Math::Sign(scrollSpill)) scrollSpill = 0;

		/* Update scroll position value.
		 */
		Int	 amount = (value + scrollSpill) * stepSize;

		SetValue(*variable - amount);

		scrollSpill += value - (Float(amount) / stepSize);

		/* Send an event to update widget under cursor if necessary.
		 */
		container->Process(SM_MOUSEMOVE, 0, 0);

		surface->EndPaint();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x2, %eax
je 0x9fbdd
jmp 0x9fd7c
movq -0x60(%rbp), %rax
movq 0x190(%rax), %rdi
callq 0x59bc0
movq -0x60(%rbp), %rdi
movq %rax, -0x18(%rbp)
callq 0x5d390
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x61(%rbp)
jne 0x9fc5c
movq -0x60(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x59ff0
movq -0x70(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5c060
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x9fc68
jmp 0x9fd7c
movq -0x60(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
callq *0x130(%rax)
movq -0x80(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x591b0
movsd -0x10(%rbp), %xmm0
callq 0x5cd50
movq -0x60(%rbp), %rax
movsd %xmm0, -0x78(%rbp)
movsd 0x640(%rax), %xmm0
callq 0x5cd50
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jne 0x9fcdc
jp 0x9fcdc
jmp 0x9fceb
movq -0x60(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x640(%rax)
movq -0x60(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
movsd 0x640(%rdi), %xmm1
addsd %xmm1, %xmm0
movl 0x5e0(%rdi), %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x54(%rbp)
movq 0x5d0(%rdi), %rax
movl (%rax), %esi
movl -0x54(%rbp), %eax
subl %eax, %esi
callq 0x5b550
movq -0x60(%rbp), %rax
movsd -0x10(%rbp), %xmm0
cvtsi2sdl -0x54(%rbp), %xmm1
movl 0x5e0(%rax), %ecx
cvtsi2sd %rcx, %xmm2
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
addsd 0x640(%rax), %xmm0
movsd %xmm0, 0x640(%rax)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movl $0x7800, %esi           # imm = 0x7800
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x80(%rax)
movq -0x40(%rbp), %rdi
callq 0x5d270
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)