// File: /workspace/github_c_makefile_star2_O1/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, 0x80(%rsp)
movl %r8d, %r14d
movl %ecx, 0x38(%rsp)
movq %rdx, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdi, %rbx
callq 0x57650
movq 0x102765(%rip), %rax    # 0x16cd10
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x610(%rbx), %rdi
movq %rdi, 0x68(%rsp)
movq %rbx, 0x40(%rsp)
callq 0x55d90
leaq 0xf6cc1(%rip), %rax     # 0x161290
movq %rax, 0x650(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x658(%rbx)
leaq 0xf6c09(%rip), %rax     # 0x1611f0
movq %rax, 0x610(%rbx)
leaq 0x668(%rbx), %rdi
movq %rdi, 0x60(%rsp)
callq 0x55d90
leaq 0xf61da(%rip), %rax     # 0x1607e0
movq %rax, 0x6a8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x6b0(%rbx)
leaq 0xf745a(%rip), %rax     # 0x161a78
movq %rax, 0x668(%rbx)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x58950
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
movq %r14, 0x18(%rsp)
leal -0x7f01(%r14), %eax
cmpl $0x4, %eax
jae 0x6a66e
movl %eax, %eax
leaq 0x8a2be(%rip), %rcx     # 0xf4918
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x55f40
xorl %ebp, %ebp
leaq 0x118(%rsp), %r12
leaq 0xa0(%rsp), %r13
leaq 0x20(%rsp), %r14
movl %ebp, %eax
leaq 0xf73a2(%rip), %rcx     # 0x161a30
movq (%rcx,%rax,8), %rsi
movq %r12, %rdi
callq 0x579f0
movq %r13, %rdi
leaq 0x8a310(%rip), %rsi     # 0xf49b4
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 0x6a8b8
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x570b0
movq %r14, %rdi
leaq 0x8a28c(%rip), %rsi     # 0xf49c3
callq 0x579f0
movq %r12, %rdi
movq %r14, %rsi
callq 0x562f0
movq %rax, %rbx
movl $0x20, %esi
leaq 0x88(%rsp), %r15
movq %r15, %rdi
callq 0x56cf0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
leaq 0x100(%rsp), %r15
movq %r15, %rdi
leaq 0xaabbc(%rip), %rsi     # 0x11533b
callq 0x579f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
movl $0x20, %esi
leaq 0xe8(%rsp), %r15
movq %r15, %rdi
callq 0x56cf0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
leaq 0xd0(%rsp), %r15
movq %r15, %rdi
leaq 0x8a204(%rip), %rsi     # 0xf49cb
callq 0x579f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x562f0
movq %r13, %rdi
movq %rax, %rsi
callq 0x570b0
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
leaq 0x100(%rsp), %rdi
callq 0x59200
leaq 0x88(%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
je 0x6a8b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x581f0
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x582c0
movq %r12, %rdi
callq 0x59148
movq %r13, %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
incl %ebp
cmpl $0x3, %ebp
sete %al
orb %al, %bl
je 0x6a685
jmp 0x6a8cd
movq %r13, %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
incl %ebp
cmpl $0x3, %ebp
jne 0x6a685
movq 0x18(%rsp), %r14
cmpl $0x7f02, %r14d          # imm = 0x7F02
jne 0x6a91d
movq 0x101b06(%rip), %rax    # 0x16c3e8
movq (%rax), %rbx
leaq 0x89966(%rip), %rsi     # 0xf4252
leaq 0x118(%rsp), %rdi
callq 0x579f0
leaq 0x118(%rsp), %rsi
movq %rbx, %rdi
callq 0x58260
movq %rax, %rdi
xorl %esi, %esi
callq 0x57fe0
cmpl $0x61f, %eax            # imm = 0x61F
sete %bl
jmp 0x6a91f
xorl %ebx, %ebx
cmpl $0x7f02, %r14d          # imm = 0x7F02
jne 0x6a935
leaq 0x118(%rsp), %rdi
callq 0x59200
testb %bl, %bl
je 0x6aa18
movq $0x0, 0x20(%rsp)
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 0x6aa18
movl 0x18(%rsp), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
leaq 0x48(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0x20(%rsp), %r15
leaq 0xa0(%rsp), %r12
leaq 0x88(%rsp), %r13
movl $0x0, 0x20(%rsp)
cmpl $0x2, 0x18(%rsp)
jl 0x6aa08
xorl %eax, %eax
notl %eax
addl 0x18(%rsp), %eax
movl 0x24(%rsp), %ecx
movl %eax, 0x88(%rsp)
movl %ecx, 0x8c(%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 0x6a9aa
movl 0x24(%rsp), %eax
incl %eax
movl %eax, 0x24(%rsp)
cmpl 0x3c(%rsp), %eax
jl 0x6a999
movq 0x230(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %r8
movq 0x40(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movl 0x38(%rsp), %ecx
movq 0x80(%rsp), %r9
callq 0x55470
leaq 0xb8(%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 0x6abc5
jmp 0x6abc5
jmp 0x6ab11
movq %rax, %rbx
jmp 0x6abd5
movq %rax, %rbx
jmp 0x6abdf
movq %rax, %rbx
jmp 0x6abe9
movq %rax, %rbx
jmp 0x6abf3
jmp 0x6abc5
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x59148
jmp 0x6ab3b
jmp 0x6ab26
jmp 0x6ab21
jmp 0x6aad4
jmp 0x6aadc
jmp 0x6aae4
jmp 0x6aae9
movq %rax, %rbx
jmp 0x6ab00
movq %rax, %rbx
jmp 0x6ab86
movq %rax, %rbx
jmp 0x6ab7c
movq %rax, %rbx
jmp 0x6ab6f
movq %rax, %rbx
jmp 0x6ab62
movq %rax, %rbx
jmp 0x6ab55
jmp 0x6ab26
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x59178
leaq 0x20(%rsp), %rdi
callq 0x59200
jmp 0x6ab3b
jmp 0x6abc5
movq %rax, %rbx
jmp 0x6abb4
movq %rax, %rbx
jmp 0x6aba7
movq %rax, %rbx
jmp 0x6ab93
movq %rax, %rbx
jmp 0x6ab3b
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x59210
leaq 0xa0(%rsp), %rdi
jmp 0x6ab8e
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
leaq 0x100(%rsp), %rdi
callq 0x59200
leaq 0x88(%rsp), %rdi
callq 0x59200
leaq 0x20(%rsp), %rdi
callq 0x59200
leaq 0x118(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
jmp 0x6abbc
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x59200
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0x118(%rsp), %rdi
callq 0x59200
jmp 0x6abc8
jmp 0x6abc5
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x10(%rsp), %rdi
callq 0x59148
movq 0x60(%rsp), %rdi
callq 0x5b11e
movq 0x68(%rsp), %rdi
callq 0x63e08
movq 0x40(%rsp), %rdi
callq 0x55b00
movq %rbx, %rdi
callq 0x57090
nop