// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/multi/list/listboxheader.cpp
// Function: smooth::GUI::ListBoxHeader::Process(int, int, int)
S::Int S::GUI::ListBoxHeader::Process(Int message, Int wParam, Int lParam)
{
	if (!IsRegistered())		 return Error();
	if (!IsActive() || !IsVisible()) return Success();

	switch (message)
	{
		case SM_MOUSEMOVE:
			if (draggingTab) break;

			{
				Window	*window	  = GetContainerWindow();
				Surface	*surface  = GetDrawSurface();

				Point	 realPos  = GetRealPosition();
				Size	 realSize = GetRealSize();
				Rect	 frame	  = Rect(realPos, realSize);

				frame.left = realPos.x - 2;

				for (Int i = 0; i < tabWidths.Length() - 1; i++)
				{
					frame.left += (Int) Math::Abs(Math::Round(tabWidths.GetNth(i) * surface->GetSurfaceDPI() / 96.0));
					frame.right = frame.left + 4;

					if (window->IsMouseOn(frame))
					{
						if (moveTab != i)
						{
							moveTab = i;

							Input::Pointer::SetCursor(window, Input::Pointer::CursorHSize);
						}
					}
					else if (moveTab == i)
					{
						moveTab = -1;

						Input::Pointer::SetCursor(window, Input::Pointer::CursorArrow);
					}
				}

				frame.left = realPos.x + 1;
				frame.top++;
				frame.bottom--;

				for (Int j = 0; j < tabWidths.Length(); j++)
				{
					frame.right = (Int) Math::Min(frame.left + Math::Abs(Math::Round(tabWidths.GetNth(j) * surface->GetSurfaceDPI() / 96.0)) - 2, realPos.x + GetRealSize().cx - 1);

					if (window->IsMouseOn(frame) && !tabChecked.GetNth(j) && moveTab == -1)
					{
						surface->StartPaint(frame);

						surface->Box(frame, Setup::LightGrayColor, Rect::Filled);
						surface->SetText(tabNames.GetNth(j), frame + Point(2, Math::Ceil(Float(frame.GetHeight() - font.GetScaledTextSizeY()) / 2) - 1) - Size(2, 0), font);

						surface->EndPaint();

						tabChecked.Set(tabChecked.GetNthIndex(j), True);
					}
					else if ((!window->IsMouseOn(frame) || moveTab != -1) && tabChecked.GetNth(j))
					{
						surface->StartPaint(frame);

						surface->Box(frame, Setup::BackgroundColor, Rect::Filled);
						surface->SetText(tabNames.GetNth(j), frame + Point(2, Math::Ceil(Float(frame.GetHeight() - font.GetScaledTextSizeY()) / 2) - 1) - Size(2, 0), font);

						surface->EndPaint();

						tabChecked.Set(tabChecked.GetNthIndex(j), False);
					}

					frame.left += (Int) Math::Abs(Math::Round(tabWidths.GetNth(j) * surface->GetSurfaceDPI() / 96.0));
				}
			}

			break;
	}

	return Widget::Process(message, wParam, lParam);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %r15
movq (%rdi), %rax
callq *0x88(%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x8638e
movq (%r15), %rax
movq %r15, %rdi
callq *0x98(%rax)
xorl %ebx, %ebx
testb %al, %al
je 0x8638e
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
testb %al, %al
je 0x8638e
cmpl $0x7800, %r12d          # imm = 0x7800
jne 0x8637c
cmpb $0x0, 0x5bc(%r15)
jne 0x8637c
movl %r14d, 0x48(%rsp)
movl %ebp, 0x4c(%rsp)
movq %r15, %rdi
callq 0x559e0
movq %rax, %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq %rax, %r13
movq (%r15), %rax
movq %r15, %rdi
callq *0x48(%rax)
movq %rax, %rbp
movq %rax, %rbx
shrq $0x20, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x50(%rax)
leal (%rax,%rbp), %ecx
shrq $0x20, %rax
movl %ebx, 0xc(%rsp)
movl %ecx, 0x10(%rsp)
addl %ebx, %eax
movq %r14, %rbx
movl %eax, 0x14(%rsp)
movq %rbp, 0x68(%rsp)
leal -0x2(%rbp), %eax
movl %eax, 0x8(%rsp)
leaq 0x630(%r15), %rax
movq %rax, 0x38(%rsp)
cmpl $0x2, 0x638(%r15)
jl 0x85f86
xorl %ebp, %ebp
movq 0x38(%rsp), %rdi
movl %ebp, %esi
callq 0x86b48
movl (%rax), %r14d
movq %r13, %rdi
callq 0x58930
cwtl
imull %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6e60d(%rip), %xmm0    # 0xf44f0
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
leaq 0x6e9c9(%rip), %rcx     # 0xf48c0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
orl $0x1, %ecx
testq %rax, %rax
movl $0x0, %edx
cmovel %edx, %ecx
imull %ecx, %eax
movl 0x8(%rsp), %ecx
leal (%rcx,%rax), %edx
movl %edx, 0x8(%rsp)
addl %ecx, %eax
addl $0x4, %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x578a0
testb %al, %al
je 0x85f55
cmpl 0x5b8(%r15), %ebp
je 0x85f73
movl %ebp, 0x5b8(%r15)
movl $0x3, %esi
jmp 0x85f6b
cmpl 0x5b8(%r15), %ebp
jne 0x85f73
movl $0xffffffff, 0x5b8(%r15) # imm = 0xFFFFFFFF
xorl %esi, %esi
movq %rbx, %rdi
callq 0x55d30
incl %ebp
movl 0x638(%r15), %eax
decl %eax
cmpl %eax, %ebp
jl 0x85eb8
movl %r12d, 0x44(%rsp)
movq 0x68(%rsp), %rax
incl %eax
movl %eax, 0x8(%rsp)
incl 0xc(%rsp)
decl 0x14(%rsp)
cmpl $0x0, 0x638(%r15)
movq 0x38(%rsp), %r12
movq %rbx, %rbp
movq %r15, %rbx
movq %r13, %r15
leaq 0x6e905(%rip), %r13     # 0xf48c0
jle 0x8636b
leaq 0x6e0(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x5d8(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x140(%rbx), %rax
movq %rax, 0x50(%rsp)
xorl %r14d, %r14d
movq %rbp, 0x70(%rsp)
movq %r15, 0x60(%rsp)
movslq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r12, %rdi
movl %r14d, %esi
callq 0x86b48
movl (%rax), %r12d
movq %r15, %rdi
callq 0x58930
cwtl
imull %r12d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6e4ca(%rip), %xmm0    # 0xf44f0
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
addsd (%r13,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
orq $0x1, %rcx
testq %rax, %rax
cmoveq %rax, %rcx
imulq %rax, %rcx
movq 0x18(%rsp), %rax
leaq (%rax,%rcx), %r12
addq $-0x2, %r12
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x50(%rax)
movq 0x68(%rsp), %rcx
addl %ecx, %eax
decl %eax
cltq
cmpq %r12, %rax
cmovlq %rax, %r12
movl %r12d, 0x10(%rsp)
movq %rbp, %r12
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x578a0
testb %al, %al
movq %rbx, %r15
je 0x861b7
movq 0x20(%rsp), %rdi
movl %r14d, %esi
callq 0x8101e
cmpb $0x0, (%rax)
jne 0x861b7
cmpl $-0x1, 0x5b8(%r15)
jne 0x861b7
movq 0x60(%rsp), %r13
movq %r13, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x55160
movq 0xe6ecb(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
movq $0x0, 0x28(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq 0xe66b3(%rip), %rdx     # 0x16c7a8
leaq 0x28(%rsp), %r8
callq 0x57930
movq 0x58(%rsp), %rdi
movl %r14d, %esi
callq 0x6b6a6
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %r12d
movl 0x14(%rsp), %ebx
movq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq 0xe6c8f(%rip), %rsi     # 0x16cdb8
callq 0x57680
addl %r12d, %eax
subl %eax, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x6e256(%rip), %xmm0    # 0xf4398
callq 0x56cb0
decl %eax
movl 0x8(%rsp), %ecx
movl 0x10(%rsp), %edx
addl $0x2, %ecx
movl 0xc(%rsp), %esi
addl %eax, %esi
shlq $0x20, %rsi
addl 0x14(%rsp), %eax
shlq $0x20, %rax
orq %rdx, %rax
orq %rsi, %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x57b80
movq %r13, %rdi
callq 0x58780
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x570f0
movq %rbx, %rdi
movl %eax, %esi
leaq 0x71471(%rip), %rdx     # 0xf7623
jmp 0x862de
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x578a0
testb %al, %al
movq 0x60(%rsp), %r13
je 0x861db
cmpl $-0x1, 0x5b8(%r15)
je 0x862e3
movq 0x20(%rsp), %rdi
movl %r14d, %esi
callq 0x8101e
cmpb $0x1, (%rax)
jne 0x862e3
movq %r13, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x55160
movq 0xe6da0(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
movq $0x0, 0x28(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq 0xe62b0(%rip), %rdx     # 0x16c4d0
leaq 0x28(%rsp), %r8
callq 0x57930
movq 0x58(%rsp), %rdi
movl %r14d, %esi
callq 0x6b6a6
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %ebx
movl 0x14(%rsp), %r12d
movq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq 0xe6b64(%rip), %rsi     # 0x16cdb8
callq 0x57680
addl %ebx, %eax
subl %eax, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
mulsd 0x6e12a(%rip), %xmm0    # 0xf4398
callq 0x56cb0
decl %eax
movl 0x8(%rsp), %ecx
movl 0x10(%rsp), %edx
addl $0x2, %ecx
movl 0xc(%rsp), %esi
addl %eax, %esi
shlq $0x20, %rsi
addl 0x14(%rsp), %eax
shlq $0x20, %rax
orq %rdx, %rax
orq %rsi, %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x57b80
movq %r13, %rdi
callq 0x58780
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x570f0
movq %rbx, %rdi
movl %eax, %esi
leaq 0x71344(%rip), %rdx     # 0xf7622
callq 0x83dd8
movq 0x38(%rsp), %r12
movq %r12, %rdi
movl %r14d, %esi
callq 0x86b48
movl (%rax), %ebx
movq %r13, %rdi
callq 0x58930
cwtl
imull %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x6e1e0(%rip), %xmm1    # 0xf44f0
divsd %xmm1, %xmm0
xorl %eax, %eax
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
seta %al
movq %r15, %rbx
movq %r13, %r15
leaq 0x6e592(%rip), %r13     # 0xf48c0
addsd (%r13,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
orl $0x1, %ecx
testq %rax, %rax
movl $0x0, %edx
cmovel %edx, %ecx
imull %ecx, %eax
addl %eax, 0x8(%rsp)
incl %r14d
cmpl 0x638(%rbx), %r14d
movq 0x70(%rsp), %rbp
jl 0x85ff2
movl 0x4c(%rsp), %ebp
movl 0x48(%rsp), %r14d
movl 0x44(%rsp), %r12d
movq %rbx, %r15
movq %r15, %rdi
movl %r12d, %esi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x58220
movl %eax, %ebx
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop