// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/dialogs/messagebox.cpp
// Function: smooth::GUI::Dialogs::MessageDlg::MessageDlg(smooth::String const&, smooth::String const&, int, int, smooth::String const&, bool*)
S::GUI::Dialogs::MessageDlg::MessageDlg(const String &text, const String &title, Int buttons, Int iconID, const String &checkBoxText, Bool *cVar)
{
	/* Load message box icon if any.
	 */
	Bitmap	 icon;

#ifdef __WIN32__
	icon = ImageLoader::Load(String("Icon:").Append(String::FromInt(iconID)));
#else
	String	 iconName;
	Int	 iconSize = 32;

	if	(iconID == Message::Icon::Error)       iconName = "dialog-error.png";
	else if (iconID == Message::Icon::Question)    iconName = "dialog-question.png";
	else if (iconID == Message::Icon::Warning)     iconName = "dialog-warning.png";
	else if (iconID == Message::Icon::Information) iconName = "dialog-information.png";

	static const char	*iconDirs[] = { "%RESOURCESDIR%/icons", "/usr/share/icons", "/usr/local/share/icons", NIL };

	for (Int i = 0; iconDirs[i] != NIL; i++)
	{
		String	 iconDir = String(iconDirs[i]).Replace("%RESOURCESDIR%", S::System::System::GetResourcesDirectory());

		if (!Directory(iconDir).Exists()) continue;

		String	 file = String(iconDir).Append("/gnome/").Append(String::FromInt(iconSize)).Append("x").Append(String::FromInt(iconSize)).Append("/status/").Append(iconName);

		if (!File(file).Exists()) continue;

		icon = ImageLoader::Load(file);

		break;
	}
#endif

	/* Mirror question mark icon for Arabic script languages.
	 */
	if (iconID == Message::Icon::Question && I18n::Translator::defaultTranslator->TranslateString("?")[0] == 0x61F)
	{
		Point	 point;
		Size	 size = icon.GetSize();

		for (point.y = 0; point.y < size.cy; point.y++)
		{
			for (point.x = 0; point.x < size.cx / 2; point.x++)
			{
				Point	 mirror = Point(size.cx - point.x - 1, point.y);

				Color	 pointPixel  = icon.GetPixel(point);
				Color	 mirrorPixel = icon.GetPixel(mirror);

				icon.SetPixel(point, mirrorPixel);
				icon.SetPixel(mirror, pointPixel);
			}
		}
	}

	/* Create message box widgets.
	 */
	InitializeWidgets(text, title, buttons, icon, checkBoxText, cVar);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %r9, 0x98(%rsp)
movl %r8d, %r14d
movl %ecx, 0x38(%rsp)
movq %rdx, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdi, %rbx
callq 0x58870
movq 0xf7153(%rip), %rax     # 0x161d10
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x610(%rbx), %rdi
movq %rdi, 0x80(%rsp)
movq %rbx, 0x40(%rsp)
callq 0x64972
leaq 0x668(%rbx), %rdi
movq %rdi, 0x78(%rsp)
callq 0x6b712
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x59c80
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
movq %r14, 0x18(%rsp)
leal -0x7f01(%r14), %eax
cmpl $0x4, %eax
jae 0x6ac37
movl %eax, %eax
leaq 0x78d3d(%rip), %rcx     # 0xe3960
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0xa0(%rsp), %rdi
callq 0x57010
xorl %ebp, %ebp
leaq 0x118(%rsp), %r12
leaq 0x20(%rsp), %r13
leaq 0x60(%rsp), %r14
cmpq $0x18, %rbp
je 0x6ae9b
leaq 0xebe14(%rip), %rax     # 0x156a70
movq (%rbp,%rax), %rsi
movq %r12, %rdi
callq 0x58c40
movq %r13, %rdi
leaq 0x78d99(%rip), %rsi     # 0xe3a0c
callq 0x58c40
movq %r14, %rdi
callq 0x581b0
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x58800
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x58280
movq %r14, %rdi
callq 0x5a588
movq %r13, %rdi
callq 0x5a588
movq %r12, %rdi
callq 0x5a588
movq %r13, %rdi
xorl %esi, %esi
callq 0x5a180
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
movq %r13, %rdx
callq 0x59fb0
movq %r12, %rdi
callq 0x56480
movl %eax, %r15d
movq %r12, %rdi
callq 0x5a598
movq %r13, %rdi
callq 0x5a588
testb %r15b, %r15b
je 0x6ae43
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x58280
movq %r14, %rdi
leaq 0x78d13(%rip), %rsi     # 0xe3a1b
callq 0x58c40
movq %r12, %rdi
movq %r14, %rsi
callq 0x573e0
movq %rax, %r15
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
pushq $0x20
popq %rsi
callq 0x57e80
movq %r15, %rdi
movq %rbx, %rsi
callq 0x573e0
movq %rax, %r15
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x9968d(%rip), %rsi     # 0x1043db
callq 0x58c40
movq %r15, %rdi
movq %rbx, %rsi
callq 0x573e0
movq %rax, %r15
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
pushq $0x20
popq %rsi
callq 0x57e80
movq %r15, %rdi
movq %rbx, %rsi
callq 0x573e0
movq %rax, %r15
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x78c8f(%rip), %rsi     # 0xe3a23
callq 0x58c40
movq %r15, %rdi
movq %rbx, %rsi
callq 0x573e0
movq %rax, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x573e0
movq %r13, %rdi
movq %rax, %rsi
callq 0x58280
leaq 0xb8(%rsp), %rdi
callq 0x5a588
leaq 0xd0(%rsp), %rdi
callq 0x5a588
leaq 0xe8(%rsp), %rdi
callq 0x5a588
leaq 0x100(%rsp), %rdi
callq 0x5a588
movq %r14, %rdi
callq 0x5a588
movq %r12, %rdi
callq 0x5a588
movq %r14, %rdi
xorl %esi, %esi
callq 0x5a180
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x57940
movq %r12, %rdi
callq 0x580a0
movl %eax, %r15d
movq %r12, %rdi
callq 0x5a500
movq %r14, %rdi
callq 0x5a588
testb %r15b, %r15b
jne 0x6ae56
movq %r13, %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
addq $0x8, %rbp
jmp 0x6ac4b
leaq 0x118(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x59490
leaq 0x10(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x59570
leaq 0x118(%rsp), %rdi
callq 0x5a4c8
leaq 0x20(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
cmpl $0x7f02, 0x18(%rsp)     # imm = 0x7F02
jne 0x6afa9
movq 0xf6538(%rip), %rax     # 0x1613e8
movq (%rax), %rbx
leaq 0x7837f(%rip), %rsi     # 0xe3239
leaq 0x118(%rsp), %rdi
callq 0x58c40
leaq 0x118(%rsp), %rsi
movq %rbx, %rdi
callq 0x59510
movq %rax, %rdi
xorl %esi, %esi
callq 0x59270
movl %eax, %ebx
leaq 0x118(%rsp), %rdi
callq 0x5a588
cmpl $0x61f, %ebx            # imm = 0x61F
jne 0x6afa9
leaq 0x10(%rsp), %rdi
callq 0x596e0
movl (%rax), %edx
movl 0x4(%rax), %eax
movl %eax, 0x3c(%rsp)
pushq $0x2
popq %rcx
movl %edx, 0x18(%rsp)
movl %edx, %eax
cltd
idivl %ecx
movl %eax, %ebp
xorl %eax, %eax
leaq 0x118(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0x20(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x60(%rsp), %rbx
movl %eax, 0x24(%rsp)
cmpl 0x3c(%rsp), %eax
jge 0x6afa9
xorl %eax, %eax
movl %eax, 0x20(%rsp)
cmpl %ebp, %eax
jge 0x6afa1
notl %eax
addl 0x18(%rsp), %eax
movl 0x24(%rsp), %ecx
movl %eax, 0x60(%rsp)
movl %ecx, 0x64(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x57000
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x57000
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x57160
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x57160
movl 0x20(%rsp), %eax
incl %eax
jmp 0x6af47
movl 0x24(%rsp), %eax
incl %eax
jmp 0x6af3b
movq 0x230(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %r8
movq 0x40(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movl 0x38(%rsp), %ecx
movq 0x98(%rsp), %r9
callq 0x564b0
leaq 0xa0(%rsp), %rdi
callq 0x5a588
leaq 0x10(%rsp), %rdi
callq 0x5a4c8
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6b150
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x5a4c8
jmp 0x6b0cc
jmp 0x6b0b2
jmp 0x6b150
jmp 0x6b09d
movq %rax, %rbx
jmp 0x6b160
movq %rax, %rbx
jmp 0x6b16a
movq %rax, %rbx
jmp 0x6b174
movq %rax, %rbx
jmp 0x6b181
jmp 0x6b150
jmp 0x6b093
movq %rax, %rbx
jmp 0x6b114
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x5a500
jmp 0x6b077
jmp 0x6b085
jmp 0x6b0ad
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x5a588
jmp 0x6b0cc
jmp 0x6b08c
movq %rax, %rbx
jmp 0x6b0fd
jmp 0x6b0b2
movq %rax, %rbx
jmp 0x6b0e3
jmp 0x6b098
movq %rax, %rbx
jmp 0x6b0f0
movq %rax, %rbx
jmp 0x6b10a
movq %rax, %rbx
jmp 0x6b13f
movq %rax, %rbx
jmp 0x6b135
movq %rax, %rbx
jmp 0x6b121
movq %rax, %rbx
jmp 0x6b0cc
jmp 0x6b150
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x5a598
leaq 0x20(%rsp), %rdi
jmp 0x6b11c
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5a588
leaq 0xd0(%rsp), %rdi
callq 0x5a588
leaq 0xe8(%rsp), %rdi
callq 0x5a588
leaq 0x100(%rsp), %rdi
callq 0x5a588
leaq 0x60(%rsp), %rdi
callq 0x5a588
leaq 0x118(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
jmp 0x6b147
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x5a588
leaq 0x20(%rsp), %rdi
callq 0x5a588
leaq 0x118(%rsp), %rdi
callq 0x5a588
jmp 0x6b153
jmp 0x6b150
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5a588
leaq 0x10(%rsp), %rdi
callq 0x5a4c8
movq 0x78(%rsp), %rdi
callq 0x5c22c
movq 0x80(%rsp), %rdi
callq 0x64988
movq 0x40(%rsp), %rdi
callq 0x56b80
movq %rbx, %rdi
callq 0x58260
nop