// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/widgets/basic/groupbox.cpp
// Function: smooth::GUI::GroupBox::Paint(int)
S::Int S::GUI::GroupBox::Paint(Int message)
{
	if (!IsRegistered()) return Error();
	if (!IsVisible())    return Success();

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

				surface->Frame(frame, FRAME_DOWN);
				surface->Frame(frame + Point(1, 1) - Size(2, 2), FRAME_UP);

				Rect	 textRect = Rect(GetRealPosition() + Point(10 * surface->GetSurfaceDPI() / 96.0, -Math::Ceil(Float(scaledTextSize.cy) / 2)), Size(scaledTextSize.cx, Math::Round(scaledTextSize.cy * 1.2)) + Size(3, 0) * surface->GetSurfaceDPI() / 96.0);

				surface->Box(textRect, Setup::BackgroundColor, Rect::Filled);

				Font	 nFont	  = font;

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

				surface->SetText(text, textRect + Point(1, 0) * surface->GetSurfaceDPI() / 96.0, nFont);
			}

			break;
	}

	return Layer::Paint(message);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x88(%rax)
testb %al, %al
je 0x762f1
movq (%r14), %rax
movq %r14, %rdi
callq *0x90(%rax)
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x762f4
testl %ebx, %ebx
jne 0x762e5
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
movq %rax, %rbp
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
movq %rax, %r12
movq %rax, %r15
shrq $0x20, %r15
movq (%r14), %rax
movq %r14, %rdi
callq *0x50(%rax)
leal (%rax,%r12), %ecx
shrq $0x20, %rax
leaq 0x88(%rsp), %r13
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
movl %ecx, 0x8(%r13)
addl %r15d, %eax
movl %eax, 0xc(%r13)
pushq $0x1
popq %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x58ad0
movabsq $0x100000001, %rax      # imm = 0x100000001
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %r13, %rdi
callq 0x58930
leal -0x2(%rdx), %ecx
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
andq %rdx, %rsi
orq %rsi, %rcx
movabsq $-0x200000000, %rdx     # imm = 0xFFFFFFFE00000000
addq %rcx, %rdx
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %rbp, %r15
movq %rbp, (%rsp)
movq %rbp, %rdi
xorl %edx, %edx
callq 0x58ad0
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
movq %rax, %r12
movq %rax, %rbp
shrq $0x20, %rbp
movq %r15, %rdi
callq 0x59c60
cwtl
imull $0xa, %eax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6d3c0(%rip), %xmm0    # 0xe3510
cvttsd2si %xmm0, %r15d
cvtsi2sdl 0x18c(%r14), %xmm0
mulsd 0x6d21a(%rip), %xmm0    # 0xe3380
callq 0x57e30
addl %r12d, %r15d
subl %eax, %ebp
cvtsi2sdl 0x18c(%r14), %xmm0
mulsd 0x6fa2f(%rip), %xmm0    # 0xe5bb0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x6d7db(%rip), %rcx     # 0xe3970
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x8(%rsp)
movl 0x188(%r14), %r13d
addl %r15d, %r13d
leaq 0x28(%rsp), %rax
movq $0x3, (%rax)
movq (%rsp), %r12
movq %r12, %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
leaq 0x28(%rsp), %rdi
callq 0x57480
leaq 0x38(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x38(%rsp), %rdi
movsd 0x6d326(%rip), %xmm0    # 0xe3510
callq 0x59050
leal (%rax,%r13), %ecx
shrq $0x20, %rax
leaq 0x18(%rsp), %rdx
movl %r15d, (%rdx)
movl %ebp, 0x4(%rdx)
movl %ecx, 0x8(%rdx)
addl %ebp, %eax
addl 0x8(%rsp), %eax
movl %eax, 0xc(%rdx)
movq 0xebd93(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x38(%rsp), %rax
andq $0x0, (%rax)
movq 0xeb2a9(%rip), %rdx     # 0x1614d0
leaq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %r8
movq %r12, %rdi
callq 0x58b80
leaq 0x140(%r14), %rsi
leaq 0x38(%rsp), %rdi
callq 0x56bf0
movq (%r14), %rax
movq %r14, %rdi
callq *0x98(%rax)
testb %al, %al
jne 0x7626b
movq 0xeb6ef(%rip), %rsi     # 0x161950
leaq 0x38(%rsp), %rdi
callq 0x59940
movq $0x1, 0x10(%rsp)
movq %r12, %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
leaq 0x10(%rsp), %rdi
callq 0x570c0
leaq 0x78(%rsp), %rdi
movq %rax, (%rdi)
movsd 0x6d275(%rip), %xmm0    # 0xe3510
callq 0x59600
leaq 0x80(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rdi
callq 0x58930
leaq 0xf0(%r14), %rsi
leaq 0x28(%rsp), %r8
movq %rax, (%r8)
movq %rdx, 0x8(%r8)
leaq 0x38(%rsp), %rcx
movq %r12, %rdi
movq %r8, %rdx
xorl %r8d, %r8d
callq 0x58df0
leaq 0x38(%rsp), %rdi
callq 0x57860
movq %r14, %rdi
movl %ebx, %esi
callq 0x575f0
jmp 0x762f4
pushq $-0x1
popq %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x76308
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x57860
movq %rbx, %rdi
callq 0x58260
nop