// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/multiedit.cpp
// Function: smooth::GUI::MultiEdit::OnCursorScroll(int, int)
S::Void S::GUI::MultiEdit::OnCursorScroll(Int scrollPos, Int maxScrollPos)
{
	if (maxScrollPos == 0 && scrollbar != NIL)
	{
		DeleteObject(scrollbar);

		scrollbar = NIL;

		cursor->SetWidth(cursor->GetWidth() + 17);

		Paint(SP_PAINT);
	}
	else if (scrollbar == NIL)
	{
		cursor->SetWidth(cursor->GetWidth() - 17);

		scrollbar = new Scrollbar(Point(18, 1), Size(0, GetHeight() - 2), OR_VERT, &scrollbarPos, 0, maxScrollPos);
		scrollbar->onValueChange.Connect(&MultiEdit::OnScroll, this);
		scrollbar->SetOrientation(OR_UPPERRIGHT);
		scrollbar->SetAlwaysActive(True);

		Add(scrollbar);

		Paint(SP_PAINT);
	}
	else
	{
		scrollbar->SetRange(0, maxScrollPos);
		scrollbar->SetValue(scrollPos);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x9af33
movq -0x48(%rbp), %rax
cmpq $0x0, 0x5c0(%rax)
je 0x9af33
movq -0x48(%rbp), %rax
movq 0x5c0(%rax), %rdi
callq 0x5d8d0
movq -0x48(%rbp), %rax
movq $0x0, 0x5c0(%rax)
movq 0x5b8(%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x5b8(%rax), %rdi
callq 0x5a210
movq -0x50(%rbp), %rdi
movl %eax, %esi
addl $0x11, %esi
callq 0x5db30
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
jmp 0x9b0a9
movq -0x48(%rbp), %rax
cmpq $0x0, 0x5c0(%rax)
jne 0x9b07f
movq -0x48(%rbp), %rax
movq 0x5b8(%rax), %rdi
movq %rdi, -0x60(%rbp)
callq 0x5a210
movq -0x60(%rbp), %rdi
movl %eax, %esi
addl $-0x11, %esi
callq 0x5db30
movl $0x668, %edi            # imm = 0x668
callq 0x59820
movq %rax, -0x58(%rbp)
leaq -0x18(%rbp), %rdi
movl $0x12, %esi
movl $0x1, %edx
callq 0x5c2c0
jmp 0x9af8a
movq -0x48(%rbp), %rdi
callq 0x5b860
movl %eax, -0x64(%rbp)
jmp 0x9af98
movl -0x64(%rbp), %edx
addl $-0x2, %edx
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
callq 0x59260
jmp 0x9afab
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %r8
addq $0x5c8, %r8             # imm = 0x5C8
movl -0x10(%rbp), %ecx
movq %rsp, %rax
movl %ecx, (%rax)
leaq -0x18(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movl $0x2, %ecx
xorl %r9d, %r9d
callq 0x5ad70
jmp 0x9afd9
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rax, 0x5c0(%rcx)
movq 0x5c0(%rcx), %rdi
addq $0x618, %rdi            # imm = 0x618
movq 0x16d8eb(%rip), %rax    # 0x2088e8
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x9be40
movq -0x48(%rbp), %rax
movq 0x5c0(%rax), %rdi
movq (%rdi), %rax
movl $0x24, %esi
callq *0x120(%rax)
movq -0x48(%rbp), %rax
movq 0x5c0(%rax), %rdi
movl $0x1, %esi
callq 0x5c4f0
movq -0x48(%rbp), %rdi
movq 0x5c0(%rdi), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
jmp 0x9b0a7
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x668, %esi            # imm = 0x668
callq 0x595b0
jmp 0x9b0af
movq -0x48(%rbp), %rax
movq 0x5c0(%rax), %rdi
movl -0x10(%rbp), %edx
xorl %esi, %esi
callq 0x599a0
movq -0x48(%rbp), %rax
movq 0x5c0(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x5b550
jmp 0x9b0a9
addq $0x70, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)