// File: /workspace/github_c_makefile_star2_O3/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 0x85e72
movq (%r15), %rax
movq %r15, %rdi
callq *0x98(%rax)
xorl %ebx, %ebx
testb %al, %al
je 0x85e72
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
testb %al, %al
je 0x85e72
cmpl $0x7800, %r12d          # imm = 0x7800
jne 0x85e60
cmpb $0x0, 0x5bc(%r15)
jne 0x85e60
movl %r12d, 0x3c(%rsp)
movl %r14d, 0x40(%rsp)
movl %ebp, 0x44(%rsp)
movq %r15, %rdi
callq 0x559e0
movq %rax, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq %rax, %r13
movq (%r15), %rax
movq %r15, %rdi
callq *0x48(%rax)
movq %rax, %r12
movq %rax, %r14
shrq $0x20, %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x50(%rax)
leal (%rax,%r12), %edx
movq %rax, %rcx
shrq $0x20, %rcx
movl %r14d, 0xc(%rsp)
movl %edx, 0x10(%rsp)
addl %r14d, %ecx
movl %ecx, 0x14(%rsp)
movq %r12, 0x60(%rsp)
leal -0x2(%r12), %eax
movl %eax, 0x8(%rsp)
leaq 0x630(%r15), %r12
movl 0x638(%r15), %edx
leaq 0x6de3b(%rip), %rsi     # 0xf37f0
cmpl $0x2, %edx
jl 0x85a96
xorl %ebp, %ebp
movq %r12, %rdi
movl %ebp, %esi
callq 0x8661e
movl (%rax), %r14d
movq %r13, %rdi
callq 0x58930
cwtl
imull %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6dccf(%rip), %xmm0    # 0xf36b8
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
leaq 0x6ddf3(%rip), %rcx     # 0xf37f0
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
movl 0x5b8(%r15), %ecx
testb %al, %al
je 0x85a58
movl $0x3, %esi
movl %ebp, %eax
cmpl %ecx, %ebp
jne 0x85a63
jmp 0x85a72
cmpl %ecx, %ebp
jne 0x85a72
xorl %esi, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x5b8(%r15)
movq %rbx, %rdi
callq 0x55d30
incl %ebp
movl 0x638(%r15), %edx
leal -0x1(%rdx), %eax
cmpl %eax, %ebp
jl 0x859c0
movl 0xc(%rsp), %r14d
movl 0x14(%rsp), %ecx
leaq 0x6dd5a(%rip), %rsi     # 0xf37f0
movq 0x60(%rsp), %rax
incl %eax
movl %eax, 0x8(%rsp)
incl %r14d
movl %r14d, 0xc(%rsp)
decl %ecx
movl %ecx, 0x14(%rsp)
testl %edx, %edx
jle 0x85e52
leaq 0x6e0(%r15), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x5d8(%r15), %rcx
movq %rcx, 0x50(%rsp)
leaq 0x140(%r15), %rcx
movq %rcx, 0x48(%rsp)
xorl %r14d, %r14d
movq %rbx, 0x70(%rsp)
movq %r12, 0x68(%rsp)
movq %r13, 0x58(%rsp)
cltq
movq %rax, 0x18(%rsp)
movq %r12, %rdi
movq %r15, %rbp
movq %rbx, %r15
movq %rsi, %rbx
movl %r14d, %esi
callq 0x8661e
movl (%rax), %r12d
movq %r13, %rdi
callq 0x58930
cwtl
imull %r12d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6db91(%rip), %xmm0    # 0xf36b8
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
addsd (%rbx,%rax,8), %xmm0
movq %r15, %rbx
movq %rbp, %r15
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 (%rbp), %rax
movq %rbp, %rdi
callq *0x50(%rax)
movq 0x60(%rsp), %rcx
addl %ecx, %eax
decl %eax
cltq
cmpq %r12, %rax
cmovlq %rax, %r12
movl %r12d, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x578a0
testb %al, %al
je 0x85c9a
movq 0x30(%rsp), %rdi
movl %r14d, %esi
callq 0x80b58
cmpb $0x0, (%rax)
jne 0x85c9a
cmpl $-0x1, 0x5b8(%r15)
jne 0x85c9a
movq 0x58(%rsp), %r13
movq %r13, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x55160
movq 0xe63cb(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
movq $0x0, 0x20(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq 0xe5bb3(%rip), %rdx     # 0x16b7a8
leaq 0x20(%rsp), %r8
callq 0x57930
movq 0x50(%rsp), %rdi
movl %r14d, %esi
callq 0x6b610
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %r12d
movl 0x14(%rsp), %ebx
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
movq 0xe618f(%rip), %rsi     # 0x16bdb8
callq 0x57680
addl %r12d, %eax
subl %eax, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x6d756(%rip), %xmm0    # 0xf3398
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, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x57b80
leaq 0x70ae1(%rip), %rbp     # 0xf6776
jmp 0x85da9
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x578a0
testb %al, %al
movq 0x68(%rsp), %r12
movq 0x58(%rsp), %r13
je 0x85cc3
cmpl $-0x1, 0x5b8(%r15)
je 0x85dd3
movq 0x30(%rsp), %rdi
movl %r14d, %esi
callq 0x80b58
cmpb $0x1, (%rax)
jne 0x85dd3
movq %r13, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x55160
movq 0xe62b8(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
movq $0x0, 0x20(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq 0xe57c8(%rip), %rdx     # 0x16b4d0
leaq 0x20(%rsp), %r8
callq 0x57930
movq 0x50(%rsp), %rdi
movl %r14d, %esi
callq 0x6b610
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %ebx
movl 0x14(%rsp), %r12d
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
movq 0xe607c(%rip), %rsi     # 0x16bdb8
callq 0x57680
addl %ebx, %eax
subl %eax, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
mulsd 0x6d642(%rip), %xmm0    # 0xf3398
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, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x57b80
leaq 0x709cc(%rip), %rbp     # 0xf6775
movq %r13, %rdi
callq 0x58780
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x570f0
movq %rbx, %rdi
movl %eax, %esi
movq %rbp, %rdx
callq 0x838c2
movq 0x68(%rsp), %r12
movq %r12, %rdi
movl %r14d, %esi
callq 0x8661e
movl (%rax), %ebx
movq %r13, %rdi
callq 0x58930
cwtl
imull %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x6d8bd(%rip), %xmm1    # 0xf36b8
divsd %xmm1, %xmm0
xorl %eax, %eax
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
seta %al
leaq 0x6d9dd(%rip), %rsi     # 0xf37f0
addsd (%rsi,%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 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
incl %r14d
cmpl 0x638(%r15), %r14d
movq 0x70(%rsp), %rbx
jl 0x85aed
movl 0x44(%rsp), %ebp
movl 0x40(%rsp), %r14d
movl 0x3c(%rsp), %r12d
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