// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/dialogs/directory/dirdlg_gtk.cpp
// Function: smooth::GUI::Dialogs::DirSelection::ShowDialog()
const Error &S::GUI::Dialogs::DirSelection::ShowDialog()
{
	/* Create file chooser dialog.
	 */
	GtkWidget	*dialog = gtk_file_chooser_dialog_new(caption, NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
							      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
							      GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
							      NULL);

	if (directory != NIL) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), directory);

	/* Run dialog and check result.
	 */
	if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
	{
		char	*name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));

		directory.ImportFrom("UTF-8", name);

		g_free(name);
	}
	else
	{
		directory = NIL;
	}

	gtk_widget_destroy(dialog);

	/* Wait for GTK to finish pending actions.
	 */
	while (gtk_events_pending()) gtk_main_iteration();

	/* Check if we actually have a directory.
	 */
	if (directory != NIL)
	{
		if (!directory.EndsWith(Directory::GetDirectoryDelimiter())) directory.Append(Directory::GetDirectoryDelimiter());
	}
	else
	{
		error = Error();
	}

	return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
addq $0x5b8, %rdi            # imm = 0x5B8
callq 0x5d090
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
leaq 0x8a8f4(%rip), %rcx     # 0x1a670a
movl $0xfffffffa, %r8d       # imm = 0xFFFFFFFA
leaq 0x8a8f2(%rip), %r9      # 0x1a6715
movl $0xfffffffd, (%rsp)     # imm = 0xFFFFFFFD
movq $0x0, 0x8(%rsp)
movb $0x0, %al
callq 0x5d4b0
movq -0x70(%rbp), %rdi
movq %rax, -0x10(%rbp)
addq $0x5e8, %rdi            # imm = 0x5E8
xorl %esi, %esi
callq 0x5b110
testb $0x1, %al
jne 0x11be56
jmp 0x11be8f
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x5bf90
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x59530
movq -0x70(%rbp), %rdi
movq %rax, -0x78(%rbp)
addq $0x5e8, %rdi            # imm = 0x5E8
callq 0x5d090
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x5a550
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x5b820
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x59530
movq %rax, %rdi
callq 0x59ea0
cmpl $-0x3, %eax
jne 0x11bf0c
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
callq 0x5bf90
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x59530
movq %rax, %rdi
callq 0x5c2b0
movq -0x70(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x5e8, %rdi            # imm = 0x5E8
movq -0x18(%rbp), %rdx
leaq 0x89cea(%rip), %rsi     # 0x1a5be6
callq 0x5ae70
movq -0x18(%rbp), %rdi
callq 0x59d60
jmp 0x11bf1e
movq -0x70(%rbp), %rdi
addq $0x5e8, %rdi            # imm = 0x5E8
xorl %esi, %esi
callq 0x5c1e0
movq -0x10(%rbp), %rdi
callq 0x596e0
callq 0x5cf90
cmpl $0x0, %eax
je 0x11bf38
callq 0x59060
jmp 0x11bf27
movq -0x70(%rbp), %rdi
addq $0x5e8, %rdi            # imm = 0x5E8
xorl %esi, %esi
callq 0x5b110
testb $0x1, %al
jne 0x11bf53
jmp 0x11c033
movq -0x70(%rbp), %rax
addq $0x5e8, %rax            # imm = 0x5E8
movq %rax, -0xa8(%rbp)
callq 0x59460
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x5c1f0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x5d6c0
movb %al, -0x91(%rbp)
jmp 0x11bf97
movb -0x91(%rbp), %al
xorb $-0x1, %al
movb %al, -0xa9(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5df00
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x11bfba
jmp 0x11c031
movq -0x70(%rbp), %rax
addq $0x5e8, %rax            # imm = 0x5E8
movq %rax, -0xc0(%rbp)
callq 0x59460
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x5c1f0
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x5a710
jmp 0x11bff8
leaq -0x58(%rbp), %rdi
callq 0x5df00
jmp 0x11c031
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5df00
jmp 0x11c071
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5df00
jmp 0x11c071
jmp 0x11c05e
leaq -0x68(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x70(%rbp), %rdi
addq $0x5d8, %rdi            # imm = 0x5D8
leaq -0x68(%rbp), %rsi
callq 0x5a3a0
leaq -0x68(%rbp), %rdi
callq 0x5b5b0
movq -0x70(%rbp), %rax
addq $0x5d8, %rax            # imm = 0x5D8
addq $0xd0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5b6b0
nopw (%rax,%rax)