// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/basic/text.cpp
// Function: smooth::GUI::Text::SetFont(smooth::GUI::Font const&)
S::Int S::GUI::Text::SetFont(const Font &nFont)
{
	if (font == nFont) return Success();

	Surface	*surface    = GetDrawSurface();

	Bool	 registered = IsRegistered();
	Bool	 visible    = IsVisible();

	if (registered && visible)
	{
		Rect	 oldRect = Rect(GetRealPosition(), GetRealSize());
		Rect	 newRect = Rect(oldRect.GetPosition(), Size(nFont.GetScaledTextSizeX(text), nFont.GetScaledTextSizeY(text)));

		surface->StartPaint(Rect::EncloseRect(oldRect, newRect));
	}

	Widget::SetFont(nFont);

	SetSize(scaledTextSize * 96.0 / Surface().GetSurfaceDPI() + Size(0, 2));

	Paint(SP_PAINT);

	if (registered && visible) surface->EndPaint();

	return Success();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
addq $0x140, %rdi            # imm = 0x140
callq 0x58dc0
testb %al, %al
jne 0x7fe50
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
movq %rax, %r13
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x88(%rax)
movl %eax, %r12d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
andb %r12b, %al
movb %al, 0xf(%rsp)
cmpb $0x1, %al
jne 0x7fcee
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x48(%rax)
movq %r13, 0x10(%rsp)
movq %rax, %r13
movq %rax, %r12
shrq $0x20, %r12
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x50(%rax)
leal (%rax,%r13), %ecx
shrq $0x20, %rax
leaq 0x28(%rsp), %rdx
movl %r13d, (%rdx)
movl %r12d, 0x4(%rdx)
movl %ecx, 0x8(%rdx)
addl %r12d, %eax
movl %eax, 0xc(%rdx)
leaq 0xf0(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x56730
movl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x57680
leaq 0x18(%rsp), %rsi
movl %r13d, (%rsi)
movl %r12d, 0x4(%rsi)
addl %r13d, %ebp
movq 0x10(%rsp), %r13
movl %ebp, 0x8(%rsi)
addl %r12d, %eax
movl %eax, 0xc(%rsi)
leaq 0x28(%rsp), %rdi
callq 0x57450
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r13, %rdi
callq 0x55160
movq %rbx, %rdi
movq %r15, %rsi
callq 0x55eb0
movl 0x188(%rbx), %ebp
movl 0x18c(%rbx), %r15d
leaq 0x38(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x57150
movq %r14, %rdi
callq 0x58930
cvtsi2sd %r15d, %xmm3
movsd 0x747ba(%rip), %xmm4    # 0xf44f0
mulsd %xmm4, %xmm3
xorpd %xmm1, %xmm1
movapd %xmm3, %xmm5
cmpltsd %xmm1, %xmm5
movsd 0x74641(%rip), %xmm0    # 0xf4390
movapd %xmm5, %xmm6
andpd %xmm0, %xmm6
movsd 0x74639(%rip), %xmm2    # 0xf4398
andnpd %xmm2, %xmm5
orpd %xmm6, %xmm5
addsd %xmm3, %xmm5
cvttsd2si %xmm5, %rcx
xorps %xmm3, %xmm3
cvtsi2sd %ebp, %xmm3
mulsd %xmm4, %xmm3
movapd %xmm3, %xmm4
cmpltsd %xmm1, %xmm4
movapd %xmm4, %xmm5
andpd %xmm0, %xmm5
andnpd %xmm2, %xmm4
orpd %xmm5, %xmm4
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %rdx
cwtl
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
xorps %xmm4, %xmm4
cvtsi2sd %edx, %xmm4
divsd %xmm3, %xmm4
movapd %xmm4, %xmm5
cmpltsd %xmm1, %xmm5
movapd %xmm5, %xmm6
andpd %xmm0, %xmm6
andnpd %xmm2, %xmm5
orpd %xmm6, %xmm5
addsd %xmm4, %xmm5
cvttsd2si %xmm5, %rax
xorps %xmm4, %xmm4
cvtsi2sd %ecx, %xmm4
divsd %xmm3, %xmm4
movapd %xmm4, %xmm3
cmpltsd %xmm1, %xmm3
andpd %xmm3, %xmm0
andnpd %xmm2, %xmm3
orpd %xmm0, %xmm3
addsd %xmm4, %xmm3
cvttsd2si %xmm3, %rcx
shlq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
movabsq $0x200000000, %rcx      # imm = 0x200000000
addq %rax, %rcx
leaq 0x28(%rsp), %rdx
movq %rcx, (%rdx)
leaq 0xa8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
leaq 0x18(%rsp), %rdi
callq 0x57b20
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
callq *0x78(%rax)
cmpb $0x0, 0xf(%rsp)
je 0x7fe50
movq %r13, %rdi
callq 0x58780
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7fe63
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x57b20
movq %rbx, %rdi
callq 0x57090