// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/dialogs/tipodaydlg.cpp
// Function: smooth::GUI::Dialogs::TipOfTheDay::ShowDialog()
const Error &S::GUI::Dialogs::TipOfTheDay::ShowDialog()
{
	if (caption != NIL) dlgwnd->SetText(caption);

	/* Compute and set dialog size.
	 */
	Rect	 workArea	= System::Screen::GetActiveScreenWorkArea();
	Float	 scaleFactor	= Surface().GetSurfaceDPI() / 96.0;

	Int	 additionalSize = Math::Max(0, check_showtips->GetWidth() + btn_next->GetWidth() - 234);
	Size	 size		= Size(328 + additionalSize, 182);

	foreach (const String &tip, tips) size = Size(Math::Max(size.cx, font.GetUnscaledTextSizeX(tip) + 12),
						      Math::Max(size.cy, font.GetUnscaledTextSizeY(tip) + 12));

	dlgwnd->SetSize(Size(24, 120) + size);
	dlgwnd->SetPosition(workArea.GetPosition() + Point((workArea.GetWidth()  - Math::Round(dlgwnd->GetWidth()  * scaleFactor)) / 2,
							   (workArea.GetHeight() - Math::Round(dlgwnd->GetHeight() * scaleFactor)) / 2));

	layer_inner->SetSize(size);
	txt_tip->SetSize(size);

	/* Set next tip and display dialog.
	 */
	if (offset >= tips.Length()) offset = 0;

	OnNext();

	if (tips.Length() <= 1) btn_next->Deactivate();

	dlgwnd->Show();
	dlgwnd->WaitUntilClosed();

	return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
addq $0x5b8, %rdi            # imm = 0x5B8
xorl %esi, %esi
callq 0x5b110
testb $0x1, %al
jne 0x8465e
jmp 0x8467c
movq -0x90(%rbp), %rsi
movq 0x5e8(%rsi), %rdi
addq $0x5b8, %rsi            # imm = 0x5B8
movq (%rdi), %rax
callq *0xa0(%rax)
callq 0x5c790
movq %rax, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x59230
movq -0xa8(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x5b7d0
movq -0xa0(%rbp), %rdi
callq 0x5d470
movw %ax, -0x92(%rbp)
jmp 0x846c9
movw -0x92(%rbp), %ax
cwtl
cvtsi2sd %eax, %xmm0
movsd 0x102de3(%rip), %xmm1   # 0x1874c0
divsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5c380
movsd -0xb8(%rbp), %xmm0
movq -0x90(%rbp), %rax
movsd %xmm0, -0x20(%rbp)
movq 0x610(%rax), %rdi
callq 0x5a210
movl %eax, %ecx
movq -0x90(%rbp), %rax
movl %ecx, -0xac(%rbp)
movq 0x608(%rax), %rdi
callq 0x5a210
movl -0xac(%rbp), %esi
addl %eax, %esi
subl $0xea, %esi
xorl %edi, %edi
callq 0x5aae0
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %esi
addl $0x148, %esi            # imm = 0x148
leaq -0x48(%rbp), %rdi
movl $0xb6, %edx
callq 0x59260
movl $0x0, -0x4c(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
movb %al, -0xb9(%rbp)
jne 0x847aa
movq -0x90(%rbp), %rdi
movl -0x50(%rbp), %eax
movl %eax, -0xc0(%rbp)
addq $0x640, %rdi            # imm = 0x640
callq 0x5c990
movl %eax, %ecx
movl -0xc0(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x847b9
jmp 0x848a2
movq -0x90(%rbp), %rdi
addq $0x640, %rdi            # imm = 0x640
movl -0x50(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x50(%rbp)
callq 0x819c0
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x4c(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x847eb
jmp 0x84892
movq -0x90(%rbp), %rdi
movl -0x48(%rbp), %eax
movl %eax, -0xcc(%rbp)
addq $0x140, %rdi            # imm = 0x140
movq -0x58(%rbp), %rsi
callq 0x5c860
movl -0xcc(%rbp), %edi
movl %eax, %esi
addl $0xc, %esi
callq 0x5aae0
movq -0x90(%rbp), %rdi
movl %eax, -0xc4(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0xc8(%rbp)
addq $0x140, %rdi            # imm = 0x140
movq -0x58(%rbp), %rsi
callq 0x5d5e0
movl -0xc8(%rbp), %edi
movl %eax, %esi
addl $0xc, %esi
callq 0x5aae0
movl -0xc4(%rbp), %esi
movl %eax, %edx
leaq -0x60(%rbp), %rdi
callq 0x59260
movq -0x60(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x847d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5c380
jmp 0x84ac4
jmp 0x84894
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8476a
movq -0x90(%rbp), %rax
movq 0x5e8(%rax), %rax
movq %rax, -0xf8(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x18, %esi
movl $0x78, %edx
callq 0x59260
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x590b0
movq -0xf8(%rbp), %rdi
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rsi
callq 0x5de18
movq -0x90(%rbp), %rax
movq 0x5e8(%rax), %rax
movq %rax, -0xd8(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x5d510
movq %rax, -0x80(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x5a5a0
movl %eax, %ecx
movq -0x90(%rbp), %rax
movslq %ecx, %rcx
movq %rcx, -0xf0(%rbp)
movq 0x5e8(%rax), %rdi
callq 0x5a210
cvtsi2sd %eax, %xmm0
mulsd -0x20(%rbp), %xmm0
callq 0x5a970
movq %rax, %rcx
movq -0xf0(%rbp), %rax
subq %rcx, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movl %eax, -0xe4(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x591a0
movl %eax, %ecx
movq -0x90(%rbp), %rax
movslq %ecx, %rcx
movq %rcx, -0xe0(%rbp)
movq 0x5e8(%rax), %rdi
callq 0x5b860
cvtsi2sd %eax, %xmm0
mulsd -0x20(%rbp), %xmm0
callq 0x5a970
movl -0xe4(%rbp), %esi
movq %rax, %rcx
movq -0xe0(%rbp), %rax
subq %rcx, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movl %eax, %edx
leaq -0x88(%rbp), %rdi
callq 0x5c2c0
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5ca20
movq -0xd8(%rbp), %rdi
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x5d8c0
movq -0x90(%rbp), %rax
movq 0x630(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5de18
movq -0x90(%rbp), %rax
movq 0x628(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5de18
movq -0x90(%rbp), %rdi
movl 0x69c(%rdi), %eax
movl %eax, -0xd0(%rbp)
addq $0x640, %rdi            # imm = 0x640
callq 0x5c990
movl %eax, %ecx
movl -0xd0(%rbp), %eax
cmpl %ecx, %eax
jl 0x84a4f
movq -0x90(%rbp), %rax
movl $0x0, 0x69c(%rax)
movq -0x90(%rbp), %rdi
callq 0x5de80
movq -0x90(%rbp), %rdi
addq $0x640, %rdi            # imm = 0x640
callq 0x5c990
cmpl $0x1, %eax
jg 0x84a87
movq -0x90(%rbp), %rax
movq 0x608(%rax), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq -0x90(%rbp), %rax
movq 0x5e8(%rax), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq -0x90(%rbp), %rax
movq 0x5e8(%rax), %rdi
callq 0x5a7d0
movq -0x90(%rbp), %rax
addq $0x5d8, %rax            # imm = 0x5D8
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)