// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x88(%rax)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
je 0x773dd
movq (%r14), %rax
movq %r14, %rdi
callq *0x90(%rax)
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x773dd
testl %ebx, %ebx
jne 0x773d3
movl %ebx, 0x4(%rsp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
movq %rax, %rbx
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 0x68(%rsp), %r13
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
movl %ecx, 0x8(%r13)
addl %r15d, %eax
movl %eax, 0xc(%r13)
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x57890
movl (%r13), %eax
movl 0x4(%r13), %ecx
incl %eax
incl %ecx
shlq $0x20, %rcx
movl 0x8(%r13), %edx
movl 0xc(%r13), %esi
decl %edx
decl %esi
orq %rcx, %rax
shlq $0x20, %rsi
orq %rsi, %rdx
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x57890
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
movq %rax, %r13
movq %rax, %rbp
shrq $0x20, %rbp
movq %rbx, %rdi
callq 0x58930
cwtl
addl %eax, %eax
leal (%rax,%rax,4), %eax
cvtsi2sd %eax, %xmm0
divsd 0x7d3d6(%rip), %xmm0    # 0xf44f0
cvttsd2si %xmm0, %r12d
xorps %xmm0, %xmm0
cvtsi2sdl 0x18c(%r14), %xmm0
movsd 0x7d265(%rip), %xmm1    # 0xf4398
mulsd %xmm1, %xmm0
callq 0x56cb0
addl %r13d, %r12d
xorps %xmm0, %xmm0
cvtsi2sdl 0x18c(%r14), %xmm0
subl %eax, %ebp
mulsd 0x7fa0b(%rip), %xmm0    # 0xf6b60
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm1
cmpltsd %xmm2, %xmm1
movsd 0x7d226(%rip), %xmm3    # 0xf4390
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
movsd 0x7d21e(%rip), %xmm3    # 0xf4398
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %r13
movl 0x188(%r14), %r15d
addl %r12d, %r15d
movq %rbx, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x7d3b3(%rip), %xmm1    # 0xf4560
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm2
xorpd %xmm5, %xmm5
cmpltsd %xmm5, %xmm2
movapd %xmm2, %xmm3
movsd 0x7d1c6(%rip), %xmm6    # 0xf4390
andpd %xmm6, %xmm3
movsd 0x7d1c2(%rip), %xmm4    # 0xf4398
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
andpd 0x7fc41(%rip), %xmm0    # 0xf6e30
addsd %xmm4, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x7d2e9(%rip), %xmm3    # 0xf44f0
divsd %xmm3, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
movapd %xmm1, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd %xmm3, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
movapd %xmm6, %xmm2
andpd %xmm1, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
leaq 0x8(%rsp), %rsi
movl %r12d, (%rsi)
movl %ebp, 0x4(%rsi)
addl %r15d, %eax
movq %rbx, %r15
movl %eax, 0x8(%rsi)
addl %ebp, %r13d
addl %ecx, %r13d
movl %r13d, 0xc(%rsi)
movq 0xf5d29(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
leaq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0xf523c(%rip), %rdx     # 0x16c4d0
leaq 0x18(%rsp), %r8
movq %rbx, %rdi
callq 0x57930
leaq 0x140(%r14), %rsi
leaq 0x18(%rsp), %rdi
callq 0x55b70
movq (%r14), %rax
movq %r14, %rdi
callq *0x98(%rax)
testb %al, %al
jne 0x772d3
movq 0xf5687(%rip), %rsi     # 0x16c950
leaq 0x18(%rsp), %rdi
callq 0x58650
movq %r15, %rdi
callq 0x58930
movl 0x4(%rsp), %ebx
cwtl
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
leaq 0xf0(%r14), %rsi
movsd 0x7d09a(%rip), %xmm0    # 0xf4390
movapd %xmm0, %xmm2
testw %ax, %ax
js 0x77307
movsd 0x7d091(%rip), %xmm2    # 0xf4398
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
andpd 0x7fb18(%rip), %xmm1    # 0xf6e30
movsd 0x7d078(%rip), %xmm5    # 0xf4398
addsd %xmm5, %xmm1
cvttsd2si %xmm1, %rcx
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x7d1b8(%rip), %xmm6    # 0xf44f0
divsd %xmm6, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm1, %xmm3
cmpltsd %xmm2, %xmm3
movapd %xmm3, %xmm4
andpd %xmm0, %xmm4
andnpd %xmm5, %xmm3
orpd %xmm4, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %rax
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd %xmm6, %xmm1
movapd %xmm1, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm0
andnpd %xmm5, %xmm3
orpd %xmm0, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %rcx
movl 0x8(%rsp), %edi
addl %eax, %edi
movl 0xc(%rsp), %edx
addl %ecx, %edx
shlq $0x20, %rdx
addl 0x10(%rsp), %eax
addl 0x14(%rsp), %ecx
orq %rdx, %rdi
shlq $0x20, %rcx
orq %rcx, %rax
leaq 0x58(%rsp), %rdx
movq %rdi, (%rdx)
movq %rax, 0x8(%rdx)
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x57b80
leaq 0x18(%rsp), %rdi
callq 0x56720
movq %r14, %rdi
movl %ebx, %esi
callq 0x564e0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x773ee
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x56720
movq %rbx, %rdi
callq 0x57090
nop