// File: /workspace/github_c_makefile_star2_O3/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 0x57650
movq 0x1017d1(%rip), %rax    # 0x16bd10
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x610(%rbx), %rdi
movq %rdi, 0x80(%rsp)
movq %rbx, 0x40(%rsp)
callq 0x55d90
leaq 0xf5d4a(%rip), %rax     # 0x1602b0
movq %rax, 0x650(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x658(%rbx)
leaq 0xf5c92(%rip), %rax     # 0x160210
movq %rax, 0x610(%rbx)
leaq 0x668(%rbx), %rdi
movq %rdi, 0x78(%rsp)
callq 0x55d90
leaq 0xf5263(%rip), %rax     # 0x15f800
movq %rax, 0x6a8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x6b0(%rbx)
leaq 0xf64e3(%rip), %rax     # 0x160a98
movq %rax, 0x668(%rbx)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x58950
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
movq %r14, 0x18(%rsp)
leal -0x7f01(%r14), %eax
cmpl $0x4, %eax
jae 0x6a605
movl %eax, %eax
leaq 0x8939f(%rip), %rcx     # 0xf3990
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0xa0(%rsp), %rdi
callq 0x55f40
xorl %ebp, %ebp
leaq 0x118(%rsp), %r12
leaq 0x20(%rsp), %r13
leaq 0x60(%rsp), %r14
leaq 0xf6430(%rip), %rax     # 0x160a50
movq (%rbp,%rax), %rsi
movq %r12, %rdi
callq 0x579f0
movq %r13, %rdi
leaq 0x893f5(%rip), %rsi     # 0xf3a2c
callq 0x579f0
movq %r14, %rdi
callq 0x56ff0
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x575f0
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x570b0
movq %r14, %rdi
callq 0x59200
movq %r13, %rdi
callq 0x59200
movq %r12, %rdi
callq 0x59200
movq %r13, %rdi
xorl %esi, %esi
callq 0x58e20
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
movq %r13, %rdx
callq 0x58c60
movq %r12, %rdi
callq 0x55440
movl %eax, %ebx
movq %r12, %rdi
callq 0x59210
movq %r13, %rdi
callq 0x59200
testb %bl, %bl
je 0x6a807
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x570b0
movq %r14, %rdi
leaq 0x89371(%rip), %rsi     # 0xf3a3b
callq 0x579f0
movq %r12, %rdi
movq %r14, %rsi
callq 0x562f0
movq %rax, %rbx
movl $0x20, %esi
leaq 0x100(%rsp), %r15
movq %r15, %rdi
callq 0x56cf0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
leaq 0xe8(%rsp), %r15
movq %r15, %rdi
leaq 0xa9e39(%rip), %rsi     # 0x11454b
callq 0x579f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
movl $0x20, %esi
leaq 0xd0(%rsp), %r15
movq %r15, %rdi
callq 0x56cf0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
leaq 0x892e9(%rip), %rsi     # 0xf3a43
callq 0x579f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x562f0
movq %r13, %rdi
movq %rax, %rsi
callq 0x570b0
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
leaq 0x100(%rsp), %rdi
callq 0x59200
movq %r14, %rdi
callq 0x59200
movq %r12, %rdi
callq 0x59200
movq %r14, %rdi
xorl %esi, %esi
callq 0x58e20
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x56800
movq %r12, %rdi
callq 0x56ef0
movl %eax, %ebx
movq %r12, %rdi
callq 0x59178
movq %r14, %rdi
callq 0x59200
testb %bl, %bl
jne 0x6a820
movq %r13, %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
addq $0x8, %rbp
cmpl $0x18, %ebp
jne 0x6a619
jmp 0x6a865
leaq 0x118(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x581f0
leaq 0x10(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x582c0
leaq 0x118(%rsp), %rdi
callq 0x59148
leaq 0x20(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
cmpl $0x7f02, 0x18(%rsp)     # imm = 0x7F02
jne 0x6a991
movq 0x100b6e(%rip), %rax    # 0x16b3e8
movq (%rax), %rbx
leaq 0x889ce(%rip), %rsi     # 0xf3252
leaq 0x118(%rsp), %rdi
callq 0x579f0
leaq 0x118(%rsp), %rsi
movq %rbx, %rdi
callq 0x58260
movq %rax, %rdi
xorl %esi, %esi
callq 0x57fe0
movl %eax, %ebx
leaq 0x118(%rsp), %rdi
callq 0x59200
cmpl $0x61f, %ebx            # imm = 0x61F
jne 0x6a991
leaq 0x10(%rsp), %rdi
callq 0x58410
movl (%rax), %ecx
movl %ecx, 0x18(%rsp)
movl 0x4(%rax), %eax
movl $0x0, 0x24(%rsp)
movl %eax, 0x3c(%rsp)
testl %eax, %eax
jle 0x6a991
movl 0x18(%rsp), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
xorl %eax, %eax
leaq 0x118(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0x20(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x60(%rsp), %r13
movl $0x0, 0x20(%rsp)
cmpl $0x2, 0x18(%rsp)
jl 0x6a985
xorl %eax, %eax
notl %eax
addl 0x18(%rsp), %eax
movl 0x24(%rsp), %ecx
movl %eax, 0x60(%rsp)
movl %ecx, 0x64(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x55f30
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x55f30
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x56080
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x56080
movl 0x20(%rsp), %eax
incl %eax
movl %eax, 0x20(%rsp)
cmpl %ebp, %eax
jl 0x6a929
movl 0x24(%rsp), %eax
incl %eax
movl %eax, 0x24(%rsp)
cmpl 0x3c(%rsp), %eax
jl 0x6a918
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 0x55470
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0x10(%rsp), %rdi
callq 0x59148
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6ab32
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x59148
jmp 0x6aa9f
jmp 0x6aa8a
jmp 0x6ab32
jmp 0x6aaab
movq %rax, %rbx
jmp 0x6ab42
movq %rax, %rbx
jmp 0x6ab4c
movq %rax, %rbx
jmp 0x6ab56
movq %rax, %rbx
jmp 0x6ab63
jmp 0x6ab32
jmp 0x6aa7b
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x59178
jmp 0x6aa5d
jmp 0x6aa80
movq %rax, %rbx
jmp 0x6aaf6
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x59200
jmp 0x6aa9f
jmp 0x6aa71
jmp 0x6aa76
jmp 0x6aa85
jmp 0x6aa8a
movq %rax, %rbx
jmp 0x6aadf
movq %rax, %rbx
jmp 0x6aac5
movq %rax, %rbx
jmp 0x6aaec
movq %rax, %rbx
jmp 0x6aad2
movq %rax, %rbx
jmp 0x6ab03
movq %rax, %rbx
jmp 0x6aa9f
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x59210
leaq 0x20(%rsp), %rdi
jmp 0x6aafe
jmp 0x6ab32
movq %rax, %rbx
jmp 0x6ab21
movq %rax, %rbx
jmp 0x6ab17
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
leaq 0x100(%rsp), %rdi
callq 0x59200
leaq 0x60(%rsp), %rdi
callq 0x59200
leaq 0x118(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
jmp 0x6ab29
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x59200
leaq 0x20(%rsp), %rdi
callq 0x59200
leaq 0x118(%rsp), %rdi
callq 0x59200
jmp 0x6ab35
jmp 0x6ab32
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0x10(%rsp), %rdi
callq 0x59148
movq 0x78(%rsp), %rdi
callq 0x5b0ee
movq 0x80(%rsp), %rdi
callq 0x63e3c
movq 0x40(%rsp), %rdi
callq 0x55b00
movq %rbx, %rdi
callq 0x57090
nop