// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/multi/list/listboxheader.cpp
// Function: smooth::GUI::ListBoxHeader::Paint(int)
S::Int S::GUI::ListBoxHeader::Paint(Int message)
{
	if (!IsRegistered()) return Error();
	if (!IsVisible())    return Success();

	switch (message)
	{
		case SP_PAINT:
			{
				Surface	*surface = GetDrawSurface();
				Point	 realPos = GetRealPosition();
				Rect	 frame	 = Rect(GetRealPosition(), GetRealSize());

				surface->Box(frame, Setup::BackgroundColor, Rect::Filled);
				surface->Frame(frame, FRAME_UP);

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

					surface->Box(frame, Setup::BackgroundColor, Rect::Filled);
					surface->Frame(frame, FRAME_UP);

					Font	 nFont = font;

					if (!IsActive()) nFont.SetColor(Setup::InactiveTextColor);

					surface->SetText(tabNames.GetNth(i), frame + Point(3, Math::Ceil(Float(frame.GetHeight() - font.GetScaledTextSizeY()) / 2) - 1) - Size(5, 0), nFont);

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

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x120(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xb4854
leaq -0x28(%rbp), %rdi
movq %rdi, -0x130(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x130(%rbp), %rdi
callq 0x59680
movl %eax, -0x124(%rbp)
jmp 0xb4823
movl -0x124(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xb4dbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xb4dca
movq -0x120(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xb48bd
leaq -0x48(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x5ca80
movq -0x140(%rbp), %rdi
callq 0x59680
movl %eax, -0x134(%rbp)
jmp 0xb488c
movl -0x134(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xb4dbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xb4dca
movl -0x14(%rbp), %eax
testl %eax, %eax
jne 0xb4d66
jmp 0xb48ca
movq -0x120(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0x120(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x120(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x120(%rbp), %rdi
movq %rax, -0x70(%rbp)
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x78(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x59ff0
movq -0x50(%rbp), %rax
movq %rax, -0x150(%rbp)
movq 0x15466f(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x144(%rbp)
leaq -0x80(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x150(%rbp), %rdi
movl -0x144(%rbp), %ecx
leaq -0x68(%rbp), %rsi
movq 0x153b4a(%rip), %rdx    # 0x2084a8
leaq -0x80(%rbp), %r8
callq 0x5c110
movq -0x50(%rbp), %rdi
leaq -0x68(%rbp), %rsi
xorl %edx, %edx
callq 0x5c050
movl $0x0, -0x84(%rbp)
movq -0x120(%rbp), %rdi
movl -0x84(%rbp), %eax
movl %eax, -0x154(%rbp)
addq $0x630, %rdi            # imm = 0x630
callq 0x5c990
movl %eax, %ecx
movl -0x154(%rbp), %eax
cmpl %ecx, %eax
jge 0xb4d64
movq -0x120(%rbp), %rdi
movslq -0x68(%rbp), %rax
movq %rax, -0x198(%rbp)
addq $0x630, %rdi            # imm = 0x630
movl -0x84(%rbp), %esi
callq 0xb5a70
movl (%rax), %eax
movl %eax, -0x19c(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
movw %ax, %cx
movl -0x19c(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xd2ac1(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rdi
callq 0x5a5d0
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movq -0x198(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x188(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x18c(%rbp)
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movl -0x18c(%rbp), %esi
movq -0x188(%rbp), %rdi
movq %rax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
addl %eax, %esi
callq 0x5ab50
movl %eax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x180(%rbp)
movq 0x15452d(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0x174(%rbp)
leaq -0x94(%rbp), %rdi
movq %rdi, -0x170(%rbp)
xorl %edx, %edx
movl %edx, -0x15c(%rbp)
movl %edx, %esi
callq 0x59260
movq -0x180(%rbp), %rdi
movl -0x174(%rbp), %ecx
movq -0x170(%rbp), %r8
movq 0x1539f5(%rip), %rdx    # 0x2084a8
leaq -0x68(%rbp), %rsi
movq %rsi, -0x168(%rbp)
callq 0x5c110
movq -0x168(%rbp), %rsi
movl -0x15c(%rbp), %edx
movq -0x50(%rbp), %rdi
callq 0x5c050
movq -0x120(%rbp), %rsi
addq $0x140, %rsi            # imm = 0x140
leaq -0xd8(%rbp), %rdi
callq 0x59da0
movq -0x120(%rbp), %rdi
movq (%rdi), %rax
movq 0x98(%rax), %rax
callq *%rax
movb %al, -0x155(%rbp)
jmp 0xb4b0e
movb -0x155(%rbp), %al
testb $0x1, %al
jne 0xb4b4e
jmp 0xb4b1a
movq 0x153e0f(%rip), %rsi    # 0x208930
leaq -0xd8(%rbp), %rdi
callq 0x5d110
jmp 0xb4b2f
jmp 0xb4b4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5abf0
jmp 0xb4dca
movq -0x120(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x1b0(%rbp)
addq $0x5d8, %rdi            # imm = 0x5D8
movl -0x84(%rbp), %esi
callq 0x81b20
movq %rax, -0x1a8(%rbp)
jmp 0xb4b7b
leaq -0x68(%rbp), %rdi
callq 0x591a0
movl %eax, -0x1b4(%rbp)
jmp 0xb4b8c
movq -0x120(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movq 0x154207(%rip), %rsi    # 0x208da8
callq 0x5bde0
movl %eax, -0x1b8(%rbp)
jmp 0xb4bae
movl -0x1b8(%rbp), %ecx
movl -0x1b4(%rbp), %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xd27c0(%rip), %xmm1    # 0x187388
mulsd %xmm1, %xmm0
callq 0x5b240
movq %rax, -0x1c0(%rbp)
jmp 0xb4bda
movq -0x1c0(%rbp), %rax
movl %eax, %edx
decl %edx
leaq -0x100(%rbp), %rdi
movl $0x3, %esi
callq 0x5c2c0
jmp 0xb4bf8
leaq -0x68(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x5be80
movq %rdx, -0x1d0(%rbp)
movq %rax, -0x1c8(%rbp)
jmp 0xb4c18
movq -0x1d0(%rbp), %rax
movq -0x1c8(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
leaq -0x108(%rbp), %rdi
movl $0x5, %esi
xorl %edx, %edx
callq 0x59260
jmp 0xb4c49
leaq -0xf8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x5c040
movq %rdx, -0x1e0(%rbp)
movq %rax, -0x1d8(%rbp)
jmp 0xb4c6c
movq -0x1a8(%rbp), %rsi
movq -0x1b0(%rbp), %rdi
movq -0x1e0(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
movq %rax, -0xe0(%rbp)
leaq -0xe8(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
xorl %r8d, %r8d
callq 0x5c3f0
jmp 0xb4cae
movq -0x120(%rbp), %rdi
addq $0x630, %rdi            # imm = 0x630
movl -0x84(%rbp), %esi
callq 0xb5a70
movq %rax, -0x1e8(%rbp)
jmp 0xb4cd0
movq -0x1e8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1f0(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5d470
movw %ax, -0x1ea(%rbp)
jmp 0xb4cf1
movl -0x1f0(%rbp), %eax
movw -0x1ea(%rbp), %cx
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xd27b0(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, -0x1f8(%rbp)
jmp 0xb4d22
movq -0x1f8(%rbp), %rdi
callq 0x5a5d0
movq %rax, -0x200(%rbp)
jmp 0xb4d37
movq -0x200(%rbp), %rax
addl -0x68(%rbp), %eax
movl %eax, -0x68(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5abf0
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xb4980
jmp 0xb4d66
leaq -0x118(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x5ca80
movq -0x210(%rbp), %rdi
callq 0x59680
movl %eax, -0x204(%rbp)
jmp 0xb4d8d
movl -0x204(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x5a410
jmp 0xb4dbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x5a410
jmp 0xb4dca
movl -0x4(%rbp), %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)